|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.ucla.stat.SOCR.touchgraph.graphlayout.Edge
public class Edge
Edge.
Field Summary | |
---|---|
protected java.awt.Color |
col
|
static java.awt.Color |
DEFAULT_COLOR
|
static int |
DEFAULT_LENGTH
|
Node |
from
|
static java.awt.Color |
HIGHLIGHT_COLOR
|
protected boolean |
highlighted
|
protected java.lang.String |
id
|
protected int |
length
|
static java.awt.Color |
MOUSE_OVER_COLOR
|
static java.awt.Color |
SELECT_COLOR
|
Node |
to
|
protected boolean |
visible
|
Constructor Summary | |
---|---|
Edge(Node f,
Node t)
Constructor with two Nodes, which uses a default length. |
|
Edge(Node f,
Node t,
int len)
Constructor with two Nodes and a length. |
Method Summary | |
---|---|
boolean |
containsPoint(double px,
double py)
|
double |
distFromPoint(double px,
double py)
|
java.awt.Color |
getColor()
Returns the color of this edge as Color. |
Node |
getFrom()
Returns the starting "from" node of this edge as Node. |
java.lang.String |
getID()
Returns the ID of this Edge as a String. |
int |
getLength()
Returns the length of this Edge as a double. |
Node |
getOtherEndpt(Node n)
|
Node |
getTo()
Returns the terminating "to" node of this edge as Node. |
boolean |
intersects(java.awt.Dimension d)
|
boolean |
isVisible()
Return the visibility of this Edge as a boolean. |
void |
paint(java.awt.Graphics g,
TGPanel tgPanel)
|
static void |
paintArrow(java.awt.Graphics g,
int x1,
int y1,
int x2,
int y2,
java.awt.Color c)
|
void |
reverse()
Switches the endpoints of the edge |
void |
setColor(java.awt.Color color)
Set the color of this Edge to the Color color. |
static void |
setEdgeDefaultColor(java.awt.Color color)
|
static void |
setEdgeDefaultLength(int length)
|
static void |
setEdgeMouseOverColor(java.awt.Color color)
|
void |
setHighlighted(boolean flag)
|
void |
setID(java.lang.String id)
Set the ID of this Edge to the String id. |
void |
setLength(int len)
Set the length of this Edge to the int len. |
void |
setVisible(boolean v)
Set the visibility of this Edge to the boolean v. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.awt.Color DEFAULT_COLOR
public static java.awt.Color HIGHLIGHT_COLOR
public static java.awt.Color SELECT_COLOR
public static java.awt.Color MOUSE_OVER_COLOR
public static int DEFAULT_LENGTH
public Node from
public Node to
protected java.awt.Color col
protected int length
protected boolean visible
protected java.lang.String id
protected boolean highlighted
Constructor Detail |
---|
public Edge(Node f, Node t, int len)
public Edge(Node f, Node t)
Method Detail |
---|
public static void setEdgeDefaultColor(java.awt.Color color)
public static void setEdgeMouseOverColor(java.awt.Color color)
public static void setEdgeDefaultLength(int length)
public Node getFrom()
public Node getTo()
public java.awt.Color getColor()
public void setColor(java.awt.Color color)
public java.lang.String getID()
public void setID(java.lang.String id)
public int getLength()
public void setLength(int len)
public void setHighlighted(boolean flag)
public void setVisible(boolean v)
public boolean isVisible()
public Node getOtherEndpt(Node n)
public void reverse()
public boolean intersects(java.awt.Dimension d)
public double distFromPoint(double px, double py)
public boolean containsPoint(double px, double py)
public static void paintArrow(java.awt.Graphics g, int x1, int y1, int x2, int y2, java.awt.Color c)
public void paint(java.awt.Graphics g, TGPanel tgPanel)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |