Author: kono
Date: 2010-12-23 00:35:35 -0800 (Thu, 23 Dec 2010)
New Revision: 23264

Modified:
   
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/GraphViewObject.java
   
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/Label.java
   
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/NodeView.java
   
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/customgraphics/CyCustomGraphics.java
   
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/customgraphics/Layer.java
   
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DGraphView.java
   
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DNodeDetails.java
   
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/InnerCanvas.java
   
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/customgraphics/AbstractDCustomGraphics.java
   
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/customgraphics/CustomGraphicsPositionCalculator.java
   
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/customgraphics/DLayer.java
Log:
Unnecessary methods are removed.  Graphics position is mostly working.

Modified: 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/GraphViewObject.java
===================================================================
--- 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/GraphViewObject.java
    2010-12-23 00:52:34 UTC (rev 23263)
+++ 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/GraphViewObject.java
    2010-12-23 08:35:35 UTC (rev 23264)
@@ -4,8 +4,19 @@
 
 public interface GraphViewObject {
 
+       /**
+        * Returns parent network view.
+        * 
+        * @return
+        */
        GraphView getGraphView();
        
+       /**
+        * Set actual value to the specified visual property
+        *  
+        * @param vp
+        * @param value
+        */
        void setVisualPropertyValue(final VisualProperty<?> vp, final Object 
value);
 
 }

Modified: 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/Label.java
===================================================================
--- 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/Label.java  
    2010-12-23 00:52:34 UTC (rev 23263)
+++ 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/Label.java  
    2010-12-23 08:35:35 UTC (rev 23264)
@@ -35,44 +35,28 @@
         * Get the paint used to paint this nodes text.
         * @return Paint
         */
-       public Paint getTextPaint();
+       Paint getTextPaint();
 
        /**
         * Set the paint used to paint this nodes text.
         * @param textPaint
         */             
-       public void setTextPaint(Paint textPaint) ;
+       void setTextPaint(Paint textPaint) ;
        
-
-       /**
-        * Returns the current greek threshold. When the screen font size will 
be below
-        * this threshold the text is rendered as 'greek' instead of drawing 
the text
-        * glyphs.
-        */
-       public double getGreekThreshold() ;
-
-       /**
-        * Sets the current greek threshold. When the screen font size will be 
below
-        * this threshold the text is rendered as 'greek' instead of drawing 
the text
-        * glyphs.
-        * 
-        * @param threshold minimum screen font size.
-        */
-       public void setGreekThreshold(double threshold) ;
                
-       public String getText() ;
+       String getText() ;
 
        /**
         * Set the text for this node. The text will be broken up into multiple
         * lines based on the size of the text and the bounds width of this 
node.
         */
-       public void setText(String aText) ;
+       void setText(String aText) ;
        
        /**
         * Returns the font of this PText.
         * @return the font of this PText.
         */ 
-       public Font getFont() ;
+       Font getFont() ;
        
        /**
         * Set the font of this PText. Note that in Piccolo if you want to 
change
@@ -80,7 +64,7 @@
         * node instead of changing the font size to get that same effect. Using
         * very large font sizes can slow performance.
         */
-       public void setFont(Font aFont) ;
+       void setFont(Font aFont) ;
 
 
 //     /**

Modified: 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/NodeView.java
===================================================================
--- 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/NodeView.java
   2010-12-23 00:52:34 UTC (rev 23263)
+++ 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/NodeView.java
   2010-12-23 08:35:35 UTC (rev 23264)
@@ -1,125 +1,113 @@
 package org.cytoscape.ding;
 
 
+import java.awt.Paint;
+import java.awt.Stroke;
+import java.awt.geom.Point2D;
+import java.util.List;
+
 import org.cytoscape.model.CyNode;
 import org.cytoscape.view.model.View;
 
-import java.awt.*;
-import java.awt.geom.Point2D;
 
