How to create a scrolling "list" of plots in a GUI?

조회 수: 5 (최근 30일)
Corey
Corey 2011년 9월 9일
I'm looking for a way to create something like a Java JScrollPane() in a Matlab GUI, and have it contain multiple Matlab axes() objects.
I've tried using this: http://www.mathworks.com/matlabcentral/fileexchange/32697-making-matlab-swing I'm able to get multiple JPanel() objects into a JScrollPane() - however, the underlying issue there is the use of a JPanel() object as a Parent for a Matlab axes() object (can't do it).
Anyone know of a workable approach for this?
This is the best approach I have come across so far (which actually does a pretty good job): http://www.mathworks.com/matlabcentral/fileexchange/7730-scrollsubplot
I'd love to find a way to do this with Java classes though, since the look is much better than native Matlab widgets.

채택된 답변

Malcolm Lidierth
Malcolm Lidierth 2011년 9월 26일
@Corey, two scrolling objects now added to the Waterloo Swing Library [version1.06] may do what you want: GScroller -which scrolls unidirectionally and might be useful for multiple, equally sized images and a GScrollPane that gives 2D scrolling.
The library is free and open-source (GPLv3) and available on SourceForge. See http://sigtool.sourceforge.net/
Regards ML
General screenshots showing some of the MATLAB GUIs you can create with this library:
  댓글 수: 1
Corey
Corey 2011년 9월 29일
Malcolm,
This is really a fantastic toolbox - especially great for those of us who are not Java programmers, but would like to improve the appearance of our Matlab GUI's.
Also, the GScroller and GScrollPane are unique Matlab user interface objects - I have not found a comparable capability anywhere else.
Thanks!
-Corey

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Corey
Corey 2011년 10월 5일
Malcolm,
I've got a few questions regarding the GScroller object...
Is it possible to (easily) change the width / height of buttons added to a GFlyoutPanel object?
When I add panels (and hence Matlab axes) to the GScroller object, I've noticed that once I scroll down, I cannot use the Matlab figure zoom tool on the axes which are initially not visible on the GScroller panel. Is this to be expected? Is there a way around this?
Thanks, Corey
  댓글 수: 1
Malcolm Lidierth
Malcolm Lidierth 2011년 10월 6일
Corey
The GFlyoutPanel provides a dockbar-like panel that appears when the mouse moves over the relevant side of a figure. That's why its is dockbar size by default but it has a setWidth(n) method. Use that to set the width for vertical, and height for horizontal, GFlyoutPanels.
Using figure zooms/pan with the standard scrolling tools inside a GScroller was not expected. Pan/zoom will work with most of the components but maybe not here. Both the GScroller and GScrollPane provide panning via the scrollbars. You could program the button down callback for the uipanels to respond to selection of a specific uipanel e.g. by copying its contents to a full size figure. Would that help in your context?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by