Package net.ontopia.topicmaps.viz
Class TMAbstractEdge
- java.lang.Object
-
- com.touchgraph.graphlayout.Edge
-
- net.ontopia.topicmaps.viz.TMAbstractEdge
-
- All Implemented Interfaces:
com.touchgraph.graphlayout.TGPaintListener,EventListener,Recoverable,VizTMObjectIF
- Direct Known Subclasses:
TMAssociationEdge,TMClassInstanceAssociation,TMRoleEdge
public abstract class TMAbstractEdge extends com.touchgraph.graphlayout.Edge implements VizTMObjectIF, com.touchgraph.graphlayout.TGPaintListener
INTERNAL: Common abstract superclass for all edges representing Topic Maps constructs.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_LINE_WEIGHTstatic intDEFAULT_SHAPEprotected Fontfontprotected Iconiconprotected static int[]intBufferprotected intlineWeightprotected static intLOADINGprotected TopicIFscopingTopicprotected intshapestatic intSHAPE_BOWTIEstatic intSHAPE_LINEprotected booleanshouldDisplayRoleHoverHelpprotected Function<TopicIF,String>stringifierprotected booleanunderMouse
-
Constructor Summary
Constructors Constructor Description TMAbstractEdge(com.touchgraph.graphlayout.Node f, com.touchgraph.graphlayout.Node t)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTo(com.touchgraph.graphlayout.TGPanel tgpanel)protected doublecalculateMidPointBetween(double from, double to)protected DimensioncalculateOffset(double x1, double x2, double y1, double y2, int weight)voiddeleteFrom(com.touchgraph.graphlayout.TGPanel tgpanel)doubledistFromPoint(double x, double y)protected GeneralPathgetCurvedBowTie(int index)protected QuadCurve2DgetCurvedLine(int index)protected ShapegetDisplayShape()FontgetFont()protected PointgetFromRolePosition()IcongetIcon()protected intgetIndexInParents()intgetLineWeight()protected StringgetMainHoverHelpText()PointgetMidPoint()Returns the mid point between the two assocaition targets.intgetShape()Function<TopicIF,String>getStringifier()ListgetTargetsFrom(com.touchgraph.graphlayout.Node find)TopicIFgetTopicMapType()protected PointgetToRolePosition()booleanisAssociation()booleanisEdge()voidpaint(Graphics g, com.touchgraph.graphlayout.TGPanel tgPanel)voidpaintAfterEdges(Graphics g)protected voidpaintBowTie(Graphics2D g)protected voidpaintConnection(Graphics g)protected voidpaintCurvedBowTie(Graphics2D g, int index)protected voidpaintCurvedLine(Graphics2D g, int index)voidpaintFirst(Graphics g)voidpaintLast(Graphics g)protected voidpaintLine(Graphics2D g)protected voidpaintToolTip(Graphics g)protected voidpaintToolTipText(Graphics g, String string, int x, int y)protected voidpaintToolTipText(Graphics g, String text, Point aPoint)protected voidpaintTypeToolTip(Graphics g)voidsetFont(Font font)voidsetIcon(Icon icon)voidsetLineWeight(int lineWeight)voidsetScopingTopic(TopicIF aTopic)voidsetShape(int shape)voidsetShouldDisplayRoleHoverHelp(boolean newValue)protected voidsetStringifier(Function<TopicIF,String> aStringifier)voidsetVisible(boolean visible)setVisible is not supported in Vizigator.-
Methods inherited from class com.touchgraph.graphlayout.Edge
containsPoint, getColor, getFrom, getID, getLength, getOtherEndpt, getTo, intersects, isVisible, paintArrow, reverse, setColor, setEdgeDefaultColor, setEdgeDefaultLength, setEdgeMouseOverColor, setID, setLength
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.ontopia.topicmaps.viz.Recoverable
getDesctructor, getRecreator
-
Methods inherited from interface net.ontopia.topicmaps.viz.VizTMObjectIF
represents, setColor
-
-
-
-
Field Detail
-
lineWeight
protected int lineWeight
-
shape
protected int shape
-
icon
protected Icon icon
-
font
protected Font font
-
underMouse
protected boolean underMouse
-
LOADING
protected static final int LOADING
- See Also:
- Constant Field Values
-
SHAPE_BOWTIE
public static final int SHAPE_BOWTIE
- See Also:
- Constant Field Values
-
SHAPE_LINE
public static final int SHAPE_LINE
- See Also:
- Constant Field Values
-
DEFAULT_SHAPE
public static int DEFAULT_SHAPE
-
DEFAULT_LINE_WEIGHT
public static int DEFAULT_LINE_WEIGHT
-
intBuffer
protected static int[] intBuffer
-
shouldDisplayRoleHoverHelp
protected boolean shouldDisplayRoleHoverHelp
-
scopingTopic
protected TopicIF scopingTopic
-
-
Method Detail
-
setVisible
public final void setVisible(boolean visible)
setVisible is not supported in Vizigator.- Specified by:
setVisiblein interfaceVizTMObjectIF- Overrides:
setVisiblein classcom.touchgraph.graphlayout.Edge
-
calculateMidPointBetween
protected double calculateMidPointBetween(double from, double to)
-
getMidPoint
public Point getMidPoint()
Returns the mid point between the two assocaition targets.
-
getFromRolePosition
protected Point getFromRolePosition()
-
getToRolePosition
protected Point getToRolePosition()
-
paintAfterEdges
public void paintAfterEdges(Graphics g)
- Specified by:
paintAfterEdgesin interfacecom.touchgraph.graphlayout.TGPaintListener
-
paintConnection
protected void paintConnection(Graphics g)
-
paintLine
protected void paintLine(Graphics2D g)
-
paintCurvedLine
protected void paintCurvedLine(Graphics2D g, int index)
-
getCurvedLine
protected QuadCurve2D getCurvedLine(int index)
-
paintCurvedBowTie
protected void paintCurvedBowTie(Graphics2D g, int index)
-
getCurvedBowTie
protected GeneralPath getCurvedBowTie(int index)
-
getIndexInParents
protected int getIndexInParents()
-
paintBowTie
protected void paintBowTie(Graphics2D g)
-
calculateOffset
protected Dimension calculateOffset(double x1, double x2, double y1, double y2, int weight)
-
paintLast
public void paintLast(Graphics g)
- Specified by:
paintLastin interfacecom.touchgraph.graphlayout.TGPaintListener
-
paintToolTip
protected void paintToolTip(Graphics g)
-
setLineWeight
public void setLineWeight(int lineWeight)
- Specified by:
setLineWeightin interfaceVizTMObjectIF
-
getShape
public int getShape()
-
setShape
public void setShape(int shape)
- Specified by:
setShapein interfaceVizTMObjectIF
-
getIcon
public Icon getIcon()
-
setIcon
public void setIcon(Icon icon)
- Specified by:
setIconin interfaceVizTMObjectIF
-
getFont
public Font getFont()
-
setFont
public void setFont(Font font)
- Specified by:
setFontin interfaceVizTMObjectIF
-
addTo
public void addTo(com.touchgraph.graphlayout.TGPanel tgpanel)
- Specified by:
addToin interfaceVizTMObjectIF
-
getLineWeight
public int getLineWeight()
-
paintFirst
public void paintFirst(Graphics g)
- Specified by:
paintFirstin interfacecom.touchgraph.graphlayout.TGPaintListener
-
paintToolTipText
protected void paintToolTipText(Graphics g, String string, int x, int y)
- Parameters:
g- - The graphic context for the drawing operation.string- - The String to be rendered.x- - The x coordinate where the String should be positioned.y- - The y coordinate where the String should be positioned. NOTE: The text is centered over the given coordinates.
-
paint
public void paint(Graphics g, com.touchgraph.graphlayout.TGPanel tgPanel)
- Overrides:
paintin classcom.touchgraph.graphlayout.Edge
-
deleteFrom
public void deleteFrom(com.touchgraph.graphlayout.TGPanel tgpanel)
- Specified by:
deleteFromin interfaceVizTMObjectIF
-
paintTypeToolTip
protected void paintTypeToolTip(Graphics g)
-
getMainHoverHelpText
protected String getMainHoverHelpText()
-
setShouldDisplayRoleHoverHelp
public void setShouldDisplayRoleHoverHelp(boolean newValue)
-
isEdge
public boolean isEdge()
- Specified by:
isEdgein interfaceVizTMObjectIF
-
isAssociation
public boolean isAssociation()
- Specified by:
isAssociationin interfaceVizTMObjectIF
-
getTargetsFrom
public List getTargetsFrom(com.touchgraph.graphlayout.Node find)
-
setScopingTopic
public void setScopingTopic(TopicIF aTopic)
- Specified by:
setScopingTopicin interfaceVizTMObjectIF
-
getTopicMapType
public TopicIF getTopicMapType()
- Specified by:
getTopicMapTypein interfaceVizTMObjectIF
-
getDisplayShape
protected Shape getDisplayShape()
-
distFromPoint
public double distFromPoint(double x, double y)- Overrides:
distFromPointin classcom.touchgraph.graphlayout.Edge
-
-