-
 /**
  * Any and all questions should be directed to me.
  * @author Rowan Christmas
  */
 public interface NodeView  extends GraphViewObject {
-       
-       
-//     public static final int TRIANGLE = 0;
-//     public static final int DIAMOND = 1;
-//     public static final int ELLIPSE = 2;
-//     public static final int HEXAGON = 3;
-//     public static final int OCTAGON = 4;
-//     public static final int PARALELLOGRAM = 5;
-//     public static final int RECTANGLE = 6;
-//     public static final int ROUNDED_RECTANGLE = 7;
-//     public static final int VEE = 8;
 
-       /**
-        * @return The Node we are a view on
-        */
-       public CyNode getNode() ;
-       public View<CyNode> getNodeViewModel() ;
+       View<CyNode> getNodeViewModel();
 
        /**
         * @return the index of this node in the perspective to which we are in 
a view on.
         */
-       public int getGraphPerspectiveIndex () ;
+       int getGraphPerspectiveIndex();
 
-       /**
-        * @return the index of this node in the root graph to which we are in 
a view on.
-        */
-       public int getRootGraphIndex () ;
 
        /**
         * @return The list of EdgeViews connecting these two nodes. Possibly 
null.
         */
-       public java.util.List<EdgeView> getEdgeViewsList(NodeView otherNode) ;
+       List<EdgeView> getEdgeViewsList(final NodeView otherNode);
+       
 
        /**
         * Shape is currently defined via predefined variables in
         * the NodeView interface. To get the actual java.awt.Shape
         * use getPathReference()
+        * 
         * @return the current int-tpye shape
         */
-       public int getShape () ;
+       int getShape() ;
 
+       
        /**
         * This sets the Paint that will be used by this node
         * when it is painted as selected.
         * @param paint The Paint to be used
         */
-       public void setSelectedPaint (Paint paint) ;
+       void setSelectedPaint(Paint paint) ;
 
+       
        /**
         * @return the currently set selection Paint
         */
-       public Paint getSelectedPaint () ;
+       Paint getSelectedPaint() ;
 
+       
        /**
-        * Set the deafult paint of this node
+        * Set the default paint of this node
         * @param paint the default Paint of this node
         */
-       public void setUnselectedPaint ( Paint paint ) ;
+       void setUnselectedPaint(final Paint paint ) ;
 
+       
        /**
         * @return the currently set paint
         */
-       public Paint getUnselectedPaint () ;
+       Paint getUnselectedPaint();
+       
 
-
-
        /**
         * @param b_paint the paint the border will use
         */
-       public void setBorderPaint ( Paint b_paint ) ;
+       void setBorderPaint( Paint b_paint ) ;
 
        /**
         * @return the currently set BOrder Paint
         */
-       public Paint getBorderPaint () ;
+       Paint getBorderPaint() ;
 
        /**
         * @param border_width The width of the border.
         */
-       public void setBorderWidth ( float border_width ) ;
+       void setBorderWidth( float border_width ) ;
 
        /**
         * @return the currently set Border width
         */
-       public float getBorderWidth () ;
+       float getBorderWidth () ;
 
 
        /**
         * @param stroke the new stroke for the border
         */
-       public void setBorder ( Stroke stroke );
+       void setBorder(final Stroke stroke);
 
 
        /**
         * @return the current border
         */
-       public Stroke getBorder ();
+       Stroke getBorder();
 
        /**
         * @param trans new value for the transparency
         */
-       public void setTransparency ( int trans );
+       void setTransparency ( int trans );
 
        /**
         * @return the value for the transparency for this node
         */
-       public int getTransparency ();
+       int getTransparency ();
 
 
        /**
@@ -149,15 +137,9 @@
        /**
         * @return The Value of the label
         */
-       public org.cytoscape.ding.Label getLabel () ;
+       public Label getLabel ();
 
-       /**
-        * @return the degree of the Node in the GraphPerspective.
-        */
-       public int getDegree() ;
-
        public void setOffset ( double x, double y );
-
        public Point2D getOffset ();
 
        /**
@@ -165,13 +147,6 @@
         */
        public void setXPosition(double new_x_position) ;
 
-       /**
-        * Set udpdate to false in order to do a layout, and then call 
updateNode on all the nodes..
-        // TODO -- HACKY
-        * @param  new_x_position for this node
-        * @param  update if this is true, the node will move immediatly.
-        */
-       public void setXPosition ( double new_x_position, boolean update ) ;
 
        /**
         * note that unless updateNode() has been called, this may not be
@@ -186,13 +161,6 @@
         */
        public void setYPosition(double new_y_position) ;
 
-       /**
-        * Set udpdate to false in order to do a layout, and then call 
updateNode on all the nodes..
-        // TODO -- HACKY
-        * @param  new_y_position for this node
-        * @param  update if this is true, the node will move immediatly.
-        */
-       public void setYPosition ( double new_y_position, boolean update ) ;
 
        /**
         * note that unless updateNode() has been called, this may not be
@@ -202,25 +170,25 @@
         */
        public double getYPosition() ;
 
-       /**
-        * moves this node to its stored x and y locations.
-        */
-       public void setNodePosition(boolean animate) ;
+//     /**
+//      * moves this node to its stored x and y locations.
+//      */
+//     public void setNodePosition(boolean animate) ;
 
        /**
         * This draws us as selected
         */
-       public void select() ;
+       void select() ;
 
        /**
         * This draws us as unselected
         */
-       public void unselect() ;
+       void unselect() ;
 
        /**
         *
         */
-       public boolean isSelected() ;
+       boolean isSelected() ;
 
        /**
         *
@@ -242,12 +210,12 @@
        /**
         * Sets what the tooltip will be for this NodeView
         */
-       public void setToolTip ( String tip );
+       void setToolTip ( String tip );
+       String getToolTip();
        
        ObjectPosition getLabelPosition();
        void setLabelPosition(final ObjectPosition p);
 
-       
         
 //     public void setLabelOffsetX(double x);
 //     public void setLabelOffsetY(double y);

Modified: 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/customgraphics/CyCustomGraphics.java
===================================================================
--- 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/customgraphics/CyCustomGraphics.java
    2010-12-23 00:52:34 UTC (rev 23263)
+++ 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/customgraphics/CyCustomGraphics.java
    2010-12-23 08:35:35 UTC (rev 23264)
@@ -3,14 +3,12 @@
 import java.awt.Image;
 import java.util.List;
 
-import org.cytoscape.ding.ObjectPosition;
 
-
 /**
  * Base interface for all Custom Graphics.
  *
  */
-public interface CyCustomGraphics {
+public interface CyCustomGraphics<T> {
                
        /**
         * Immutable session-unique identifier of image generated in 
constructor.
@@ -46,7 +44,7 @@
         * @return Collection of layer objects (in this version, it's 
CustomGraphics in Ding)
         * 
         */
-       public List<Layer> getLayers();
+       public List<Layer<T>> getLayers();
        
        
        /**
@@ -93,18 +91,18 @@
        public Image getRenderedImage();
 
        
-       /**
-        * Set position of this graphics.
-        * 
-        * @param position
-        */
-       public void setPosition(final ObjectPosition position);
-       
-       
-       /**
-        * Current position
-        * 
-        * @return position of graphics as ObjectPosition.
-        */
-       public ObjectPosition getPosition();
+//     /**
+//      * Set position of this graphics.
+//      * 
+//      * @param position
+//      */
+//     public void setPosition(final ObjectPosition position);
+//     
+//     
+//     /**
+//      * Current position
+//      * 
+//      * @return position of graphics as ObjectPosition.
+//      */
+//     public ObjectPosition getPosition();
 }

Modified: 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/customgraphics/Layer.java
===================================================================
--- 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/customgraphics/Layer.java
       2010-12-23 00:52:34 UTC (rev 23263)
+++ 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/customgraphics/Layer.java
       2010-12-23 08:35:35 UTC (rev 23264)
@@ -6,15 +6,15 @@
  * In current version, it's always CustomGraphic 
  *
  */
-public interface Layer {
+public interface Layer<T> {
        
        /**
         * Each layer has immutable Z-Order value for rendering.
-        * This method returens the value as int.
+        * This method returns the value as int.
         * 
         * @return
         */
-       public int getZorder();
+       int getZorder();
        
-       public Object getLayerObject();
+       T getLayerObject();
 }

Modified: 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DGraphView.java
===================================================================
--- 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DGraphView.java
    2010-12-23 00:52:34 UTC (rev 23263)
+++ 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DGraphView.java
    2010-12-23 08:35:35 UTC (rev 23264)
@@ -634,7 +634,7 @@
                                // GINY requires all node indices to be 
negative (why?),
                                // hence the bitwise complement here.
                                returnThis.add(m_nodeViewMap.get(
-                                               
Integer.valueOf(elms.nextInt())).getNode());
+                                               
Integer.valueOf(elms.nextInt())).getNodeViewModel().getModel());
 
                        return returnThis;
                }
