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

5 次查看(过去 30 天)
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