|
Cytoscape 2.8.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cytoscape.render.stateful.NodeDetails
public class NodeDetails
Defines visual properties of a node modulo the node size and location Even though this class is not declared abstract, in most situations it makes sense to override at least some of its methods in order to gain control over node visual properties.
To understand the significance of each method's return value, it makes sense to become familiar with the API cytoscape.render.immed.GraphGraphics.
Field Summary | |
---|---|
static byte |
ANCHOR_CENTER
Specifies that an anchor point lies at the center of a bounding box. |
static byte |
ANCHOR_EAST
Specifies that an anchor point lies on the east edge of a bounding box, halfway between the north and south edges. |
static byte |
ANCHOR_NORTH
Specifies that an anchor point lies on the north edge of a bounding box, halfway between the east and west edges. |
static byte |
ANCHOR_NORTHEAST
Specifies that an anchor point lies on the northeast corner of a bounding box. |
static byte |
ANCHOR_NORTHWEST
Specifies that an anchor point lies on the northwest corner of a bounding box. |
static byte |
ANCHOR_SOUTH
Specifies that an anchor point lies on the south edge of a bounding box, halfway between the east and west edges. |
static byte |
ANCHOR_SOUTHEAST
Specifies that an anchor point lies on the southeast corner of a bounding box. |
static byte |
ANCHOR_SOUTHWEST
Specifies that an anchor point lies on the southwest corner of a bounding box. |
static byte |
ANCHOR_WEST
Specifies that an anchor point lies on the west edge of a bounding box, halfway between the north and south edges. |
static byte |
LABEL_WRAP_JUSTIFY_CENTER
Specifies that the lines in a multi-line node label should each have a center point with similar X coordinate. |
static byte |
LABEL_WRAP_JUSTIFY_LEFT
Specifies that the lines of a multi-line node label should each have a leftmost point with similar X coordinate. |
static byte |
LABEL_WRAP_JUSTIFY_RIGHT
Specifies that the lines of a multi-line node label should each have a rightmost point with similar X coordinate. |
static byte |
MAX_ANCHOR_VAL
Used for range checking the anchor values. |
Constructor Summary | |
---|---|
NodeDetails()
Instantiates node details with defaults. |
Method Summary | |
---|---|
Paint |
borderPaint(int node)
Returns the paint of the border of the node shape. |
float |
borderWidth(int node)
Returns the border width of the node shape. |
Color |
colorLowDetail(int node)
Returns the color of node in low detail rendering mode. |
int |
customGraphicCount(int node)
A thread-safe method returning the number of custom graphics associated with a given Node. |
Iterator<CustomGraphic> |
customGraphics(int node)
Return a non-null, read-only Iterator over all CustomGraphics contained in this Node. |
Object |
customGraphicsLock(int node)
Return the object used for synchronizing custom graphics operations for a given Node. |
Paint |
fillPaint(int node)
Returns the paint of the interior of the node shape. |
TexturePaint |
getNestedNetworkTexturePaint(int node)
Child class should ovrride this method to render correct Nexted Network Image. |
boolean |
getSelected(Integer node)
Used to get selected state of given node. |
float |
graphicOffsetVectorX(int node,
int graphicInx)
Specifies the X component of the vector that separates the location of a rendered graphic from the node's anchor point for that graphic. |
float |
graphicOffsetVectorY(int node,
int graphicInx)
Specifies the Y component of the vector that separates the location of a rendered graphic from the node's anchor point for that graphic. |
int |
labelCount(int node)
Returns the number of labels that this node has. |
Font |
labelFont(int node,
int labelInx)
Returns the font to use when rendering this label. |
byte |
labelJustify(int node,
int labelInx)
By returning one of the LABEL_WRAP_JUSTIFY_* constants, determines how to justify a node label spanning multiple lines. |
byte |
labelNodeAnchor(int node,
int labelInx)
By returning one of the ANCHOR_* constants, specifies where on the node's extents rectangle an anchor point lies. |
float |
labelOffsetVectorX(int node,
int labelInx)
Specifies the X component of the vector that separates a text anchor point from a node anchor point. |
float |
labelOffsetVectorY(int node,
int labelInx)
Specifies the Y component of the vector that separates a text anchor point from a node anchor point. |
Paint |
labelPaint(int node,
int labelInx)
Returns the paint of a text label. |
double |
labelScaleFactor(int node,
int labelInx)
Returns an additional scaling factor that is to be applied to the font used to render this label; this scaling factor, applied to the point size of the font returned by labelFont(node, labelInx), yields a new virtual font that is used to render the text label. |
String |
labelText(int node,
int labelInx)
Returns a label's text. |
byte |
labelTextAnchor(int node,
int labelInx)
By returning one of the ANCHOR_* constants, specifies where on a text label's logical bounds box an anchor point lies. |
double |
labelWidth(int node)
Returns the label width of the node. |
void |
setSelected(Integer node,
Boolean selected)
Used to set selected state of given node. |
byte |
shape(int node)
Returns a GraphGraphics.SHAPE_* constant (or a custom node shape that an instance of GraphGraphics understands); this defines the shape that this node takes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte ANCHOR_CENTER
public static final byte ANCHOR_NORTH
public static final byte ANCHOR_NORTHEAST
public static final byte ANCHOR_EAST
public static final byte ANCHOR_SOUTHEAST
public static final byte ANCHOR_SOUTH
public static final byte ANCHOR_SOUTHWEST
public static final byte ANCHOR_WEST
public static final byte ANCHOR_NORTHWEST
public static final byte MAX_ANCHOR_VAL
public static final byte LABEL_WRAP_JUSTIFY_CENTER
public static final byte LABEL_WRAP_JUSTIFY_LEFT
public static final byte LABEL_WRAP_JUSTIFY_RIGHT
Constructor Detail |
---|
public NodeDetails()
Method Detail |
---|
public Color colorLowDetail(int node)
In low detail rendering mode, this is the only method from this class that is looked at. The rest of the methods in this class define visual properties that are used in full detail rendering mode. In low detail rendering mode translucent colors are not supported whereas in full detail rendering mode they are.
public byte shape(int node)
public Paint fillPaint(int node)
public float borderWidth(int node)
public Paint borderPaint(int node)
public int labelCount(int node)
public String labelText(int node, int labelInx)
To specify multiple lines of text in a node label, simply insert the '\n' character between lines of text.
labelInx
- a value in the range [0, labelCount(node)-1] indicating
which node label in question.public Font labelFont(int node, int labelInx)
labelInx
- a value in the range [0, labelCount(node)-1] indicating
which node label in question.public double labelScaleFactor(int node, int labelInx)
labelInx
- a value in the range [0, labelCount(node)-1] indicating
which node label in question.public Paint labelPaint(int node, int labelInx)
labelInx
- a value in the range [0, labelCount(node)-1] indicating
which node label in question.public byte labelTextAnchor(int node, int labelInx)
By default this method always returns ANCHOR_CENTER. This method is only called by the rendering engine if labelCount(node) returns a value greater than zero.
labelInx
- a value in the range [0, labelCount(node)-1] indicating
which node label in question.ANCHOR_CENTER
,
labelNodeAnchor(int, int)
,
labelOffsetVectorX(int, int)
,
labelOffsetVectorY(int, int)
public byte labelNodeAnchor(int node, int labelInx)
By default this method always returns ANCHOR_CENTER. This method is only called by the rendering engine if labelCount(node) returns a value greater than zero.
labelInx
- a value in the range [0, labelCount(node)-1] indicating
which node label in question.ANCHOR_CENTER
,
labelTextAnchor(int, int)
,
labelOffsetVectorX(int, int)
,
labelOffsetVectorY(int, int)
public float labelOffsetVectorX(int node, int labelInx)
By default this method always returns zero. This method is only called by the rendering engine if labelCount(node) returns a value greater than zero.
labelInx
- a value in the range [0, labelCount(node)-1] indicating
which node label in question.labelOffsetVectorY(int, int)
,
labelTextAnchor(int, int)
,
labelNodeAnchor(int, int)
public float labelOffsetVectorY(int node, int labelInx)
By default this method always returns zero. This method is only called by the rendering engine if labelCount(node) returns a value greater than zero.
labelInx
- a value in the range [0, labelCount(node)-1] indicating
which node label in question.labelOffsetVectorX(int, int)
,
labelTextAnchor(int, int)
,
labelNodeAnchor(int, int)
public byte labelJustify(int node, int labelInx)
By default this method always returns LABEL_WRAP_JUSTIFY_CENTER. This return value is ignored if labelText(node, labelInx) returns a text string that does not span multiple lines.
LABEL_WRAP_JUSTIFY_CENTER
public float graphicOffsetVectorX(int node, int graphicInx)
graphicInx
- a value in the range [0, graphicCount(node)-1]
indicating which node graphic in question.graphicOffsetVectorY(int, int)
,
#graphicNodeAnchor(int, int)
public float graphicOffsetVectorY(int node, int graphicInx)
graphicInx
- a value in the range [0, graphicCount(node)-1]
indicating which node graphic in question.graphicOffsetVectorX(int, int)
,
#graphicNodeAnchor(int, int)
public int customGraphicCount(int node)
customGraphics(int)
public Iterator<CustomGraphic> customGraphics(int node)
UnsupportedOperationException
- if an attempt is made to use the Iterator's remove() method.customGraphicsLock(int)
public Object customGraphicsLock(int node)
NodeDetails nd = ...; synchronized (nd.customGraphicsLock(node)) { IteratorNOTE: This method should be abstract, but since it isn't, any real use should override this method in a subclass.dNodeIt = nodeDetails.customGraphics (node); CustomGraphic cg = null; while (dNodeIt.hasNext()) { cg = dNodeIt.next(); // DO STUFF WITH cg HERE. } }
public void setSelected(Integer node, Boolean selected)
node
- Integerselected
- Booleanpublic boolean getSelected(Integer node)
public double labelWidth(int node)
public TexturePaint getNestedNetworkTexturePaint(int node)
node
-
|
Cytoscape 2.8.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |