|
Cytoscape 2.6.2 (c) 2006,2007 ISB, MSKCC, UCSD | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ding.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 NodeView
public Node getNode()
getNode
in interface NodeView
public int getGraphPerspectiveIndex()
getGraphPerspectiveIndex
in interface NodeView
public int getRootGraphIndex()
getRootGraphIndex
in interface NodeView
public List getEdgeViewsList(NodeView otherNodeView)
getEdgeViewsList
in interface NodeView
otherNodeView
- DOCUMENT ME!
public int getShape()
getShape
in interface NodeView
public void setSelectedPaint(Paint paint)
setSelectedPaint
in interface NodeView
paint
- DOCUMENT ME!public Paint getSelectedPaint()
getSelectedPaint
in interface NodeView
public void setUnselectedPaint(Paint paint)
setUnselectedPaint
in interface NodeView
paint
- DOCUMENT ME!public Paint getUnselectedPaint()
getUnselectedPaint
in interface NodeView
public void setBorderPaint(Paint paint)
setBorderPaint
in interface NodeView
paint
- DOCUMENT ME!public Paint getBorderPaint()
getBorderPaint
in interface NodeView
public void setBorderWidth(float width)
setBorderWidth
in interface NodeView
width
- DOCUMENT ME!public float getBorderWidth()
getBorderWidth
in interface NodeView
public void setBorder(Stroke stroke)
setBorder
in interface NodeView
stroke
- DOCUMENT ME!public Stroke getBorder()
getBorder
in interface NodeView
public void setTransparency(float trans)
setTransparency
in interface NodeView
trans
- DOCUMENT ME!public float getTransparency()
getTransparency
in interface NodeView
public boolean setWidth(double width)
setWidth
in interface NodeView
width
- DOCUMENT ME!
public double getWidth()
getWidth
in interface NodeView
public boolean setHeight(double height)
setHeight
in interface NodeView
height
- DOCUMENT ME!
public double getHeight()
getHeight
in interface NodeView
public Label getLabel()
getLabel
in interface NodeView
public int getDegree()
getDegree
in interface NodeView
public void setOffset(double x, double y)
setOffset
in interface NodeView
x
- DOCUMENT ME!y
- DOCUMENT ME!public Point2D getOffset()
getOffset
in interface NodeView
public void setXPosition(double xPos)
setXPosition
in interface NodeView
xPos
- DOCUMENT ME!public void setXPosition(double xPos, boolean update)
setXPosition
in interface NodeView
xPos
- DOCUMENT ME!update
- DOCUMENT ME!public double getXPosition()
getXPosition
in interface NodeView
NodeView.setXPosition(double)
public void setYPosition(double yPos)
setYPosition
in interface NodeView
yPos
- DOCUMENT ME!public void setYPosition(double yPos, boolean update)
setYPosition
in interface NodeView
yPos
- DOCUMENT ME!update
- DOCUMENT ME!public double getYPosition()
getYPosition
in interface NodeView
NodeView.setYPosition(double)
public void setNodePosition(boolean animate)
setNodePosition
in interface NodeView
animate
- DOCUMENT ME!public void select()
select
in interface NodeView
public void unselect()
unselect
in interface NodeView
public boolean isSelected()
isSelected
in interface NodeView
public boolean setSelected(boolean selected)
setSelected
in interface NodeView
selected
- DOCUMENT ME!
public void setShape(int shape)
setShape
in interface NodeView
shape
- DOCUMENT ME!public void setToolTip(String tip)
setToolTip
in interface NodeView
tip
- DOCUMENT ME!public String getToolTip()
public void setPositionHint(int position)
position
- DOCUMENT ME!public Paint getTextPaint()
getTextPaint
in interface Label
public void setTextPaint(Paint textPaint)
setTextPaint
in interface Label
textPaint
- DOCUMENT ME!public double getGreekThreshold()
getGreekThreshold
in interface Label
public void setGreekThreshold(double threshold)
setGreekThreshold
in interface Label
threshold
- DOCUMENT ME!public String getText()
getText
in interface Label
public void setText(String text)
setText
in interface Label
text
- DOCUMENT ME!public Font getFont()
getFont
in interface Label
public void setFont(Font font)
setFont
in interface Label
font
- 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)
,
CustomGraphic
public 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.CustomGraphic
public 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()) { IteratorNOTE: 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.cgIt = dnv.customGraphicIterator(); while (cgIt.hasNext()) { cg = cgIt.next(); // PERFORM your operations here. } }
@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 Label
position
- DOCUMENT ME!public int getTextAnchor()
getTextAnchor
in interface Label
public void setJustify(int justify)
setJustify
in interface Label
justify
- DOCUMENT ME!public int getJustify()
getJustify
in interface Label
public void setLabelOffsetX(double x)
setLabelOffsetX
in interface NodeView
x
- DOCUMENT ME!public double getLabelOffsetX()
getLabelOffsetX
in interface NodeView
public void setLabelOffsetY(double y)
setLabelOffsetY
in interface NodeView
y
- DOCUMENT ME!public double getLabelOffsetY()
getLabelOffsetY
in interface NodeView
public void setNodeLabelAnchor(int position)
setNodeLabelAnchor
in interface NodeView
position
- 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 |