Author: ruschein
Date: 2010-11-15 14:37:48 -0800 (Mon, 15 Nov 2010)
New Revision: 22858
Added:
core3/ding-presentation-impl/trunk/src/main/resources/images/
core3/ding-presentation-impl/trunk/src/main/resources/images/default_network.png
core3/ding-presentation-impl/trunk/src/main/resources/images/recursive_network.png
Modified:
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/EdgeView.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/impl/DEdgeDetails.java
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DEdgeView.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/DNodeView.java
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/IntermediateEdgeDetails.java
Log:
Added missing images and ported additional 2.8 functionality.
Modified:
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/EdgeView.java
===================================================================
---
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/EdgeView.java
2010-11-15 22:24:40 UTC (rev 22857)
+++
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/EdgeView.java
2010-11-15 22:37:48 UTC (rev 22858)
@@ -1,5 +1,6 @@
package org.cytoscape.ding;
+
import java.awt.Paint;
import java.awt.Stroke;
@@ -8,280 +9,282 @@
public interface EdgeView extends GraphViewObject {
+ /**
+ * Draws splined curves for edges.
+ */
+ public static int CURVED_LINES = 1;
- /**
- * Draws splined curves for edges.
- */
- public static int CURVED_LINES = 1;
-
- /**
- * Draws straight lines for edges.
- */
- public static int STRAIGHT_LINES = 2;
+ /**
+ * Draws straight lines for edges.
+ */
+ public static int STRAIGHT_LINES = 2;
+ // these are now only used to support parsing of legacy files
+ static int NO_END = 0;
+ static int WHITE_DELTA = 1;
+ static int BLACK_DELTA = 2;
+ static int EDGE_COLOR_DELTA = 3;
+ static int WHITE_ARROW = 4;
+ static int BLACK_ARROW = 5;
+ static int EDGE_COLOR_ARROW = 6;
+ static int WHITE_DIAMOND = 7;
+ static int BLACK_DIAMOND = 8;
+ static int EDGE_COLOR_DIAMOND = 9;
+ static int WHITE_CIRCLE = 10;
+ static int BLACK_CIRCLE = 11;
+ static int EDGE_COLOR_CIRCLE = 12;
+ static int WHITE_T = 13;
+ static int BLACK_T = 14;
+ static int EDGE_COLOR_T = 15;
- // these are now only used to support parsing of legacy files
- static int NO_END = 0;
- static int WHITE_DELTA = 1;
- static int BLACK_DELTA = 2;
- static int EDGE_COLOR_DELTA = 3;
- static int WHITE_ARROW = 4;
- static int BLACK_ARROW = 5;
- static int EDGE_COLOR_ARROW = 6;
- static int WHITE_DIAMOND = 7;
- static int BLACK_DIAMOND = 8;
- static int EDGE_COLOR_DIAMOND = 9;
- static int WHITE_CIRCLE = 10;
- static int BLACK_CIRCLE = 11;
- static int EDGE_COLOR_CIRCLE = 12;
- static int WHITE_T = 13;
- static int BLACK_T = 14;
- static int EDGE_COLOR_T = 15;
+ /**
+ * @return the index of this edge in the GraphPerspective
+ */
+ public int getGraphPerspectiveIndex ();
- /**
- * @return the index of this edge in the GraphPerspective
- */
- public int getGraphPerspectiveIndex ();
+ /**
+ * @return the index of this edge in the RootGraph
+ */
+ public int getRootGraphIndex ();
- /**
- * @return the index of this edge in the RootGraph
- */
- public int getRootGraphIndex ();
+ /**
+ * @return the Edge to which we are a view on
+ */
+ public CyEdge getEdge();
+ public View<CyEdge> getEdgeView();
- /**
- * @return the Edge to which we are a view on
- */
- public CyEdge getEdge();
- public View<CyEdge> getEdgeView();
+ /**
+ * @param width set a new line width for this edge
+ */
+ public void setStrokeWidth ( float width );
- /**
- * @param width set a new line width for this edge
- */
- public void setStrokeWidth ( float width );
+ /**
+ * @return the currently set edge width
+ */
+ public float getStrokeWidth ();
- /**
- * @return the currently set edge width
- */
- public float getStrokeWidth ();
+ /**
+ * @param stroke the stroke to use on this edge
+ */
+ public void setStroke ( Stroke stroke );
- /**
- * @param stroke the stroke to use on this edge
- */
- public void setStroke ( Stroke stroke );
+ /**
+ * @return the stroke used on this edge
+ */
+ public Stroke getStroke ();
- /**
- * @return the stroke used on this edge
- */
- public Stroke getStroke ();
+ /**
+ * @param line_type set a new line type for the edge
+ */
+ public void setLineType ( int line_type );
- /**
- * @param line_type set a new line type for the edge
- */
- public void setLineType ( int line_type );
+ /**
+ * @return the currently set edge line type
+ */
+ public int getLineType ();
- /**
- * @return the currently set edge line type
- */
- public int getLineType ();
+ /**
+ * This really refers to the <B>Stroke</B>,
+ * TODO: Make separte stroke methods
+ * @param paint the paint for this node
+ */
+ public void setUnselectedPaint ( Paint paint );
- /**
- * This really refers to the <B>Stroke</B>,
- * TODO: Make separte stroke methods
- * @param paint the paint for this node
- */
- public void setUnselectedPaint ( Paint paint );
+ /**
+ * This really refers to the <B>Stroke</B>,
+ * TODO: Make separte stroke methods
+ * @return the currently set edge Paint
+ */
+ public Paint getUnselectedPaint ();
- /**
- * This really refers to the <B>Stroke</B>,
- * TODO: Make separte stroke methods
- * @return the currently set edge Paint
- */
- public Paint getUnselectedPaint ();
+ /**
+ * This really refers to the <B>Stroke</B>,
+ * TODO: Make separte stroke methods
+ * @param paint the paint for this node
+ */
+ public void setSelectedPaint ( Paint paint );
- /**
- * This really refers to the <B>Stroke</B>,
- * TODO: Make separte stroke methods
- * @param paint the paint for this node
- */
- public void setSelectedPaint ( Paint paint );
+ /**
+ * This really refers to the <B>Stroke</B>,
+ * TODO: Make separte stroke methods
+ * @return the currently set edge Selectionpaint
+ */
+ public Paint getSelectedPaint ();
- /**
- * This really refers to the <B>Stroke</B>,
- * TODO: Make separte stroke methods
- * @return the currently set edge Selectionpaint
- */
- public Paint getSelectedPaint ();
+ /**
+ * @return the currently set Source Edge End Type
+ */
+ public Paint getSourceEdgeEndPaint ();
- /**
- * @return the currently set Source Edge End Type
- */
- public Paint getSourceEdgeEndPaint ();
+ /**
+ * @return the currently set Source Edge End Type
+ */
+ public Paint getSourceEdgeEndSelectedPaint ();
- /**
- * @return the currently set Source Edge End Type
- */
- public Paint getSourceEdgeEndSelectedPaint ();
+ /**
+ * @return the currently set Target Edge End Type
+ */
+ public Paint getTargetEdgeEndPaint ();
- /**
- * @return the currently set Target Edge End Type
- */
- public Paint getTargetEdgeEndPaint ();
+ /**
+ * @return the currently set Target Edge End Type
+ */
+ public Paint getTargetEdgeEndSelectedPaint ();
- /**
- * @return the currently set Target Edge End Type
- */
- public Paint getTargetEdgeEndSelectedPaint ();
+ /**
+ * @param paint set the value for the source edge end when selected
+ */
+ public void setSourceEdgeEndSelectedPaint ( Paint paint );
- /**
- * @param paint set the value for the source edge end when selected
- */
- public void setSourceEdgeEndSelectedPaint ( Paint paint );
+ /**
+ * @param paint set the value for the target edge end when selected
+ */
+ public void setTargetEdgeEndSelectedPaint ( Paint paint );
- /**
- * @param paint set the value for the target edge end when selected
- */
- public void setTargetEdgeEndSelectedPaint ( Paint paint );
+ /**
+ * @param paint the new paint for the stroke of the source eged end
+ */
+ public void setSourceEdgeEndStrokePaint ( Paint paint );
- /**
- * @param paint the new paint for the stroke of the source eged end
- */
- public void setSourceEdgeEndStrokePaint ( Paint paint );
+ /**
+ * @param paint the new paint for the stroke of the target eged end
+ */
+ public void setTargetEdgeEndStrokePaint ( Paint paint );
- /**
- * @param paint the new paint for the stroke of the target eged end
- */
- public void setTargetEdgeEndStrokePaint ( Paint paint );
-
- /**
- * @param paint set the value for the source edge end
- */
- public void setSourceEdgeEndPaint ( Paint paint );
+ /**
+ * @param paint set the value for the source edge end
+ */
+ public void setSourceEdgeEndPaint ( Paint paint );
- /**
- * @param paint set the value for the target edge end
- */
- public void setTargetEdgeEndPaint ( Paint paint );
+ /**
+ * @param paint set the value for the target edge end
+ */
+ public void setTargetEdgeEndPaint ( Paint paint );
- public void select ();
+ public void select ();
- public void unselect ();
+ public void unselect ();
- /**
- * When we are selected then we draw ourselves red, and draw any handles.
- */
- public boolean setSelected ( boolean state );
+ /**
+ * When we are selected then we draw ourselves red, and draw any
handles.
+ */
+ public boolean setSelected ( boolean state );
- /**
- * @return selcted state
- */
- public boolean isSelected ();
+ /**
+ * @return selected state
+ */
+ public boolean isSelected ();
- /**
- * @return selcted state
- */
- public boolean getSelected ();
+ /**
+ * @return selected state
+ */
+ public boolean getSelected ();
- /**
- * Add a PHandle to the edge at the point specified.
- *
- * @param pt The point at which to draw the PHandle and to which the
- * PHandle will be attached via the locator.
- */
-// public void addHandle ( Point2D pt );
+ /**
+ * @return true if the EdgeView is hidden, else false
+ */
+ public boolean isHidden();
- /**
- * Removes the PHandle at the specified point.
- *
- * @param pt If this point intersects an existing PHandle, then remove that
- * PHandle.
- */
- // public void removeHandle ( Point2D pt );
+ /**
+ * Add a PHandle to the edge at the point specified.
+ *
+ * @param pt The point at which to draw the PHandle and to which the
+ * PHandle will be attached via the locator.
+ */
+ // public void addHandle ( Point2D pt );
- /**
- * Checks to see if a PHandle already exists for the given point.
- *
- * @param pt If this point intersects a currently existing PHandle, then
- * return true, else return false.
- */
- //public boolean handleAlreadyExists ( Point2D pt );
+ /**
+ * Removes the PHandle at the specified point.
+ *
+ * @param pt If this point intersects an existing PHandle, then remove
that
+ * PHandle.
+ */
+ // public void removeHandle ( Point2D pt );
- /**
- * This is the main method called to update the drawing of the edge.
- */
- public void updateEdgeView ();
+ /**
+ * Checks to see if a PHandle already exists for the given point.
+ *
+ * @param pt If this point intersects a currently existing PHandle, then
+ * return true, else return false.
+ */
+ //public boolean handleAlreadyExists ( Point2D pt );
- /**
- * Draws the EdgeEnd, also sets the Source/Target Points to values such
- * that the edge does not "go through" the end
- */
- public void updateTargetArrow ();
+ /**
+ * This is the main method called to update the drawing of the edge.
+ */
+ public void updateEdgeView ();
- /**
- * Draws the EdgeEnd, also sets the Source/Target Points to values such
- * that the edge does not "go through" the end
- */
- public void updateSourceArrow ();
+ /**
+ * Draws the EdgeEnd, also sets the Source/Target Points to values such
+ * that the edge does not "go through" the end
+ */
+ public void updateTargetArrow ();
- /**
- * Sets the Drawing style for the edge end.
- */
- public void setSourceEdgeEnd(int type);
+ /**
+ * Draws the EdgeEnd, also sets the Source/Target Points to values such
+ * that the edge does not "go through" the end
+ */
+ public void updateSourceArrow ();
- /**
- * Sets the Drawing style for the edge end.
- */
- public void setTargetEdgeEnd(int type);
+ /**
+ * Sets the Drawing style for the edge end.
+ */
+ public void setSourceEdgeEnd(int type);
+ /**
+ * Sets the Drawing style for the edge end.
+ */
+ public void setTargetEdgeEnd(int type);
+
- /**
- * Return the Drawing style for the edge end.
- */
- public int getSourceEdgeEnd();
+ /**
+ * Return the Drawing style for the edge end.
+ */
+ public int getSourceEdgeEnd();
- /**
- * REturn the Drawing style for the edge end.
- */
- public int getTargetEdgeEnd();
+ /**
+ * REturn the Drawing style for the edge end.
+ */
+ public int getTargetEdgeEnd();
- /**
- * Draws the Edge
- */
- public void updateLine();
+ /**
+ * Draws the Edge
+ */
+ public void updateLine();
- /**
- * Draws the edge as red and draws any handles previously added.
- */
- public void drawSelected();
+ /**
+ * Draws the edge as red and draws any handles previously added.
+ */
+ public void drawSelected();
- /**
- * Draws the edge as black and removes any handles from the display.
- */
- public void drawUnselected();
+ /**
+ * Draws the edge as black and removes any handles from the display.
+ */
+ public void drawUnselected();
- /**
- * @return the Bend used
- */
- public Bend getBend ();
+ /**
+ * @return the Bend used
+ */
+ public Bend getBend ();
- public void clearBends ();
+ public void clearBends ();
- public Label getLabel();
+ public Label getLabel();
- /**
- * Sets what the tooltip will be for this EdgeView
- */
- public void setToolTip ( String tip );
+ /**
+ * Sets what the tooltip will be for this EdgeView
+ */
+ public void setToolTip ( String tip );
- public void setLabelOffsetX(double x);
- public void setLabelOffsetY(double y);
- public void setEdgeLabelAnchor(int position);
+ public void setLabelOffsetX(double x);
+ public void setLabelOffsetY(double y);
+ public void setEdgeLabelAnchor(int position);
- public double getLabelOffsetX();
- public double getLabelOffsetY();
- public int getEdgeLabelAnchor();
-
+ public double getLabelOffsetX();
+ public double getLabelOffsetY();
+ public int getEdgeLabelAnchor();
}
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-11-15 22:24:40 UTC (rev 22857)
+++
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/NodeView.java
2010-11-15 22:37:48 UTC (rev 22858)
@@ -1,11 +1,13 @@
package org.cytoscape.ding;
+
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.
@@ -13,231 +15,234 @@
*/
public interface NodeView extends GraphViewObject {
- /**
- * @return The Node we are a view on
- */
- public CyNode getNode() ;
- public View<CyNode> getNodeViewModel() ;
+ /**
+ * @return The Node we are a view on
+ */
+ public CyNode getNode() ;
+ public View<CyNode> getNodeViewModel() ;
- /**
- * @return the index of this node in the perspective to which we are in a
view on.
- */
- public int getGraphPerspectiveIndex () ;
+ /**
+ * @return the index of this node in the perspective to which we are in
a view on.
+ */
+ public 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 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) ;
+ /**
+ * @return The list of EdgeViews connecting these two nodes. Possibly
null.
+ */
+ public java.util.List<EdgeView> getEdgeViewsList(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 () ;
+ /**
+ * 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 () ;
- /**
- * 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) ;
+ /**
+ * 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) ;
- /**
- * @return the currently set selection Paint
- */
- public Paint getSelectedPaint () ;
+ /**
+ * @return the currently set selection Paint
+ */
+ public Paint getSelectedPaint () ;
- /**
- * Set the deafult paint of this node
- * @param paint the default Paint of this node
- */
- public void setUnselectedPaint ( Paint paint ) ;
+ /**
+ * Set the deafult paint of this node
+ * @param paint the default Paint of this node
+ */
+ public void setUnselectedPaint ( Paint paint ) ;
- /**
- * @return the currently set paint
- */
- public Paint getUnselectedPaint () ;
+ /**
+ * @return the currently set paint
+ */
+ public Paint getUnselectedPaint () ;
- /**
- * @param b_paint the paint the border will use
- */
- public void setBorderPaint ( Paint b_paint ) ;
+ /**
+ * @param b_paint the paint the border will use
+ */
+ public void setBorderPaint ( Paint b_paint ) ;
- /**
- * @return the currently set BOrder Paint
- */
- public Paint getBorderPaint () ;
+ /**
+ * @return the currently set BOrder Paint
+ */
+ public Paint getBorderPaint () ;
- /**
- * @param border_width The width of the border.
- */
- public void setBorderWidth ( float border_width ) ;
+ /**
+ * @param border_width The width of the border.
+ */
+ public void setBorderWidth ( float border_width ) ;
- /**
- * @return the currently set Border width
- */
- public float getBorderWidth () ;
+ /**
+ * @return the currently set Border width
+ */
+ public float getBorderWidth () ;
- /**
- * @param stroke the new stroke for the border
- */
- public void setBorder ( Stroke stroke );
+ /**
+ * @param stroke the new stroke for the border
+ */
+ public void setBorder ( Stroke stroke );
- /**
- * @return the current border
- */
- public Stroke getBorder ();
+ /**
+ * @return the current border
+ */
+ public Stroke getBorder ();
- /**
- * @param trans new value for the transparency
- */
- public void setTransparency ( int trans );
+ /**
+ * @param trans new value for the transparency
+ */
+ public void setTransparency ( int trans );
- /**
- * @return the value for the transparency for this node
- */
- public int getTransparency ();
+ /**
+ * @return the value for the transparency for this node
+ */
+ public int getTransparency ();
- /**
- * TODO: Reconcile with Border Methods
- * @param width the currently set width of this node
- */
- public boolean setWidth ( double width ) ;
+ /**
+ * TODO: Reconcile with Border Methods
+ * @param width the currently set width of this node
+ */
+ public boolean setWidth ( double width ) ;
- /**
- * TODO: Reconcile with Border Methods
- * @return the currently set width of this node
- */
- public double getWidth () ;
+ /**
+ * TODO: Reconcile with Border Methods
+ * @return the currently set width of this node
+ */
+ public double getWidth () ;
- /**
- * TODO: Reconcile with Border Methods
- * @param height the currently set height of this node
- */
- public boolean setHeight ( double height ) ;
+ /**
+ * TODO: Reconcile with Border Methods
+ * @param height the currently set height of this node
+ */
+ public boolean setHeight ( double height ) ;
- /**
- * TODO: Reconcile with Border Methods
- * @return the currently set height of this node
- */
- public double getHeight () ;
+ /**
+ * TODO: Reconcile with Border Methods
+ * @return the currently set height of this node
+ */
+ public double getHeight () ;
- /**
- * @return The Value of the label
- */
- public org.cytoscape.ding.Label getLabel () ;
+ /**
+ * @return The Value of the label
+ */
+ public org.cytoscape.ding.Label getLabel () ;
- /**
- * @return the degree of the Node in the GraphPerspective.
- */
- public int getDegree() ;
+ /**
+ * @return the degree of the Node in the GraphPerspective.
+ */
+ public int getDegree() ;
- public void setOffset ( double x, double y );
+ public void setOffset ( double x, double y );
- public Point2D getOffset ();
+ public Point2D getOffset ();
- /**
- * @param new_x_position the new X position for this node
- */
- public void setXPosition(double new_x_position) ;
+ /**
+ * @param new_x_position the new X position for this node
+ */
+ 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 ) ;
+ /**
+ * 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
- * the "real" location of this node
- * @return the current x position of this node
- * @see #setXPosition
- */
- public double getXPosition() ;
+ /**
+ * note that unless updateNode() has been called, this may not be
+ * the "real" location of this node
+ * @return the current x position of this node
+ * @see #setXPosition
+ */
+ public double getXPosition() ;
- /**
- * @param new_y_position the new Y position for this node
- */
- public void setYPosition(double new_y_position) ;
+ /**
+ * @param new_y_position the new Y position for this node
+ */
+ 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 ) ;
+ /**
+ * 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
- * the "real" location of this node
- * @return the current y position of this node
- * @see #setYPosition
- */
- public double getYPosition() ;
+ /**
+ * note that unless updateNode() has been called, this may not be
+ * the "real" location of this node
+ * @return the current y position of this node
+ * @see #setYPosition
+ */
+ 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() ;
+ /**
+ * This draws us as selected
+ */
+ public void select() ;
- /**
- * This draws us as unselected
- */
- public void unselect() ;
+ /**
+ * This draws us as unselected
+ */
+ public void unselect() ;
- /**
- *
- */
- public boolean isSelected() ;
+ /**
+ *
+ */
+ public boolean isSelected() ;
- /**
- *
- */
- public boolean setSelected(boolean selected) ;
+ /**
+ *
+ */
+ public boolean setSelected(boolean selected) ;
+ /**
+ * @return true if the NodeView is hidden, else false
+ */
+ public boolean isHidden();
+
+ /**
+ * Set a new shape for the Node, based on one of the pre-defined shapes
+ * <B>Note:</B> calling setPathTo( Shape ), allows one to define their
own
+ * java.awt.Shape ( i.e. A picture of Johnny Cash )
+ */
+ public void setShape(int shape) ;
- /**
- * Set a new shape for the Node, based on one of the pre-defined shapes
- * <B>Note:</B> calling setPathTo( Shape ), allows one to define their own
- * java.awt.Shape ( i.e. A picture of Johnny Cash )
- */
- public void setShape(int shape) ;
-
- /**
- * Sets what the tooltip will be for this NodeView
- */
- public void setToolTip ( String tip );
+ /**
+ * Sets what the tooltip will be for this NodeView
+ */
+ public void setToolTip ( String tip );
- public void setLabelOffsetX(double x);
- public void setLabelOffsetY(double y);
- public void setNodeLabelAnchor(int position);
+ public void setLabelOffsetX(double x);
+ public void setLabelOffsetY(double y);
+ public void setNodeLabelAnchor(int position);
- public double getLabelOffsetX();
- public double getLabelOffsetY();
- public int getNodeLabelAnchor();
-
+ public double getLabelOffsetX();
+ public double getLabelOffsetY();
+ public int getNodeLabelAnchor();
}
Modified:
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DEdgeDetails.java
===================================================================
---
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DEdgeDetails.java
2010-11-15 22:24:40 UTC (rev 22857)
+++
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DEdgeDetails.java
2010-11-15 22:37:48 UTC (rev 22858)
@@ -1,14 +1,6 @@
-
/*
- Copyright (c) 2006, 2007, The Cytoscape Consortium (www.cytoscape.org)
+ Copyright (c) 2006, 2007, 2010, The Cytoscape Consortium (www.cytoscape.org)
- The Cytoscape Consortium is:
- - Institute for Systems Biology
- - University of California San Diego
- - Memorial Sloan-Kettering Cancer Center
- - Institut Pasteur
- - Agilent Technologies
-
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License, or
@@ -33,9 +25,9 @@
along with this library; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-
package org.cytoscape.ding.impl;
+
import org.cytoscape.graph.render.immed.EdgeAnchors;
import org.cytoscape.util.intr.IntEnumerator;
import org.cytoscape.util.intr.IntIterator;
@@ -54,6 +46,7 @@
final IntObjHash m_colorsLowDetail = new IntObjHash();
final Object m_deletedEntry = new Object();
final HashMap<Integer,Object> m_segmentThicknesses = new
HashMap<Integer,Object>();
+ final HashMap m_segmentStrokes = new HashMap();
final HashMap<Integer,Object> m_sourceArrows = new
HashMap<Integer,Object>();
final HashMap<Integer,Object> m_sourceArrowPaints = new
HashMap<Integer,Object>();
final HashMap<Integer,Object> m_targetArrows = new
HashMap<Integer,Object>();
@@ -77,6 +70,7 @@
final Integer key = Integer.valueOf(edge);
m_segmentThicknesses.remove(key);
+ m_segmentStrokes.remove(key);
m_sourceArrows.remove(key);
m_sourceArrowPaints.remove(key);
m_targetArrows.remove(key);
@@ -417,25 +411,28 @@
m_segmentThicknesses.put(Integer.valueOf(edge), new
Float(thickness));
}
- /**
- * DOCUMENT ME!
- *
- * @param edge DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public Paint segmentPaint(int edge) {
- final Object o = m_segmentPaints.get(Integer.valueOf(edge));
+ public Stroke segmentStroke(int edge) {
+ final Object o = m_segmentStrokes.get(new Integer(edge));
if (o == null)
- return super.segmentPaint(edge);
+ return super.segmentStroke(edge);
- return (Paint) o;
+ return (Stroke) o;
}
/*
* A null paint has the special meaning to remove overridden paint.
*/
+ void overrideSegmentStroke(int edge, Stroke stroke) {
+ if ((stroke == null) ||
stroke.equals(super.segmentStroke(edge)))
+ m_segmentStrokes.remove(new Integer(edge));
+ else
+ m_segmentStrokes.put(new Integer(edge), stroke);
+ }
+
+ /*
+ * A null paint has the special meaning to remove overridden paint.
+ */
void overrideSegmentPaint(int edge, Paint paint) {
if ((paint == null) || paint.equals(super.segmentPaint(edge)))
m_segmentPaints.remove(Integer.valueOf(edge));
Modified:
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DEdgeView.java
===================================================================
---
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DEdgeView.java
2010-11-15 22:24:40 UTC (rev 22857)
+++
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DEdgeView.java
2010-11-15 22:37:48 UTC (rev 22858)
@@ -1,13 +1,6 @@
/*
- Copyright (c) 2006, 2007, The Cytoscape Consortium (www.cytoscape.org)
+ Copyright (c) 2006, 2007, 2010, The Cytoscape Consortium (www.cytoscape.org)
- The Cytoscape Consortium is:
- - Institute for Systems Biology
- - University of California San Diego
- - Memorial Sloan-Kettering Cancer Center
- - Institut Pasteur
- - Agilent Technologies
-
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License, or
@@ -31,10 +24,10 @@
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.BasicStroke;
import java.awt.Color;
import java.awt.Font;
@@ -57,11 +50,12 @@
import org.cytoscape.view.model.VisualProperty;
import org.cytoscape.view.presentation.property.TwoDVisualLexicon;
-class DEdgeView implements EdgeView, Label, Bend, EdgeAnchors {
+class DEdgeView implements EdgeView, Label, Bend, EdgeAnchors {
static final float DEFAULT_ARROW_SIZE = 5.0f;
static final Paint DEFAULT_ARROW_PAINT = Color.black;
static final float DEFAULT_EDGE_THICKNESS = 1.0f;
+ static final Stroke DEFAULT_EDGE_STROKE = new BasicStroke();
static final Color DEFAULT_EDGE_PAINT = Color.black;
static final String DEFAULT_LABEL_TEXT = "";
static final Font DEFAULT_LABEL_FONT = new Font(null, Font.PLAIN, 1);
@@ -174,23 +168,9 @@
* DOCUMENT ME!
*/
public void setStroke(Stroke stroke) {
- if (stroke instanceof BasicStroke) {
- synchronized (m_view.m_lock) {
- final BasicStroke bStroke = (BasicStroke)
stroke;
-
m_view.m_edgeDetails.overrideSegmentThickness(m_inx,
- bStroke.getLineWidth());
-
- final float[] dashArr = bStroke.getDashArray();
-
- if ((dashArr != null) && (dashArr.length > 0))
-
m_view.m_edgeDetails.overrideSegmentDashLength(m_inx,
- dashArr[0]);
- else
- m_view.m_edgeDetails
-
.overrideSegmentDashLength(m_inx, -1.0f);
-
- m_view.m_contentChanged = true;
- }
+ synchronized (m_view.m_lock) {
+ m_view.m_edgeDetails.overrideSegmentStroke(m_inx,
stroke);
+ m_view.m_contentChanged = true;
}
}
@@ -201,21 +181,7 @@
*/
public Stroke getStroke() {
synchronized (m_view.m_lock) {
- final float segmentThickness = m_view.m_edgeDetails
- .segmentThickness(m_inx);
- final float segmentDashLength = m_view.m_edgeDetails
- .segmentDashLength(m_inx);
-
- if (segmentDashLength > 0.0f) {
- final float[] dashes = new float[] {
segmentDashLength,
- segmentDashLength };
-
- return new BasicStroke(segmentThickness,
- BasicStroke.CAP_SQUARE,
BasicStroke.JOIN_MITER, 10.0f,
- dashes, 0.0f);
- } else
-
- return new BasicStroke(segmentThickness);
+ return m_view.m_edgeDetails.segmentStroke(m_inx);
}
}
@@ -601,6 +567,10 @@
return m_selected;
}
+ final public boolean isHidden() {
+ return m_view.isHidden(this);
+ }
+
/**
* DOCUMENT ME!
*/
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-11-15 22:24:40 UTC (rev 22857)
+++
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DGraphView.java
2010-11-15 22:37:48 UTC (rev 22858)
@@ -1428,6 +1428,20 @@
}
}
+ final boolean isHidden(final DEdgeView edgeView) {
+ synchronized (m_lock) {
+ final int edgeIndex = edgeView.getRootGraphIndex();
+ return
m_drawPersp.containsEdge(m_drawPersp.getEdge(edgeIndex));
+ }
+ }
+
+ final boolean isHidden(final DNodeView nodeView) {
+ synchronized (m_lock) {
+ final int nodeIndex = nodeView.getRootGraphIndex();
+ return
m_drawPersp.containsNode(m_drawPersp.getNode(nodeIndex));
+ }
+ }
+
/**
* @param obj
* should be either a DEdgeView or a DNodeView.
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-11-15 22:24:40 UTC (rev 22857)
+++
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DNodeView.java
2010-11-15 22:37:48 UTC (rev 22858)
@@ -878,6 +878,10 @@
return true;
}
+ final public boolean isHidden() {
+ return graphView.isHidden(this);
+ }
+
/**
* DOCUMENT ME!
*
Modified:
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/IntermediateEdgeDetails.java
===================================================================
---
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/IntermediateEdgeDetails.java
2010-11-15 22:24:40 UTC (rev 22857)
+++
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/IntermediateEdgeDetails.java
2010-11-15 22:37:48 UTC (rev 22858)
@@ -1,14 +1,6 @@
-
/*
- Copyright (c) 2006, 2007, The Cytoscape Consortium (www.cytoscape.org)
+ Copyright (c) 2006, 2007, 2010, The Cytoscape Consortium (www.cytoscape.org)
- The Cytoscape Consortium is:
- - Institute for Systems Biology
- - University of California San Diego
- - Memorial Sloan-Kettering Cancer Center
- - Institut Pasteur
- - Agilent Technologies
-
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License, or
@@ -116,6 +108,17 @@
*
* @return DOCUMENT ME!
*/
+ public Stroke segmentStroke(int edge) {
+ return DEdgeView.DEFAULT_EDGE_STROKE;
+ }
+
+ /**
+ * DOCUMENT ME!
+ *
+ * @param edge DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ */
public Paint segmentPaint(int edge) {
return DEdgeView.DEFAULT_EDGE_PAINT;
}
Copied:
core3/ding-presentation-impl/trunk/src/main/resources/images/default_network.png
(from rev 22823,
cytoscape/trunk/corelibs/ding/src/main/resources/images/default_network.png)
===================================================================
(Binary files differ)
Copied:
core3/ding-presentation-impl/trunk/src/main/resources/images/recursive_network.png
(from rev 22823,
cytoscape/trunk/corelibs/ding/src/main/resources/images/recursive_network.png)
===================================================================
(Binary files differ)
--
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.