|
|||||||||
| 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.TNode
public class TNode
An extension of com.touchgraph.graphlayout.Node for display of a Topic Map node. Additionally, nodes that contain temporal extents may be displayed as a horizontally-oriented timeline. Other Nodes having a temporal extent can be aligned according to the timeline, after turning off TouchGraph's rubber-banding (by fixing the nodes) and hiding their edges or causing them to appear as without horizontal vectors (ie., as vertical lines).
Because TNodes are meant to represent topic map topics (in this case, Topic objects), constructors including Topics use those objects' IDs as the TNode IDs so that retrieving a specific Topic from the topic map processor or the TNode representing that topic is a matter of referencing either within the topic map or graph (resp.) using the same ID value.
If temporal extents have not been set, getStart() and getEnd()
return the Date constant TimeLine.TIME_NOT_SET
(see TimeLine.TIME_NOT_SET).
Note: that the timeline code is currently commented out.
GraphNode,
TMNode,
TimeLine| Field Summary | |
|---|---|
protected int[] |
b
|
static Color |
COLOR_EARMARK
|
static Color |
COLOR_EARMARK_B
|
static Color |
COLOR_EARMARK_E
|
static Color |
COLOR_NEEDLE
|
static Color |
COLOR_OCCUR_COUNT
|
static Color |
COLOR_TIMELINE
|
static Color |
COLOR_TIMELINE_MASK
|
static Color |
COLOR_TOPIC_BORDER
The border color of inactive topic nodes. |
static Color |
COLOR_TOPIC_BORDER_OUTLINE
The outline color of selected topic nodes. |
static Color |
COLOR_TOPIC_BORDER_SELECT
The border color of selected topic nodes. |
static Color |
COLOR_TOPIC_BORDER_SELECT_MOUSE_OVER
|
static Color |
COLOR_TOPIC_COMPONENT
The color of topic nodes whose type indicates that they are document components. |
static Color |
COLOR_TOPIC_COMPONENT_B
|
static Color |
COLOR_TOPIC_COMPONENT_D
|
static Color |
COLOR_TOPIC_COMPONENT_MOUSE_OVER
The color of mouse-over'd document component nodes. |
static Color |
COLOR_TOPIC_COMPONENT_SELECT
The color of topic nodes' text whose type indicates that they are document components. |
static Color |
COLOR_TOPIC_COMPONENT_TEXT
The color of topic nodes' text whose type indicates that they are document components. |
static Color |
COLOR_TOPIC_NODE
The color of topic nodes. |
static Color |
COLOR_TOPIC_NODE_B
|
static Color |
COLOR_TOPIC_NODE_D
|
static Color |
COLOR_TOPIC_NODE_FIXED
The color of fixed topic nodes. |
static Color |
COLOR_TOPIC_NODE_MOUSE_OVER
The color of mouse-over'd topic nodes. |
static Color |
COLOR_TOPIC_NODE_REM
The color of a topic nodes marked for removal. |
static Color |
COLOR_TOPIC_NODE_TEXT
The color of text on topic nodes. |
static Color |
COLOR_TOPIC_NODE_TIMELINE
The color of timeline nodes. |
static Color |
COLOR_VERNIER_BASE
|
static Color |
COLOR_VERNIER_DARK
|
static Color |
COLOR_VERNIER_TINT
|
static Color |
COLOR_VERNIER_WINDOW
|
static Color |
COLOR_VERNIER_WINDOW_TINT
|
static boolean |
colorAsFlag
A boolean controlling whether custom colors should be painted as a small tab or flag (when true) or as the entire node background (when false). |
protected boolean |
component
True if the type of the Topic of this TNode indicates it is a document component. |
protected long |
endDate
Temporal end extent stored internally as a long. |
protected Color |
flag
The Color tab or 'flag' indicating a color label. |
protected Color |
flagHilight
|
boolean |
ignoreMe
When true, the TNode is ignored by the layout. |
protected int |
occurCount
Topic occurrence count. |
boolean |
paintOccurrences
A boolean indicating whether the occurrence count should be displayed. |
protected int[] |
pox
|
protected int[] |
poy
|
float |
score
Topic match score. |
protected long |
startDate
Temporal start extent stored internally as a long. |
protected static int |
textHeight
Default text height, in pixels (default is 16; substitute for fontmetrics). |
int |
tl_h
An int storing the calculated width of the Node ('h' is the height). |
int |
tl_w
An int storing the calculated width of the Node ('h' is the height). |
| 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 | |
|---|---|
TNode(String id)
Constructor with the required ID id value. |
|
TNode(String id,
String label)
Constructor with the required ID id and label. |
|
TNode(TopicMapObject tmo,
Locator locator,
String id,
String label)
Primary constructor for a TNode, provided with a TopicMapObject tmo, a Locator locator for the external link, an optional ID String id, and optional String label. |
|
TNode(TopicMapObject tmo,
String id,
String label)
Constructor with an Topic topic and Strings for ID id and label. |
|
TNode(Topic topic,
String label)
Constructor with an Topic topic, and a String used as its label. |
|
| Method Summary | |
|---|---|
Color |
getBackColor()
Overrides Node's method to return the background color, ignoring fixed status, highlighting or mouseovers. |
Color |
getFlag()
Returns the color flag of this node, or null if it has not been set. |
int |
getHeight()
Overrides GraphNode's method by returning the calculated height of this TNode. |
Locator |
getLocator()
Returns the Locator of this TNode, null if not set. |
Color |
getPaintBackColor(TGPanel tgPanel)
Overrides GraphNode's method by highlighting mouseOvers. |
Color |
getPaintBorderColor(TGPanel tgPanel)
Overrides GraphNode's method to return the border color of the node, dependent on context. |
Color |
getPaintTextColor(TGPanel tgPanel)
Returns the text color of the node, dependent on context. |
int |
getWidth()
Overrides GraphNode's method by returning the calculated width of this TNode. |
boolean |
hasFlag()
Returns true if the color flag of this node has been set. |
boolean |
hasLocator()
Returns true if this TNode has a Locator set. |
boolean |
hasPopupMenu()
Returns true if a menu has been set for this TNode. |
boolean |
isClickInMenu(int x)
Returns true if there is a popup menu set, and the click position x was in the area of the popupmenu. |
boolean |
isComponent()
If the TopicMapObject for this TNode is set, and the associated Topic includes a Locator for the Ceryle PSI for 'component', returns true, otherwise, returns false. |
void |
paint(Graphics g,
TGPanel tgPanel)
Paints the Node. |
void |
paintColorFlag(Graphics g,
int x,
int y)
Sets the color flag of this TNode to color. |
void |
paintLinkBody(Graphics g,
TGPanel tgPanel)
Paints the node as either a popup menu node (if a popup is set), or an arrow/link node (if a Locator is set). |
void |
paintNodeBody(Graphics g,
TGPanel tgPanel)
Overrides GraphNode's method by painting the body of the TNode, along with a timeline scale if scaleViz is true. |
void |
paintOccurrenceCount(Graphics g,
TGPanel tgPanel,
int tagX,
int tagY)
Paints a small rectangle displaying the number of topic occurrences. |
void |
setAsComponent(boolean isComponent)
Sets the value of the TNode's 'component' boolean. |
void |
setFixed(boolean fixed)
Sets the fixed status of this TNode to the boolean fixed. |
void |
setFixed(boolean fixed,
Point p)
Sets the fixed status of this TNode to the boolean fixed, fixing it at the provided Point p. |
void |
setFlag(Color color)
Sets the color flag of this GraphNode to color. |
void |
setLocator(Locator locator)
Sets the Locator of this TNode to the provided parameter. |
void |
setPopupMenu(LinkPopupMenu popupmenu)
Set the menu for this TNode. |
void |
setTopicMapObject(TopicMapObject object)
Overrides TMNode's method of the same name, setting the TopicMapObject reference within this TNode to the TopicMapObject object. |
void |
showPopupMenu(MouseEvent e)
Show the popup menu if it has been set for this TNode. |
| Methods inherited from class org.ceryle.graph.tm.TMNode |
|---|
getTopicMapObject |
| Methods inherited from class org.ceryle.graph.GraphNode |
|---|
compareTo, getDefaultNodeFont, getHilight, getID, getLabel, getMouseListener, getNodeFont, getVerticalTweak, getVerticalTweak, isHidden, isProvisional, jubble, 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, getEdges, getFixed, getFont, getLocation, getTextColor, getType, hasEdge, intersects, isFixed, isVisible, removeEdge, setBackColor, 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_TOPIC_NODE
public static Color COLOR_TOPIC_NODE_D
public static Color COLOR_TOPIC_NODE_B
public static Color COLOR_TOPIC_COMPONENT
public static Color COLOR_TOPIC_COMPONENT_D
public static Color COLOR_TOPIC_COMPONENT_B
public static Color COLOR_TOPIC_COMPONENT_TEXT
public static Color COLOR_TOPIC_COMPONENT_SELECT
public static Color COLOR_TOPIC_COMPONENT_MOUSE_OVER
public static Color COLOR_TOPIC_BORDER
public static Color COLOR_TOPIC_BORDER_SELECT
public static Color COLOR_TOPIC_BORDER_SELECT_MOUSE_OVER
public static Color COLOR_TOPIC_BORDER_OUTLINE
COLOR_TOPIC_BORDER_SELECT.
public static Color COLOR_TOPIC_NODE_MOUSE_OVER
public static Color COLOR_TOPIC_NODE_REM
public static Color COLOR_TOPIC_NODE_FIXED
public static Color COLOR_TOPIC_NODE_TEXT
public static Color COLOR_TOPIC_NODE_TIMELINE
public static Color COLOR_EARMARK
public static Color COLOR_EARMARK_B
public static Color COLOR_EARMARK_E
public static Color COLOR_OCCUR_COUNT
public static Color COLOR_NEEDLE
public static Color COLOR_TIMELINE
public static Color COLOR_TIMELINE_MASK
public static Color COLOR_VERNIER_WINDOW
public static Color COLOR_VERNIER_WINDOW_TINT
public static Color COLOR_VERNIER_BASE
public static Color COLOR_VERNIER_TINT
public static Color COLOR_VERNIER_DARK
protected static int textHeight
public boolean paintOccurrences
protected boolean component
public int tl_w
TNode when its TimeScale is visible.
public int tl_h
TNode when its TimeScale is visible.
protected int occurCount
public float score
public static boolean colorAsFlag
protected Color flag
protected Color flagHilight
protected long startDate
protected long endDate
public boolean ignoreMe
protected int[] b
protected int[] pox
protected int[] poy
| Constructor Detail |
|---|
public TNode(String id)
throws GraphException
GraphException
public TNode(String id,
String label)
throws GraphException
GraphException
public TNode(Topic topic,
String label)
throws GraphException
GraphException
public TNode(TopicMapObject tmo,
String id,
String label)
throws GraphException
GraphExceptionTopic
public TNode(TopicMapObject tmo,
Locator locator,
String id,
String label)
throws GraphException
GraphException| Method Detail |
|---|
public void setFixed(boolean fixed)
setFixed in class Node
public void setFixed(boolean fixed,
Point p)
setFixed in class TMNodepublic void setTopicMapObject(TopicMapObject object)
setTopicMapObject in class TMNodeTMNode.setTopicMapObject(TopicMapObject)public void setAsComponent(boolean isComponent)
public boolean isComponent()
public void setFlag(Color color)
public boolean hasFlag()
public Color getFlag()
public int getWidth()
getWidth in class GraphNodepublic int getHeight()
getHeight in class GraphNodepublic Color getPaintBorderColor(TGPanel tgPanel)
getPaintBorderColor in class GraphNodepublic Color getPaintBackColor(TGPanel tgPanel)
getPaintBackColor in class GraphNodepublic Color getBackColor()
getBackColor in class Nodepublic Color getPaintTextColor(TGPanel tgPanel)
getPaintTextColor in class Nodepublic boolean isClickInMenu(int x)
public void setLocator(Locator locator)
throws GraphException
GraphExceptionpublic boolean hasLocator()
public Locator getLocator()
public boolean hasPopupMenu()
public void setPopupMenu(LinkPopupMenu popupmenu)
public void showPopupMenu(MouseEvent e)
public void paint(Graphics g,
TGPanel tgPanel)
paint in class GraphNode
public void paintNodeBody(Graphics g,
TGPanel tgPanel)
paintNodeBody in class GraphNode
public void paintColorFlag(Graphics g,
int x,
int y)
public void paintOccurrenceCount(Graphics g,
TGPanel tgPanel,
int tagX,
int tagY)
public void paintLinkBody(Graphics g,
TGPanel tgPanel)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||