@@ -762,7 +762,7 @@
 
                if (listener != null) {
                        listener.graphViewChanged(new 
GraphViewNodesRestoredEvent(this,
-                                       makeList(newView.getNode())));
+                                       
makeList(newView.getNodeViewModel().getModel())));
                }
 
                return newView;
@@ -856,12 +856,12 @@
                                int[] nodeInx;
 
                                if (sourceNode == null) {
-                                       nodeInx = new int[] { 
targetNode.getRootGraphIndex() };
+                                       nodeInx = new int[] { 
targetNode.getGraphPerspectiveIndex() };
                                } else if (targetNode == null) {
-                                       nodeInx = new int[] { 
sourceNode.getRootGraphIndex() };
+                                       nodeInx = new int[] { 
sourceNode.getGraphPerspectiveIndex() };
                                } else {
-                                       nodeInx = new int[] { 
sourceNode.getRootGraphIndex(),
-                                                       
targetNode.getRootGraphIndex() };
+                                       nodeInx = new int[] { 
sourceNode.getGraphPerspectiveIndex(),
+                                                       
targetNode.getGraphPerspectiveIndex() };
                                }
 
                                listener.graphViewChanged(new 
GraphViewNodesRestoredEvent(this,
@@ -884,7 +884,7 @@
         * @return The NodeView object that was removed.
         */
        public NodeView removeNodeView(NodeView nodeView) {
-               return removeNodeView(nodeView.getRootGraphIndex());
+               return removeNodeView(nodeView.getGraphPerspectiveIndex());
        }
 
        /**
@@ -954,7 +954,7 @@
                        }
 
                        listener.graphViewChanged(new 
GraphViewNodesHiddenEvent(this,
-                                       makeList(returnThis.getNode())));
+                                       
makeList(returnThis.getNodeViewModel().getModel())));
                }
 
                return returnThis;
@@ -1384,7 +1384,7 @@
 
                        synchronized (m_lock) {
                                final DNodeView nView = (DNodeView) obj;
-                               nodeInx = nView.getRootGraphIndex();
+                               nodeInx = nView.getGraphPerspectiveIndex();
                                nnode = networkModel.getNode(nodeInx);
                                edges = m_drawPersp.getAdjacentEdgeList(nnode, 
CyEdge.Type.ANY);
 
@@ -1437,7 +1437,7 @@
 
        final boolean isHidden(final DNodeView nodeView) {
                synchronized (m_lock) {
-                       final int nodeIndex = nodeView.getRootGraphIndex();
+                       final int nodeIndex = 
nodeView.getGraphPerspectiveIndex();
                        return 
m_drawPersp.containsNode(m_drawPersp.getNode(nodeIndex));
                }
        }
@@ -1459,7 +1459,7 @@
                        final DNodeView nView = (DNodeView) obj;
 
                        synchronized (m_lock) {
-                               nodeInx = nView.getRootGraphIndex();
+                               nodeInx = nView.getGraphPerspectiveIndex();
                                CyNode nnode = networkModel.getNode(nodeInx);
 
                                if (nnode == null) {
@@ -1481,7 +1481,7 @@
 
                                if (listener != null) {
                                        listener.graphViewChanged(new 
GraphViewNodesRestoredEvent(
-                                                       this, 
makeList(nView.getNode())));
+                                                       this, 
makeList(nView.getNodeViewModel().getModel())));
                                }
                        }
 
@@ -2732,7 +2732,7 @@
        static List<CyNode> makeNodeList(int[] nodeids, GraphView view) {
                List<CyNode> l = new ArrayList<CyNode>(nodeids.length);
                for (int nid : nodeids)
-                       l.add(view.getNodeView(nid).getNode());
+                       
l.add(view.getNodeView(nid).getNodeViewModel().getModel());
 
                return l;
        }

Modified: 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DNodeDetails.java
===================================================================
--- 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DNodeDetails.java
  2010-12-23 00:52:34 UTC (rev 23263)
+++ 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DNodeDetails.java
  2010-12-23 08:35:35 UTC (rev 23264)
@@ -165,12 +165,12 @@
         * @return DOCUMENT ME!
         */
        public Paint fillPaint(int node) {
-               final Object o = m_fillPaints.get(Integer.valueOf(node));
+               final Paint o = m_fillPaints.get(node);
 
                if (o == null)
                        return super.fillPaint(node);
 
-               return (Paint) o;
+               return o;
        }
 
        /*

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
     2010-12-23 00:52:34 UTC (rev 23263)
+++ 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DNodeView.java
     2010-12-23 08:35:35 UTC (rev 23264)
@@ -34,14 +34,12 @@
 import java.awt.Font;
 import java.awt.Graphics2D;
 import java.awt.Paint;
-import java.awt.Shape;
 import java.awt.Stroke;
 import java.awt.TexturePaint;
 import java.awt.geom.Point2D;
 import java.awt.geom.Rectangle2D;
 import java.awt.image.BufferedImage;
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -67,7 +65,6 @@
 import org.cytoscape.ding.impl.visualproperty.CustomGraphicsVisualProperty;
 import org.cytoscape.graph.render.immed.GraphGraphics;
 import org.cytoscape.graph.render.stateful.CustomGraphic;
-import org.cytoscape.model.CyEdge;
 import org.cytoscape.model.CyNode;
 import org.cytoscape.view.model.View;
 import org.cytoscape.view.model.VisualLexicon;
@@ -76,12 +73,12 @@
 import org.cytoscape.view.presentation.property.TwoDVisualLexicon;
 
 
-
 /**
  * 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;
 
@@ -107,28 +104,41 @@
                }
        }
 
-       static final float DEFAULT_WIDTH = 20.0f;
-       static final float DEFAULT_HEIGHT = 20.0f;
-       static final int DEFAULT_SHAPE = GraphGraphics.SHAPE_ELLIPSE;
-       static final Paint DEFAULT_BORDER_PAINT = Color.black;
-       static final String DEFAULT_LABEL_TEXT = "";
+       // Default size of node.
+       static final float DEFAULT_WIDTH = 30.0f;
+       static final float DEFAULT_HEIGHT = 30.0f;
        
-       static final Font DEFAULT_LABEL_FONT = new Font("SansSerif", 
Font.PLAIN, 12);
+       // Default node shape
+       static final int DEFAULT_SHAPE = GraphGraphics.SHAPE_RECTANGLE;
        
-       static final Paint DEFAULT_LABEL_PAINT = Color.black;
+       // Default border color
+       static final Paint DEFAULT_BORDER_PAINT = Color.DARK_GRAY;
+       static final Paint DEFAULT_NODE_PAINT = Color.BLUE;
+       static final Paint DEFAULT_NODE_SELECTED_PAINT = Color.YELLOW;
+       
+       static final String DEFAULT_LABEL_TEXT = "";
+       static final Font DEFAULT_LABEL_FONT = new Font("SansSerif", 
Font.PLAIN, 12);
+       static final Paint DEFAULT_LABEL_PAINT = Color.DARK_GRAY;
        static final double DEFAULT_LABEL_WIDTH = 100.0;
+       
+       // Default opacity
+       static final int DEFAULT_TRANSPARENCY = 255;
 
+       // Parent network view
        private final DGraphView graphView;
 
-       static final int DEFAULT_TRANSPARENCY = 255;
-
-       private final int m_inx; // The FixedGraph index (non-negative).
+       // The FixedGraph index (non-negative)
+       private final int m_inx; 
        
+       // Selection flag.
        private boolean m_selected;
+       
+       // Node color
        private Paint m_unselectedPaint;
        private Paint m_selectedPaint;
        private Paint m_borderPaint;
 
+       // Opacity
        private int transparency;
 
        /**
@@ -140,13 +150,19 @@
        float m_hiddenXMax = Float.MAX_VALUE;
        float m_hiddenYMax = Float.MAX_VALUE;
 
-       ArrayList<Shape> m_graphicShapes;
-       ArrayList<Paint> m_graphicPaints;
+//     // Node shapes
+//     List<Shape> m_graphicShapes;
+//     
+//     // Node Colors
+//     List<Paint> m_graphicPaints;
 
-       // AJK: 04/26/06 for tooltip
-       private String m_toolTipText = null;
+       // Tool Tip text
+       private String m_toolTipText;
 
+       // Nested Network View
        private DGraphView nestedNetworkView;
+       
+       // Show/hide flag for nested network graphics
        private boolean nestedNetworkVisible = true;
 
        // A LinkedHashSet of the custom graphics associated with this
@@ -163,22 +179,32 @@
        // object assuming it takes up the least amount of memory:
        private final Object[] CG_LOCK = new Object[0];
        
+       // Will be used when Custom graphics is empty.
        private final static Set<CustomGraphic> EMPTY_CUSTOM_GRAPHICS = new 
LinkedHashSet<CustomGraphic>(0);
 
-       // View Model for this presentation.
+       // View Model for this node presentation.
        private final View<CyNode> nodeViewModel;
        
-       // Map of VP to native CustomGraphics objects.
+       // Map from NodeCustomGraphics Visual Property to native CustomGraphics 
objects.
        private final Map<VisualProperty<?>, Set<CustomGraphic>> cgMap;
-       private final Map<CustomGraphic, ObjectPosition> graphicsPositions;
        
+       // Locations of Custom Graphics  
+       private Map<CustomGraphic, ObjectPosition> graphicsPositions;
+       
+       // Label position
        private ObjectPosition labelPosition;
        
-       
+       // Visual Properties used in this node view.
        private final VisualLexicon lexicon;
 
-       /*
-        * @param inx the RootGraph index of node (a negative number).
+       
+       /**
+        * Constructor takes 
+        * 
+        * @param lexicon
+        * @param graphView
+        * @param inx
+        * @param viewModel
         */
        DNodeView(final VisualLexicon lexicon, final DGraphView graphView, int 
inx, final View<CyNode> viewModel) {
                if (graphView == null)
@@ -193,18 +219,18 @@
 
                // Initialize custom graphics pool.
                cgMap = new HashMap<VisualProperty<?>, Set<CustomGraphic>>();
-               this.graphicsPositions = new HashMap<CustomGraphic, 
ObjectPosition>();
                
                this.graphView = graphView;
                
                m_inx = inx;
                nodeViewModel = viewModel;
+               
                m_selected = false;
+               
                m_unselectedPaint = graphView.m_nodeDetails.fillPaint(m_inx);
-               m_selectedPaint = Color.yellow;
+               m_selectedPaint = DEFAULT_NODE_SELECTED_PAINT;
                m_borderPaint = graphView.m_nodeDetails.borderPaint(m_inx);
-               m_graphicShapes = null;
-               m_graphicPaints = null;
+               
                transparency = DEFAULT_TRANSPARENCY;
        }
 
@@ -212,53 +238,38 @@
        @Override public GraphView getGraphView() {
                return graphView;
        }
+       
 
        /**
-        * DOCUMENT ME!
-        *
-        * @return DOCUMENT ME!
+        * Returns View Model object of this node presentation.
         */
-       @Override public CyNode getNode() {
-               synchronized (graphView.m_lock) {
-                       return graphView.networkModel.getNode(m_inx);
-               }
-       }
-
-       
        @Override public View<CyNode> getNodeViewModel() {
-               return nodeViewModel;
+               return this.nodeViewModel;
        }
 
        
        /**
-        * DOCUMENT ME!
+        * Returns node index of this node presentation in the parent network.
         *
         * @return DOCUMENT ME!
         */
-       public int getGraphPerspectiveIndex() {
+       @Override public int getGraphPerspectiveIndex() {
                return m_inx;
        }
+       
 
        /**
         * DOCUMENT ME!
         *
-        * @return DOCUMENT ME!
-        */
-       public int getRootGraphIndex() {
-               return m_inx;
-       }
-
-       /**
-        * DOCUMENT ME!
-        *
         * @param otherNodeView
         *            DOCUMENT ME!
         *
         * @return DOCUMENT ME!
         */
-       public List<EdgeView> getEdgeViewsList(NodeView otherNodeView) {
+       @Override public List<EdgeView> getEdgeViewsList(NodeView 
otherNodeView) {
                synchronized (graphView.m_lock) {
-                       return graphView.getEdgeViewsList(getNode(), 
otherNodeView.getNode());
+                       return graphView.
+                               
getEdgeViewsList(this.getNodeViewModel().getModel(), 
otherNodeView.getNodeViewModel().getModel());
                }
        }
 
@@ -267,7 +278,7 @@
         *
         * @return DOCUMENT ME!
         */
-       public int getShape() {
+       @Override public int getShape() {
                synchronized (graphView.m_lock) {
                        return graphView.m_nodeDetails.shape(m_inx);
                }
@@ -279,7 +290,7 @@
         * @param paint
         *            DOCUMENT ME!
         */
-       public void setSelectedPaint(Paint paint) {
+       @Override public void setSelectedPaint(Paint paint) {
                synchronized (graphView.m_lock) {
                        if (paint == null)
                                throw new NullPointerException("paint is null");
@@ -303,7 +314,7 @@
         *
         * @return DOCUMENT ME!
         */
-       public Paint getSelectedPaint() {
+       @Override public Paint getSelectedPaint() {
                return m_selectedPaint;
        }
 
@@ -313,7 +324,7 @@
         * @param paint
         *            DOCUMENT ME!
         */
-       public void setUnselectedPaint(Paint paint) {
+       @Override public void setUnselectedPaint(Paint paint) {
                synchronized (graphView.m_lock) {
                        if (paint == null)
                                throw new NullPointerException("paint is null");
@@ -340,7 +351,7 @@
         *
         * @return DOCUMENT ME!
         */
-       public Paint getUnselectedPaint() {
+       @Override public Paint getUnselectedPaint() {
                return m_unselectedPaint;
        }
 
@@ -350,7 +361,7 @@
         * @param paint
         *            DOCUMENT ME!
         */
-       public void setBorderPaint(Paint paint) {
+       @Override public void setBorderPaint(Paint paint) {
                synchronized (graphView.m_lock) {
                        m_borderPaint = paint;
                        fixBorder();
@@ -363,7 +374,7 @@
         *
         * @return DOCUMENT ME!
         */
-       public Paint getBorderPaint() {
+       @Override public Paint getBorderPaint() {
                return m_borderPaint;
        }
 
@@ -373,7 +384,7 @@
         * @param width
         *            DOCUMENT ME!
         */
-       public void setBorderWidth(float width) {
+       @Override public void setBorderWidth(float width) {
                synchronized (graphView.m_lock) {
                        graphView.m_nodeDetails.overrideBorderWidth(m_inx, 
width);
                        graphView.m_contentChanged = true;
@@ -385,7 +396,7 @@
         *
         * @return DOCUMENT ME!
         */
-       public float getBorderWidth() {
+       @Override public float getBorderWidth() {
                synchronized (graphView.m_lock) {
                        return graphView.m_nodeDetails.borderWidth(m_inx);
                }
@@ -397,7 +408,7 @@
         * @param stroke
         *            DOCUMENT ME!
         */
-       public void setBorder(Stroke stroke) {
+       @Override public void setBorder(Stroke stroke) {
                if (stroke instanceof BasicStroke) {
                        synchronized (graphView.m_lock) {
                                setBorderWidth(((BasicStroke) 
stroke).getLineWidth());
@@ -457,7 +468,7 @@
         *
         * @return DOCUMENT ME!
         */
-       public Stroke getBorder() {
+       @Override public Stroke getBorder() {
                synchronized (graphView.m_lock) {
                        if ((m_borderDash == 0.0f) && (m_borderDash2 == 0.0f))
                                return new BasicStroke(getBorderWidth());
@@ -475,7 +486,7 @@
         * @param trans
         *            DOCUMENT ME!
         */
-       public void setTransparency(int trans) {
+       @Override public void setTransparency(int trans) {
                synchronized (graphView.m_lock) {
                        if (trans < 0 || trans > 255)
                                throw new 
IllegalArgumentException("Transparency is out of range.");
@@ -503,7 +514,7 @@
         *
         * @return DOCUMENT ME!
         */
-       public int getTransparency() {
+       @Override public int getTransparency() {
                return transparency;
        }
 
@@ -515,7 +526,7 @@
         *
         * @return DOCUMENT ME!
         */
-       public boolean setWidth(double width) {
+       @Override public boolean setWidth(double width) {
                synchronized (graphView.m_lock) {
                        if (!graphView.m_spacial.exists(m_inx, 
graphView.m_extentsBuff, 0))
                                return false;
@@ -587,14 +598,6 @@
                        graphView.m_spacial.insert(m_inx, 
graphView.m_extentsBuff[0], yMin,
                                        graphView.m_extentsBuff[2], yMax);
 
-                       final double w = ((double) graphView.m_extentsBuff[2])
-                                       - graphView.m_extentsBuff[0];
-                       final double h = ((double) yMax) - yMin;
-
-//                     if (!(Math.max(w, h) < (1.99d * Math.min(w, h)))
-//                                     && (getShape() == 
GraphGraphics.SHAPE_ROUNDED_RECTANGLE))
-//                             setShape(NodeShape.RECT);
-
                        graphView.m_contentChanged = true;
 
                        return true;
@@ -606,7 +609,7 @@
         *
         * @return DOCUMENT ME!
         */
-       public double getHeight() {
+       @Override public double getHeight() {
                synchronized (graphView.m_lock) {
                        if (!graphView.m_spacial.exists(m_inx, 
graphView.m_extentsBuff, 0))
                                return -1.0d;
@@ -620,30 +623,20 @@
         *
         * @return DOCUMENT ME!
         */
-       public Label getLabel() {
+       @Override public Label getLabel() {
                return this;
        }
 
-       /**
-        * DOCUMENT ME!
-        *
-        * @return DOCUMENT ME!
-        */
-       public int getDegree() {
-               // This method is totally ridiculous.
-               return graphView.getNetwork()
-                               .getAdjacentEdgeList(getNode(), 
CyEdge.Type.ANY).size();
-       }
 
        /**
-        * DOCUMENT ME!
+        * FIXME: need to separate Label from this.
         *
         * @param x
         *            DOCUMENT ME!
         * @param y
         *            DOCUMENT ME!
         */
-       public void setOffset(double x, double y) {
+       @Override public void setOffset(double x, double y) {
                synchronized (graphView.m_lock) {
                        if (!graphView.m_spacial.exists(m_inx, 
graphView.m_extentsBuff, 0))
                                return;
@@ -672,11 +665,11 @@
        }
 
        /**
-        * DOCUMENT ME!
+        * FIXME: remove label-related methods.
         *
         * @return DOCUMENT ME!
         */
-       public Point2D getOffset() {
+       @Override public Point2D getOffset() {
                synchronized (graphView.m_lock) {
                        if (!graphView.m_spacial.exists(m_inx, 
graphView.m_extentsBuff, 0))
                                return null;
@@ -694,7 +687,7 @@
         * @param xPos
         *            DOCUMENT ME!
         */
-       public void setXPosition(double xPos) {
+       @Override public void setXPosition(double xPos) {
                synchronized (graphView.m_lock) {
                        final double wDiv2;
                        final boolean nodeVisible = 
graphView.m_spacial.exists(m_inx,
@@ -732,22 +725,11 @@
                        }
                }
        }
+       
 
        /**
         * DOCUMENT ME!
         *
-        * @param xPos
-        *            DOCUMENT ME!
-        * @param update
-        *            DOCUMENT ME!
-        */
-       public void setXPosition(double xPos, boolean update) {
-               setXPosition(xPos);
-       }
-
-       /**
-        * DOCUMENT ME!
-        *
         * @return DOCUMENT ME!
         */
        public double getXPosition() {
@@ -802,22 +784,11 @@
                        }
                }
        }
+       
 
        /**
         * DOCUMENT ME!
         *
-        * @param yPos
-        *            DOCUMENT ME!
-        * @param update
-        *            DOCUMENT ME!
-        */
-       public void setYPosition(double yPos, boolean update) {
-               setYPosition(yPos);
-       }
-
-       /**
-        * DOCUMENT ME!
-        *
         * @return DOCUMENT ME!
         */
        public double getYPosition() {
@@ -831,16 +802,7 @@
 
        /**
         * DOCUMENT ME!
-        *
-        * @param animate
-        *            DOCUMENT ME!
         */
-       public void setNodePosition(boolean animate) {
-       }
-
-       /**
-        * DOCUMENT ME!
-        */
        public void select() {
                final boolean somethingChanged;
 
@@ -856,7 +818,7 @@
 
                        if (listener != null)
                                listener.graphViewChanged(new 
GraphViewNodesSelectedEvent(
-                                               graphView, 
DGraphView.makeList(getNode())));
+                                               graphView, 
DGraphView.makeList(this.getNodeViewModel().getModel())));
                }
        }
 
@@ -895,7 +857,7 @@
 
                        if (listener != null)
                                listener.graphViewChanged(new 
GraphViewNodesUnselectedEvent(
-                                               graphView, 
DGraphView.makeList(getNode())));
+                                               graphView, 
DGraphView.makeList(this.getNodeViewModel().getModel())));
                }
        }
 
@@ -921,7 +883,7 @@
         *
         * @return DOCUMENT ME!
         */
-       public boolean isSelected() {
+       @Override public boolean isSelected() {
                return m_selected;
        }
 
@@ -933,16 +895,18 @@
         *
         * @return DOCUMENT ME!
         */
-       public boolean setSelected(boolean selected) {
+       @Override public boolean setSelected(boolean selected) {
                if (selected)
                        select();
                else
                        unselect();
 
+               // TODO: Is this necessary???
                return true;
        }
 
-       final public boolean isHidden() {
+       
+       @Override public boolean isHidden() {
                return graphView.isHidden(this);
        }
 
@@ -952,24 +916,20 @@
         * @param shape
         *            DOCUMENT ME!
         */
-       public void setShape(final NodeShape shape) {
+       @Override public void setShape(final NodeShape shape) {
                synchronized (graphView.m_lock) {
-                       //byte nativeShape = GinyUtil.getNativeNodeType(shape);
-                       
-
                        graphView.m_nodeDetails.overrideShape(m_inx, shape);
                        graphView.m_contentChanged = true;
                }
        }
 
-       // AJK: 04/26/06 BEGIN
        /**
         * DOCUMENT ME!
         *
         * @param tip
         *            DOCUMENT ME!
         */
-       public void setToolTip(String tip) {
+       @Override public void setToolTip(final String tip) {
                m_toolTipText = tip;
        }
 
@@ -978,52 +938,36 @@
         *
         * @return DOCUMENT ME!
         */
-       public String getToolTip() {
+       @Override public String getToolTip() {
                return m_toolTipText;
        }
 
-       // AJK: 04/26/06 END
-       /**
-        * DOCUMENT ME!
-        *
-        * @param position
-        *            DOCUMENT ME!
-        */
-       public void setPositionHint(int position) {
-       }
 
        /**
         * DOCUMENT ME!
         *
         * @return DOCUMENT ME!
         */
-       public Paint getTextPaint() {
+       @Override public Paint getTextPaint() {
                synchronized (graphView.m_lock) {
                        return graphView.m_nodeDetails.labelPaint(m_inx, 0);
                }
        }
 
+       
        /**
         * DOCUMENT ME!
         *
         * @param textPaint
         *            DOCUMENT ME!
         */
-       public void setTextPaint(Paint textPaint) {
+       @Override public void setTextPaint(Paint textPaint) {
                synchronized (graphView.m_lock) {
                        graphView.m_nodeDetails.overrideLabelPaint(m_inx, 0, 
textPaint);
                        graphView.m_contentChanged = true;
                }
        }
 
-       /**
-        * DOCUMENT ME!
-        *
-        * @return DOCUMENT ME!
-        */
-       public double getGreekThreshold() {
-               return 0.0d;
-       }
 
        /**
         * DOCUMENT ME!
@@ -1066,23 +1010,18 @@
        }
 
        /**
-        * DOCUMENT ME!
-        *
-        * @return DOCUMENT ME!
+        * Get label font type.
         */
-       public Font getFont() {
+       @Override public Font getFont() {
                synchronized (graphView.m_lock) {
                        return graphView.m_nodeDetails.labelFont(m_inx, 0);
                }
        }
 
        /**
-        * DOCUMENT ME!
-        *
-        * @param font
-        *            DOCUMENT ME!
+        * Set label font type.
         */
-       public void setFont(Font font) {
+       @Override public void setFont(Font font) {
                synchronized (graphView.m_lock) {
                        graphView.m_nodeDetails.overrideLabelFont(m_inx, 0, 
font);
                        graphView.m_contentChanged = true;
@@ -1111,17 +1050,20 @@
         *         this DNodeView already contained this CustomGraphic.
         * @see org.cytoscape.graph.render.stateful.CustomGraphic
         */
-       public boolean addCustomGraphic(CustomGraphic cg) {
+       public boolean addCustomGraphic(final CustomGraphic cg) {
                boolean retVal = false;
                synchronized (CG_LOCK) {
+                       // Lazy instantiation
                        if (orderedCustomGraphicLayers == null) {
                                orderedCustomGraphicLayers = new 
LinkedHashSet<CustomGraphic>();
-                               //graphicsPositions = new 
HashMap<CustomGraphic, ObjectPosition>();
+                               graphicsPositions = new HashMap<CustomGraphic, 
ObjectPosition>();
                        }
+                       
                        if (orderedCustomGraphicLayers.contains(cg))
                                retVal = false;
                        else {
                                retVal = orderedCustomGraphicLayers.add(cg);
+                               graphicsPositions.put(cg, 
ObjectPositionImpl.DEFAULT_POSITION);
                        }
                }
                ensureContentChanged();
@@ -1136,11 +1078,10 @@
         *            the CustomGraphic for which we are checking containment.
         * @since Cytoscape 2.6
         */
-       public boolean containsCustomGraphic(CustomGraphic cg) {
+       public boolean containsCustomGraphic(final CustomGraphic cg) {
                synchronized (CG_LOCK) {
-                       if (orderedCustomGraphicLayers == null) {
+                       if (orderedCustomGraphicLayers == null)
                                return false;
-                       }
                        return orderedCustomGraphicLayers.contains(cg);
                }
        }
@@ -1211,7 +1152,8 @@
                synchronized (CG_LOCK) {
                        if (orderedCustomGraphicLayers == null)
                                return 0;
-                       return orderedCustomGraphicLayers.size();
+                       else
+                               return orderedCustomGraphicLayers.size();
                }
        }
 
@@ -1416,7 +1358,7 @@
                        ++nestedNetworkPaintingDepth;
                        try {
                                if (nestedNetworkPaintingDepth > 1
-                                               || getNode().getNestedNetwork() 
== null
+                                               || 
this.getNodeViewModel().getModel().getNestedNetwork() == null
                                                || !nestedNetworkVisible)
                                        return null;
 
@@ -1511,19 +1453,18 @@
        }
        
        
-       private CustomGraphic setCustomGraphicsPosition(final CustomGraphic cg, 
final ObjectPosition p) {
-               if (cg == null || p == null)
+       private CustomGraphic moveCustomGraphicsToNewPosition(final 
CustomGraphic cg, final ObjectPosition newPosition) {
+               if (cg == null || newPosition == null)
                        throw new NullPointerException(
                                        "CustomGraphic and Position cannot be 
null.");
 
-               orderedCustomGraphicLayers.remove(cg);
-               graphicsPositions.remove(cg);
+               removeCustomGraphic(cg);
 
                // Create new graphics
-               final CustomGraphic newCg = 
CustomGraphicsPositionCalculator.transform(p, this, cg);
+               final CustomGraphic newCg = 
CustomGraphicsPositionCalculator.transform(newPosition, this, cg);
                
-               orderedCustomGraphicLayers.add(newCg);
-               graphicsPositions.put(newCg, p);
+               this.addCustomGraphic(newCg);
+               graphicsPositions.put(newCg, newPosition);
 
                return newCg;
        }
@@ -1536,7 +1477,7 @@
 //     }
 
        @Override
-       public void setVisualPropertyValue(VisualProperty<?> vp, Object value) {
+       public void setVisualPropertyValue(final VisualProperty<?> vp, final 
Object value) {
 
                if (vp == DVisualLexicon.NODE_SHAPE) {
                        setShape(((NodeShape) value));
@@ -1580,33 +1521,32 @@
                } else if (vp == DVisualLexicon.NODE_LABEL_POSITION) {
                        this.setLabelPosition((ObjectPosition) value);
                } else if(vp instanceof CustomGraphicsVisualProperty) {
-                       applyCustomGraphics(vp, (CyCustomGraphics) value);
+                       applyCustomGraphics(vp, 
(CyCustomGraphics<CustomGraphic>) value);
                } else if(DVisualLexicon.getGraphicsPositionVP().contains(vp)) {
                        applyCustomGraphicsPosition(vp, (ObjectPosition) value);
                }
        }
        
        
-       private void applyCustomGraphics(final VisualProperty<?> vp, final 
CyCustomGraphics customGraphics) {
+       private void applyCustomGraphics(final VisualProperty<?> vp, final 
CyCustomGraphics<CustomGraphic> customGraphics) {
 
                Set<CustomGraphic> dCustomGraphicsSet = cgMap.get(vp);
-               
-               // Remove current layers associated with this Custom Graphics
-               if(dCustomGraphicsSet == null) {
+               if(dCustomGraphicsSet == null)
                        dCustomGraphicsSet = new HashSet<CustomGraphic>();
-               }
                
-               for (final CustomGraphic cg : dCustomGraphicsSet)
+               ObjectPosition newPosition = null;
+               for (final CustomGraphic cg : dCustomGraphicsSet) {             
        
+                       newPosition = this.graphicsPositions.get(cg);
                        removeCustomGraphic(cg);
+               }
                
                dCustomGraphicsSet.clear();
 
-               if (customGraphics == null || customGraphics instanceof 
NullCustomGraphics) {
-                       //System.out.println(" This is NULL = " + 
vp.getDisplayName());
+               if (customGraphics == null || customGraphics instanceof 
NullCustomGraphics)
                        return;
-               }
                
-               final List<Layer> layers = customGraphics.getLayers();
+               
+               final List<Layer<CustomGraphic>> layers = 
customGraphics.getLayers();
 
                // No need to update
                if (layers == null || layers.size() == 0)
@@ -1619,16 +1559,21 @@
 //                     sync = dep.check(NODE_CUSTOM_GRAPHICS_SIZE_SYNC);
 //             }
 
-               for (Layer layer : layers) {
+               for (Layer<CustomGraphic> layer : layers) {
                        // Assume it's a Ding layer
-                       final CustomGraphic cg = (CustomGraphic) 
layer.getLayerObject();
+                       CustomGraphic newCG = layer.getLayerObject();
+                       if(newPosition != null) {
+                               newCG = 
this.moveCustomGraphicsToNewPosition(newCG, newPosition);
+                               System.out.println("MOVED: " + 
vp.getDisplayName());
+                       }
+                       
 //                     if (sync) {
 //                             final CustomGraphic resized = 
syncSize(graphics, cg, dv, dep);
 //                             dv.addCustomGraphic(resized);
 //                             targets.add(resized);
 //                     } else {
-                               addCustomGraphic(cg);
-                               dCustomGraphicsSet.add(cg);
+                               addCustomGraphic(newCG);
+                               dCustomGraphicsSet.add(newCG);
                                
 //                     }
                }
@@ -1673,13 +1618,14 @@
                
                if (currentCG == null || currentCG.size() == 0) {
                        // Ignore if no CG is available.
-                       //System.out.println("    CG not found.  No need to 
update: " + parent.getDisplayName() + "\n\n");
+                       //System.out.println("    CG not found.  No need to 
update: " + parent.getDisplayName());
                        return;
                }
-               final List<CustomGraphic> newList = new 
ArrayList<CustomGraphic>();
+               
+               final Set<CustomGraphic> newList = new HashSet<CustomGraphic>();
                for (CustomGraphic g : currentCG) {
-                       newList.add(this.setCustomGraphicsPosition(g, 
position));
-                       this.removeCustomGraphic(g);
+                       newList.add(moveCustomGraphicsToNewPosition(g, 
position));
+                       //this.removeCustomGraphic(g);
                }
 
                currentCG.clear();
@@ -1690,9 +1636,5 @@
                
                System.out.println("Position applied of CG = " + 
vp.getDisplayName() + " <--- " + parent.getDisplayName());
        }
-       
-       private void transformCustomGraphics(final Set<CustomGraphic> 
currentCG, VisualProperty<?> vp, final ObjectPosition position) {
-               
-       }
 
 }

Modified: 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/InnerCanvas.java
===================================================================
--- 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/InnerCanvas.java
   2010-12-23 00:52:34 UTC (rev 23263)
+++ 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/InnerCanvas.java
   2010-12-23 08:35:35 UTC (rev 23264)
@@ -1136,10 +1136,10 @@
                                if (chosenNode != 0) {
                                        if (chosenNodeSelected > 0)
                                                listener.graphViewChanged(new 
GraphViewNodesSelectedEvent(m_view,
-                                                       
DGraphView.makeList(m_view.getNodeView(chosenNode).getNode())));
+                                                       
DGraphView.makeList(m_view.getNodeView(chosenNode).getNodeViewModel().getModel())));
                                        else if (chosenNodeSelected < 0)
                                                listener.graphViewChanged(new 
GraphViewNodesUnselectedEvent(m_view,
-                                                       
DGraphView.makeList(m_view.getNodeView(chosenNode).getNode())));
+                                                       
DGraphView.makeList(m_view.getNodeView(chosenNode).getNodeViewModel().getModel())));
                                }
        
                                if (chosenEdge != 0) {

Modified: 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/customgraphics/AbstractDCustomGraphics.java
===================================================================
--- 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/customgraphics/AbstractDCustomGraphics.java
        2010-12-23 00:52:34 UTC (rev 23263)
+++ 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/customgraphics/AbstractDCustomGraphics.java
        2010-12-23 08:35:35 UTC (rev 23264)
@@ -14,9 +14,10 @@
 import org.cytoscape.ding.customgraphics.Layer;
 import org.cytoscape.ding.customgraphics.Taggable;
 import org.cytoscape.ding.impl.ObjectPositionImpl;
+import org.cytoscape.graph.render.stateful.CustomGraphic;
 
 public abstract class AbstractDCustomGraphics implements
-               CyCustomGraphics, Taggable {
+               CyCustomGraphics<CustomGraphic>, Taggable {
 
        protected static final String DELIMITER = ",";
        public static final String LIST_DELIMITER = "|";
@@ -27,7 +28,7 @@
        protected final Long id;
        
        // Layers of Ding Custom Graphic objects.
-       protected List<Layer> layers;
+       protected List<Layer<CustomGraphic>> layers;
        
        // Human readable name
        protected String displayName;
@@ -37,7 +38,7 @@
        
        protected CyCustomGraphicsParser parser;
 
-       protected ObjectPosition position;
+       //protected ObjectPosition position;
 
        // For tags
        protected final SortedSet<String> tags;
@@ -58,11 +59,11 @@
        public AbstractDCustomGraphics(final Long id, final String displayName) 
{
                this.id = id;
                
-               this.layers = new ArrayList<Layer>();
+               this.layers = new ArrayList<Layer<CustomGraphic>>();
                this.displayName = displayName;
 
                this.tags = new TreeSet<String>();
-               this.position = new ObjectPositionImpl();
+               //this.position = new ObjectPositionImpl();
        }
        
        
@@ -87,7 +88,7 @@
        }
 
        
-       public List<Layer> getLayers() {
+       public List<Layer<CustomGraphic>> getLayers() {
                return layers;
        }
 
@@ -107,13 +108,13 @@
        }
 
 
-       public ObjectPosition getPosition() {
-               return position;
-       }
-
-       public void setPosition(final ObjectPosition position) {
-               this.position = position;
-       }
+//     public ObjectPosition getPosition() {
+//             return position;
+//     }
+//
+//     public void setPosition(final ObjectPosition position) {
+//             this.position = position;
+//     }
        
 
        // This will be used prop file.

Modified: 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/customgraphics/CustomGraphicsPositionCalculator.java
===================================================================
--- 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/customgraphics/CustomGraphicsPositionCalculator.java
       2010-12-23 00:52:34 UTC (rev 23263)
+++ 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/customgraphics/CustomGraphicsPositionCalculator.java
       2010-12-23 08:35:35 UTC (rev 23264)
@@ -37,8 +37,15 @@
        }
        
        
-       
-       public static CustomGraphic transform(final ObjectPosition p, final 
DNodeView nv, CustomGraphic cg) {           
+       /**
+        * Creates new custom graphics in new location
+        * 
+        * @param p
+        * @param nv
+        * @param cg
+        * @return
+        */
+       public static CustomGraphic transform(final ObjectPosition p, final 
DNodeView nv, final CustomGraphic cg) {             
                final Position anc = p.getAnchor();
                final Position ancN = p.getTargetAnchor();
                

Modified: 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/customgraphics/DLayer.java
===================================================================
--- 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/customgraphics/DLayer.java
 2010-12-23 00:52:34 UTC (rev 23263)
+++ 
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/customgraphics/DLayer.java
 2010-12-23 08:35:35 UTC (rev 23264)
@@ -8,7 +8,7 @@
  * Ding implementation of Custom graphics layers.
  *
  */
-public class DLayer implements Layer {
+public class DLayer implements Layer<CustomGraphic> {
        
        private final CustomGraphic layer;
        private final int zOrder;
@@ -22,7 +22,7 @@
                return zOrder;
        }
        
-       public Object getLayerObject() {
+       public CustomGraphic getLayerObject() {
                return layer;
        }
 

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