Author: ruschein
Date: 2010-08-05 08:55:37 -0700 (Thu, 05 Aug 2010)
New Revision: 21217

Added:
   
coreplugins/trunk/ManualLayout/src/main/java/ManualLayout/common/SliderTracker.java
   
coreplugins/trunk/ManualLayout/src/main/java/ManualLayout/scale/ScalingDirectionTracker.java
Modified:
   
coreplugins/trunk/ManualLayout/src/main/java/ManualLayout/common/CheckBoxTracker.java
   
coreplugins/trunk/ManualLayout/src/main/java/ManualLayout/rotate/RotatePanel.java
   
coreplugins/trunk/ManualLayout/src/main/java/ManualLayout/scale/ScaleLayouter.java
   
coreplugins/trunk/ManualLayout/src/main/java/ManualLayout/scale/ScalePanel.java
Log:
Now we allow scaling along the x- and y-axes separately.

Modified: 
coreplugins/trunk/ManualLayout/src/main/java/ManualLayout/common/CheckBoxTracker.java
===================================================================
--- 
coreplugins/trunk/ManualLayout/src/main/java/ManualLayout/common/CheckBoxTracker.java
       2010-08-05 15:54:00 UTC (rev 21216)
+++ 
coreplugins/trunk/ManualLayout/src/main/java/ManualLayout/common/CheckBoxTracker.java
       2010-08-05 15:55:37 UTC (rev 21217)
@@ -1,14 +1,6 @@
-
 /*
- Copyright (c) 2006, 2007, The Cytoscape Consortium (www.cytoscape.org)
+ Copyright (c) 2006, 2007, 2010, The Cytoscape Consortium (www.cytoscape.org)
 
- The Cytoscape Consortium is:
- - Institute for Systems Biology
- - University of California San Diego
- - Memorial Sloan-Kettering Cancer Center
- - Institut Pasteur
- - Agilent Technologies
-
  This library is free software; you can redistribute it and/or modify it
  under the terms of the GNU Lesser General Public License as published
  by the Free Software Foundation; either version 2.1 of the License, or
@@ -33,9 +25,9 @@
  along with this library; if not, write to the Free Software Foundation,
  Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
 */
-
 package ManualLayout.common;
 
+
 import ManualLayout.rotate.RotatePanel;
 import ManualLayout.rotate.RotationLayouter;
 
@@ -78,14 +70,10 @@
 import javax.swing.event.ChangeListener;
 
 
-/**
- *
- */
 public class CheckBoxTracker implements SelectEventListener, 
