public abstract class ProcessEdge extends ProcessObject
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROP_COLOR_ARC
The color of the arc in jawa.awt.Color
|
static java.lang.String |
PROP_LABEL
The label of the edge
|
static java.lang.String |
PROP_LABELOFFSET
The offset of the label from the source (in percent as double)
|
static java.lang.String |
PROP_POINTS
The list of intermediate routing points in format x1,y1+x2,y2+x3,y3
|
static java.lang.String |
PROP_SOURCE_DOCKPOINT
The source docking point (offset from source node)
|
static java.lang.String |
PROP_SOURCENODE |
static java.lang.String |
PROP_TARGET_DOCKPOINT
The target docking point (offset from target node)
|
static java.lang.String |
PROP_TARGETNODE |
protected java.util.List<java.awt.Point> |
routingPointCache |
static java.lang.String |
TAG_EDGE
Serialization properties
|
contexts, FALSE, PROP_CLASS_TYPE, PROP_ID, TRUE
Constructor and Description |
---|
ProcessEdge() |
ProcessEdge(ProcessNode source,
ProcessNode target) |
Modifier and Type | Method and Description |
---|---|
void |
addRoutingPoint(int pos,
java.awt.Point p)
Adds a new routing point at a specific location (0=first index)
|
void |
addRoutingPoint(java.awt.Point p)
Adds a routing point (detects the position automatically).
|
void |
clearRoutingPoints()
removes all routing points of that edge
|
void |
clearSourceDockPointOffset()
resets the target docking point offset and returns to the usage
of automatic determination
|
void |
clearTargetDockPointOffset()
resets the target docking point offset and returns to the usage
of automatic determination
|
ProcessEdge |
clone() |
void |
clonePropertiesFrom(ProcessEdge edge)
Clones all properties from this ProcessEdge, including ID and TYPE.
|
void |
copyPropertiesFrom(ProcessEdge edge)
Copies the properties from this ProcessEdge, without ID and Type.
|
int |
distanceToEdge(java.awt.Point p)
Returns the closest distance of a certain point to the lines of this
edge.
|
protected void |
drawSourceArrow(java.awt.Graphics2D g2)
This method draws the source arrow.
|
protected void |
drawTargetArrow(java.awt.Graphics2D g2)
This method draws the target arrow.
|
java.awt.Color |
getColor()
Returns the Color of the Edge.
|
protected java.awt.geom.QuadCurve2D |
getCurve(java.awt.Point p1,
java.awt.Point p2,
boolean direction) |
java.awt.Point |
getDockPointOffset(boolean fromSource) |
java.lang.String |
getLabel() |
ProcessHelper |
getLabelHelper() |
double |
getLabelOffset() |
java.awt.Point |
getLabelPosition()
Returns the center position of the label.
|
abstract java.awt.Stroke |
getLineStroke() |
java.lang.String |
getName()
Returns the Name of this ProcessObject
|
java.awt.Point |
getRoutingPoint(int index)
Returns the routing Point with the given Index.
|
java.util.List<java.awt.Point> |
getRoutingPoints()
Returns the list of Points the edge goes through.
|
java.util.List<java.awt.Shape> |
getRoutingPointShapes()
Returns a list of Shapes representing the routing points.
|
ProcessNode |
getSource() |
java.awt.Point |
getSourceDockPointOffset()
Gets the relative dock point for the source node, based on the source
node's position.
|
abstract java.awt.Shape |
getSourceShape() |
ProcessNode |
getTarget() |
java.awt.Point |
getTargetDockPointOffset()
Gets the relative dock point for the target node, based on the target
node's position.
|
abstract java.awt.Shape |
getTargetShape() |
protected java.lang.String |
getXmlTag() |
protected boolean |
isDockingSupported()
Returns if this edge supports docking (might be overwritten by
subclasses).
|
boolean |
isOutlineSourceArrow()
Determines whether the source arrow should be outlined or not.
|
boolean |
isOutlineTargetArrow()
Determines whether the target arrow should be outlined or not.
|
void |
moveRoutingPoint(int pos,
java.awt.Point p)
sets the coordiantes of the point with index pos to the position p.
|
static ProcessEdge |
newInstanceFromSerialization(org.w3c.dom.Node XMLnode,
java.util.HashMap<java.lang.String,ProcessNode> nodesInModel) |
protected void |
paint(java.awt.Graphics g)
Draws the edge.
|
protected void |
paintInternal(java.awt.Graphics g)
Paints the flow object on the given graphics.
|
protected void |
paintSelection(java.awt.Graphics g)
Paints the selection around the edge (if selected).
|
void |
removeRoutingPoint(int pos)
Removes a routing point at a specific location (0=first index)
|
void |
setColor(java.awt.Color color)
Sets the Color of the Edge.
|
void |
setDockPointOffset(java.awt.Point p,
boolean forSource)
Sets source or target dock point offset depending on forSource.
|
void |
setLabel(java.lang.String label) |
void |
setLabelOffset(double offset) |
void |
setRoutingPoints(java.util.List<java.awt.Point> _rps) |
void |
setSource(ProcessNode source) |
void |
setSourceDockPointOffset(java.awt.Point p)
Sets the relative dock point for the source node, based on the source
node's position.
|
void |
setTarget(ProcessNode target) |
void |
setTargetDockPointOffset(java.awt.Point p)
Sets the relative dock point for the target node, based on the target
node's position.
|
java.lang.String |
toString() |
protected void |
updateCache() |
addContext, addListener, equals, getAlpha, getContexts, getId, getPropertyEditor, isHighlighted, isSelected, removeContext, removeListener, setAlpha, setHighlighted, setId, setProperty, setPropertyEditor, setSelected
getProperty, getPropertyKeys, getSerialization, removeProperty
public static final java.lang.String TAG_EDGE
public static final java.lang.String PROP_SOURCENODE
public static final java.lang.String PROP_TARGETNODE
public static final java.lang.String PROP_POINTS
public static final java.lang.String PROP_COLOR_ARC
public static final java.lang.String PROP_LABEL
public static final java.lang.String PROP_LABELOFFSET
public static final java.lang.String PROP_SOURCE_DOCKPOINT
public static final java.lang.String PROP_TARGET_DOCKPOINT
protected transient java.util.List<java.awt.Point> routingPointCache
public ProcessEdge()
public ProcessEdge(ProcessNode source, ProcessNode target)
public static ProcessEdge newInstanceFromSerialization(org.w3c.dom.Node XMLnode, java.util.HashMap<java.lang.String,ProcessNode> nodesInModel) throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.Exception
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.Exception
public ProcessNode getSource()
public void setSource(ProcessNode source)
public ProcessNode getTarget()
public void setTarget(ProcessNode target)
public void setLabel(java.lang.String label)
public java.lang.String getLabel()
public java.awt.Point getLabelPosition()
public double getLabelOffset()
public void setLabelOffset(double offset)
public void setColor(java.awt.Color color)
color
- public java.awt.Color getColor()
protected boolean isDockingSupported()
public void addRoutingPoint(java.awt.Point p)
p
- public void addRoutingPoint(int pos, java.awt.Point p)
p
- pos
- public void moveRoutingPoint(int pos, java.awt.Point p)
pos
- p
- public void clearRoutingPoints()
public void removeRoutingPoint(int pos)
p
- pos
- public java.util.List<java.awt.Point> getRoutingPoints()
public java.awt.Point getRoutingPoint(int index)
index
- public java.util.List<java.awt.Shape> getRoutingPointShapes()
protected void updateCache()
public abstract java.awt.Shape getSourceShape()
public abstract java.awt.Shape getTargetShape()
public abstract java.awt.Stroke getLineStroke()
protected void paint(java.awt.Graphics g)
g
- protected void paintSelection(java.awt.Graphics g)
g
- protected void paintInternal(java.awt.Graphics g)
g
- protected java.awt.geom.QuadCurve2D getCurve(java.awt.Point p1, java.awt.Point p2, boolean direction)
protected void drawSourceArrow(java.awt.Graphics2D g2)
g
- protected void drawTargetArrow(java.awt.Graphics2D g2)
g
- public int distanceToEdge(java.awt.Point p)
p
- public void setSourceDockPointOffset(java.awt.Point p)
p
- public void setDockPointOffset(java.awt.Point p, boolean forSource)
p
- forSource
- public java.awt.Point getSourceDockPointOffset()
p
- public void clearSourceDockPointOffset()
public void setTargetDockPointOffset(java.awt.Point p)
p
- public java.awt.Point getTargetDockPointOffset()
p
- public java.awt.Point getDockPointOffset(boolean fromSource)
public void clearTargetDockPointOffset()
public boolean isOutlineSourceArrow()
public boolean isOutlineTargetArrow()
public void copyPropertiesFrom(ProcessEdge edge)
edge
- clonePropertiesFrom()
public void clonePropertiesFrom(ProcessEdge edge)
edge
- copyPropertiesFrom()
public ProcessEdge clone()
clone
in class ProcessObject
protected java.lang.String getXmlTag()
getXmlTag
in class SerializableProcessObject
public java.lang.String getName()
ProcessObject
getName
in class ProcessObject
public java.lang.String toString()
toString
in class java.lang.Object
public ProcessHelper getLabelHelper()
public void setRoutingPoints(java.util.List<java.awt.Point> _rps)
_rps
-