Author: kono
Date: 2012-01-06 16:54:04 -0800 (Fri, 06 Jan 2012)
New Revision: 27950

Removed:
   
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/IntermediateEdgeDetails.java
   
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/IntermediateNodeDetails.java
Modified:
   
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/GraphView.java
   
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/AbstractDViewModel.java
   
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DEdgeDetails.java
   
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DGraphView.java
   
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/test/java/org/cytoscape/view/DNodeViewTest.java
   
core3/impl/trunk/ding-impl/graph-render/src/main/java/org/cytoscape/graph/render/stateful/NodeDetails.java
Log:
Some of the bypass code had been implemented.  Still some of them are missing.

Modified: 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/GraphView.java
===================================================================
--- 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/GraphView.java
   2012-01-06 22:59:43 UTC (rev 27949)
+++ 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/GraphView.java
   2012-01-07 00:54:04 UTC (rev 27950)
@@ -17,6 +17,8 @@
 
 import javax.swing.JLayeredPane;
 
+import org.cytoscape.ding.impl.DEdgeView;
+import org.cytoscape.ding.impl.DNodeView;
 import org.cytoscape.graph.render.stateful.GraphLOD;
 import org.cytoscape.model.CyEdge;
 import org.cytoscape.model.CyNetwork;
@@ -244,14 +246,14 @@
         * 
         * @return The NodeView of the given Node
         */
-       public NodeView getDNodeView(CyNode node);
+       public DNodeView getDNodeView(CyNode node);
 
        /**
         * @param index
         *            the index of the node whose view is requested
         * @return The NodeView of the given Node
         */
-       public NodeView getDNodeView(int index);
+       public DNodeView getDNodeView(int index);
 
        /**
         * Return all of the EdgeViews in this GraphView
@@ -275,7 +277,7 @@
        /**
         * @return the EdgeView that corresponds to the given index
         */
-       public EdgeView getDEdgeView(int edge_index);
+       public DEdgeView getDEdgeView(int edge_index);
 
        /**
         * Return all of the EdgeViews in this GraphView
@@ -285,7 +287,7 @@
        /**
         * @return the EdgeView that corresponds to the given Edge
         */
-       public EdgeView getDEdgeView(CyEdge edge);
+       public DEdgeView getDEdgeView(CyEdge edge);
 
        /**
         * @return the number of edges

Modified: 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/AbstractDViewModel.java
===================================================================
--- 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/AbstractDViewModel.java
     2012-01-06 22:59:43 UTC (rev 27949)
+++ 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/AbstractDViewModel.java
     2012-01-07 00:54:04 UTC (rev 27950)
@@ -20,7 +20,6 @@
         * Create an instance of view model, but not firing event to upper 
layer.
         * 
         * @param model
-        * @param cyEventHelper
         */
        public AbstractDViewModel(final M model) {
                if (model == null)

Modified: 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DEdgeDetails.java
===================================================================
--- 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DEdgeDetails.java
   2012-01-06 22:59:43 UTC (rev 27949)
+++ 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DEdgeDetails.java
   2012-01-07 00:54:04 UTC (rev 27950)
@@ -42,14 +42,16 @@
 import org.cytoscape.ding.impl.visualproperty.EdgeBendVisualProperty;
 import org.cytoscape.graph.render.immed.EdgeAnchors;
 import org.cytoscape.graph.render.immed.GraphGraphics;
+import org.cytoscape.graph.render.stateful.EdgeDetails;
 import org.cytoscape.model.CyEdge;
 import org.cytoscape.model.CyNetwork;
 import org.cytoscape.model.CyNode;
 import org.cytoscape.util.intr.IntEnumerator;
 import org.cytoscape.util.intr.IntObjHash;
 import org.cytoscape.util.intr.MinIntHeap;
+import org.cytoscape.view.presentation.property.values.LineType;
 
-class DEdgeDetails extends IntermediateEdgeDetails {
+class DEdgeDetails extends EdgeDetails {
 
        final DGraphView m_view;
        final Object m_deletedEntry = new Object();
@@ -383,6 +385,11 @@
         */
        @Override
        public float segmentThickness(final int edge) {
+               //  Bypass check
+               final DEdgeView edv = m_view.getDEdgeView(edge);
+               if (edv.isValueLocked(DVisualLexicon.EDGE_WIDTH))
+                       return 
edv.getVisualProperty(DVisualLexicon.EDGE_WIDTH).floatValue();
+               
                final Float thickness = m_segmentThicknesses.get(edge);
                if (thickness == null)
                        if (m_segmentThicknessDefault == null)
@@ -415,6 +422,13 @@
         */
        @Override
        public Stroke segmentStroke(final int edge) {
+               // Bypass check
+               final DEdgeView edv = m_view.getDEdgeView(edge);
+               if (edv.isValueLocked(DVisualLexicon.EDGE_LINE_TYPE)) {
+                       final LineType lineType = 
edv.getVisualProperty(DVisualLexicon.EDGE_LINE_TYPE);
+                       return 
DLineType.getDLineType(lineType).getStroke(edv.getStrokeWidth());
+               }
+               
                final Stroke stroke = m_segmentStrokes.get(edge);
 
                if (stroke == null)

Modified: 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DGraphView.java
===================================================================
--- 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DGraphView.java
     2012-01-06 22:59:43 UTC (rev 27949)
+++ 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DGraphView.java
     2012-01-07 00:54:04 UTC (rev 27950)
@@ -1192,23 +1192,19 @@
        }
 
 
-       public NodeView getDNodeView(final CyNode node) {
+       @Override
+       public DNodeView getDNodeView(final CyNode node) {
                return getDNodeView(node.getIndex());
        }
        
        @Override
-       public NodeView getDNodeView(final int nodeInx) {
+       public DNodeView getDNodeView(final int nodeInx) {
                synchronized (m_lock) {
-                       return m_nodeViewMap.get(nodeInx);
+                       return (DNodeView) m_nodeViewMap.get(nodeInx);
                }
        }
 
-       /**
-        * Returns a list of all edge views, including those that are currently
-        * hidden.
-        *
-        * @return DOCUMENT ME!
-        */
+       @Override
        public List<EdgeView> getEdgeViewsList() {
                synchronized (m_lock) {
                        final ArrayList<EdgeView> returnThis = new 
ArrayList<EdgeView>(
@@ -1287,18 +1283,13 @@
         * {@inheritDoc}
         */
        @Override
-       public EdgeView getDEdgeView(final int edgeInx) {
+       public DEdgeView getDEdgeView(final int edgeInx) {
                synchronized (m_lock) {
-                       return m_edgeViewMap.get(edgeInx);
+                       return (DEdgeView) m_edgeViewMap.get(edgeInx);
                }
        }
 
-       /**
-        * Returns an iterator of all edge views, including those that are 
currently
-        * hidden.
-        *
-        * @return DOCUMENT ME!
-        */
+       @Override
        public Iterator<EdgeView> getEdgeViewsIterator() {
                synchronized (m_lock) {
                        return m_edgeViewMap.values().iterator();
@@ -1307,34 +1298,21 @@
 
        
        @Override
-       public EdgeView getDEdgeView(final CyEdge edge) {
+       public DEdgeView getDEdgeView(final CyEdge edge) {
                return getDEdgeView(edge.getIndex());
        }
 
-       /**
-        * Alias to getEdgeViewCount().
-        *
-        * @return DOCUMENT ME!
-        */
+       @Override
        public int edgeCount() {
                return getEdgeViewCount();
        }
 
-       /**
-        * Alias to getNodeViewCount().
-        *
-        * @return DOCUMENT ME!
-        */
+       @Override
        public int nodeCount() {
                return getNodeViewCount();
        }
 
-       /**
-        * @param obj
-        *            should be either a DEdgeView or a DNodeView.
-        *
-        * @return DOCUMENT ME!
-        */
+       @Override
        public boolean hideGraphObject(Object obj) {
                return hideGraphObjectInternal(obj, true);
        }
@@ -2036,12 +2014,7 @@
                return m_networkCanvas.m_fontMetrics.charsWidth(lab, 0, 
lab.length);
        }
 
-       /**
-        * DOCUMENT ME!
-        *
-        * @param lod
-        *            DOCUMENT ME!
-        */
+       @Override
        public void setGraphLOD(GraphLOD lod) {
                synchronized (m_lock) {
                        m_networkCanvas.m_lod[0] = lod;

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-01-06 22:59:43 UTC (rev 27949)
+++ 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DNodeDetails.java
   2012-01-07 00:54:04 UTC (rev 27950)
@@ -41,8 +41,11 @@
 import java.util.Set;
 
 import org.cytoscape.ding.DNodeShape;
+import org.cytoscape.ding.Justification;
 import org.cytoscape.ding.Label;
+import org.cytoscape.ding.NodeView;
 import org.cytoscape.ding.ObjectPosition;
+import org.cytoscape.ding.Position;
 import org.cytoscape.ding.customgraphics.CyCustomGraphics;
 import org.cytoscape.ding.impl.visualproperty.CustomGraphicsVisualProperty;
 import org.cytoscape.ding.impl.visualproperty.ObjectPositionVisualProperty;
@@ -51,16 +54,19 @@
 import org.cytoscape.model.CyNode;
 import org.cytoscape.util.intr.IntObjHash;
 import org.cytoscape.view.model.View;
+import org.cytoscape.view.presentation.property.NodeShapeVisualProperty;
+import org.cytoscape.view.presentation.property.values.NodeShape;
 
 
 /*
  * Access to the methods of this class should be synchronized externally if
  * there is a threat of multiple threads.
  */
-class DNodeDetails extends IntermediateNodeDetails {
+class DNodeDetails extends NodeDetails {
        
+       private static final byte DEF_NODE_SHAPE = 
DNodeShape.getDShape(NodeShapeVisualProperty.RECTANGLE).getNativeShape();
        
-       final DGraphView m_view;
+       private final DGraphView m_view;
        
        final Object m_deletedEntry = new Object();
 
@@ -100,7 +106,6 @@
        private Paint m_unselectedPaintDefault; 
        private Paint m_selectedPaintDefault;
 
-       
        private DNodeShape m_shapeDefault; 
        private Float m_borderWidthDefault; 
        private Paint m_borderPaintDefault; 
@@ -125,8 +130,9 @@
 
        private boolean isCleared = false;
        
+       
        DNodeDetails(final DGraphView view) {
-               m_view = view;
+               this.m_view = view;
                
                defaultCustomGraphicsMap = new 
HashMap<CustomGraphicsVisualProperty, CyCustomGraphics<CustomGraphic>>();
                defaultCustomGraphicsPositionMap = new 
HashMap<ObjectPositionVisualProperty, ObjectPosition>();
@@ -209,7 +215,7 @@
        
        
        @Override
-       public Color colorLowDetail(int node) {
+       public Color colorLowDetail(final int node) {
                boolean isSelected = selected.contains(node);
                
                if(isSelected)
@@ -253,6 +259,11 @@
        
        
        public Paint selectedPaint(int node) {
+               // Check bypass
+               final DNodeView dnv = m_view.getDNodeView(node);
+               if (dnv.isValueLocked(DVisualLexicon.NODE_SELECTED_PAINT))
+                       return 
dnv.getVisualProperty(DVisualLexicon.NODE_SELECTED_PAINT);
+               
                final Paint o = m_selectedPaints.get(node);
 
                if (o == null)
@@ -271,6 +282,17 @@
 
        @Override
        public byte shape(final int node) {
+               // Check bypass
+               final DNodeView dnv = m_view.getDNodeView(node);
+               if(dnv.isValueLocked(DVisualLexicon.NODE_SHAPE)) {
+                       final NodeShape nodeShape = 
dnv.getVisualProperty(DVisualLexicon.NODE_SHAPE);
+                       final DNodeShape dShape = 
DNodeShape.getDShape(nodeShape);
+                       if(dShape == null)
+                               return DEF_NODE_SHAPE;
+                       else
+                               return dShape.getNativeShape();
+               }
+               
                final Byte shape = m_shapes.get(node);
 
                if (shape == null)
@@ -302,6 +324,11 @@
         * 
         */
        public Paint unselectedPaint(final int node) {
+               // Check bypass
+               final DNodeView dnv = m_view.getDNodeView(node);
+               if (dnv.isValueLocked(DVisualLexicon.NODE_FILL_COLOR))
+                       return 
dnv.getVisualProperty(DVisualLexicon.NODE_FILL_COLOR);
+               
                final Paint o = m_unselectedPaints.get(node);
 
                if (o == null)
@@ -354,6 +381,11 @@
        
        @Override
        public float borderWidth(final int node) {
+               // Check bypass
+               final DNodeView dnv = m_view.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)
@@ -383,6 +415,14 @@
 
        @Override
        public Paint borderPaint(final int node) {
+               // Check bypass
+               final DNodeView dnv = m_view.getDNodeView(node);
+               if(dnv == null)
+                       return DVisualLexicon.NODE_BORDER_PAINT.getDefault();
+               
+               if (dnv.isValueLocked(DVisualLexicon.NODE_BORDER_PAINT))
+                       return 
dnv.getVisualProperty(DVisualLexicon.NODE_BORDER_PAINT);
+
                final Paint o = m_borderPaints.get(node);
 
                if (o == null)
@@ -441,6 +481,11 @@
 
        @Override
        public String labelText(final int node, final int labelInx) {
+               // Check bypass
+               final DNodeView dnv = m_view.getDNodeView(node);
+               if (dnv.isValueLocked(DVisualLexicon.NODE_LABEL))
+                       return dnv.getVisualProperty(DVisualLexicon.NODE_LABEL);
+                               
                final long key = (((long) node) << 32) | ((long) labelInx);
                final String o = m_labelTexts.get(key);
 
@@ -473,6 +518,11 @@
        
        
        public String tooltipText(final int node) {
+               // Check bypass
+               final DNodeView dnv = m_view.getDNodeView(node);
+               if (dnv.isValueLocked(DVisualLexicon.NODE_TOOLTIP))
+                       return 
dnv.getVisualProperty(DVisualLexicon.NODE_TOOLTIP);
+               
                final String o = m_tooltipTexts.get(node);
 
                if (o == null)
@@ -505,16 +555,41 @@
 
        @Override
        public Font labelFont(int node, int labelInx) {
+               // Check bypass
+               final DNodeView dnv = m_view.getDNodeView(node);
+               
+               Integer size = null;
+               Font fontFace = null;
+               if (dnv.isValueLocked(DVisualLexicon.NODE_LABEL_FONT_SIZE))
+                       size = 
dnv.getVisualProperty(DVisualLexicon.NODE_LABEL_FONT_SIZE);
+               if (dnv.isValueLocked(DVisualLexicon.NODE_LABEL_FONT_FACE))
+                       fontFace = 
dnv.getVisualProperty(DVisualLexicon.NODE_LABEL_FONT_FACE);
+               
+               if(size != null && fontFace != null)
+                       return fontFace.deriveFont(size.floatValue());
+               
                final long key = (((long) node) << 32) | ((long) labelInx);
-               final Font o = m_labelFonts.get(key);
+               final Font font = m_labelFonts.get(key);
 
-               if (o == null)
+               if (font == null) {
                        if ( m_labelFontDefault == null )
-                               return super.labelFont(node, labelInx);
-                       else
-                               return m_labelFontDefault;
-
-               return o;
+                               return 
DVisualLexicon.NODE_LABEL_FONT_FACE.getDefault();
+                       else {
+                               if(size != null)
+                                       return 
m_labelFontDefault.deriveFont(size.floatValue());
+                               else if(fontFace != null)
+                                       return 
fontFace.deriveFont((float)m_labelFontDefault.getSize());
+                               else
+                                       return m_labelFontDefault;
+                       }
+               }
+               
+               if(size != null)
+                       return font.deriveFont(size.floatValue());
+               else if(fontFace != null)
+                       return fontFace.deriveFont((float)font.getSize());
+               else
+                       return font;
        }
 
        void setLabelFontDefault(Font f) {
@@ -537,6 +612,11 @@
 
        @Override
        public Paint labelPaint(int node, int labelInx) {
+               // Check bypass
+               final DNodeView dnv = m_view.getDNodeView(node);
+               if (dnv.isValueLocked(DVisualLexicon.NODE_LABEL_COLOR))
+                       return 
dnv.getVisualProperty(DVisualLexicon.NODE_LABEL_COLOR);
+       
                final long key = (((long) node) << 32) | ((long) labelInx);
                final Object o = m_labelPaints.get(Long.valueOf(key));
 
@@ -575,10 +655,6 @@
        }
 
 
-       /**
-        * Return value of this will be used actual rendering code.
-        * 
-        */
        @Override
        public Iterator<CustomGraphic> customGraphics (final int node) {
                final DNodeView dnv = (DNodeView) m_view.getDNodeView(node);
@@ -586,96 +662,17 @@
        }
        
 
-//     void setCustomGraphicsDefault(final CustomGraphicsVisualProperty vp,
-//                     final CyCustomGraphics<CustomGraphic> customGraphics) {
-//             
-//             if(customGraphics == null || customGraphics == 
NullCustomGraphics.getNullObject()) {
-//                     // Setting NullCustomGraphics means remove current 
custom graphics.
-//                     defaultCustomGraphicsMap.remove(vp);
-//             } else {
-//                     // Create new default values.  Need to apply positions, 
too.
-//                     defaultCustomGraphicsMap.put(vp, customGraphics);
-//                     
-//                     this.defaultCGList = new ArrayList<CustomGraphic>();
-//                     final Collection<CyCustomGraphics<CustomGraphic>> 
defCGList = defaultCustomGraphicsMap.values();
-//                     
-//                     for (final CyCustomGraphics<CustomGraphic> 
val:defCGList) {
-//                             List<Layer<CustomGraphic>> layers = 
val.getLayers();
-//                             for(Layer<CustomGraphic> layer: layers)
-//                                     
defaultCGList.add(layer.getLayerObject());
-//                     }
-//             }
-//     }
-//     
-//     private CustomGraphicsVisualProperty getParentVP(final 
ObjectPositionVisualProperty vp) {
-//             final VisualLexiconNode lexNode = 
m_view.dingLexicon.getVisualLexiconNode(vp);
-//             final Collection<VisualLexiconNode> leavs = 
lexNode.getParent().getChildren();
-//
-//             CustomGraphicsVisualProperty parent = null;
-//             for (VisualLexiconNode vlNode : leavs) {
-//                     if 
(vlNode.getVisualProperty().getRange().getType().equals(CyCustomGraphics.class))
 {
-//                             parent = (CustomGraphicsVisualProperty) 
vlNode.getVisualProperty();
-//                             break;
-//                     }
-//             }
-//
-//             if (parent == null)
-//                     throw new NullPointerException("Associated Custom 
Graphics VP is missing for " + vp.getDisplayName());
-//             
-//             return parent;
-//     }
-//     
-//     void setCustomGraphicsPositionDefault(final 
ObjectPositionVisualProperty vp, final ObjectPosition position) {
-//             
-//             System.out.println("#Setting called: " + vp.getDisplayName());
-//             
-//             if (position == null || 
position.equals(ObjectPositionImpl.DEFAULT_POSITION))
-//                     defaultCustomGraphicsPositionMap.remove(vp);
-//             else {
-//                     defaultCustomGraphicsPositionMap.put(vp, position);
-//                     
-//                     final CustomGraphicsVisualProperty parent = 
getParentVP(vp);
-//                     final CyCustomGraphics<CustomGraphic> cg = 
defaultCustomGraphicsMap.get(parent);
-//                     if(cg == null)
-//                             return;
-//                     
-//                     System.out.println("#Setting new location for: " + 
parent.getDisplayName() + " -- " + vp.getDisplayName());
-//
-//                     // This is the set of all Custom Graphics.
-//                     final Collection<CyCustomGraphics<CustomGraphic>> 
defCGList = defaultCustomGraphicsMap.values();
-//                     
-//                     for (final View<CyNode> dnv : m_view.getNodeViews()) {
-//                             final List<CustomGraphic> newCGList = new 
ArrayList<CustomGraphic>();
-//                             for (final Layer<CustomGraphic> layer : 
cg.getLayers()) {
-//                                     final CustomGraphic newCG = 
moveCustomGraphicsToNewPosition(layer.getLayerObject(), position,
-//                                                     (DNodeView) dnv);
-//                                     newCGList.add(newCG);
-//                             }
-//
-//                             for (final CyCustomGraphics<CustomGraphic> val 
: defCGList) {
-//                                     if (val != cg) {
-//                                             List<Layer<CustomGraphic>> 
layers = val.getLayers();
-//                                             for (Layer<CustomGraphic> layer 
: layers)
-//                                                     
newCGList.add(layer.getLayerObject());
-//                                     }
-//                             }
-//                             this.m_customGraphics.put(((DNodeView) 
dnv).m_inx, newCGList);
-//                     }
-//             }
-//     }
-//     
-//     private CustomGraphic moveCustomGraphicsToNewPosition(final 
CustomGraphic cg, final ObjectPosition newPosition, final DNodeView dnv) {
-//             if (cg == null || newPosition == null)
-//                     throw new NullPointerException("CustomGraphic and 
Position cannot be null.");
-//
-//             // Create new graphics
-//             final CustomGraphic newCg = 
CustomGraphicsPositionCalculator.transform(newPosition, dnv, cg);
-//             return newCg;
-//     }
 
-
        @Override
        public byte labelTextAnchor(final int node, final int labelInx) {
+               // Check bypass
+               final DNodeView dnv = m_view.getDNodeView(node);
+               if (dnv.isValueLocked(DVisualLexicon.NODE_LABEL_POSITION)) {
+                       final ObjectPosition lp = 
dnv.getVisualProperty(DVisualLexicon.NODE_LABEL_POSITION);
+                       final Position anchor = lp.getAnchor();
+                       return convertG2ND(anchor.getConversionConstant());
+               }
+               
                final Integer p = m_labelTextAnchors.get(node);
 
                if (p == null)
@@ -702,6 +699,14 @@
 
        @Override
        public byte labelNodeAnchor(final int node, final int labelInx) {
+               // Check bypass
+               final DNodeView dnv = m_view.getDNodeView(node);
+               if (dnv.isValueLocked(DVisualLexicon.NODE_LABEL_POSITION)) {
+                       final ObjectPosition lp = 
dnv.getVisualProperty(DVisualLexicon.NODE_LABEL_POSITION);
+                       final Position anchor = lp.getTargetAnchor();
+                       return convertG2ND(anchor.getConversionConstant());
+               }
+               
                final Integer o = m_labelNodeAnchors.get(node);
 
                if (o == null)
@@ -726,15 +731,15 @@
                }
        }
 
-       /**
-        *  DOCUMENT ME!
-        *
-        * @param node DOCUMENT ME!
-        * @param labelInx DOCUMENT ME!
-        *
-        * @return  DOCUMENT ME!
-        */
+       @Override
        public float labelOffsetVectorX(final int node, final int labelInx) {
+               // Check bypass
+               final DNodeView dnv = m_view.getDNodeView(node);
+               if (dnv.isValueLocked(DVisualLexicon.NODE_LABEL_POSITION)) {
+                       final ObjectPosition lp = 
dnv.getVisualProperty(DVisualLexicon.NODE_LABEL_POSITION);
+                       return (float) lp.getOffsetX();
+               }
+               
                final Object o = m_labelOffsetXs.get(Integer.valueOf(node));
 
                if (o == null)
@@ -759,15 +764,15 @@
                }
        }
 
-       /**
-        *  DOCUMENT ME!
-        *
-        * @param node DOCUMENT ME!
-        * @param labelInx DOCUMENT ME!
-        *
-        * @return  DOCUMENT ME!
-        */
+       @Override
        public float labelOffsetVectorY(final int node, final int labelInx) {
+               // Check bypass
+               final DNodeView dnv = m_view.getDNodeView(node);
+               if (dnv.isValueLocked(DVisualLexicon.NODE_LABEL_POSITION)) {
+                       final ObjectPosition lp = 
dnv.getVisualProperty(DVisualLexicon.NODE_LABEL_POSITION);
+                       return (float) lp.getOffsetY();
+               }
+               
                final Object o = m_labelOffsetYs.get(Integer.valueOf(node));
 
                if (o == null)
@@ -792,15 +797,17 @@
                }
        }
 
-       /**
-        *  DOCUMENT ME!
-        *
-        * @param node DOCUMENT ME!
-        * @param labelInx DOCUMENT ME!
-        *
-        * @return  DOCUMENT ME!
-        */
+       
+       @Override
        public byte labelJustify(final int node, final int labelInx) {
+               // Check bypass
+               final DNodeView dnv = m_view.getDNodeView(node);
+               if (dnv.isValueLocked(DVisualLexicon.NODE_LABEL_POSITION)) {
+                       final ObjectPosition lp = 
dnv.getVisualProperty(DVisualLexicon.NODE_LABEL_POSITION);
+                       final Justification justify = lp.getJustify();
+                       return convertG2ND(justify.getConversionConstant());
+               }
+               
                Integer o = m_labelJustifys.get(node);
 
                if (o == null)

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-01-06 22:59:43 UTC (rev 27949)
+++ 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DNodeView.java
      2012-01-07 00:54:04 UTC (rev 27950)
@@ -426,7 +426,14 @@
         * {@inheritDoc}
         */
        @Override
-       public boolean setWidth(final double width) {
+       public boolean setWidth(final double originalWidth) {
+               final Double width;
+               // Check bypass
+               if(isValueLocked(DVisualLexicon.NODE_WIDTH))
+                       width = getVisualProperty(DVisualLexicon.NODE_WIDTH);
+               else
+                       width = originalWidth;
+               
                synchronized (graphView.m_lock) {
                        if (!graphView.m_spacial.exists(m_inx, 
graphView.m_extentsBuff, 0))
                                return false;
@@ -472,7 +479,14 @@
         * {@inheritDoc}
         */
        @Override
-       public boolean setHeight(double height) {
+       public boolean setHeight(double originalHeight) {
+               final Double height;
+               // Check bypass
+               if(isValueLocked(DVisualLexicon.NODE_HEIGHT))
+                       height = getVisualProperty(DVisualLexicon.NODE_HEIGHT);
+               else
+                       height = originalHeight;
+               
                synchronized (graphView.m_lock) {
                        if (!graphView.m_spacial.exists(m_inx, 
graphView.m_extentsBuff, 0))
                                return false;
@@ -517,14 +531,7 @@
                return this;
        }
 
-       /**
-        * FIXME: need to separate Label from this.
-        * 
-        * @param x
-        *            DOCUMENT ME!
-        * @param y
-        *            DOCUMENT ME!
-        */
+
        @Override
        public void setOffset(double x, double y) {
                synchronized (graphView.m_lock) {

Deleted: 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/IntermediateEdgeDetails.java
===================================================================
--- 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/IntermediateEdgeDetails.java
        2012-01-06 22:59:43 UTC (rev 27949)
+++ 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/IntermediateEdgeDetails.java
        2012-01-07 00:54:04 UTC (rev 27950)
@@ -1,101 +0,0 @@
-/*
- 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 org.cytoscape.ding.impl;
-
-import java.awt.Color;
-import java.awt.Font;
-import java.awt.Paint;
-import java.awt.Stroke;
-
-import org.cytoscape.graph.render.stateful.EdgeDetails;
-
-/**
- * Defines default values for each edge visual properties.
- * 
- */
-class IntermediateEdgeDetails extends EdgeDetails {
-
-       /**
-        * {@inheritDoc}
-        */
-       @Override
-       public Color colorLowDetail(final int edge) {
-               return DEdgeView.DEFAULT_EDGE_PAINT;
-       }
-
-       @Override
-       public float sourceArrowSize(int edge) {
-               return DEdgeView.DEFAULT_ARROW_SIZE;
-       }
-
-       @Override
-       public Paint sourceArrowPaint(int edge) {
-               return DEdgeView.DEFAULT_ARROW_PAINT;
-       }
-
-       @Override
-       public float targetArrowSize(int edge) {
-               return DEdgeView.DEFAULT_ARROW_SIZE;
-       }
-
-       @Override
-       public Paint targetArrowPaint(int edge) {
-               return DEdgeView.DEFAULT_ARROW_PAINT;
-       }
-
-       @Override
-       public float segmentThickness(int edge) {
-               return DEdgeView.DEFAULT_EDGE_THICKNESS;
-       }
-
-       @Override
-       public Stroke segmentStroke(int edge) {
-               return DEdgeView.DEFAULT_EDGE_STROKE;
-       }
-
-       @Override
-       public Paint segmentPaint(int edge) {
-               return DEdgeView.DEFAULT_EDGE_PAINT;
-       }
-
-       @Override
-       public String labelText(int edge, int labelInx) {
-               return DEdgeView.DEFAULT_LABEL_TEXT;
-       }
-
-       @Override
-       public Font labelFont(int edge, int labelInx) {
-               return DEdgeView.DEFAULT_LABEL_FONT;
-       }
-
-       @Override
-       public Paint labelPaint(int edge, int labelInx) {
-               return DEdgeView.DEFAULT_LABEL_PAINT;
-       }
-}

Deleted: 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/IntermediateNodeDetails.java
===================================================================
--- 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/IntermediateNodeDetails.java
        2012-01-06 22:59:43 UTC (rev 27949)
+++ 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/IntermediateNodeDetails.java
        2012-01-07 00:54:04 UTC (rev 27950)
@@ -1,95 +0,0 @@
-/*
- 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 org.cytoscape.ding.impl;
-
-
-import java.awt.Font;
-import java.awt.Paint;
-
-import org.cytoscape.graph.render.stateful.NodeDetails;
-
-
-class IntermediateNodeDetails extends NodeDetails {
-       /**
-        * DOCUMENT ME!
-        *
-        * @param node DOCUMENT ME!
-        *
-        * @return DOCUMENT ME!
-        */
-       public byte shape(int node) {
-               return DNodeView.DEFAULT_SHAPE;
-       }
-
-       /**
-        * DOCUMENT ME!
-        *
-        * @param node DOCUMENT ME!
-        *
-        * @return DOCUMENT ME!
-        */
-       public Paint borderPaint(int node) {
-               return DNodeView.DEFAULT_BORDER_PAINT;
-       }
-
-       /**
-        * DOCUMENT ME!
-        *
-        * @param node DOCUMENT ME!
-        * @param labelInx DOCUMENT ME!
-        *
-        * @return DOCUMENT ME!
-        */
-       public String labelText(int node, int labelInx) {
-               return DNodeView.DEFAULT_LABEL_TEXT;
-       }
-
-       /**
-        * DOCUMENT ME!
-        *
-        * @param node DOCUMENT ME!
-        * @param labelInx DOCUMENT ME!
-        *
-        * @return DOCUMENT ME!
-        */
-       public Font labelFont(int node, int labelInx) {
-               return DNodeView.DEFAULT_LABEL_FONT;
-       }
-
-       /**
-        * DOCUMENT ME!
-        *
-        * @param node DOCUMENT ME!
-        * @param labelInx DOCUMENT ME!
-        *
-        * @return DOCUMENT ME!
-        */
-       public Paint labelPaint(int node, int labelInx) {
-               return DNodeView.DEFAULT_LABEL_PAINT;
-       }
-}

Modified: 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/test/java/org/cytoscape/view/DNodeViewTest.java
===================================================================
--- 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/test/java/org/cytoscape/view/DNodeViewTest.java
       2012-01-06 22:59:43 UTC (rev 27949)
+++ 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/test/java/org/cytoscape/view/DNodeViewTest.java
       2012-01-07 00:54:04 UTC (rev 27950)
@@ -222,7 +222,7 @@
        @Test
        public void testGetBorderPaint() {
                final Paint borderPaint = dnv1.getBorderPaint();
-               assertEquals(Color.DARK_GRAY, borderPaint);
+               assertEquals(Color.BLACK, borderPaint);
        }
 
        @Test

Modified: 
core3/impl/trunk/ding-impl/graph-render/src/main/java/org/cytoscape/graph/render/stateful/NodeDetails.java
===================================================================
--- 
core3/impl/trunk/ding-impl/graph-render/src/main/java/org/cytoscape/graph/render/stateful/NodeDetails.java
  2012-01-06 22:59:43 UTC (rev 27949)
+++ 
core3/impl/trunk/ding-impl/graph-render/src/main/java/org/cytoscape/graph/render/stateful/NodeDetails.java
  2012-01-07 00:54:04 UTC (rev 27950)
@@ -35,7 +35,9 @@
 import java.awt.Paint;
 import java.awt.TexturePaint;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.Iterator;
+import java.util.Map;
 
 
 /**
@@ -129,14 +131,8 @@
         * by GraphRenderer.renderGraph() to render selected nodes on top of
         * unselected nodes.
         */
-       java.util.Map<Integer, Boolean> selectedMap = new 
java.util.HashMap<Integer, Boolean>();
+       Map<Integer, Boolean> selectedMap = new HashMap<Integer, Boolean>();
 
-       /**
-        * Instantiates node details with defaults.  Documentation on each 
method
-        * describes defaults.  To override defaults, extend this class.
-        */
-       public NodeDetails() {
-       }
 
        /**
         * Returns the color of node in low detail rendering mode.
@@ -188,7 +184,7 @@
         * a value greater than zero.
         */
        public Paint borderPaint(final int node) {
-               return null;
+               return Color.DARK_GRAY;
        }
 
        /**
@@ -250,7 +246,7 @@
         *   which node label in question.
         */
        public Paint labelPaint(final int node, final int labelInx) {
-               return null;
+               return Color.DARK_GRAY;
        }
 
        /**

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