PropertyChangeListener {
+       private JCheckBox jCheckBox;
+       private Set<String> listeningNetworks;
 
-       JCheckBox jCheckBox;
-       Set<String> listeningNetworks;
-
        public CheckBoxTracker(JCheckBox j) {
                jCheckBox = j;
                listeningNetworks = new HashSet<String>();
@@ -94,12 +82,7 @@
        }
 
        public void onSelectEvent(SelectEvent event) {
-               if 
(Cytoscape.getCurrentNetworkView().getSelectedNodeIndices().length == 0) {
-                       jCheckBox.setEnabled(false);
-               } else {
-                       jCheckBox.setEnabled(true);
-                       jCheckBox.setSelected(false);
-               }
+               
jCheckBox.setSelected(Cytoscape.getCurrentNetworkView().getSelectedNodeIndices().length
 > 0);
        } 
 
        public void propertyChange(PropertyChangeEvent e) {

Added: 
coreplugins/trunk/ManualLayout/src/main/java/ManualLayout/common/SliderTracker.java
===================================================================
--- 
coreplugins/trunk/ManualLayout/src/main/java/ManualLayout/common/SliderTracker.java
                         (rev 0)
+++ 
coreplugins/trunk/ManualLayout/src/main/java/ManualLayout/common/SliderTracker.java
 2010-08-05 15:55:37 UTC (rev 21217)
@@ -0,0 +1,68 @@
+/*
+ Copyright (c) 2010, The Cytoscape Consortium (www.cytoscape.org)
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications.  In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage.  See
+ the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+*/
+package ManualLayout.common;
+
+
+import cytoscape.Cytoscape;
+import cytoscape.CyNetwork;
+import cytoscape.data.SelectEvent;
+import cytoscape.data.SelectEventListener;
+import cytoscape.view.CytoscapeDesktop;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import javax.swing.JCheckBox;
+import javax.swing.JPanel;
+import javax.swing.JSlider;
+
+
+public class SliderTracker implements SelectEventListener, 
PropertyChangeListener {
+       private final JSlider slider;
+       private final JCheckBox controllingCheckBox;
+
+       public SliderTracker(final JSlider slider, final JCheckBox 
controllingCheckBox) {
+               this.slider = slider;
+               this.controllingCheckBox = controllingCheckBox;
+
+               
Cytoscape.getDesktop().getNetworkViewManager().getSwingPropertyChangeSupport()
+                        
.addPropertyChangeListener(CytoscapeDesktop.NETWORK_VIEW_FOCUSED, this);
+       }
+
+       public void onSelectEvent(final SelectEvent event) {
+               final boolean currentNetworkHasSelectedNodes = 
+                       
Cytoscape.getCurrentNetworkView().getSelectedNodeIndices().length > 0;
+
+               slider.setEnabled(!controllingCheckBox.isSelected() || 
currentNetworkHasSelectedNodes);
+       } 
+
+       public void propertyChange(final PropertyChangeEvent e) {
+               if (e.getPropertyName() == 
CytoscapeDesktop.NETWORK_VIEW_FOCUSED)
+                       
Cytoscape.getCurrentNetwork().addSelectEventListener(this);
+       }
+}

Modified: 
coreplugins/trunk/ManualLayout/src/main/java/ManualLayout/rotate/RotatePanel.java
===================================================================
--- 
coreplugins/trunk/ManualLayout/src/main/java/ManualLayout/rotate/RotatePanel.java
   2010-08-05 15:54:00 UTC (rev 21216)
+++ 
coreplugins/trunk/ManualLayout/src/main/java/ManualLayout/rotate/RotatePanel.java
   2010-08-05 15:55:37 UTC (rev 21217)
@@ -1,14 +1,6 @@
-
 /*
- Copyright (c) 2006, 2007, The Cytoscape Consortium (www.cytoscape.org)
+ Copyright (c) 2006, 2007, 2010, The Cytoscape Consortium (www.cytoscape.org)
 
- The Cytoscape Consortium is:
- - Institute for Systems Biology
- - University of California San Diego
- - Memorial Sloan-Kettering Cancer Center
- - Institut Pasteur
- - Agilent Technologies
-
  This library is free software; you can redistribute it and/or modify it
  under the terms of the GNU Lesser General Public License as published
  by the Free Software Foundation; either version 2.1 of the License, or
@@ -33,7 +25,6 @@
  along with this library; if not, write to the Free Software Foundation,
  Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
 */
-
 package ManualLayout.rotate;
 
 import cytoscape.Cytoscape;
@@ -58,25 +49,20 @@
 
 import cytoscape.graph.layout.algorithm.MutablePolyEdgeGraphLayout;
 
+
 /**
- *
  * GUI for rotation of manualLayout
  *
  *      Rewrite based on the class RotateAction       9/13/2006        
Peng-Liang Wang
- *
  */
 public class RotatePanel extends JPanel implements ChangeListener, 
PolymorphicSlider {
+       private JCheckBox jCheckBox;
+       private JSlider jSlider;
+       private int prevValue; 
 
-       JCheckBox jCheckBox;
-       JSlider jSlider;
-       int prevValue; 
+       private boolean startAdjusting = true;
+       private ViewChangeEdit currentEdit = null;
 
-       boolean startAdjusting = true;
-       ViewChangeEdit currentEdit = null;
-
-       /**
-        * Creates a new RotatePanel object.
-        */
        public RotatePanel() {
                // set up the user interface
                JLabel jLabel = new JLabel();
@@ -95,8 +81,7 @@
 
                prevValue = jSlider.getValue();
 
-               jCheckBox = new JCheckBox();
-               jCheckBox.setText("Rotate Selected Nodes Only");
+               jCheckBox = new JCheckBox("Rotate Selected Nodes Only", /* 
selected = */true);
 
                new CheckBoxTracker( jCheckBox );
 
@@ -121,9 +106,9 @@
 
                new SliderStateTracker(this);
 
-               setMinimumSize(new Dimension(100,1000));
-               setPreferredSize(new Dimension(100,1000));
-               setMaximumSize(new Dimension(100,1000));
+               setMinimumSize(new Dimension(100,1200));
+               setPreferredSize(new Dimension(100,1200));
+               setMaximumSize(new Dimension(100,1200));
        } 
 
        public void updateSlider(int x) {

Modified: 
coreplugins/trunk/ManualLayout/src/main/java/ManualLayout/scale/ScaleLayouter.java
===================================================================
--- 
coreplugins/trunk/ManualLayout/src/main/java/ManualLayout/scale/ScaleLayouter.java
  2010-08-05 15:54:00 UTC (rev 21216)
+++ 
coreplugins/trunk/ManualLayout/src/main/java/ManualLayout/scale/ScaleLayouter.java
  2010-08-05 15:55:37 UTC (rev 21217)
@@ -1,6 +1,33 @@
-//package cytoscape.graph.layout.impl;
+/*
+ Copyright (c) 2006, 2007, 2010, The Cytoscape Consortium (www.cytoscape.org)
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications.  In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage.  See
+ the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+*/
 package ManualLayout.scale;
 
+
 import com.nerius.math.xform.AffineTransform3D;
 import com.nerius.math.xform.Scale3D;
 import com.nerius.math.xform.Translation3D;
@@ -10,10 +37,13 @@
 import cytoscape.util.intr.IntEnumerator;
 
 
-/**
- *
- */
 public final class ScaleLayouter {
+       public enum Direction {
+               X_AXIS_ONLY,
+               Y_AXIS_ONLY,
+               BOTH_AXES
+       };
+
        private final MutablePolyEdgeGraphLayout m_graph;
        private final Translation3D m_translationToOrig;
        private final Translation3D m_translationFromOrig;
@@ -66,8 +96,7 @@
                        yMax = Math.max(yMax, nodeYPosition);
                }
 
-               if (xMax < 0) // Nothing is movable.
-                {
+               if (xMax < 0) { // Nothing is movable.
                        m_translationToOrig = null;
                        m_translationFromOrig = null;
                } else {
@@ -86,17 +115,28 @@
         * @exception IllegalArgumentException if
         *   scaleFactor < 0.001 or if scaleFactor > 1000.0.
         **/
-       public void scaleGraph(double scaleFactor) {
+       public void scaleGraph(double scaleFactor, final Direction direction) {
                if ((scaleFactor < 0.001d) || (scaleFactor > 1000.0d))
                        throw new IllegalArgumentException("scaleFactor is 
outside allowable range [0.001, 1000.0]");
 
                if (m_translationToOrig == null)
                        return;
 
-               final AffineTransform3D xform = 
m_translationToOrig.concatenatePost((new Scale3D(scaleFactor,
-                                                                               
                 scaleFactor,
-                                                                               
                 1.0d))
-                                                                               
                           .concatenatePost(m_translationFromOrig));
+               double xFactor = scaleFactor, yFactor = scaleFactor;
+               switch (direction) {
+               case X_AXIS_ONLY:
+                       yFactor = 1.0;
+                       break;
+               case Y_AXIS_ONLY:
+                       xFactor = 1.0;
+                       break;
+               case BOTH_AXES:
+                       /* Intentionally empty! */
+                       break;
+               }
+
+               final AffineTransform3D xform = 
m_translationToOrig.concatenatePost(
+                       (new Scale3D(xFactor, yFactor, 
1.0d)).concatenatePost(m_translationFromOrig));
                IntEnumerator nodes = m_graph.nodes();
 
                while (nodes.numRemaining() > 0) {

Modified: 
coreplugins/trunk/ManualLayout/src/main/java/ManualLayout/scale/ScalePanel.java
===================================================================
--- 
coreplugins/trunk/ManualLayout/src/main/java/ManualLayout/scale/ScalePanel.java 
    2010-08-05 15:54:00 UTC (rev 21216)
+++ 
coreplugins/trunk/ManualLayout/src/main/java/ManualLayout/scale/ScalePanel.java 
    2010-08-05 15:55:37 UTC (rev 21217)
@@ -1,14 +1,6 @@
-
 /*
- Copyright (c) 2006, 2007, The Cytoscape Consortium (www.cytoscape.org)
+ Copyright (c) 2006, 2007, 2010, The Cytoscape Consortium (www.cytoscape.org)
 
- The Cytoscape Consortium is:
- - Institute for Systems Biology
- - University of California San Diego
- - Memorial Sloan-Kettering Cancer Center
- - Institut Pasteur
- - Agilent Technologies
-
  This library is free software; you can redistribute it and/or modify it
  under the terms of the GNU Lesser General Public License as published
  by the Free Software Foundation; either version 2.1 of the License, or
@@ -33,15 +25,12 @@
  along with this library; if not, write to the Free Software Foundation,
  Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
 */
-
 package ManualLayout.scale;
 
+
 import ManualLayout.common.*;
 
 import cytoscape.Cytoscape;
-
-//import cytoscape.util.CytoscapeAction;
-//import cytoscape.view.cytopanels.CytoPanelState;
 import cytoscape.graph.layout.algorithm.MutablePolyEdgeGraphLayout;
 
 import ding.view.DGraphView;
@@ -57,16 +46,12 @@
 import java.util.Hashtable;
 
 import javax.swing.AbstractAction;
-
+import javax.swing.ButtonGroup;
 import javax.swing.JCheckBox;
-
-//import javax.swing.JMenu;
-import javax.swing.JDialog;
-
-//import javax.swing.JCheckBoxMenuItem;
 import javax.swing.JButton;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
+import javax.swing.JRadioButton;
 import javax.swing.JSlider;
 import javax.swing.WindowConstants;
 import javax.swing.event.ChangeEvent;
@@ -81,19 +66,18 @@
  *
  */
 public class ScalePanel extends JPanel implements ChangeListener, 
PolymorphicSlider {
+       private JCheckBox jCheckBox;
+       private JSlider jSlider;
+       private JRadioButton alongXAxisOnlyRadioButton;
+       private JRadioButton alongYAxisOnlyRadioButton;
+       private JRadioButton alongBothAxesRadioButton;
+       private ButtonGroup radioButtonGroup;
+       private int prevValue; 
 
-       JCheckBox jCheckBox;
-       JSlider jSlider;
-       int prevValue; 
+       private boolean startAdjusting = true;
+       private ViewChangeEdit currentEdit = null;
 
-       boolean startAdjusting = true;
-       ViewChangeEdit currentEdit = null;
-
-       /**
-        * Creates a new ScalePanel object.
-        */
        public ScalePanel() {
-               // setup interface
                JLabel jLabel = new JLabel();
                jLabel.setText("Scale:");
 
@@ -109,7 +93,6 @@
 
                jSlider.addChangeListener(this);
 
-
                prevValue = jSlider.getValue();
 
                Hashtable<Integer,JLabel> labels = new 
Hashtable<Integer,JLabel>();
@@ -123,11 +106,16 @@
 
                jSlider.setLabelTable(labels);
 
-               jCheckBox = new JCheckBox();
-               jCheckBox.setText("Scale Selected Nodes Only");
-
+               jCheckBox = new JCheckBox("Scale Selected Nodes Only", /* 
selected = */true);
                new CheckBoxTracker( jCheckBox );
 
+               alongXAxisOnlyRadioButton = new JRadioButton("along x-axis 
only");
+               alongYAxisOnlyRadioButton = new JRadioButton("along y-axis 
only");
+               alongBothAxesRadioButton = new JRadioButton("along both axes", 
/* selected = */true);
+               radioButtonGroup = new ButtonGroup();
+               radioButtonGroup.add(alongXAxisOnlyRadioButton);
+               radioButtonGroup.add(alongYAxisOnlyRadioButton);
+               radioButtonGroup.add(alongBothAxesRadioButton);
 
                setLayout(new GridBagLayout());
 
@@ -164,9 +152,28 @@
 
                new SliderStateTracker(this);
 
-               setMinimumSize(new java.awt.Dimension(100,1000));
-               setPreferredSize(new java.awt.Dimension(100,1000));
-               setMaximumSize(new java.awt.Dimension(100,1000));
+               gbc.gridy = 4;
+               gbc.anchor = GridBagConstraints.WEST;
+               gbc.fill = GridBagConstraints.NONE;
+               gbc.insets = new Insets(20, 15, 0, 15);
+               add(alongXAxisOnlyRadioButton, gbc);
+
+               gbc.gridy = 5;
+               gbc.anchor = GridBagConstraints.WEST;
+               gbc.fill = GridBagConstraints.NONE;
+               gbc.insets = new Insets(0, 15, 0, 15);
+               add(alongYAxisOnlyRadioButton, gbc);
+
+               gbc.gridy = 6;
+               gbc.anchor = GridBagConstraints.WEST;
+               gbc.fill = GridBagConstraints.NONE;
+               gbc.insets = new Insets(0, 15, 0, 15);
+               add(alongBothAxesRadioButton, gbc);
+               /*
+               setMinimumSize(new java.awt.Dimension(100,2200));
+               setPreferredSize(new java.awt.Dimension(100,2200));
+               setMaximumSize(new java.awt.Dimension(100,2200));
+               */
        } 
 
        public void updateSlider(int x) {
@@ -179,7 +186,7 @@
        }
 
        public void stateChanged(ChangeEvent e) {
-               if ( e.getSource() != jSlider )
+               if (e.getSource() != jSlider)
                        return;
 
                // only create the edit when we're beginning to adjust
@@ -199,12 +206,20 @@
 
                double neededIncrementalScaleFactor = 
currentAbsoluteScaleFactor / prevAbsoluteScaleFactor;
 
-               scale.scaleGraph(neededIncrementalScaleFactor);
+               final ScaleLayouter.Direction direction;
+               if (alongXAxisOnlyRadioButton.isSelected())
+                       direction = ScaleLayouter.Direction.X_AXIS_ONLY;
+               else if (alongYAxisOnlyRadioButton.isSelected())
+                       direction = ScaleLayouter.Direction.Y_AXIS_ONLY;
+               else
+                       direction = ScaleLayouter.Direction.BOTH_AXES;
+               
+               scale.scaleGraph(neededIncrementalScaleFactor, direction);
                Cytoscape.getCurrentNetworkView().updateView();
                prevValue = jSlider.getValue();
 
                // only post the edit when we're finished adjusting 
-               if ( !jSlider.getValueIsAdjusting() ) { 
+               if (!jSlider.getValueIsAdjusting()) { 
                        currentEdit.post();
                        startAdjusting = true;
                } 

Added: 
coreplugins/trunk/ManualLayout/src/main/java/ManualLayout/scale/ScalingDirectionTracker.java
===================================================================
--- 
coreplugins/trunk/ManualLayout/src/main/java/ManualLayout/scale/ScalingDirectionTracker.java
                                (rev 0)
+++ 
coreplugins/trunk/ManualLayout/src/main/java/ManualLayout/scale/ScalingDirectionTracker.java
        2010-08-05 15:55:37 UTC (rev 21217)
@@ -0,0 +1,95 @@
+/*
+ Copyright (c) 2010, The Cytoscape Consortium (www.cytoscape.org)
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications.  In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage.  See
+ the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+*/
+package ManualLayout.scale;
+
+
+import cytoscape.Cytoscape;
+import cytoscape.CyNetwork;
+
+import cytoscape.data.SelectEvent;
+import cytoscape.data.SelectEventListener;
+
+import cytoscape.graph.layout.algorithm.MutablePolyEdgeGraphLayout;
+
+import cytoscape.util.CytoscapeAction;
+
+import cytoscape.view.CytoscapeDesktop;
+
+import cytoscape.view.cytopanels.BiModalJSplitPane;
+import cytoscape.view.cytopanels.CytoPanelImp;
+import cytoscape.view.cytopanels.CytoPanelListener;
+import cytoscape.view.cytopanels.CytoPanelState;
+
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.swing.JCheckBoxMenuItem;
+import javax.swing.JCheckBox;
+import javax.swing.JMenu;
+import javax.swing.JPanel;
+import javax.swing.JSplitPane;
+import javax.swing.SwingConstants;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+
+
+public class ScalingDirectionTracker implements SelectEventListener, 
PropertyChangeListener {
+       private JCheckBox jCheckBox;
+       private Set<String> listeningNetworks;
+
+       public ScalingDirectionTracker(JCheckBox j) {
+               jCheckBox = j;
+               listeningNetworks = new HashSet<String>();
+               
Cytoscape.getDesktop().getNetworkViewManager().getSwingPropertyChangeSupport()
+                        
.addPropertyChangeListener(CytoscapeDesktop.NETWORK_VIEW_FOCUSED,this);
+       }
+
+       public void onSelectEvent(SelectEvent event) {
+               
jCheckBox.setSelected(Cytoscape.getCurrentNetworkView().getSelectedNodeIndices().length
 > 0);
+       } 
+
+       public void propertyChange(PropertyChangeEvent e) {
+               if (e.getPropertyName() == 
CytoscapeDesktop.NETWORK_VIEW_FOCUSED) {
+                       CyNetwork curr = Cytoscape.getCurrentNetwork();
+                       String nid = curr.getIdentifier();
+
+                       // only add this as a listener if it hasn't been done 
already
+                       if ( !listeningNetworks.contains(nid) )
+                               curr.addSelectEventListener(this);      
+               
+                       // to make sure we're set intially      
+                       onSelectEvent(null);
+               }
+       }
+}

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to