Author: kono
Date: 2012-08-23 12:13:30 -0700 (Thu, 23 Aug 2012)
New Revision: 30259

Modified:
   
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DNodeDetails.java
   
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DNodeView.java
   
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/graph/render/stateful/GraphRenderer.java
   
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/graph/render/stateful/NodeDetails.java
   
core3/impl/trunk/ding-impl/ding-presentation-impl/src/test/java/org/cytoscape/ding/impl/DGraphViewApplyTest.java
   
core3/impl/trunk/ding-impl/ding-presentation-impl/src/test/java/org/cytoscape/ding/impl/DNodeViewTest.java
   
core3/impl/trunk/ding-impl/ding-presentation-impl/src/test/java/org/cytoscape/view/DNetworkViewTest.java
   
core3/impl/trunk/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/bypass/BypassMenuBuilder.java
   
core3/impl/trunk/vizmap-impl/impl/src/main/java/org/cytoscape/view/vizmap/internal/AbstractApplyHandler.java
   
core3/impl/trunk/vizmap-impl/impl/src/test/java/org/cytoscape/view/vizmap/VisualStyleTest.java
Log:
Some of the bypass problems had been fixed.  But still size, and label related 
ones are not working correctly.

Modified: 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DNodeDetails.java
===================================================================
--- 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DNodeDetails.java
   2012-08-23 18:27:46 UTC (rev 30258)
+++ 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DNodeDetails.java
   2012-08-23 19:13:30 UTC (rev 30259)
@@ -366,17 +366,17 @@
        }
 
        @Override
