|
Cytoscape 2.6.1 (c) 2006,2007 ISB, MSKCC, UCSD | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectding.view.DNodeView
public class DNodeView
DOCUMENT ME!
| Field Summary |
|---|
| Fields inherited from interface giny.view.NodeView |
|---|
DIAMOND, ELLIPSE, HEXAGON, OCTAGON, PARALELLOGRAM, RECTANGLE, ROUNDED_RECTANGLE, TRIANGLE |
| Fields inherited from interface giny.view.Label |
|---|
CENTER, EAST, JUSTIFY_CENTER, JUSTIFY_LEFT, JUSTIFY_RIGHT, NONE, NORTH, NORTHEAST, NORTHWEST, SOURCE_BOUND, SOUTH, SOUTHEAST, SOUTHWEST, TARGET_BOUND, WEST |
| Method Summary | |
|---|---|
boolean |
addCustomGraphic(cytoscape.render.stateful.CustomGraphic cg)
Adds a given CustomGraphic, in draw order, to this DNodeView in a thread-safe way. |
cytoscape.render.stateful.CustomGraphic |
addCustomGraphic(Shape shape,
Paint paint,
byte anchor)
Adds a custom graphic, in draw order, to this DNodeView in a thread-safe way. |
void |
addCustomGraphic(Shape s,
Paint p,
int index)
Deprecated. use addCustomGraphic(Shape,Paint,byte).
The entire index-based custom graphic API has been deprecated. This includes all the methods that refer to custom graphics using indices: public int addCustomGraphic(Shape s, Paint p, int index); public void removeCustomGraphic(int index); public Paint getCustomGraphicPaint(int index); public Shape getCustomGraphicShape(int index); public int getCustomGraphicCount();To keep things completetly backwards compatible and to avoid introducing bugs, the new API methods are completely independent from the the old API methods. Thus, a custom graphic added using the new API will not be accessible from the old API and visa versa. The reason for the deprecation is:
|
boolean |
containsCustomGraphic(cytoscape.render.stateful.CustomGraphic cg)
A thread-safe way to determine if this DNodeView contains a given custom graphic. |
Iterator<cytoscape.render.stateful.CustomGraphic> |
customGraphicIterator()
Return a non-null, read-only Iterator over all CustomGraphics contained in this DNodeView. |
Object |
customGraphicLock()
Obtain the lock used for reading information about custom graphics. |
Stroke |
getBorder()
DOCUMENT ME! |
Paint |
getBorderPaint()
DOCUMENT ME! |
float |
getBorderWidth()
DOCUMENT ME! |
int |
getCustomGraphicCount()
Deprecated. use getNumCustomGraphics().
Note that the new API methods work independent of the old API methods.
See addCustomGraphic(Shape,Paint,int)
for details. |
Paint |
getCustomGraphicPaint(int index)
Deprecated. use cytoscape.render.stateful.CustomGraphic.getPaint().
Note that the new API methods work independent of the old API methods.
See addCustomGraphic(Shape,Paint,int)
for details. |
Shape |
getCustomGraphicShape(int index)
Deprecated. use cytoscape.render.stateful.CustomGraphic.getShape().
Note that the new API methods work independent of the old API methods.
See addCustomGraphic(Shape,Paint,int)
for details. |
int |
getDegree()
DOCUMENT ME! |
List |
getEdgeViewsList(NodeView otherNodeView)
DOCUMENT ME! |
Font |
getFont()
DOCUMENT ME! |
int |
getGraphPerspectiveIndex()
DOCUMENT ME! |
GraphView |
getGraphView()
DOCUMENT ME! |
double |
getGreekThreshold()
DOCUMENT ME! |
double |
getHeight()
DOCUMENT ME! |
int |
getJustify()
DOCUMENT ME! |
Label |
getLabel()
DOCUMENT ME! |
double |
getLabelOffsetX()
DOCUMENT ME! |
double |
getLabelOffsetY()
DOCUMENT ME! |
Node |
getNode()
DOCUMENT ME! |
int |
getNodeLabelAnchor()
DOCUMENT ME! |
int |
getNumCustomGraphics()
A thread-safe method returning the number of custom graphics associated with this DNodeView. |
Point2D |
getOffset()
DOCUMENT ME! |
int |
getRootGraphIndex()
DOCUMENT ME! |
Paint |
getSelectedPaint()
DOCUMENT ME! |
int |
getShape()
DOCUMENT ME! |
String |
getText()
DOCUMENT ME! |
int |
getTextAnchor()
DOCUMENT ME! |
Paint |
getTextPaint()
DOCUMENT ME! |
String |
getToolTip()
DOCUMENT ME! |
float |
getTransparency()
DOCUMENT ME! |
Paint |
getUnselectedPaint()
DOCUMENT ME! |
double |
getWidth()
DOCUMENT ME! |
double |
getXPosition()
DOCUMENT ME! |
double |
getYPosition()
DOCUMENT ME! |
boolean |
isSelected()
DOCUMENT ME! |
boolean |
removeCustomGraphic(cytoscape.render.stateful.CustomGraphic cg)
A thread-safe method for removing a given custom graphic from this DNodeView. |
void |
removeCustomGraphic(int index)
Deprecated. use removeCustomGraphic(CustomGraphic).
Note that the new API methods work independent of the old API methods.
See addCustomGraphic(Shape,Paint,int)
for details. |
void |
select()
DOCUMENT ME! |
void |
setBorder(Stroke stroke)
DOCUMENT ME! |
void |
setBorderPaint(Paint paint)
DOCUMENT ME! |
void |
setBorderWidth(float width)
DOCUMENT ME! |
void |
setFont(Font font)
DOCUMENT ME! |
void |
setGreekThreshold(double threshold)
DOCUMENT ME! |
boolean |
setHeight(double height)
DOCUMENT ME! |
void |
setJustify(int justify)
DOCUMENT ME! |
void |
setLabelOffsetX(double x)
DOCUMENT ME! |
void |
setLabelOffsetY(double y)
DOCUMENT ME! |
void |
setNodeLabelAnchor(int position)
DOCUMENT ME! |
void |
setNodePosition(boolean animate)
DOCUMENT ME! |
void |
setOffset(double x,
double y)
DOCUMENT ME! |
void |
setPositionHint(int position)
DOCUMENT ME! |
boolean |
setSelected(boolean selected)
DOCUMENT ME! |
void |
setSelectedPaint(Paint paint)
DOCUMENT ME! |
void |
setShape(int shape)
DOCUMENT ME! |
void |
setText(String text)
DOCUMENT ME! |
void |
setTextAnchor(int position)
DOCUMENT ME! |
void |
setTextPaint(Paint textPaint)
DOCUMENT ME! |
void |
setToolTip(String tip)
DOCUMENT ME! |
void |
setTransparency(float trans)
DOCUMENT ME! |
void |
setUnselectedPaint(Paint paint)
DOCUMENT ME! |
boolean |
setWidth(double width)
DOCUMENT ME! |
void |
setXPosition(double xPos)
DOCUMENT ME! |
void |
setXPosition(double xPos,
boolean update)
DOCUMENT ME! |
void |
setYPosition(double yPos)
DOCUMENT ME! |
void |
setYPosition(double yPos,
boolean update)
DOCUMENT ME! |
void |
unselect()
DOCUMENT ME! |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public GraphView getGraphView()
getGraphView in interface NodeViewpublic Node getNode()
getNode in interface NodeViewpublic int getGraphPerspectiveIndex()
getGraphPerspectiveIndex in interface NodeViewpublic int getRootGraphIndex()
getRootGraphIndex in interface NodeViewpublic List getEdgeViewsList(NodeView otherNodeView)
getEdgeViewsList in interface NodeViewotherNodeView - DOCUMENT ME!
public int getShape()
getShape in interface NodeViewpublic void setSelectedPaint(Paint paint)
setSelectedPaint in interface NodeViewpaint - DOCUMENT ME!public Paint getSelectedPaint()
getSelectedPaint in interface NodeViewpublic void setUnselectedPaint(Paint paint)
setUnselectedPaint in interface NodeViewpaint - DOCUMENT ME!public Paint getUnselectedPaint()
getUnselectedPaint in interface NodeViewpublic void setBorderPaint(Paint paint)
setBorderPaint in interface NodeViewpaint - DOCUMENT ME!public Paint getBorderPaint()
getBorderPaint in interface NodeViewpublic void setBorderWidth(float width)
setBorderWidth in interface NodeViewwidth - DOCUMENT ME!public float getBorderWidth()
getBorderWidth in interface NodeViewpublic void setBorder(Stroke stroke)
setBorder in interface NodeViewstroke - DOCUMENT ME!public Stroke getBorder()
getBorder in interface NodeViewpublic void setTransparency(float trans)
setTransparency in interface NodeViewtrans - DOCUMENT ME!public float getTransparency()
getTransparency in interface NodeViewpublic boolean setWidth(double width)
setWidth in interface NodeViewwidth - DOCUMENT ME!
public double getWidth()
getWidth in interface NodeViewpublic boolean setHeight(double height)
setHeight in interface NodeViewheight - DOCUMENT ME!
public double getHeight()
getHeight in interface NodeViewpublic Label getLabel()
getLabel in interface NodeViewpublic int getDegree()
getDegree in interface NodeView
public void setOffset(double x,
double y)
setOffset in interface NodeViewx - DOCUMENT ME!y - DOCUMENT ME!public Point2D getOffset()
getOffset in interface NodeViewpublic void setXPosition(double xPos)
setXPosition in interface NodeViewxPos - DOCUMENT ME!
public void setXPosition(double xPos,
boolean update)
setXPosition in interface NodeViewxPos - DOCUMENT ME!update - DOCUMENT ME!public double getXPosition()
getXPosition in interface NodeViewNodeView.setXPosition(double)public void setYPosition(double yPos)
setYPosition in interface NodeViewyPos - DOCUMENT ME!
public void setYPosition(double yPos,
boolean update)
setYPosition in interface NodeViewyPos - DOCUMENT ME!update - DOCUMENT ME!public double getYPosition()
getYPosition in interface NodeViewNodeView.setYPosition(double)public void setNodePosition(boolean animate)
setNodePosition in interface NodeViewanimate - DOCUMENT ME!public void select()
select in interface NodeViewpublic void unselect()
unselect in interface NodeViewpublic boolean isSelected()
isSelected in interface NodeViewpublic boolean setSelected(boolean selected)
setSelected in interface NodeViewselected - DOCUMENT ME!
public void setShape(int shape)
setShape in interface NodeViewshape - DOCUMENT ME!public void setToolTip(String tip)
setToolTip in interface NodeViewtip - DOCUMENT ME!public String getToolTip()
public void setPositionHint(int position)
position - DOCUMENT ME!public Paint getTextPaint()
getTextPaint in interface Labelpublic void setTextPaint(Paint textPaint)
setTextPaint in interface LabeltextPaint - DOCUMENT ME!public double getGreekThreshold()
getGreekThreshold in interface Labelpublic void setGreekThreshold(double threshold)
setGreekThreshold in interface Labelthreshold - DOCUMENT ME!public String getText()
getText in interface Labelpublic void setText(String text)
setText in interface Labeltext - DOCUMENT ME!public Font getFont()
getFont in interface Labelpublic void setFont(Font font)
setFont in interface Labelfont - DOCUMENT ME!@Deprecated public int getCustomGraphicCount()
getNumCustomGraphics().
Note that the new API methods work independent of the old API methods.
See addCustomGraphic(Shape,Paint,int)
for details.
@Deprecated public Shape getCustomGraphicShape(int index)
cytoscape.render.stateful.CustomGraphic.getShape().
Note that the new API methods work independent of the old API methods.
See addCustomGraphic(Shape,Paint,int)
for details.
@Deprecated public Paint getCustomGraphicPaint(int index)
cytoscape.render.stateful.CustomGraphic.getPaint().
Note that the new API methods work independent of the old API methods.
See addCustomGraphic(Shape,Paint,int)
for details.
@Deprecated public void removeCustomGraphic(int index)
removeCustomGraphic(CustomGraphic).
Note that the new API methods work independent of the old API methods.
See addCustomGraphic(Shape,Paint,int)
for details.
public cytoscape.render.stateful.CustomGraphic addCustomGraphic(Shape shape,
Paint paint,
byte anchor)
addCustomGraphic (new CustomGraphic (shape,paint,anchor))
except the the new CustomGraphic created is returned.
shape - paint - anchor - The byte value from NodeDetails, that defines where the graphic anchor point lies on this DNodeView's extents rectangle. A common anchor is NodeDetails.ANCHOR_CENTER.
IllegalArgumentException - if shape or paint are null or anchor is not in the range 0 <= anchor <= NodeDetails.MAX_ANCHOR_VAL.addCustomGraphic(CustomGraphic),
CustomGraphicpublic boolean addCustomGraphic(cytoscape.render.stateful.CustomGraphic cg)
A CustomGraphic can only be associated with a DNodeView once. If you wish to have a custom graphic, with the same paint and shape information, occur in multiple places in the draw order, simply create a new CustomGraphic and add it.
IllegalArgumentException - if shape or paint are null.CustomGraphicpublic boolean containsCustomGraphic(cytoscape.render.stateful.CustomGraphic cg)
cg - the CustomGraphic for which we are checking containment.public Iterator<cytoscape.render.stateful.CustomGraphic> customGraphicIterator()
UnsupportedOperationException - if an attempt is made to use the Iterator's remove() method.public boolean removeCustomGraphic(cytoscape.render.stateful.CustomGraphic cg)
public int getNumCustomGraphics()
public Object customGraphicLock()
DNodeView dnv = ...;
CustomGraphic cg = null;
synchronized (dnv.customGraphicLock()) {
Iterator cgIt = dnv.customGraphicIterator();
while (cgIt.hasNext()) {
cg = cgIt.next();
// PERFORM your operations here.
}
}
NOTE: A better concurrency approach would be to return the read
lock from a
java.util.concurrent.locks.ReentrantReadWriteLock.
However, this requires users to manually lock and unlock
blocks of code where many times try{} finally{} blocks
are needed and if any mistake are made, a DNodeView may be
permanently locked. Since concurrency will most
likely be very low, we opt for the simpler approach of
having users use synchronized {} blocks on a standard
lock object.
@Deprecated
public void addCustomGraphic(Shape s,
Paint p,
int index)
addCustomGraphic(Shape,Paint,byte).
The entire index-based custom graphic API has been deprecated. This includes all the methods that refer to custom graphics using indices:
public int addCustomGraphic(Shape s, Paint p, int index); public void removeCustomGraphic(int index); public Paint getCustomGraphicPaint(int index); public Shape getCustomGraphicShape(int index); public int getCustomGraphicCount();To keep things completetly backwards compatible and to avoid introducing bugs, the new API methods are completely independent from the the old API methods. Thus, a custom graphic added using the new API will not be accessible from the old API and visa versa.
The reason for the deprecation is:
In order for multiple plugins to use the old API, each must monitor deletions to custom graphics and update their saved indices, since the indices will shift down as graphics are deleted. This management isn't even possible with the old API because there's no event mechanism to inform plugins when the indices change. Also, each plugin must keep a list of all indices for all graphics added, since the indices may not be contiguous.
Using indices forces the need for a locking mechanism to ensure you are guaranteed a unique and correct index independent of any other plugins.
public void setTextAnchor(int position)
setTextAnchor in interface Labelposition - DOCUMENT ME!public int getTextAnchor()
getTextAnchor in interface Labelpublic void setJustify(int justify)
setJustify in interface Labeljustify - DOCUMENT ME!public int getJustify()
getJustify in interface Labelpublic void setLabelOffsetX(double x)
setLabelOffsetX in interface NodeViewx - DOCUMENT ME!public double getLabelOffsetX()
getLabelOffsetX in interface NodeViewpublic void setLabelOffsetY(double y)
setLabelOffsetY in interface NodeViewy - DOCUMENT ME!public double getLabelOffsetY()
getLabelOffsetY in interface NodeViewpublic void setNodeLabelAnchor(int position)
setNodeLabelAnchor in interface NodeViewposition - DOCUMENT ME!public int getNodeLabelAnchor()
getNodeLabelAnchor in interface NodeView
|
www.cytoscape.org | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||