|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.touchgraph.graphlayout.Node
org.ceryle.graph.GraphNode
org.ceryle.graph.tm.TMNode
org.ceryle.graph.tm.ANode
public class ANode
Extends TMNode acting as an Association Node (or A-Node) in a topic map graph.
For binary associations, the 'to' and 'from' TNodes can be set for directedness. The method isDirected() returns true when both are set. If more than two edges are connected to this ANode, isDirected() should return false (this must be managed external to the ANode by nulling one or both of the to and from references).
Because ANodes are meant to represent topic map associations (in this case, Association objects), constructors including Associations use those objects' IDs as the ANode IDs so that retrieving a specific Association from the topic map processor or the ANode representing that association is a matter of referencing either within the topic map or graph (resp.) using the same ID value.
| Field Summary | |
|---|---|
static Color |
COLOR_ASSOC_BORDER
The border color of inactive association nodes. |
static Color |
COLOR_ASSOC_BORDER_SELECT
The border color of selected association nodes. |
static Color |
COLOR_ASSOC_INSTANCEOF
The color of instance-of association nodes. |
static Color |
COLOR_ASSOC_NODE
The color of association nodes. |
static Color |
COLOR_ASSOC_NODE_FIXED
The color of fixed association nodes. |
static Color |
COLOR_ASSOC_NODE_MOUSE_OVER
The color of mouse-over'd association nodes. |
static Color |
COLOR_ASSOC_NODE_REM
The color of an association nodes marked for removal. |
static Color |
COLOR_ASSOC_NODE_SELECT
The color of selected association nodes. |
static Color |
COLOR_ASSOC_NODE_TEXT
The color of text on association nodes. |
static Color |
COLOR_ASSOC_SUBCLASSOF
The color of subclass association nodes. |
static Color |
COLOR_ASSOC_TEMPLATE
The color of association template nodes, i.e., the type of association. |
| Fields inherited from class com.touchgraph.graphlayout.Node |
|---|
BACK_DEFAULT_COLOR, BACK_FIXED_COLOR, BACK_HILIGHT_COLOR, BACK_SELECT_COLOR, backColor, BORDER_DRAG_COLOR, BORDER_INACTIVE_COLOR, BORDER_MOUSE_OVER_COLOR, DEFAULT_TYPE, drawx, drawy, dx, dy, edges, fixed, font, justMadeLocal, lbl, markedForRemoval, massfade, repulsion, simpleDraw, SMALL_TAG_FONT, TEXT_COLOR, TEXT_FONT, textColor, typ, TYPE_CIRCLE, TYPE_ELLIPSE, TYPE_RECTANGLE, TYPE_ROUNDRECT, visible, visibleEdgeCnt, x, y |
| Constructor Summary | |
|---|---|
ANode(Association assoc)
Constructor with an Association assoc. |
|
ANode(Association assoc,
String label)
Constructor with an Association assoc and a String label. |
|
ANode(String id)
Constructor with the required ID id value. |
|
ANode(String id,
String label)
Constructor with the required ID id and label. |
|
| Method Summary | |
|---|---|
GraphEdge |
getEdgeForTNode(TNode tnode)
Return the edge connecting this ANode to the TNode tnode. |
Iterator |
getEdges()
Overrides getEdges() in Node, returning the Edges of this ANode, null if none have been set. |
Edge |
getFrom()
Returns the 'from' Edge of this ANode, null if it has not been set. |
TNode |
getOtherEnd(TNode n)
Returns the other end of this ANode provided with one end, throwing a GraphException if direction is not set. |
Iterator |
getOtherEnds(TNode n)
Returns an Iterator over the "other ends" (i.e., all TNodes connected to this ANode) provided with one end. |
Color |
getPaintBackColor(TGPanel tgPanel)
Overrides Node's method. |
Color |
getPaintBorderColor(TGPanel tgPanel)
Returns the border color of the node, dependent on context. |
Color |
getPaintTextColor(TGPanel tgPanel)
Returns the text color of the node, dependent on context. |
Edge |
getTo()
Returns the 'from' Edge of this ANode, null if it has not been set. |
boolean |
isConnected(TNode n)
Returns true if the provided TNode n is connected to this ANode. |
boolean |
isDirected()
Returns whether or not this ANode is binary directed, ie., whether the TNode references to and from have been set (ie., if both getTo() and getFrom() return non-null values). |
void |
setFrom(Edge edge)
Set the 'from' Edge of this ANode. |
void |
setTo(Edge edge)
Set the 'to' Edge of this ANode. |
| Methods inherited from class org.ceryle.graph.tm.TMNode |
|---|
getTopicMapObject, setFixed, setTopicMapObject |
| Methods inherited from class org.ceryle.graph.GraphNode |
|---|
compareTo, getDefaultNodeFont, getHeight, getHilight, getID, getLabel, getMouseListener, getNodeFont, getVerticalTweak, getVerticalTweak, getWidth, isHidden, isProvisional, jubble, paint, paintNodeBody, paintProvisional, paintSimple, paintSmallTag, setAlternateFont, setHidden, setHilight, setMargin, setMaximumLabelLength, setMouseListener, setNodeTagFont, setNodeTextFont, setProvisional, setSize, setVerticalTweak, toString |
| Methods inherited from class com.touchgraph.graphlayout.Node |
|---|
addEdge, containsPoint, containsPoint, deleteEdges, edgeAt, edgeCount, edgeNum, getBackColor, getFixed, getFont, getLocation, getTextColor, getType, hasEdge, intersects, isFixed, isVisible, removeEdge, setBackColor, setFixed, setFont, setID, setLabel, setLocation, setLocation, setNodeBackDefaultColor, setNodeBackFixedColor, setNodeBackHilightColor, setNodeBackSelectColor, setNodeBorderDragColor, setNodeBorderInactiveColor, setNodeBorderMouseOverColor, setNodeTextColor, setNodeType, setTextColor, setType, setVisible, visibleEdgeCount |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Field Detail |
|---|
public static Color COLOR_ASSOC_NODE
public static Color COLOR_ASSOC_NODE_SELECT
public static Color COLOR_ASSOC_BORDER
public static Color COLOR_ASSOC_BORDER_SELECT
public static Color COLOR_ASSOC_NODE_MOUSE_OVER
public static Color COLOR_ASSOC_NODE_REM
public static Color COLOR_ASSOC_NODE_FIXED
public static Color COLOR_ASSOC_NODE_TEXT
public static Color COLOR_ASSOC_INSTANCEOF
public static Color COLOR_ASSOC_SUBCLASSOF
public static Color COLOR_ASSOC_TEMPLATE
| Constructor Detail |
|---|
public ANode(String id)
throws GraphException
GraphException
public ANode(String id,
String label)
throws GraphException
GraphException
public ANode(Association assoc)
throws GraphException
GraphException
public ANode(Association assoc,
String label)
throws GraphException
GraphException| Method Detail |
|---|
public boolean isDirected()
public void setFrom(Edge edge)
public Edge getFrom()
public void setTo(Edge edge)
public Edge getTo()
public GraphEdge getEdgeForTNode(TNode tnode)
public Iterator getEdges()
Because on ANodes, to and from references may be set instead of adding them to the edges registry, if the registry is empty to and from are checked and an Iterator returned if either reference is non-null.
getEdges in class Node
public TNode getOtherEnd(TNode n)
throws GraphException
T1----from----A1----to----T2
Where n = T1, returns T2.
Where n = T2, returns T1.
Non-TNodes are ignored.
GraphException - if the association is not directed, or if n
is not a connected node in this association
public boolean isConnected(TNode n)
throws GraphException
GraphException
public Iterator getOtherEnds(TNode n)
throws GraphException
GraphExceptionpublic Color getPaintBackColor(TGPanel tgPanel)
getPaintBackColor in class GraphNodepublic Color getPaintBorderColor(TGPanel tgPanel)
getPaintBorderColor in class GraphNodepublic Color getPaintTextColor(TGPanel tgPanel)
getPaintTextColor in class Node
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||