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 int
DEFAULT_LINE_WEIGHT
static int
DEFAULT_SHAPE
protected Font
font
protected Icon
icon
protected static int[]
intBuffer
protected int
lineWeight
protected static int
LOADING
protected TopicIF
scopingTopic
protected int
shape
static int
SHAPE_BOWTIE
static int
SHAPE_LINE
protected boolean
shouldDisplayRoleHoverHelp
protected Function<TopicIF,String>
stringifier
protected boolean
underMouse
-
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 void
addTo(com.touchgraph.graphlayout.TGPanel tgpanel)
protected double
calculateMidPointBetween(double from, double to)
protected Dimension
calculateOffset(double x1, double x2, double y1, double y2, int weight)
void
deleteFrom(com.touchgraph.graphlayout.TGPanel tgpanel)
double
distFromPoint(double x, double y)
protected GeneralPath
getCurvedBowTie(int index)
protected QuadCurve2D
getCurvedLine(int index)
protected Shape
getDisplayShape()
Font
getFont()
protected Point
getFromRolePosition()
Icon
getIcon()
protected int
getIndexInParents()
int
getLineWeight()
protected String
getMainHoverHelpText()
Point
getMidPoint()
Returns the mid point between the two assocaition targets.int
getShape()
Function<TopicIF,String>
getStringifier()
List
getTargetsFrom(com.touchgraph.graphlayout.Node find)
TopicIF
getTopicMapType()
protected Point
getToRolePosition()
boolean
isAssociation()
boolean
isEdge()
void
paint(Graphics g, com.touchgraph.graphlayout.TGPanel tgPanel)
void
paintAfterEdges(Graphics g)
protected void
paintBowTie(Graphics2D g)
protected void
paintConnection(Graphics g)
protected void
paintCurvedBowTie(Graphics2D g, int index)
protected void
paintCurvedLine(Graphics2D g, int index)
void
paintFirst(Graphics g)
void
paintLast(Graphics g)
protected void
paintLine(Graphics2D g)
protected void
paintToolTip(Graphics g)
protected void
paintToolTipText(Graphics g, String string, int x, int y)
protected void
paintToolTipText(Graphics g, String text, Point aPoint)
protected void
paintTypeToolTip(Graphics g)
void
setFont(Font font)
void
setIcon(Icon icon)
void
setLineWeight(int lineWeight)
void
setScopingTopic(TopicIF aTopic)
void
setShape(int shape)
void
setShouldDisplayRoleHoverHelp(boolean newValue)
protected void
setStringifier(Function<TopicIF,String> aStringifier)
void
setVisible(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:
setVisible
in interfaceVizTMObjectIF
- Overrides:
setVisible
in 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:
paintAfterEdges
in 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:
paintLast
in interfacecom.touchgraph.graphlayout.TGPaintListener
-
paintToolTip
protected void paintToolTip(Graphics g)
-
setLineWeight
public void setLineWeight(int lineWeight)
- Specified by:
setLineWeight
in interfaceVizTMObjectIF
-
getShape
public int getShape()
-
setShape
public void setShape(int shape)
- Specified by:
setShape
in interfaceVizTMObjectIF
-
getIcon
public Icon getIcon()
-
setIcon
public void setIcon(Icon icon)
- Specified by:
setIcon
in interfaceVizTMObjectIF
-
getFont
public Font getFont()
-
setFont
public void setFont(Font font)
- Specified by:
setFont
in interfaceVizTMObjectIF
-
addTo
public void addTo(com.touchgraph.graphlayout.TGPanel tgpanel)
- Specified by:
addTo
in interfaceVizTMObjectIF
-
getLineWeight
public int getLineWeight()
-
paintFirst
public void paintFirst(Graphics g)
- Specified by:
paintFirst
in 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:
paint
in classcom.touchgraph.graphlayout.Edge
-
deleteFrom
public void deleteFrom(com.touchgraph.graphlayout.TGPanel tgpanel)
- Specified by:
deleteFrom
in interfaceVizTMObjectIF
-
paintTypeToolTip
protected void paintTypeToolTip(Graphics g)
-
getMainHoverHelpText
protected String getMainHoverHelpText()
-
setShouldDisplayRoleHoverHelp
public void setShouldDisplayRoleHoverHelp(boolean newValue)
-
isEdge
public boolean isEdge()
- Specified by:
isEdge
in interfaceVizTMObjectIF
-
isAssociation
public boolean isAssociation()
- Specified by:
isAssociation
in interfaceVizTMObjectIF
-
getTargetsFrom
public List getTargetsFrom(com.touchgraph.graphlayout.Node find)
-
setScopingTopic
public void setScopingTopic(TopicIF aTopic)
- Specified by:
setScopingTopic
in interfaceVizTMObjectIF
-
getTopicMapType
public TopicIF getTopicMapType()
- Specified by:
getTopicMapType
in interfaceVizTMObjectIF
-
getDisplayShape
protected Shape getDisplayShape()
-
distFromPoint
public double distFromPoint(double x, double y)
- Overrides:
distFromPoint
in classcom.touchgraph.graphlayout.Edge
-
-