|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectaminePlatform.guis.graphDrawing.VisualEdge
Title : VisualGraph
Description : VisualEdge is a visual wrapper for Edge: a VisualEdge contains a reference to an Edge with visual attributes and methods. In this way, visualization (or drawing) of a Graph is separeted from the structure Graph.
Copyright : Copyright (c) Adil KABBAJ 2004-2009
Field Summary | |
java.util.ArrayList |
arrow
|
Constructor Summary | |
VisualEdge(Edge edge)
Create a VisualEdge for the specified Edge |
|
VisualEdge(Edge edge,
VisualNode source,
VisualNode target)
Create a VisualEdge for the specified Edge with the specified source and target. |
Method Summary | |
void |
constructArrow(Lexicon lexicon)
Construct the arrow of the relation: determine the three points that compose the triangle of the arrow. |
VisualEdge |
copy()
Copy the current VisualEdge |
void |
draw(java.awt.Graphics g,
Lexicon lexicon)
Draw the relation consists in : a) determine the color for the relation (color of segments, of the arrow and of the text) depending on being selectioned or not, b) draw the segments of the relation, c) draw the name of the relation, d) draw the arrow. |
void |
drawArrow(java.awt.Graphics g)
Draw the arrow of the VisualEdge |
Edge |
getEdge()
Get the edge associated to the current VisualEdge |
java.lang.Object |
getName(Lexicon lexicon)
Get the name of the edge associated to the current VisualEdge |
java.awt.Point |
getPosVEdgeNameOnSegments(Lexicon lexicon)
Get the position of the name of the edge associated to the current VisualEdge |
java.util.ArrayList |
getSegmentPoints(Lexicon lexicon)
Get the segment points of the edge associated to the current VisualEdge |
VisualNode |
getSource()
Get the source VisualNode of the current VisualEdge |
VisualNode |
getTarget()
Get the target VisualNode of the current VisualEdge |
boolean |
isTextOnSegment(java.awt.Point p0,
java.awt.Point p1,
Lexicon lexicon)
Check if the text is on the segment specified by the points p0 and p1. |
void |
moveVEdgeName(java.awt.Point pt,
Lexicon lexicon)
Move the name of the edge associated to the current VisualEdge to the specified point pt. |
void |
putTextOnSegment(java.awt.Point p0,
java.awt.Point p1,
Lexicon lexicon)
Put the identifier of the relation on the segment specified by (p0, p1). |
void |
setEdge(Edge edge)
Set the specified edge for the current Visual Edge |
boolean |
setName(java.lang.String name,
Lexicon lexicon)
Set the specified name as the name of the edge associated to the current VisualEdge |
void |
setPosVEdgeNameOnSegments(java.awt.Point pos)
Set the position of the name of the edge associated to the current VisualEdge |
void |
setSegmentPoints(java.util.ArrayList segmentsPoints)
Set the segment points of the edge associated to the current VisualEdge |
void |
setSource(VisualNode visualNode)
Set the specified VisualNode as the source for the current VisualEdge |
void |
setTarget(VisualNode visualNode)
Set the specified VisualNode as the target for the current VisualEdge |
void |
setVisualSegmentPoints(java.util.ArrayList segmentsPoints)
|
java.lang.String |
toString(Lexicon lexicon)
Get the name, in String, of the edge associated to the current VisualEdge |
void |
updateFirstSegment(Lexicon lexicon)
Update the first segment of the edge associated to the current VisualEdge |
void |
updateLastSegment(Lexicon lexicon)
Update the last segment of the edge associated to the current VisualEdge |
void |
updateName(java.lang.String name,
Lexicon lexicon)
Update the name of the edge associated to the current VisualEdge |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public java.util.ArrayList arrow
Constructor Detail |
public VisualEdge(Edge edge)
edge
- An Edgepublic VisualEdge(Edge edge, VisualNode source, VisualNode target)
edge
- An Edgesource
- A VisualNodetarget
- A VisualNodeMethod Detail |
public Edge getEdge()
public void setEdge(Edge edge)
edge
- An Edgepublic VisualEdge copy()
public VisualNode getTarget()
public void setTarget(VisualNode visualNode)
visualNode
- A VisualNodepublic VisualNode getSource()
public void setSource(VisualNode visualNode)
visualNode
- A VisualNodepublic java.lang.Object getName(Lexicon lexicon)
lexicon
- The Lexicon
public java.lang.String toString(Lexicon lexicon)
lexicon
- The Lexicon
public boolean setName(java.lang.String name, Lexicon lexicon) throws java.lang.Exception
name
- A Stringlexicon
- A Lexicon
java.lang.Exception
- if a problem occurs during the operationpublic java.awt.Point getPosVEdgeNameOnSegments(Lexicon lexicon)
lexicon
- A Lexicon
public void setPosVEdgeNameOnSegments(java.awt.Point pos)
pos
- A Point that represents the positionpublic java.util.ArrayList getSegmentPoints(Lexicon lexicon)
lexicon
- A Lexicon
public void setSegmentPoints(java.util.ArrayList segmentsPoints)
segmentsPoints
- An ArrayList of Pointpublic void setVisualSegmentPoints(java.util.ArrayList segmentsPoints)
public void updateFirstSegment(Lexicon lexicon)
lexicon
- The Lexiconpublic void updateLastSegment(Lexicon lexicon)
lexicon
- The Lexiconpublic void updateName(java.lang.String name, Lexicon lexicon) throws java.lang.Exception
name
- A Stringlexicon
- The Lexicon
java.lang.Exception
- if problem occurs during the operationpublic void constructArrow(Lexicon lexicon)
lexicon
- The Lexiconpublic void draw(java.awt.Graphics g, Lexicon lexicon)
g
- Graphicslexicon
- The Lexiconpublic void drawArrow(java.awt.Graphics g)
g
- Graphicspublic boolean isTextOnSegment(java.awt.Point p0, java.awt.Point p1, Lexicon lexicon)
p0
- A Pointp1
- A Pointlexicon
- A Lexicon
public void putTextOnSegment(java.awt.Point p0, java.awt.Point p1, Lexicon lexicon)
p0
- A Pointp1
- A Pointlexicon
- A Lexiconpublic void moveVEdgeName(java.awt.Point pt, Lexicon lexicon)
pt
- A Pointlexicon
- A Lexicon
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |