[kepler-dev] Re: [kepler-cvs] kepler/src/exp/ptolemy/vergil/basic BasicGraphFrame.java

Chad Berkley berkley at nceas.ucsb.edu
Thu Jul 22 15:43:03 PDT 2004


hi steve,

Thanks for the note....I debated whether to change diva or try using 
swing components in BasicGraphFrame to do this.  I decided to try to get 
it to work with BasicGraphFrame first to avoid making changes to diva. 
I'm actually having decent luck so far, although I haven't gotten it 
totally working yet.  If I run into any major roadblocks, I'll redo it 
in diva.

we have had several domain scientists (as well as several of our 
developers) request scrollbars in the canvas area so that's why we're 
adding them.  I think the scrollbars and panner can complement each 
other well.  The panner gives the "big picture" view while the 
scrollbars let you make smaller moves easier than the panner.

I'm going to eventually make this into pluggable architecture like Matt 
did with the tabbed actor/data library view so that using the scrollbars 
(or not) will be a property in the configuration file.

chad

Stephen Andrew Neuendorffer wrote:
> I doubt you will able to get this to work by simply adding the standard 
> swing scrollbars,
> since swing's scrollbars hook into
> swing's layout hierarchy.  the Diva JCanvas uses an independant view 
> hierarchy.  If you really
> want this, then it will probably be necessary to hook directly into the 
> scrollbars event handling
> and modify the diva view information directly.
> 
> Is there any particular reason why you need scrollbars, anyway?  The panner
> generally deals with this much better than scrollbars, in terms of 
> maximizing
> the available viewing area and providing highlevel orientation.
> 
> Steve
> 
> At 03:48 PM 7/21/2004, you wrote:
> 
>> berkley     04/07/21 15:48:28
>>
>>   Modified:    configs/ptolemy/configs/kepler configuration.xml
>>                src/exp/ptolemy/vergil/basic BasicGraphFrame.java
>>   Log:
>>   added scrollbars to the canvas.  haven't gotten it to respond to 
>> window resizes or zooms yet.  only had to change the BasicGraphFrame 
>> (so far)
>>
>>   Revision  Changes    Path
>>   1.8       +0 -5      
>> kepler/configs/ptolemy/configs/kepler/configuration.xml
>>
>>   Index: configuration.xml
>>   ===================================================================
>>   RCS file: 
>> /cvs/kepler/configs/ptolemy/configs/kepler/configuration.xml,v
>>   retrieving revision 1.7
>>   retrieving revision 1.8
>>   diff -u -r1.7 -r1.8
>>   --- configuration.xml 21 Jul 2004 17:11:50 -0000      1.7
>>   +++ configuration.xml 21 Jul 2004 22:48:28 -0000      1.8
>>   @@ -57,11 +57,6 @@
>>      <property name="libraryPaneFactory" 
>> class="org.ecoinformatics.seek.ecogrid.LibraryPaneFactory">
>>        <property name="basicLibraryPane" 
>> class="org.ecoinformatics.seek.ecogrid.TabbedLibraryPane$Factory"/>
>>      </property>
>>   -
>>   -  <!-- the list of tableau factors for the visual arrangement of 
>> the vergil canvas -->
>>   -  <!--<property name="vergilCanvasPaneFactory" 
>> class="org.ecoinformatics.seek.ecogrid.VergilCanvasPaneFactory">
>>   -    <property name="scrolledCanvasPane" 
>> class="org.ecoinformatics.seek.ecogrid.ScrolledCanvasPane$Factory"/>
>>   -  </property>-->
>>
>>      <!-- Main default library. -->
>>      <input source="ptolemy/configs/basicLibrary.xml"/>
>>
>>
>>
>>   1.3       +8 -4      
>> kepler/src/exp/ptolemy/vergil/basic/BasicGraphFrame.java
>>
>>   Index: BasicGraphFrame.java
>>   ===================================================================
>>   RCS file: 
>> /cvs/kepler/src/exp/ptolemy/vergil/basic/BasicGraphFrame.java,v
>>   retrieving revision 1.2
>>   retrieving revision 1.3
>>   diff -u -r1.2 -r1.3
>>   --- BasicGraphFrame.java      1 Jul 2004 23:26:38 -0000       1.2
>>   +++ BasicGraphFrame.java      21 Jul 2004 22:48:28 -0000      1.3
>>   @@ -157,7 +157,7 @@
>>       paste operations are supported using MoML.
>>
>>       @author  Steve Neuendorffer, Edward A. Lee
>>   -   @version $Id: BasicGraphFrame.java,v 1.2 2004/07/01 23:26:38 
>> higgins Exp $
>>   +   @version $Id: BasicGraphFrame.java,v 1.3 2004/07/21 22:48:28 
>> berkley Exp $
>>       @since Ptolemy II 2.0
>>       @Pt.ProposedRating Red (neuendor)
>>       @Pt.AcceptedRating Red (johnr)
>>   @@ -400,13 +400,14 @@
>>            _palettePane.setBorder(null);
>>            _palettePane.setLayout(new BoxLayout(_palettePane, 
>> BoxLayout.Y_AXIS));
>>
>>   -//DFH        _palettePane.add(_libraryScrollPane, 
>> BorderLayout.CENTER);
>>   +//DFH   _palettePane.add(_libraryScrollPane, BorderLayout.CENTER);
>>            _palettePane.add(_libraryPane, BorderLayout.CENTER);
>>   -        _palettePane.add(_graphPanner, BorderLayout.SOUTH);
>>   +//CWB   _palettePane.add(_graphPanner, BorderLayout.SOUTH);
>>
>>            _splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, 
>> true);
>>            _splitPane.setLeftComponent(_palettePane);
>>   -        _splitPane.setRightComponent(_jgraph);
>>   +        _canvasScrollPane = new JScrollPane(_jgraph);  //add the 
>> scroll bar to the canvas
>>   +        _splitPane.setRightComponent(_canvasScrollPane);
>>            getContentPane().add(_splitPane, BorderLayout.CENTER);
>>
>>            _toolbar = new JToolBar();
>>   @@ -1593,6 +1594,9 @@
>>
>>        /** The library scroll pane. */
>>        protected JScrollPane _libraryScrollPane;
>>   +
>>   +    /** The library scroll pane. */
>>   +    protected JScrollPane _canvasScrollPane;
>>
>>        /** The library display panel. */
>>        protected JPanel _palettePane;
>>
>>
>>
>> _______________________________________________
>> kepler-cvs mailing list
>> kepler-cvs at ecoinformatics.org
>> http://www.ecoinformatics.org/mailman/listinfo/kepler-cvs
> 
> 



More information about the Kepler-dev mailing list