|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.touchgraph.graphlayout.Edge
org.ceryle.graph.GraphEdge
public class GraphEdge
Extends Edge, providing the
additional ability to set edge direction. This also uses a
drawing algorithm for directed edges based on drawing a triangle
rather than the superclass's rather more brute force method of
drawing 17 overlapping lines. On platforms that do not have a
math coprocessor, the brute force method may be faster.
| Field Summary | |
|---|---|
static int |
ALEN
|
static int |
ALEN2
|
static int |
ARROW_FORWARD
A constant indicating an arrow-headed Edge. |
static int |
ARROW_MULTIPLIER
The length of arrow-style edges is determined by a multiplier upon the default length. |
static int |
ARROW_WIDTH
The width of half an arrowhead. |
protected AffineTransform |
at
The AffineTransform used to rotate arrowheads. |
static Color |
COLOR_EDGE
The default color of edges. |
static Color |
COLOR_EDGE_ARROW
The default color of arrowhead style edges. |
static Color |
COLOR_EDGE_DOWNSTREAM
The default color of "downstream"-hilighted edges. |
static Color |
COLOR_EDGE_FROM
The color of a 'from' directed edge. |
static Color |
COLOR_EDGE_MOUSE_OVER
The default color of mouse-over'd edges. |
static Color |
COLOR_EDGE_TO
The color of a 'to' directed edge. |
static Color |
COLOR_EDGE_UPSTREAM
The default color of "upstream"-hilighted edges. |
static int |
DEFAULT_ARROW_LENGTH
The default length of arrowhead style edges. |
static int |
DEFAULT_LENGTH
Overrides the default value from Edge (setting the default slightly lower so that the multiplier has greater range (altered from 40 to 20). |
static int |
DIRECTED_FROM
A constant indicating a reverse directed ("from") Edge. |
static int |
DIRECTED_TO
A constant indicating a forward directed ("to") Edge. |
protected boolean |
hidden
Hidden status of this GraphEdge. |
protected int |
m_style
The drawing style of this Edge (DIRECTED_TO, DIRECTED_FROM, ARROW_FORWARD, or UNDIRECTED). |
static boolean |
reflexiveTO
When true (the default) uses two 'To' roles instead of two 'From' roles to indicate a reflexive relation. |
protected AffineTransform |
saveAt
The AffineTransform used to save current state. |
static int |
SIMPLE
A constant indicating an Edge using a simple, undirected line. |
static BasicStroke |
stroke2
|
static BasicStroke |
stroke3
|
static boolean |
suppressDirectedEdges
A static variable indicating whether or not to suppress drawing of directed edges (for the sake of simplicity and/or performance). |
static int |
UNDIRECTED
A constant indicating an undirected Edge. |
static BasicStroke |
widestroke
|
| Fields inherited from class com.touchgraph.graphlayout.Edge |
|---|
arrowForward, col, DEFAULT_COLOR, from, HILIGHT_COLOR, id, length, MOUSE_OVER_COLOR, simpleDraw, to, visible |
| Constructor Summary | |
|---|---|
GraphEdge(Node f,
Node t)
Constructor for an undirected edge with two Nodes and a default length. |
|
GraphEdge(Node f,
Node t,
int directed)
Constructor with two Nodes (using a default length) and edge direction. |
|
GraphEdge(Node f,
Node t,
int len,
int directed)
Constructor with two Nodes, a length, and edge direction. |
|
| Method Summary | |
|---|---|
Object |
clone()
Clones and returns a copy of this edge. |
int |
getDirection()
Returns the direction of this edge as an int. |
double[] |
getMidPoint()
Returns the bisecting point on the edge's line. |
boolean |
isDirected()
Returns the directedness of this edge as an boolean, true if directed, false if undirected. |
static boolean |
isDirected(int d1,
int d2)
Returns true if the two supplied directions indicate a directed relation. |
boolean |
isHidden()
Returns the hidden status of this GraphEdge. |
static boolean |
isReflexive(int d1,
int d2)
Returns true if the two supplied directions indicate a reflexive relation. |
void |
paint(Graphics g,
TGPanel tgPanel)
|
void |
paintArrow(Graphics g,
int x1,
int y1,
int x2,
int y2,
Color c,
int dir)
Overrides the method in Edge, following edge direction d. |
void |
setDirected(int directed)
Set the directedness style of this edge to the int directed, as well as setting the edge color based on direction. |
void |
setHidden(boolean hidden)
Sets the hidden status of this GraphEdge to the boolean hidden. |
int |
swapDirection()
If this is a directed edge, this swaps its direction, returning the new direction. |
| Methods inherited from class com.touchgraph.graphlayout.Edge |
|---|
containsPoint, distFromPoint, getColor, getFrom, getID, getLength, getOtherEndpt, getTo, intersects, isVisible, paintArrow, reverse, setColor, setEdgeDefaultColor, setEdgeDefaultLength, setEdgeMouseOverColor, setID, setLength, setVisible |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static boolean suppressDirectedEdges
public static boolean reflexiveTO
public static final int UNDIRECTED
public static final int DIRECTED_TO
public static final int DIRECTED_FROM
public static final int ARROW_FORWARD
DIRECTED_TO.
public static final int SIMPLE
protected boolean hidden
public static Color COLOR_EDGE
public static Color COLOR_EDGE_TO
public static Color COLOR_EDGE_FROM
public static Color COLOR_EDGE_MOUSE_OVER
public static Color COLOR_EDGE_DOWNSTREAM
public static Color COLOR_EDGE_UPSTREAM
public static Color COLOR_EDGE_ARROW
public static int ARROW_MULTIPLIER
public static int DEFAULT_LENGTH
public static int DEFAULT_ARROW_LENGTH
public static int ARROW_WIDTH
protected int m_style
public static final BasicStroke stroke2
public static final BasicStroke stroke3
public static final BasicStroke widestroke
protected AffineTransform at
protected AffineTransform saveAt
public static final int ALEN
public static final int ALEN2
| Constructor Detail |
|---|
public GraphEdge(Node f,
Node t)
public GraphEdge(Node f,
Node t,
int directed)
public GraphEdge(Node f,
Node t,
int len,
int directed)
| Method Detail |
|---|
public static boolean isDirected(int d1,
int d2)
public static boolean isReflexive(int d1,
int d2)
public boolean isDirected()
public int getDirection()
public int swapDirection()
Edge, except it
only makes a change if the edge is directed and also
correctly updates the edge color.
public void setDirected(int directed)
public boolean isHidden()
public Object clone()
clone in class Objectpublic void setHidden(boolean hidden)
public double[] getMidPoint()
public void paint(Graphics g,
TGPanel tgPanel)
paint in class Edge
public void paintArrow(Graphics g,
int x1,
int y1,
int x2,
int y2,
Color c,
int dir)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||