Author: kono
Date: 2011-06-17 11:03:34 -0700 (Fri, 17 Jun 2011)
New Revision: 25792

Modified:
   
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DNodeView.java
Log:
Broken synchronization problem (node locations and selections) had been fixed.

Modified: 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DNodeView.java
===================================================================
--- 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DNodeView.java
     2011-06-17 17:36:25 UTC (rev 25791)
+++ 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DNodeView.java
     2011-06-17 18:03:34 UTC (rev 25792)
@@ -75,13 +75,15 @@
 import org.cytoscape.view.presentation.property.NodeShapeVisualProperty;
 import org.cytoscape.view.presentation.property.values.LineType;
 import org.cytoscape.view.presentation.property.values.NodeShape;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Ding implementation of node presentation.
  * 
  */
 public class DNodeView implements NodeView, Label {
-
+       
        // Affects size of the nested network image relative to the node size:
        private static final float NESTED_IMAGE_SCALE_FACTOR = 0.6f;
 
@@ -155,12 +157,6 @@
        float m_hiddenXMax = Float.MAX_VALUE;
        float m_hiddenYMax = Float.MAX_VALUE;
 
-       // // Node shapes
-       // List<Shape> m_graphicShapes;
-       //
-       // // Node Colors
-       // List<Paint> m_graphicPaints;
-
        // Tool Tip text
        private String m_toolTipText;
 
@@ -262,27 +258,19 @@
                return m_inx;
        }
 
+       
        /**
-        * DOCUMENT ME!
-        * 
-        * @param otherNodeView
-        *            DOCUMENT ME!
-        * 
-        * @return DOCUMENT ME!
+        * Provides list of DING edge views.
         */
        @Override
-       public List<EdgeView> getEdgeViewsList(NodeView otherNodeView) {
+       public List<EdgeView> getEdgeViewsList(final NodeView otherNodeView) {
                synchronized (graphView.m_lock) {
                        return 
graphView.getEdgeViewsList(this.getNodeViewModel().getModel(), 
otherNodeView.getNodeViewModel()
                                        .getModel());
                }
        }
 
-       /**
-        * DOCUMENT ME!
-        * 
-        * @return DOCUMENT ME!
-        */
+       
        @Override
        public int getShape() {
                synchronized (graphView.m_lock) {
@@ -353,11 +341,7 @@
                }
        }
 
-       /**
-        * DOCUMENT ME!
-        * 
-        * @return DOCUMENT ME!
-        */
+       
        @Override
        public Paint getUnselectedPaint() {
                return m_unselectedPaint;
@@ -866,7 +850,6 @@
                else
                        unselect();
 
-               // TODO: Is this necessary???
                return true;
        }
 
@@ -875,12 +858,7 @@
                return graphView.isHidden(this);
        }
 
-       /**
-        * DOCUMENT ME!
-        * 
-        * @param shape
-        *            DOCUMENT ME!
-        */
+       
        @Override
        public void setShape(final NodeShape shape) {
                synchronized (graphView.m_lock) {
@@ -1190,128 +1168,6 @@
                }
        };
 
-       // /**
-       // * DOCUMENT ME!
-       // *
-       // * @param position
-       // * DOCUMENT ME!
-       // */
-       // public void setTextAnchor(int position) {
-       // synchronized (graphView.m_lock) {
-       // graphView.m_nodeDetails.overrideLabelTextAnchor(m_inx, 0, position);
-       // graphView.m_contentChanged = true;
-       // }
-       // }
-       //
-       // /**
-       // * DOCUMENT ME!
-       // *
-       // * @return DOCUMENT ME!
-       // */
-       // public int getTextAnchor() {
-       // synchronized (graphView.m_lock) {
-       // return DNodeDetails.convertND2G(graphView.m_nodeDetails
-       // .labelTextAnchor(m_inx, 0));
-       // }
-       // }
-       //
-       // /**
-       // * DOCUMENT ME!
-       // *
-       // * @param justify
-       // * DOCUMENT ME!
-       // */
-       // public void setJustify(int justify) {
-       // synchronized (graphView.m_lock) {
-       // graphView.m_nodeDetails.overrideLabelJustify(m_inx, 0, justify);
-       // graphView.m_contentChanged = true;
-       // }
-       // }
-       //
-       // /**
-       // * DOCUMENT ME!
-       // *
-       // * @return DOCUMENT ME!
-       // */
-       // public int getJustify() {
-       // synchronized (graphView.m_lock) {
-       // return DNodeDetails.convertND2G(graphView.m_nodeDetails.labelJustify(
-       // m_inx, 0));
-       // }
-       // }
-       //
-       // /**
-       // * DOCUMENT ME!
-       // *
-       // * @param x
-       // * DOCUMENT ME!
-       // */
-       // public void setLabelOffsetX(double x) {
-       // synchronized (graphView.m_lock) {
-       // graphView.m_nodeDetails.overrideLabelOffsetVectorX(m_inx, 0, x);
-       // graphView.m_contentChanged = true;
-       // }
-       // }
-       //
-       // /**
-       // * DOCUMENT ME!
-       // *
-       // * @return DOCUMENT ME!
-       // */
-       // public double getLabelOffsetX() {
-       // synchronized (graphView.m_lock) {
-       // return graphView.m_nodeDetails.labelOffsetVectorX(m_inx, 0);
-       // }
-       // }
-       //
-       // /**
-       // * DOCUMENT ME!
-       // *
-       // * @param y
-       // * DOCUMENT ME!
-       // */
-       // public void setLabelOffsetY(double y) {
-       // synchronized (graphView.m_lock) {
-       // graphView.m_nodeDetails.overrideLabelOffsetVectorY(m_inx, 0, y);
-       // graphView.m_contentChanged = true;
-       // }
-       // }
-       //
-       // /**
-       // * DOCUMENT ME!
-       // *
-       // * @return DOCUMENT ME!
-       // */
-       // public double getLabelOffsetY() {
-       // synchronized (graphView.m_lock) {
-       // return graphView.m_nodeDetails.labelOffsetVectorY(m_inx, 0);
-       // }
-       // }
-       //
-       // /**
-       // * DOCUMENT ME!
-       // *
-       // * @param position
-       // * DOCUMENT ME!
-       // */
-       // public void setNodeLabelAnchor(int position) {
-       // synchronized (graphView.m_lock) {
-       // graphView.m_nodeDetails.overrideLabelNodeAnchor(m_inx, 0, position);
-       // graphView.m_contentChanged = true;
-       // }
-       // }
-       //
-       // /**
-       // * DOCUMENT ME!
-       // *
-       // * @return DOCUMENT ME!
-       // */
-       // public int getNodeLabelAnchor() {
-       // synchronized (graphView.m_lock) {
-       // return DNodeDetails.convertND2G(graphView.m_nodeDetails
-       // .labelNodeAnchor(m_inx, 0));
-       // }
-       // }
 
        public double getLabelWidth() {
                synchronized (graphView.m_lock) {
@@ -1434,9 +1290,9 @@
 
        @Override
        public void setVisualPropertyValue(final VisualProperty<?> vpOriginal, 
final Object value) {
-
+               
                final VisualProperty<?> vp;
-               VisualLexiconNode treeNode = 
lexicon.getVisualLexiconNode(vpOriginal);
+               final VisualLexiconNode treeNode = 
lexicon.getVisualLexiconNode(vpOriginal);
                if (treeNode == null)
                        return;
 
@@ -1458,9 +1314,8 @@
                if (treeNode.isDepend()) {
                        // Do not use this. Parent will be applied.
                        return;
-               } else {
+               } else
                        vp = vpOriginal;
-               }
 
                if (vp == DVisualLexicon.NODE_SHAPE) {
                        setShape(((NodeShape) value));
@@ -1516,9 +1371,6 @@
                } else if (vp instanceof CustomGraphicsVisualProperty) {
                        applyCustomGraphics(vp, 
(CyCustomGraphics<CustomGraphic>) value);
                }
-               // } else 
if(DVisualLexicon.getGraphicsPositionVP().contains(vp)) {
-               // applyCustomGraphicsPosition(vp, (ObjectPosition) value);
-               // }
        }
 
        private void applyCustomGraphics(final VisualProperty<?> vp, final 
CyCustomGraphics<CustomGraphic> customGraphics) {

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