Package net.ontopia.topicmaps.viz
Class TMTopicNode
- java.lang.Object
-
- com.touchgraph.graphlayout.Node
-
- net.ontopia.topicmaps.viz.TMAbstractNode
-
- net.ontopia.topicmaps.viz.TMTopicNode
-
- All Implemented Interfaces:
Recoverable
public class TMTopicNode extends TMAbstractNode
INTERNAL: Node class representing topics.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_SHAPE_PADDING
protected boolean
forceColor
static int
MAX_SHAPE_PADDING
-
Fields inherited from class net.ontopia.topicmaps.viz.TMAbstractNode
icon, topicMapView, underMouse
-
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, fixed, font, fontMetrics, justMadeLocal, lbl, markedForRemoval, repulsion, SMALL_TAG_FONT, TEXT_COLOR, TEXT_FONT, textColor, typ, TYPE_CIRCLE, TYPE_ELLIPSE, TYPE_RECTANGLE, TYPE_ROUNDRECT, visible, visibleEdgeCnt, x, y
-
-
Constructor Summary
Constructors Constructor Description TMTopicNode(TopicIF topic, TopicIF scopingTopic, TopicMapView topicMapView)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsPoint(double aPx, double aPy)
protected void
drawMissingEdgesIndicator(Graphics g, com.touchgraph.graphlayout.TGPanel tgPanel)
RecoveryObjectIF
getDesctructor()
int
getHeight()
Color
getPaintBackColor(com.touchgraph.graphlayout.TGPanel tgPanel)
This method enables TMTopicNode to force a particular color upon a given node, even if it is the focus node.RecoveryObjectIF
getRecreator()
int
getShapePadding()
Function<TopicIF,String>
getStringifier()
TopicIF
getTopic()
String
getTopicName()
int
getWidth()
void
miniPaint(Graphics g, com.touchgraph.graphlayout.TGPanel tgPanel)
void
paint(Graphics g, com.touchgraph.graphlayout.TGPanel tgPanel)
Repaints the name.void
repaint(Color aColor, com.touchgraph.graphlayout.TGPanel tgPanel)
void
repaint(Color aColor, com.touchgraph.graphlayout.TGPanel tgPanel, boolean forceColor)
void
setAssociationCount(int count)
void
setLabel(String name)
void
setScopingTopic(TopicIF aScopingTopic)
void
setShapePadding(int value)
void
updateLabel()
-
Methods inherited from class net.ontopia.topicmaps.viz.TMAbstractNode
drawNeighboursInForeground, getEdges, getIcon, getPaintBorderColor, getPaintTextColor, getVisibleEdges, getVisibleEdgesList, hasPathTo, removeMouseoverIcon, setBackColor, setIcon, setUnderMouse, setUnderMouseForced, setVisible, textColourForBackground
-
Methods inherited from class com.touchgraph.graphlayout.Node
addEdge, containsPoint, edgeAt, edgeCount, edgeNum, getBackColor, getFixed, getFont, getID, getLabel, getLocation, getTextColor, getType, intersects, isVisible, paintNodeBody, paintSmallTag, removeEdge, setFixed, setFont, setID, setLocation, setNodeBackDefaultColor, setNodeBackFixedColor, setNodeBackHilightColor, setNodeBackSelectColor, setNodeBorderDragColor, setNodeBorderInactiveColor, setNodeBorderMouseOverColor, setNodeTextColor, setNodeTextFont, setNodeType, setTextColor, setType, visibleEdgeCount
-
-
-
-
Constructor Detail
-
TMTopicNode
public TMTopicNode(TopicIF topic, TopicIF scopingTopic, TopicMapView topicMapView)
-
-
Method Detail
-
updateLabel
public void updateLabel()
-
setScopingTopic
public void setScopingTopic(TopicIF aScopingTopic)
-
getTopicName
public String getTopicName()
-
paint
public void paint(Graphics g, com.touchgraph.graphlayout.TGPanel tgPanel)
Repaints the name. Some topic names are shortened when initially displayed. When the user moves the mouse over the node the full name is displayed.- Overrides:
paint
in classcom.touchgraph.graphlayout.Node
-
miniPaint
public void miniPaint(Graphics g, com.touchgraph.graphlayout.TGPanel tgPanel)
-
drawMissingEdgesIndicator
protected void drawMissingEdgesIndicator(Graphics g, com.touchgraph.graphlayout.TGPanel tgPanel)
-
setLabel
public void setLabel(String name)
- Overrides:
setLabel
in classcom.touchgraph.graphlayout.Node
-
getTopic
public TopicIF getTopic()
-
setShapePadding
public void setShapePadding(int value)
-
getShapePadding
public int getShapePadding()
-
getWidth
public int getWidth()
- Overrides:
getWidth
in classcom.touchgraph.graphlayout.Node
-
getHeight
public int getHeight()
- Overrides:
getHeight
in classcom.touchgraph.graphlayout.Node
-
getPaintBackColor
public Color getPaintBackColor(com.touchgraph.graphlayout.TGPanel tgPanel)
This method enables TMTopicNode to force a particular color upon a given node, even if it is the focus node. This was necessary because blinking didn't work on the focus node.- Overrides:
getPaintBackColor
in classTMAbstractNode
-
repaint
public void repaint(Color aColor, com.touchgraph.graphlayout.TGPanel tgPanel)
-
repaint
public void repaint(Color aColor, com.touchgraph.graphlayout.TGPanel tgPanel, boolean forceColor)
-
setAssociationCount
public void setAssociationCount(int count)
-
containsPoint
public boolean containsPoint(double aPx, double aPy)
- Overrides:
containsPoint
in classcom.touchgraph.graphlayout.Node
-
getDesctructor
public RecoveryObjectIF getDesctructor()
-
getRecreator
public RecoveryObjectIF getRecreator()
-
-