|
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.EdgeDetails
public class EdgeDetails
Defines the visual properties of an edge. Even though this class is not declared abstract, in most situations it makes sense to override at least some of its methods (especially segmentThickness()) in order to gain control over edge 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 |
EDGE_ANCHOR_MIDPOINT
Specifies that an anchor point lies at the midpoint of an edge. |
static byte |
EDGE_ANCHOR_SOURCE
Specifies that an anchor point lies at an edge's endpoint at source node. |
static byte |
EDGE_ANCHOR_TARGET
Specifies that an anchor point lies at an edge's endpoint at target node. |
Constructor Summary | |
---|---|
EdgeDetails()
Instantiates edge details with defaults. |
Method Summary | |
---|---|
Paint |
anchorPaint(int edge,
int anchorInx)
Returns the paint to use when rendering an edge anchor. |
EdgeAnchors |
anchors(int edge)
Returns edge anchors to use when rendering this edge. |
float |
anchorSize(int edge,
int anchorInx)
For edges with anchors, the anchors can be rendered as squares. |
Color |
colorLowDetail(int edge)
Returns the color of edge in low detail rendering mode. |
int |
labelCount(int edge)
Returns the number of labels that this edge has. |
byte |
labelEdgeAnchor(int edge,
int labelInx)
By returning one of the EDGE_ANCHOR_* constants, specifies where on an edge an anchor point lies. |
Font |
labelFont(int edge,
int labelInx)
Returns the font to use when rendering this label. |
byte |
labelJustify(int edge,
int labelInx)
By returning one of the NodeDetails.LABEL_WRAP_JUSTIFY_* constants, determines how to justify an edge label spanning multiple lines. |
float |
labelOffsetVectorX(int edge,
int labelInx)
Specifies the X component of the vector that separates a text anchor point from an edge anchor point. |
float |
labelOffsetVectorY(int edge,
int labelInx)
Specifies the Y component of the vector that separates a text anchor point from an edge anchor point. |
Paint |
labelPaint(int edge,
int labelInx)
Returns the paint of a text label. |
double |
labelScaleFactor(int edge,
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(edge, labelInx), yields a new virtual font that is used to render the text label. |
String |
labelText(int edge,
int labelInx)
Returns a label's text. |
byte |
labelTextAnchor(int edge,
int labelInx)
By returning one of the NodeDetails.ANCHOR_* constants, specifies where on a text label's logical bounds box an anchor point lies. |
double |
labelWidth(int edge)
Returns the width of the label. |
Paint |
segmentPaint(int edge)
Returns the paint of the edge segment. |
Stroke |
segmentStroke(int edge)
|
float |
segmentThickness(int edge)
Returns the thickness of the edge segment. |
byte |
sourceArrow(int edge)
Returns a GraphGraphics.ARROW_* constant; this defines the arrow to use when rendering the edge endpoint touching source node. |
Paint |
sourceArrowPaint(int edge)
Returns the paint of the arrow at edge endpoint touching source node. |
float |
sourceArrowSize(int edge)
Returns the size of the arrow at edge endpoint touching source node. |
byte |
targetArrow(int edge)
Returns a GraphGraphics.ARROW_* constant; this defines the arrow to use when rendering the edge endpoint at the target node. |
Paint |
targetArrowPaint(int edge)
Returns the paint of the arrow at edge endpoint touching target node. |
float |
targetArrowSize(int edge)
Returns the size of the arrow at edge endpoint touching target node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte EDGE_ANCHOR_MIDPOINT
public static final byte EDGE_ANCHOR_SOURCE
public static final byte EDGE_ANCHOR_TARGET
Constructor Detail |
---|
public EdgeDetails()
Method Detail |
---|
public Color colorLowDetail(int edge)
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 sourceArrow(int edge)
public float sourceArrowSize(int edge)
public Paint sourceArrowPaint(int edge)
public byte targetArrow(int edge)
public float targetArrowSize(int edge)
public Paint targetArrowPaint(int edge)
public EdgeAnchors anchors(int edge)
The anchors returned are interpreted such that the anchor at index zero (the "first" anchor) is the anchor next to the source node of this edge; the last anchor is the anchor next to the target node of this edge. The rendering engine works such that if the first anchor lies inside the source node shape or if the last anchor lies inside the target node shape, the edge is not rendered.
public float anchorSize(int edge, int anchorInx)
public Paint anchorPaint(int edge, int anchorInx)
public float segmentThickness(int edge)
public Stroke segmentStroke(int edge)
public Paint segmentPaint(int edge)
public int labelCount(int edge)
public String labelText(int edge, int labelInx)
To specify multiple lines of text in an edge label, simply insert the '\n' character between lines of text.
labelInx
- a value in the range [0, labelCount(edge)-1] indicating
which edge label in question.public Font labelFont(int edge, int labelInx)
labelInx
- a value in the range [0, labelCount(edge)-1] indicating
which edge label in question.public double labelScaleFactor(int edge, int labelInx)
labelInx
- a value in the range [0, labelCount(edge)-1] indicating
which edge label in question.public Paint labelPaint(int edge, int labelInx)
labelInx
- a value in the range [0, labelCount(edge)-1] indicating
which edge label in question.public byte labelTextAnchor(int edge, int labelInx)
By default this method always returns NodeDetails.ANCHOR_CENTER. This method is only called by the rendering engine if labelCount(edge) returns a value greater than zero.
labelInx
- a value in the range [0, labelCount(edge)-1] indicating
which edge label in question.NodeDetails.ANCHOR_CENTER
,
labelEdgeAnchor(int, int)
,
labelOffsetVectorX(int, int)
,
labelOffsetVectorY(int, int)
public byte labelEdgeAnchor(int edge, int labelInx)
By default this method always returns EDGE_ANCHOR_MIDPOINT. This method is only called by the rendering engine if labelCount(edge) returns a value greater than zero.
labelInx
- a value in the range [0, labelCount(edge)-1] indicating
which edge label in question.EDGE_ANCHOR_MIDPOINT
,
labelTextAnchor(int, int)
,
labelOffsetVectorX(int, int)
,
labelOffsetVectorY(int, int)
public float labelOffsetVectorX(int edge, int labelInx)
By default this method always returns zero. This method is only called by the rendering engine if labelCount(edge) returns a value greater than zero.
labelInx
- a value in the range [0, labelCount(edge)-1] indicating
which edge label in question.labelOffsetVectorY(int, int)
,
labelTextAnchor(int, int)
,
labelEdgeAnchor(int, int)
public float labelOffsetVectorY(int edge, int labelInx)
By default this method always returns zero. This method is only called by the rendering engine if labelCount(edge) returns a value greater than zero.
labelInx
- a value in the range [0, labelCount(edge)-1] indicating
which edge label in question.labelOffsetVectorX(int, int)
,
labelTextAnchor(int, int)
,
labelEdgeAnchor(int, int)
public byte labelJustify(int edge, int labelInx)
By default this method always returns NodeDetails.LABEL_WRAP_JUSTIFY_CENTER. This return value is ignored if labelText(edge, labelInx) returns a text string that does not span multiple lines.
NodeDetails.LABEL_WRAP_JUSTIFY_CENTER
public double labelWidth(int edge)
|
Cytoscape 2.8.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |