[kepler-dev] scrollbar additions to kepler

Stephen Andrew Neuendorffer neuendor at eecs.berkeley.edu
Tue Jul 27 11:11:46 PDT 2004


I think you can do this by instantiating two JScrollBars manually, and 
implementing a BoundedRangeModel and an AdjustmentListener.
The BoundedRangeModel should reflect the currently visible portion of the 
canvas, relative to the bounds of all the figures on the canvas.
(See JPanner for how to do this).

I don't think you really have to change Diva... just implement the above 
code and integrate with the canvas's view model, instead of swings 
JViewport model.

In terms of hand tools: they tend to make interfaces more 
modal  (stateful).  Despite the preponderance of modal interfaces, they 
tend to
work against people who want to become expert users.  If you do this, be 
sure to make the hand state highly visible and unobtrusive when
not being used.

Steve

At 10:47 AM 7/27/2004, Chad Berkley wrote:
>Hi,
>
>I've been working the last 4 days to add scrollbars to the vergil 
>canvas.  I've had limited success and I've run into a couple problems. I 
>wanted to see what others thought of this before I continue.
>
>There are two different places where this functionality can be added. The 
>first one (and probably the technically correct place) is in the Diva 
>library.  Diva is the library ptolemy uses to provide all of the graph 
>editing functionality.  Diva also provides the panner (the widget in the 
>bottom left that allows you to move around the workspace).  The second 
>place this functionality can be added is to the Vergil gui classes.
>
>Placing the code in diva is probably the best way to do this because then 
>it would integrate seamlessly into the current view and allow the 
>scrollbars to interact with the panner.  Changing Diva to do this is not 
>trivial.  Diva has it's own layer system built around AWT with some Swing 
>components.  Also, if we change diva, it's going to be much harder to make 
>this a "pluggable" change without making some architectural change to diva 
>itself.
>
>Placing the code in the BasicGraphFrame class of vergil is the most 
>straight forward way to do it because the vergil gui uses all swing 
>components and places diva widgets inside the swing components.  This is 
>the way I have partially implemented the scrollbars now (using a 
>JScrollPane).  There are several problems with this.  First of all, 
>getting the scrollbars to interact with the panner correctly seems mostly 
>impossible.  Basically, i have to remove the panner or else things get 
>chaotic real quick.  If the user moves the workspace via the panner, there 
>is no event to catch when this happens, so the scrollbars can't be updated 
>accordingly.  I've also had to make major changes to the zoom code.  The 
>two advantages of doing it this way are that it's easier to code since one 
>can work with only swing components and i think it will be easier to make 
>this a pluggable change since some people have said they don't want 
>scrollbars on the canvas.
>
>Another thing I thought of the other day while working with photoshop 
>(which has scrollbars on it's canvas), is that we could add a "hand" tool 
>which would serve one of the purposes of the panner (to let you move 
>around the workspace).  I like the panner and don't really want to get rid 
>of it anyway.  I think the panner, scrollbars and a potential hand tool 
>would work well together.  It's just a matter of figuring out the best way 
>to do it.  Ptolemy folks: how hard do you think it would be to add this to 
>Diva?
>
>thoughts?
>
>chad
>_______________________________________________
>kepler-dev mailing list
>kepler-dev at ecoinformatics.org
>http://www.ecoinformatics.org/mailman/listinfo/kepler-dev





More information about the Kepler-dev mailing list