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 intDEFAULT_SHAPE_PADDINGprotected booleanforceColorstatic intMAX_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 booleancontainsPoint(double aPx, double aPy)protected voiddrawMissingEdgesIndicator(Graphics g, com.touchgraph.graphlayout.TGPanel tgPanel)RecoveryObjectIFgetDesctructor()intgetHeight()ColorgetPaintBackColor(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.RecoveryObjectIFgetRecreator()intgetShapePadding()Function<TopicIF,String>getStringifier()TopicIFgetTopic()StringgetTopicName()intgetWidth()voidminiPaint(Graphics g, com.touchgraph.graphlayout.TGPanel tgPanel)voidpaint(Graphics g, com.touchgraph.graphlayout.TGPanel tgPanel)Repaints the name.voidrepaint(Color aColor, com.touchgraph.graphlayout.TGPanel tgPanel)voidrepaint(Color aColor, com.touchgraph.graphlayout.TGPanel tgPanel, boolean forceColor)voidsetAssociationCount(int count)voidsetLabel(String name)voidsetScopingTopic(TopicIF aScopingTopic)voidsetShapePadding(int value)voidupdateLabel()-
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:
paintin 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:
setLabelin classcom.touchgraph.graphlayout.Node
-
getTopic
public TopicIF getTopic()
-
setShapePadding
public void setShapePadding(int value)
-
getShapePadding
public int getShapePadding()
-
getWidth
public int getWidth()
- Overrides:
getWidthin classcom.touchgraph.graphlayout.Node
-
getHeight
public int getHeight()
- Overrides:
getHeightin 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:
getPaintBackColorin 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:
containsPointin classcom.touchgraph.graphlayout.Node
-
getDesctructor
public RecoveryObjectIF getDesctructor()
-
getRecreator
public RecoveryObjectIF getRecreator()
-
-