-       public float borderWidth(final CyNode node) {
+       public float getBorderWidth(final CyNode node) {
                // Check bypass
                final DNodeView dnv = dGraphView.getDNodeView(node);
                if (dnv.isValueLocked(DVisualLexicon.NODE_BORDER_WIDTH))
                        return 
dnv.getVisualProperty(DVisualLexicon.NODE_BORDER_WIDTH).floatValue();
 
                final Float o = m_borderWidths.get(node);
-
+               
                if (o == null)
                        if (m_borderWidthDefault == null)
-                               return super.borderWidth(node);
+                               return 
DVisualLexicon.NODE_BORDER_WIDTH.getDefault().floatValue();
                        else
                                return m_borderWidthDefault.floatValue();
 
@@ -393,7 +393,7 @@
         * width.
         */
        void overrideBorderWidth(final CyNode node, final float width) {
-               if ((width < 0.0f) || (width == super.borderWidth(node)))
+               if ((width < 0.0f) || (width == super.getBorderWidth(node)))
                        m_borderWidths.remove(node);
                else {
                        m_borderWidths.put(node, width);

Modified: 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DNodeView.java
===================================================================
--- 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DNodeView.java
      2012-08-23 18:27:46 UTC (rev 30258)
+++ 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DNodeView.java
      2012-08-23 19:13:30 UTC (rev 30259)
@@ -1095,7 +1095,7 @@
                        setBorderWidth(((Number) value).floatValue());
                } else if (vp == DVisualLexicon.NODE_BORDER_LINE_TYPE) {
                        final DLineType dLineType = 
DLineType.getDLineType((LineType) value);
-                       final float currentBorderWidth = 
graphView.m_nodeDetails.borderWidth(model);
+                       final float currentBorderWidth = 
graphView.m_nodeDetails.getBorderWidth(model);
                        setBorder(dLineType.getStroke(currentBorderWidth));
                } else if (vp == DVisualLexicon.NODE_TRANSPARENCY) {
                        setTransparency(((Number) value).intValue());

Modified: 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/graph/render/stateful/GraphRenderer.java
===================================================================
--- 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/graph/render/stateful/GraphRenderer.java
      2012-08-23 18:27:46 UTC (rev 30258)
+++ 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/graph/render/stateful/GraphRenderer.java
      2012-08-23 19:13:30 UTC (rev 30259)
@@ -1055,7 +1055,7 @@
                                borderWidth = 0.0f;
                                borderPaint = null;
                        } else { // Rendering node borders.
-                               borderWidth = nodeDetails.borderWidth(cyNode);
+                               borderWidth = 
nodeDetails.getBorderWidth(cyNode);
 
                                if (borderWidth == 0.0f)
                                        borderPaint = null;

Modified: 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/graph/render/stateful/NodeDetails.java
===================================================================
--- 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/graph/render/stateful/NodeDetails.java
        2012-08-23 18:27:46 UTC (rev 30258)
+++ 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/graph/render/stateful/NodeDetails.java
        2012-08-23 19:13:30 UTC (rev 30259)
@@ -171,7 +171,7 @@
         * returns zero. Take note of certain constraints specified in
         * GraphGraphics.drawNodeFull().
         */
-       public float borderWidth(final CyNode node) {
+       public float getBorderWidth(final CyNode node) {
                return 0.0f;
        }
 

Modified: 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/test/java/org/cytoscape/ding/impl/DGraphViewApplyTest.java
===================================================================
--- 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/test/java/org/cytoscape/ding/impl/DGraphViewApplyTest.java
    2012-08-23 18:27:46 UTC (rev 30258)
+++ 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/test/java/org/cytoscape/ding/impl/DGraphViewApplyTest.java
    2012-08-23 19:13:30 UTC (rev 30259)
@@ -7,25 +7,33 @@
 import java.awt.Color;
 import java.awt.Font;
 
+import javax.jws.soap.SOAPBinding.Style;
+
 import org.cytoscape.ding.DVisualLexicon;
 import org.cytoscape.ding.NetworkViewTestSupport;
 import org.cytoscape.ding.customgraphics.CustomGraphicsManager;
 import org.cytoscape.ding.impl.cyannotator.create.AnnotationFactoryManager;
 import org.cytoscape.event.CyEventHelper;
 import org.cytoscape.model.CyEdge;
+import org.cytoscape.model.CyIdentifiable;
 import org.cytoscape.model.CyNetwork;
 import org.cytoscape.model.CyNode;
+import org.cytoscape.model.CyRow;
 import org.cytoscape.model.internal.CyRootNetworkManagerImpl;
 import org.cytoscape.model.subnetwork.CyRootNetworkManager;
 import org.cytoscape.service.util.CyServiceRegistrar;
 import org.cytoscape.spacial.SpacialIndex2DFactory;
 import org.cytoscape.spacial.internal.rtree.RTreeFactory;
+import org.cytoscape.view.model.CyNetworkView;
 import org.cytoscape.view.model.CyNetworkViewManager;
+import org.cytoscape.view.model.View;
 import org.cytoscape.view.model.VisualLexicon;
+import org.cytoscape.view.model.VisualProperty;
 import org.cytoscape.view.presentation.property.NodeShapeVisualProperty;
 import org.cytoscape.view.presentation.property.values.HandleFactory;
 import org.cytoscape.view.presentation.property.values.NodeShape;
 import org.cytoscape.view.vizmap.VisualMappingManager;
+import org.cytoscape.view.vizmap.VisualStyle;
 import org.cytoscape.work.swing.DialogTaskManager;
 import org.cytoscape.work.undo.UndoSupport;
 import org.junit.After;
@@ -120,6 +128,7 @@
                ev1 = dgv.getDEdgeView(edge12);
                ev2 = dgv.getDEdgeView(edge13);
                ev3 = dgv.getDEdgeView(edge23);
+               
        }
 
        private CyNetwork buildNetworkModel() {
@@ -324,4 +333,4 @@
                assertEquals(resultColor.getAlpha(), ((Color) 
dgv.m_nodeDetails.getBorderPaint(node2)).getAlpha());
                assertEquals(trans, 
dgv.m_nodeDetails.getBorderTransparency(node2));
        }
-}
+}
\ No newline at end of file

Modified: 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/test/java/org/cytoscape/ding/impl/DNodeViewTest.java
===================================================================
--- 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/test/java/org/cytoscape/ding/impl/DNodeViewTest.java
  2012-08-23 18:27:46 UTC (rev 30258)
+++ 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/test/java/org/cytoscape/ding/impl/DNodeViewTest.java
  2012-08-23 19:13:30 UTC (rev 30259)
@@ -209,7 +209,7 @@
        public void testSetBorderWidth() {
                float width = 10f;
                dnv1.setBorderWidth(width);
-               float newWidth = 
((DGraphView)dnv1.getGraphView()).m_nodeDetails.borderWidth(dnv1.getCyNode());
+               float newWidth = 
((DGraphView)dnv1.getGraphView()).m_nodeDetails.getBorderWidth(dnv1.getCyNode());
                assertTrue(width == newWidth);
                
                // Make sure stroke is also updated.

Modified: 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/test/java/org/cytoscape/view/DNetworkViewTest.java
===================================================================
--- 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/test/java/org/cytoscape/view/DNetworkViewTest.java
    2012-08-23 18:27:46 UTC (rev 30258)
+++ 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/test/java/org/cytoscape/view/DNetworkViewTest.java
    2012-08-23 19:13:30 UTC (rev 30259)
@@ -4,17 +4,15 @@
 import java.util.List;
 import java.util.Map;
 
-import org.cytoscape.ding.impl.cyannotator.create.AnnotationFactoryManager;
 import org.cytoscape.ding.impl.DGraphView;
 import org.cytoscape.ding.impl.DingGraphLOD;
 import org.cytoscape.ding.impl.ViewTaskFactoryListener;
+import org.cytoscape.ding.impl.cyannotator.create.AnnotationFactoryManager;
 import org.cytoscape.event.CyEventHelper;
 import org.cytoscape.model.CyEdge;
 import org.cytoscape.model.CyNetworkTableManager;
 import org.cytoscape.model.CyNode;
-import org.cytoscape.model.CyTableFactory;
 import org.cytoscape.model.NetworkTestSupport;
-import org.cytoscape.model.TableTestSupport;
 import org.cytoscape.model.subnetwork.CyRootNetworkManager;
 import org.cytoscape.service.util.CyServiceRegistrar;
 import org.cytoscape.spacial.SpacialIndex2DFactory;
@@ -35,8 +33,6 @@
 
 public class DNetworkViewTest extends AbstractCyNetworkViewTest {
 
-
-       private CyTableFactory dataFactory;
        private CyRootNetworkManager cyRoot;
        private SpacialIndex2DFactory spacialFactory;
 
@@ -77,15 +73,11 @@
        @Mock
        private CyServiceRegistrar registrar;
        
-       private final TableTestSupport tableSupport = new TableTestSupport();
        private final NetworkTestSupport netSupport = new NetworkTestSupport();
 
        @Before
        public void setUp() throws Exception {
                MockitoAnnotations.initMocks(this);
-               
-               
-               dataFactory = tableSupport.getTableFactory();
                cyRoot = netSupport.getRootNetworkFactory();
                spacialFactory = new RTreeFactory();
                

Modified: 
core3/impl/trunk/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/bypass/BypassMenuBuilder.java
===================================================================
--- 
core3/impl/trunk/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/bypass/BypassMenuBuilder.java
 2012-08-23 18:27:46 UTC (rev 30258)
+++ 
core3/impl/trunk/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/bypass/BypassMenuBuilder.java
 2012-08-23 19:13:30 UTC (rev 30259)
@@ -27,6 +27,7 @@
 import org.cytoscape.view.model.VisualLexiconNode;
 import org.cytoscape.view.model.VisualProperty;
 import org.cytoscape.view.vizmap.VisualMappingManager;
+import org.cytoscape.view.vizmap.VisualStyle;
 import org.cytoscape.view.vizmap.gui.editor.EditorManager;
 import org.cytoscape.view.vizmap.gui.editor.ValueEditor;
 import org.cytoscape.view.vizmap.gui.util.PropertySheetUtil;
@@ -182,7 +183,8 @@
 
        private final void clearAll(final CyNetworkView netView, final View<? 
extends CyIdentifiable> nodeView) {
                boolean needToUpdateView = false;
-
+               final VisualStyle style = vmm.getCurrentVisualStyle();
+               
                for (VisualProperty<?> vp : vpSet) {
                        final boolean lock = nodeView.isValueLocked(vp);
                        if (lock) {
@@ -191,8 +193,10 @@
                        }
                }
 
-               if (needToUpdateView)
+               if (needToUpdateView) {
+                       style.apply(netView);
                        netView.updateView();
+               }
        }
 
        private static final class VisualLexiconNodeComparator implements 
Comparator<VisualLexiconNode> {

Modified: 
core3/impl/trunk/vizmap-impl/impl/src/main/java/org/cytoscape/view/vizmap/internal/AbstractApplyHandler.java
===================================================================
--- 
core3/impl/trunk/vizmap-impl/impl/src/main/java/org/cytoscape/view/vizmap/internal/AbstractApplyHandler.java
        2012-08-23 18:27:46 UTC (rev 30258)
+++ 
core3/impl/trunk/vizmap-impl/impl/src/main/java/org/cytoscape/view/vizmap/internal/AbstractApplyHandler.java
        2012-08-23 19:13:30 UTC (rev 30259)
@@ -34,8 +34,8 @@
                                final VisualMappingFunction<?, ?> mapping = 
style.getVisualMappingFunction(vp);
        
                                if (mapping != null) {
-                                       Object value = 
mapping.getMappedValue(row);
-                                       
+                                       // Mapping rexists.
+                                       final Object value = 
mapping.getMappedValue(row);
                                        if (value != null)
                                                view.setVisualProperty(vp, 
value);
                                } else {
@@ -68,7 +68,8 @@
                }
                
                // TODO: is this correct?
-               view.setVisualProperty(vp, defaultValue);
+               if(!vp.shouldIgnoreDefault())
+                       view.setVisualProperty(vp, defaultValue);
        }
 
        private void override(final CyRow row, final View<T> view) {

Modified: 
core3/impl/trunk/vizmap-impl/impl/src/test/java/org/cytoscape/view/vizmap/VisualStyleTest.java
===================================================================
--- 
core3/impl/trunk/vizmap-impl/impl/src/test/java/org/cytoscape/view/vizmap/VisualStyleTest.java
      2012-08-23 18:27:46 UTC (rev 30258)
+++ 
core3/impl/trunk/vizmap-impl/impl/src/test/java/org/cytoscape/view/vizmap/VisualStyleTest.java
      2012-08-23 19:13:30 UTC (rev 30259)
@@ -1,9 +1,11 @@
 package org.cytoscape.view.vizmap;
 
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
+import java.awt.Color;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashSet;
@@ -11,10 +13,13 @@
 import java.util.Properties;
 import java.util.Set;
 
+import org.cytoscape.ding.DVisualLexicon;
 import org.cytoscape.ding.NetworkViewTestSupport;
 import org.cytoscape.event.CyEventHelper;
+import org.cytoscape.model.CyIdentifiable;
 import org.cytoscape.model.CyNetwork;
 import org.cytoscape.model.CyNode;
+import org.cytoscape.model.CyRow;
 import org.cytoscape.model.CyTable;
 import org.cytoscape.property.CyProperty;
 import org.cytoscape.service.util.CyServiceRegistrar;
@@ -28,6 +33,7 @@
 import org.cytoscape.view.vizmap.internal.VisualStyleFactoryImpl;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.asm.util.CheckAnnotationAdapter;
 
 public class VisualStyleTest extends AbstractVisualStyleTest {
        
@@ -134,4 +140,132 @@
                return System.currentTimeMillis() - start2;
        }
        
+       @Test
+       public void testNodeBypass() {
+
+               final View<CyNode> nodeView1 = networkView.getNodeView(node1);
+               
+               // Set defaults
+               final Double nodeSize = Double.valueOf(22d);
+               final Double nodeWidth = Double.valueOf(150d);
+               final Double nodeHeight = Double.valueOf(44d);
+               final Double nodeBWidth = Double.valueOf(6d);
+               final Integer trans = Integer.valueOf(123);
+               final Integer bordertrans = Integer.valueOf(222);
+               
+               networkView.setViewDefault(DVisualLexicon.NODE_SIZE, nodeSize);
+               networkView.setViewDefault(DVisualLexicon.NODE_WIDTH, 
nodeWidth);
+               networkView.setViewDefault(DVisualLexicon.NODE_HEIGHT, 
nodeHeight);
+               networkView.setViewDefault(DVisualLexicon.NODE_FILL_COLOR, 
Color.magenta);
+               networkView.setViewDefault(DVisualLexicon.NODE_BORDER_PAINT, 
Color.pink);
+               networkView.setViewDefault(DVisualLexicon.NODE_TRANSPARENCY, 
trans);
+               networkView.setViewDefault(DVisualLexicon.NODE_BORDER_WIDTH, 
nodeBWidth);
+               
networkView.setViewDefault(DVisualLexicon.NODE_BORDER_TRANSPARENCY, 
bordertrans);
+               
+               nodeView1.setVisualProperty(DVisualLexicon.NODE_X_LOCATION, 
100d);
+               nodeView1.setVisualProperty(DVisualLexicon.NODE_Y_LOCATION, 
123d);
+
+               
+               // Make sure default values are applied to the view
+               assertEquals(nodeSize, 
nodeView1.getVisualProperty(DVisualLexicon.NODE_SIZE));
+               assertEquals(nodeWidth, 
nodeView1.getVisualProperty(DVisualLexicon.NODE_WIDTH));
+               assertEquals(nodeHeight, 
nodeView1.getVisualProperty(DVisualLexicon.NODE_HEIGHT));
+               assertEquals(nodeBWidth, 
nodeView1.getVisualProperty(DVisualLexicon.NODE_BORDER_WIDTH));
+               assertEquals(trans, 
nodeView1.getVisualProperty(DVisualLexicon.NODE_TRANSPARENCY));
+               assertEquals(bordertrans, 
nodeView1.getVisualProperty(DVisualLexicon.NODE_BORDER_TRANSPARENCY));
+               assertEquals(Color.magenta.getRed(),
+                               ((Color) 
nodeView1.getVisualProperty(DVisualLexicon.NODE_FILL_COLOR)).getRed());
+               assertEquals(Color.magenta.getGreen(),
+                               ((Color) 
nodeView1.getVisualProperty(DVisualLexicon.NODE_FILL_COLOR)).getGreen());
+               assertEquals(Color.magenta.getBlue(),
+                               ((Color) 
nodeView1.getVisualProperty(DVisualLexicon.NODE_FILL_COLOR)).getBlue());
+               assertEquals(Color.pink.getRed(),
+                               ((Color) 
nodeView1.getVisualProperty(DVisualLexicon.NODE_BORDER_PAINT)).getRed());
+               assertEquals(Color.pink.getGreen(),
+                               ((Color) 
nodeView1.getVisualProperty(DVisualLexicon.NODE_BORDER_PAINT)).getGreen());
+               assertEquals(Color.pink.getBlue(),
+                               ((Color) 
nodeView1.getVisualProperty(DVisualLexicon.NODE_BORDER_PAINT)).getBlue());
+               assertEquals(Double.valueOf(100d), 
nodeView1.getVisualProperty(DVisualLexicon.NODE_X_LOCATION));
+               assertEquals(Double.valueOf(123d), 
nodeView1.getVisualProperty(DVisualLexicon.NODE_Y_LOCATION));
+               
+               //Apply bypass
+               applyBypass(Color.orange, DVisualLexicon.NODE_FILL_COLOR, 
networkView, nodeView1);
+               applyBypass(200d, DVisualLexicon.NODE_WIDTH, networkView, 
nodeView1);
+               applyBypass(300d, DVisualLexicon.NODE_HEIGHT, networkView, 
nodeView1);
+               applyBypass(33, DVisualLexicon.NODE_TRANSPARENCY, networkView, 
nodeView1);
+               applyBypass(Color.yellow, DVisualLexicon.NODE_BORDER_PAINT, 
networkView, nodeView1);
+               applyBypass(111, DVisualLexicon.NODE_BORDER_TRANSPARENCY, 
networkView, nodeView1);
+               applyBypass(9d, DVisualLexicon.NODE_BORDER_WIDTH, networkView, 
nodeView1);
+               
+               assertEquals(Double.valueOf(200d), 
nodeView1.getVisualProperty(DVisualLexicon.NODE_WIDTH));
+               assertEquals(Double.valueOf(300d), 
nodeView1.getVisualProperty(DVisualLexicon.NODE_HEIGHT));
+               assertEquals(Double.valueOf(9d), 
nodeView1.getVisualProperty(DVisualLexicon.NODE_BORDER_WIDTH));
+               assertEquals(Integer.valueOf(111), 
nodeView1.getVisualProperty(DVisualLexicon.NODE_BORDER_TRANSPARENCY));
+               assertEquals(Integer.valueOf(33), 
nodeView1.getVisualProperty(DVisualLexicon.NODE_TRANSPARENCY));
+               assertEquals(Color.orange.getRed(),
+                               ((Color) 
nodeView1.getVisualProperty(DVisualLexicon.NODE_FILL_COLOR)).getRed());
+               assertEquals(Color.orange.getGreen(),
+                               ((Color) 
nodeView1.getVisualProperty(DVisualLexicon.NODE_FILL_COLOR)).getGreen());
+               assertEquals(Color.orange.getBlue(),
+                               ((Color) 
nodeView1.getVisualProperty(DVisualLexicon.NODE_FILL_COLOR)).getBlue());
+               assertEquals(Color.yellow.getRed(),
+                               ((Color) 
nodeView1.getVisualProperty(DVisualLexicon.NODE_BORDER_PAINT)).getRed());
+               assertEquals(Color.yellow.getGreen(),
+                               ((Color) 
nodeView1.getVisualProperty(DVisualLexicon.NODE_BORDER_PAINT)).getGreen());
+               assertEquals(Color.yellow.getBlue(),
+                               ((Color) 
nodeView1.getVisualProperty(DVisualLexicon.NODE_BORDER_PAINT)).getBlue());
+               
+               // Check node position is the same
+               assertEquals(Double.valueOf(100d), 
nodeView1.getVisualProperty(DVisualLexicon.NODE_X_LOCATION));
+               assertEquals(Double.valueOf(123d), 
nodeView1.getVisualProperty(DVisualLexicon.NODE_Y_LOCATION));
+               
+               // Clear and test
+               nodeView1.clearValueLock(DVisualLexicon.NODE_FILL_COLOR);
+               nodeView1.clearValueLock(DVisualLexicon.NODE_WIDTH);
+               nodeView1.clearValueLock(DVisualLexicon.NODE_HEIGHT);
+               nodeView1.clearValueLock(DVisualLexicon.NODE_BORDER_PAINT);
+               
nodeView1.clearValueLock(DVisualLexicon.NODE_BORDER_TRANSPARENCY);
+               nodeView1.clearValueLock(DVisualLexicon.NODE_BORDER_WIDTH);
+               
+               final CyRow row = 
networkView.getModel().getRow(nodeView1.getModel());
+               style.apply(networkView);
+               networkView.updateView();
+               
+               // FIXME
+//             assertEquals(nodeSize, 
nodeView1.getVisualProperty(DVisualLexicon.NODE_SIZE));
+//             assertEquals(nodeWidth, 
nodeView1.getVisualProperty(DVisualLexicon.NODE_WIDTH));
+//             assertEquals(nodeHeight, 
nodeView1.getVisualProperty(DVisualLexicon.NODE_HEIGHT));
+//             assertEquals(nodeBWidth, 
nodeView1.getVisualProperty(DVisualLexicon.NODE_BORDER_WIDTH));
+//             assertEquals(trans, 
nodeView1.getVisualProperty(DVisualLexicon.NODE_TRANSPARENCY));
+//             assertEquals(bordertrans, 
nodeView1.getVisualProperty(DVisualLexicon.NODE_BORDER_TRANSPARENCY));
+//             assertEquals(Color.magenta.getRed(),
+//                             ((Color) 
nodeView1.getVisualProperty(DVisualLexicon.NODE_FILL_COLOR)).getRed());
+//             assertEquals(Color.magenta.getGreen(),
+//                             ((Color) 
nodeView1.getVisualProperty(DVisualLexicon.NODE_FILL_COLOR)).getGreen());
+//             assertEquals(Color.magenta.getBlue(),
+//                             ((Color) 
nodeView1.getVisualProperty(DVisualLexicon.NODE_FILL_COLOR)).getBlue());
+//             assertEquals(Color.pink.getRed(),
+//                             ((Color) 
nodeView1.getVisualProperty(DVisualLexicon.NODE_BORDER_PAINT)).getRed());
+//             assertEquals(Color.pink.getGreen(),
+//                             ((Color) 
nodeView1.getVisualProperty(DVisualLexicon.NODE_BORDER_PAINT)).getGreen());
+//             assertEquals(Color.pink.getBlue(),
+//                             ((Color) 
nodeView1.getVisualProperty(DVisualLexicon.NODE_BORDER_PAINT)).getBlue());
+//             assertEquals(Double.valueOf(100d), 
nodeView1.getVisualProperty(DVisualLexicon.NODE_X_LOCATION));
+//             assertEquals(Double.valueOf(123d), 
nodeView1.getVisualProperty(DVisualLexicon.NODE_Y_LOCATION));
+               
+       }
+       
+       
+       
+       private final <T, V extends T> void applyBypass(V bypassValue, 
VisualProperty<T> vp, CyNetworkView networkView,
+                       View<? extends CyIdentifiable> view) {
+               // Set lock for the vp
+               view.setLockedValue(vp, bypassValue);
+
+               // Apply the new value only for the given view
+               final CyRow row = 
networkView.getModel().getRow(view.getModel());
+               style.apply(row, view);
+       }
+       
+       
 }

-- 
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