com.touchgraph.graphlayout
public class Node extends Object
Modifier and Type | Field and Description |
---|---|
Color |
BACK_DEFAULT_COLOR |
Color |
BACK_FIXED_COLOR |
Color |
BACK_HILIGHT_COLOR |
Color |
BACK_JML_COLOR |
Color |
BACK_MRF_COLOR |
Color |
BACK_SELECT_COLOR |
protected Color |
backColor |
Color |
BORDER_DRAG_COLOR |
Color |
BORDER_INACTIVE_COLOR |
Color |
BORDER_MOUSE_OVER_COLOR |
static int |
DEFAULT_TYPE |
double |
drawx |
double |
drawy |
protected double |
dx |
protected double |
dy |
protected boolean |
fixed |
protected Font |
font |
protected FontMetrics |
fontMetrics |
boolean |
justMadeLocal |
protected String |
lbl |
boolean |
markedForRemoval |
double |
massfade |
protected int |
repulsion |
static Font |
SMALL_TAG_FONT |
Color |
TEXT_COLOR |
static Font |
TEXT_FONT |
protected Color |
textColor |
protected int |
typ
an int indicating the Node type.
|
static int |
TYPE_CIRCLE
This Node's type is a Circle.
|
static int |
TYPE_ELLIPSE
This Node's type is an Ellipse.
|
static int |
TYPE_RECTANGLE
This Node's type is a Rectangle.
|
static int |
TYPE_ROUNDRECT
This Node's type is a Round Rectangle.
|
protected boolean |
visible |
int |
visibleEdgeCnt |
double |
x |
double |
y |
Constructor and Description |
---|
Node()
Minimal constructor which will generate an ID value from Java's Date class.
|
Node(String id)
Constructor with the required ID id, using defaults
for type (rectangle), color (a static variable from TGPanel).
|
Node(String id,
int type,
Color color,
String label)
Constructor with a String ID id, an int type, Background Color bgColor,
and a String label.
|
Node(String id,
String label)
Constructor with Strings for ID id and label, using defaults
for type (rectangle) and color (a static variable from TGPanel).
|
Modifier and Type | Method and Description |
---|---|
void |
addEdge(Edge edge)
Add the Edge edge to the graph.
|
boolean |
containsPoint(double px,
double py)
Returns true if this Node contains the Point px,py.
|
boolean |
containsPoint(Point p)
Returns true if this Node contains the Point p.
|
Edge |
edgeAt(int index)
Return the Edge at int index.
|
int |
edgeCount()
Return the number of Edges in the cumulative Vector.
|
int |
edgeNum()
Deprecated.
this method has been replaced by the edgeCount() method.
|
Color |
getBackColor()
Return the background color of this Node as a Color.
|
boolean |
getFixed()
Returns true if this Node is fixed (in place).
|
Font |
getFont()
Returns the font of this Node as a Font
|
int |
getHeight()
Return the height of this Node.
|
String |
getID()
Return the ID of this Node as a String.
|
String |
getLabel()
Return the label of this Node as a String.
|
Point |
getLocation()
Return the location of this Node as a Point.
|
Color |
getPaintBackColor(TGPanel tgPanel) |
Color |
getPaintBorderColor(TGPanel tgPanel) |
Color |
getPaintTextColor(TGPanel tgPanel) |
Color |
getTextColor()
Return the text color of this Node as a Color.
|
int |
getType()
Return the type of this Node as an int.
|
String |
getURL() |
int |
getWidth()
Return the width of this Node.
|
boolean |
intersects(Dimension d)
Returns true if this Node intersects Dimension d.
|
boolean |
isVisible()
Return the visibility of this Node as a boolean.
|
void |
paint(Graphics g,
TGPanel tgPanel)
Paints the Node.
|
void |
paintNodeBody(Graphics g,
TGPanel tgPanel)
Paints the background of the node, along with its label
|
void |
paintSmallTag(Graphics g,
TGPanel tgPanel,
int tagX,
int tagY,
Color backCol,
Color textCol,
char character)
Paints a tag with containing a character in a small font.
|
void |
removeEdge(Edge edge)
Remove the Edge edge from the graph.
|
void |
setBackColor(Color bgColor)
Set the background color of this Node to the Color bgColor.
|
void |
setFixed(boolean fixed)
Set the fixed status of this Node to the boolean fixed.
|
void |
setFont(Font font)
Set the font of this Node to the Font font.
|
void |
setID(String id)
Set the ID of this Node to the String id.
|
void |
setLabel(String label)
Set the label of this Node to the String label.
|
void |
setLocation(Point p)
Set the location of this Node provided the Point p.
|
void |
setNodeBackDefaultColor(Color color) |
void |
setNodeBackFixedColor(Color color) |
void |
setNodeBackHilightColor(Color color) |
void |
setNodeBackSelectColor(Color color) |
void |
setNodeBorderDragColor(Color color) |
void |
setNodeBorderInactiveColor(Color color) |
void |
setNodeBorderMouseOverColor(Color color) |
void |
setNodeTextColor(Color color) |
void |
setNodeTextFont(Font font) |
void |
setNodeType(int type) |
void |
setTextColor(Color txtColor)
Set the text color of this Node to the Color txtColor.
|
void |
setType(int type)
Set the type of this Node to the int type.
|
void |
setURL(String strUrl) |
void |
setVisible(boolean v)
Set the visibility of this Node to the boolean v.
|
int |
visibleEdgeCount()
Returns the local Edge count.
|
public static final int TYPE_RECTANGLE
public static final int TYPE_ROUNDRECT
public static final int TYPE_ELLIPSE
public static final int TYPE_CIRCLE
public static final Font SMALL_TAG_FONT
public Color BACK_FIXED_COLOR
public Color BACK_SELECT_COLOR
public Color BACK_DEFAULT_COLOR
public Color BACK_HILIGHT_COLOR
public Color BACK_MRF_COLOR
public Color BACK_JML_COLOR
public Color BORDER_DRAG_COLOR
public Color BORDER_MOUSE_OVER_COLOR
public Color BORDER_INACTIVE_COLOR
public Color TEXT_COLOR
public static Font TEXT_FONT
public static int DEFAULT_TYPE
protected int typ
TYPE_RECTANGLE
,
TYPE_ROUNDRECT
,
TYPE_ELLIPSE
public double drawx
public double drawy
protected FontMetrics fontMetrics
protected Font font
protected String lbl
protected Color backColor
protected Color textColor
public double x
public double y
public double massfade
protected double dx
protected double dy
protected boolean fixed
protected int repulsion
public boolean justMadeLocal
public boolean markedForRemoval
public int visibleEdgeCnt
protected boolean visible
public Node()
public Node(String id)
public Node(String id, String label)
public void setNodeBackFixedColor(Color color)
public void setNodeBackSelectColor(Color color)
public void setNodeBackDefaultColor(Color color)
public void setNodeBackHilightColor(Color color)
public void setNodeBorderDragColor(Color color)
public void setNodeBorderMouseOverColor(Color color)
public void setNodeBorderInactiveColor(Color color)
public void setNodeTextColor(Color color)
public void setNodeTextFont(Font font)
public void setNodeType(int type)
public void setID(String id)
public String getID()
public void setLocation(Point p)
public Point getLocation()
public void setVisible(boolean v)
public boolean isVisible()
public void setType(int type)
TYPE_RECTANGLE
,
TYPE_ROUNDRECT
,
TYPE_ELLIPSE
,
TYPE_CIRCLE
public int getType()
TYPE_RECTANGLE
,
TYPE_ROUNDRECT
,
TYPE_ELLIPSE
,
TYPE_CIRCLE
public void setFont(Font font)
public Font getFont()
public void setBackColor(Color bgColor)
public Color getBackColor()
public void setTextColor(Color txtColor)
public Color getTextColor()
public void setLabel(String label)
public String getLabel()
public void setFixed(boolean fixed)
public boolean getFixed()
public int edgeNum()
public int edgeCount()
public int visibleEdgeCount()
public Edge edgeAt(int index)
public void addEdge(Edge edge)
public void removeEdge(Edge edge)
public int getWidth()
public int getHeight()
public boolean intersects(Dimension d)
public boolean containsPoint(double px, double py)
public boolean containsPoint(Point p)
public void paintNodeBody(Graphics g, TGPanel tgPanel)
public void paintSmallTag(Graphics g, TGPanel tgPanel, int tagX, int tagY, Color backCol, Color textCol, char character)
public String getURL()
public void setURL(String strUrl)