|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mindfusion.diagramming.DiagramItem
com.mindfusion.diagramming.DiagramLink
public class DiagramLink
Links between nodes in JDiagram diagrams are represented by instances of the
DiagramLink
class. Links connect at most two nodes, which can be
accessed via the getOrigin()
and getDestination()
methods. If
linked to node anchor points, the point indices can be accessed using the
getOriginAnchor()
and getDestinationAnchor()
methods. To control
whether users are allowed to move link end points, call one or both of the
setAllowMoveStart(boolean)
and setAllowMoveEnd(boolean)
.
Links are built of smaller parts, called segments, which can be straight
lines, cascading orthogonal lines or Bezier curves. The type of segments can
be set through the setShape(int)
method. The number of links segments
is specified via the setSegmentCount(int)
method. Access to the control
point locations is provided via the getControlPoints()
method.
Usually only the start and end segments of a link are updated if the nodes
it connects are moved around. Number, orientation and/or position of link
segments can change dynamically in various ways depending on the values set
through setAutoRoute(boolean)
, setDynamic(boolean)
and setRetainForm(boolean)
.
The setCascadeOrientation(int)
method lets you specify the orientation
of the first segment of a link of style Cascading
.
If setSnapToNodeBorder(boolean)
is enabled, a link automatically aligns
its end points to the border of the origin or destination nodes when a user
moves the first or last control points. This has a higher priority than
aligning to the grid, but a lower priority than aligning to an anchor point.
Links can display distinct arrowhead shapes at their ends. These shapes can
be set via the setHeadShape(java.lang.String)
and setBaseShape(java.lang.String)
methods. The
size of the arrowhead and base images can be specified respectively via the
setHeadShapeSize(float)
and setBaseShapeSize(float)
methods. Arrowhead
shapes can be displayed in the middle of each segment to facilitate users by
distinguishing different links. The type and size of these shapes is set
via the setIntermediateShape(java.lang.String)
and setIntermediateShapeSize(float)
methods.
The outlines of arrowhead shapes are painted with the pen specified via
setHeadPen(com.mindfusion.diagramming.Pen)
.
Links can have some text associated with them, displayed as specified via
the setText(java.lang.String)
, DiagramItem.setTextBrush(com.mindfusion.diagramming.Brush)
and setTextStyle(int)
methods.
Field Summary |
---|
Fields inherited from class com.mindfusion.diagramming.DiagramItem |
---|
brush, cycleDetected, cycleProtect, modifyDX, modifyDY, modifyHandle, modifying, pen, ptEnd, ptMdfLast, ptOrg, ptSavedEnd, ptSavedOrg, subordinateGroup |
Constructor Summary | |
---|---|
DiagramLink()
Used internally to implement serialization functionality. |
|
DiagramLink(Diagram parent)
Initializes a new instance of the DiagramLink class by setting its properties to the default values defined in the specified diagram. |
|
DiagramLink(Diagram parent,
DiagramNode src,
DiagramNode dest)
Initializes a new instance of the DiagramLink class by setting its properties to the default values defined in the specified diagram, and setting the specified nodes as link's origin and destination. |
|
DiagramLink(Diagram parent,
DiagramNode src,
java.awt.geom.Point2D dest)
Initializes a new instance of the DiagramLink class by setting its properties to the default values defined in the specified diagram, and setting the specified nodes as link's origin and destination. |
|
DiagramLink(DiagramLink prototype,
DiagramNode src,
DiagramNode dest)
Initializes a new instance of the DiagramLink class by copying its properties from another link, and setting the specified nodes as link's origin and destination. |
|
DiagramLink(Diagram parent,
java.awt.geom.Point2D src,
DiagramNode dest)
Initializes a new instance of the DiagramLink class by setting its properties to the default values defined in the specified diagram, and setting the specified nodes as link's origin and destination. |
|
DiagramLink(Diagram parent,
java.awt.geom.Point2D src,
java.awt.geom.Point2D dest)
Initializes a new instance of the DiagramLink class by setting its properties to the default values defined in the specified diagram, and setting the specified points as link's origin and destination. |
Method Summary | |
---|---|
void |
addLabel(LinkLabel label)
Adds a new label to this link. |
LinkLabel |
addLabel(java.lang.String text)
Adds a new label to this link. |
protected boolean |
allowCreate(java.awt.geom.Point2D current,
InteractionState ist)
Invoked during interactive creation of items to test whether the operation can be completed in the current context. |
protected boolean |
allowModify(java.awt.geom.Point2D current,
InteractionState ist)
Invoked during interactive modification of items to test whether the operation can be completed in the current context. |
void |
applyRoute(java.util.ArrayList<java.awt.Point> routePoints,
RouteDescriptor routeDescriptor,
PointList resultPoints)
|
protected void |
cancelModify(InteractionState ist)
Invoked when the interactive modification of this object has been canceled. |
DiagramItem |
clone(boolean clipboard)
Creates a copy of this link. |
protected void |
completeCreate(java.awt.geom.Point2D end)
Invoked when the item creation has been completed. |
protected void |
completeModify(java.awt.geom.Point2D end,
InteractionState ist)
Invoked when the item modification has been completed. |
boolean |
containsPoint(java.awt.geom.Point2D point)
DiagramItem.containsPoint override. |
protected DiagramItemProperties |
createProperties()
DiagramItem.createProperties() override. |
RouteDescriptor |
createRouteDescriptor()
|
protected DiagramItemState |
createState()
DiagramItem.createState() override. |
protected void |
draw(java.awt.Graphics2D graphics,
RenderOptions options)
|
void |
drawArrowhead(java.awt.Graphics2D graphics,
Pen pen,
Brush b,
Shape shape,
java.awt.geom.Point2D pivot,
java.awt.geom.Point2D position,
java.awt.geom.Point2D segmentStart,
double size,
boolean shadow)
Draws an arrowhead shape. |
protected void |
drawShadow(java.awt.Graphics2D graphics,
RenderOptions options)
|
boolean |
getAllowMoveEnd()
Gets a value indicating whether users are allowed to move the last control point of a link. |
boolean |
getAllowMoveStart()
Gets a value indicating whether users are allowed to move the first control point of a link. |
boolean |
getAutoRoute()
Gets a value indicating whether a link should automatically find its way between nodes so that it will not cross other nodes. |
Shape |
getBaseShape()
Gets the shape that is displayed at the origin of a link. |
float |
getBaseShapeSize()
Gets the size of the shape displayed at the origin of a link. |
java.awt.geom.Rectangle2D.Float |
getBounds()
Gets the smallest rectangle that bounds all points of a link. |
int |
getCascadeOrientation()
Gets the orientation of the first segment of a cascading link. |
PointList |
getControlPoints()
Gets the list of control points of a link. |
int |
getCustomDraw()
Gets the type of custom drawing performed on this link. |
DiagramNode |
getDestination()
Gets the destination node of a link. |
int |
getDestinationAnchor()
Gets the index of the anchor point to which a link is connected at its destination. |
int |
getDestinationIndex()
Gets the index of the row of a table or the anchor point of a box to which a link is connected. |
boolean |
getDynamic()
Gets whether a link should automatically update the position of its end points while a node related to the link is moved, so that the link end segments always point to the center of the link's nodes. |
java.awt.geom.Rectangle2D |
getEditRect(java.awt.geom.Point2D mousePosition)
|
Pen |
getEffectiveHeadPen()
Creates a Pen object representing the currently
effective head pen of the link. |
int |
getHandlesStyle()
Gets the style of the link selection handles. |
Pen |
getHeadPen()
Gets the pen used to draw the arrowhead shapes outlines. |
Shape |
getHeadShape()
Gets the shape of the arrowhead. |
float |
getHeadShapeSize()
Gets the size of the arrowhead shape. |
Shape |
getIntermediateShape()
Gets the shape that is displayed at the middle of each segment of a link. |
float |
getIntermediateShapeSize()
Gets the size of the shape displayed at the middle of each segment of a link. |
java.util.ArrayList<LinkLabel> |
getLabels()
Returns the list of all labels displayed by this link. |
float |
getLength()
Gets the length of this link. |
int |
getLongestHSegment()
Returns the index of the longest non-vertical segment of the link. |
DiagramNode |
getOrigin()
Gets the origin node of a link. |
int |
getOriginAnchor()
Gets the index of the anchor point to which a link is connected at its origin. |
int |
getOriginIndex()
Gets the index of the row of a table or the anchor point of a box to which a link is connected. |
protected java.awt.geom.Rectangle2D |
getRepaintRect(boolean includeConnected)
Gets the repaint region for this item, taking into account factors such as pen, selection handles and shadow. |
boolean |
getRetainForm()
Gets a value indicating whether a link should preserve its original shape while the nodes related to that link are moved around. |
short |
getSegmentCount()
Gets the number of segments of this link. |
int |
getShape()
Gets the shape of a link. |
boolean |
getSnapToNodeBorder()
Gets a value indicating whether the end points of a link are automatically aligned to node borders while a user modifies the link. |
java.lang.String |
getText()
Gets the text of the link's label. |
int |
getTextStyle()
Gets the alignment of the link's label. |
java.lang.String |
getTextToEdit()
|
boolean |
intersects(DiagramNode node)
Determines whether a link intersects the specified node. |
boolean |
isConnected()
Gets a value indicating whether a link is connected to any nodes. |
LinkLabel |
labelFromPoint(java.awt.geom.Point2D point)
Returns the label whose layout rectangle contains the specified point. |
protected void |
loadFromXml(org.w3c.dom.Element xmlElement,
XmlPersistContext context)
Loads the item content from an XML element. |
protected void |
onChangeFont()
|
protected void |
onLoad(Diagram diagram)
DiagramItem.onLoad(com.mindfusion.diagramming.Diagram) override. |
void |
readExternal(java.io.ObjectInput in)
Implements Externalizable. |
void |
reassignAnchorPoints()
Chooses new anchor points for a link. |
void |
removeLabel(LinkLabel label)
Removes the specified label from this link. |
protected void |
restoreProperties(DiagramItemProperties props)
DiagramItem.restoreProperties(com.mindfusion.diagramming.DiagramItemProperties) override. |
protected void |
restoreState(DiagramItemState state)
DiagramItem.restoreState(com.mindfusion.diagramming.DiagramItemState) override. |
boolean |
route()
Sets the link control points so that a link goes between its related nodes without crossing other nodes. |
protected void |
saveProperties(DiagramItemProperties props)
DiagramItem.saveProperties(com.mindfusion.diagramming.DiagramItemProperties) override. |
protected void |
saveState(DiagramItemState state)
DiagramItem.saveState(com.mindfusion.diagramming.DiagramItemState) override. |
protected void |
saveToXml(org.w3c.dom.Element xmlElement,
XmlPersistContext context)
Saves the item content into an XML element. |
void |
setAllowMoveEnd(boolean value)
Sets a value indicating whether users are allowed to move the last control point of a link. |
void |
setAllowMoveStart(boolean value)
Sets a value indicating whether users are allowed to move the first control point of a link. |
void |
setAutoRoute(boolean value)
Sets a value indicating whether a link should automatically find its way between nodes so that it will not cross other nodes. |
void |
setBaseShape(Shape value)
Sets the shape that is displayed at the origin of a link. |
void |
setBaseShape(java.lang.String shapeId)
Sets the shape that is displayed at the origin of a link. |
void |
setBaseShapeSize(float value)
Sets the size of the shape displayed at the origin of a link. |
void |
setCascadeOrientation(int value)
Sets the orientation of the first segment of a cascading link. |
void |
setCustomDraw(int value)
Gets the type of custom drawing performed on this link. |
void |
setDestination(DiagramNode value)
Sets the destination node of a link. |
void |
setDestinationAnchor(int value)
sets the anchor point to which a link is connected at its destination. |
void |
setDestinationIndex(int value)
Sets the row of a table or the anchor point of a box to which a link is connected. |
void |
setDynamic(boolean value)
Sets whether a link should automatically update the position of its end points while a node related to the link is moved, so that the link end segments always point to the center of the link's nodes. |
void |
setEditedText(java.lang.String newText)
|
void |
setHandlesStyle(int value)
Sets the style of the link selection handles. |
void |
setHeadPen(Pen value)
Sets the pen used to draw the arrowhead shapes outlines. |
void |
setHeadShape(Shape value)
Sets the shape of the arrowhead. |
void |
setHeadShape(java.lang.String shapeId)
Sets the shape of the arrowhead. |
void |
setHeadShapeSize(float value)
Sets the size of the arrowhead shape. |
void |
setIntermediateShape(Shape value)
Sets the shape that is displayed at the middle of each segment of a link. |
void |
setIntermediateShape(java.lang.String shapeId)
Sets the shape that is displayed at the middle of each segment of a link. |
void |
setIntermediateShapeSize(float value)
Sets the size of the shape displayed at the middle of each segment of a link. |
void |
setOrigin(DiagramNode value)
Sets the origin node of a link. |
void |
setOriginAnchor(int value)
Sets the anchor point to which a link is connected at its origin. |
void |
setOriginIndex(int value)
Sets the row of a table or the anchor point of a box to which a link is connected. |
void |
setRetainForm(boolean value)
Sets a value indicating whether a link should preserve its original shape while the nodes related to that link are moved around. |
void |
setSegmentCount(int value)
Sets the number of segments of this link. |
void |
setShape(int value)
Sets the shape of a link. |
void |
setSnapToNodeBorder(boolean value)
Sets a value indicating whether the end points of a link should be automatically aligned to node borders while a user modifies the link. |
void |
setText(java.lang.String value)
Sets the text of the link's label. |
void |
setTextStyle(int value)
Sets the alignment of the link's label. |
void |
setVisible(boolean value)
Specifies whether the link should be drawn on the screen. |
protected void |
startCreate(java.awt.geom.Point2D org)
Invoked once when the user starts creating a new item interactively. |
protected void |
startModify(java.awt.geom.Point2D org,
int handle,
InteractionState ist)
Invoked when the user starts modifying this item interactively. |
protected void |
updateCreate(java.awt.geom.Point2D current)
Invoked during interactive creation of this item. |
void |
updateFromPoints()
Updates a link after its control point positions are changed programmatically. |
void |
updateFromPoints(boolean updateGroups)
Updates a link after its control point positions are changed programmatically. |
void |
updateFromPoints(boolean updateGroups,
boolean updateSegmentCount)
Updates the link's internal state after the link's control points have been changed. |
protected void |
updateModify(java.awt.geom.Point2D current,
InteractionState ist)
Invoked during interactive modification of this item. |
void |
writeExternal(java.io.ObjectOutput out)
Implements Externalizable. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DiagramLink(Diagram parent)
parent
- A Diagram
instance whose default link
attributes are copied to this link.public DiagramLink(Diagram parent, DiagramNode src, DiagramNode dest)
parent
- A Diagram
instance whose default link
attributes are copied to this link.src
- A DiagramNode
-derived object representing the
link origin node.dest
- A DiagramNode
-derived object representing the
link destination node.public DiagramLink(Diagram parent, DiagramNode src, java.awt.geom.Point2D dest)
parent
- A Diagram
instance whose default link
attributes are copied to this link.src
- A DiagramNode
-derived object representing the
link origin node.dest
- A Point2D.Float
object representing the
link destination point.public DiagramLink(Diagram parent, java.awt.geom.Point2D src, DiagramNode dest)
parent
- A Diagram
instance whose default link
attributes are copied to this link.src
- A Point2D.Float
object representing the
link origin point.dest
- A DiagramNode
-derived object representing the
link destination node.public DiagramLink(Diagram parent, java.awt.geom.Point2D src, java.awt.geom.Point2D dest)
parent
- A Diagram
instance whose default link
attributes are copied to this link.src
- A Point2D.Float
object representing the
link origin point.dest
- A Point2D.Float
object representing the
link destination point.public DiagramLink(DiagramLink prototype, DiagramNode src, DiagramNode dest)
prototype
- An DiagramLink
instance whose attributes are
copied to this link.src
- A DiagramNode
-derived object representing the
link origin node.dest
- A DiagramNode
-derived object representing the
link destination node.public DiagramLink()
Method Detail |
---|
public DiagramItem clone(boolean clipboard)
clone
in class DiagramItem
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
writeExternal
in class DiagramItem
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
readExternal
in class DiagramItem
java.io.IOException
java.lang.ClassNotFoundException
protected void onLoad(Diagram diagram)
DiagramItem.onLoad(com.mindfusion.diagramming.Diagram)
override.
onLoad
in class DiagramItem
protected void saveToXml(org.w3c.dom.Element xmlElement, XmlPersistContext context)
DiagramItem
saveToXml
in class DiagramItem
xmlElement
- An Element
the item's data should be stored into.context
- An XmlPersistContext
object providing contextual information about the serialization process and some helper serialization methods.protected void loadFromXml(org.w3c.dom.Element xmlElement, XmlPersistContext context) throws javax.xml.transform.TransformerException, XmlException
DiagramItem
loadFromXml
in class DiagramItem
xmlElement
- An XmlElement containing the item's data.context
- An XmlPersistContext
object providing contextual
information about the serialization process and some helper serialization methods
javax.xml.transform.TransformerException
XmlException
protected void startCreate(java.awt.geom.Point2D org)
DiagramItem
startCreate
in class DiagramItem
org
- Position of the mouse pointer.protected void updateCreate(java.awt.geom.Point2D current)
DiagramItem
updateCreate
in class DiagramItem
current
- Position of the mouse pointer.protected void completeCreate(java.awt.geom.Point2D end)
DiagramItem
completeCreate
in class DiagramItem
end
- The mouse pointer position.protected boolean allowCreate(java.awt.geom.Point2D current, InteractionState ist)
DiagramItem
allowCreate
in class DiagramItem
current
- The current mouse pointer position.ist
- An InteractionState
object containing more information about the current state of the operation.
protected boolean allowModify(java.awt.geom.Point2D current, InteractionState ist)
DiagramItem
allowModify
in class DiagramItem
current
- The current mouse pointer position.ist
- An InteractionState object containing more information about the current state of the operation.
protected void startModify(java.awt.geom.Point2D org, int handle, InteractionState ist)
DiagramItem
startModify
in class DiagramItem
org
- Position of the mouse pointer.handle
- Index of the adjustment handle used to modify the item.ist
- An InteractionState
object containing more information about the current state of the operation.protected void updateModify(java.awt.geom.Point2D current, InteractionState ist)
DiagramItem
updateModify
in class DiagramItem
current
- Position of the mouse pointer.ist
- An InteractionState
object containing more information about the current state of the operation.protected void completeModify(java.awt.geom.Point2D end, InteractionState ist)
DiagramItem
completeModify
in class DiagramItem
end
- The mouse pointer position.ist
- An InteractionState
object containing more information about the current state of the operation.protected void cancelModify(InteractionState ist)
DiagramItem
cancelModify
in class DiagramItem
ist
- An InteractionState object containing more information about the current state of the operation.protected void draw(java.awt.Graphics2D graphics, RenderOptions options)
draw
in class DiagramItem
protected void drawShadow(java.awt.Graphics2D graphics, RenderOptions options)
drawShadow
in class DiagramItem
public void drawArrowhead(java.awt.Graphics2D graphics, Pen pen, Brush b, Shape shape, java.awt.geom.Point2D pivot, java.awt.geom.Point2D position, java.awt.geom.Point2D segmentStart, double size, boolean shadow)
graphics
- The DrawingContext surface to draw the shape on.pen
- A Pen instance used to draw the shape outline.b
- A Brush instance used to fill the shape.shape
- A Shape instance that defines the arrowhead geometry.pivot
- A Point specified in percents that corresponds to the arrowhead tip position within the Shape geometry.position
- A point on the drawing surface where the arrowhead tip should be located.segmentStart
- A point specifying the arrowhead direction.size
- A double value that specifies the arrowhead size.public void setVisible(boolean value)
setVisible
in class DiagramItem
value
- true
if the link should be visible,
otherwise false
.public boolean isConnected()
true
if the link is connected to any node,
false
otherwise.public DiagramNode getOrigin()
DiagramNode
.public void setOrigin(DiagramNode value)
value
- A DiagramNode
object representing the link origin.public DiagramNode getDestination()
DiagramNode
.public void setDestination(DiagramNode value)
value
- A DiagramNode
object representing the link destination.public int getOriginIndex()
public void setOriginIndex(int value)
value
- An integer value specifying the index of the origin anchor point.public int getDestinationIndex()
public void setDestinationIndex(int value)
value
- An integer value specifying the index of the destination anchor point.public int getOriginAnchor()
public void setOriginAnchor(int value)
value
- An integer value specifying the index of the origin anchor point.public int getDestinationAnchor()
public void setDestinationAnchor(int value)
value
- An integer value specifying the index of the destination anchor point.public short getSegmentCount()
public void setSegmentCount(int value)
value
- An integer value specifying the number of segments in the link.public PointList getControlPoints()
PointList
containing the link's control points.public void updateFromPoints()
public void updateFromPoints(boolean updateGroups)
public void updateFromPoints(boolean updateGroups, boolean updateSegmentCount) throws java.lang.Exception
updateGroups
- true
to update the positions of nodes attached to the link; otherwise, false
.updateSegmentCount
- true
to update the SegmentCount
property based on the number of points in the collection.
java.lang.Exception
public boolean getDynamic()
true
if the link updates its end points
automatically, otherwise false
.public void setDynamic(boolean value)
value
- true
if the link should update its end points
positions automatically, otherwise false
.public boolean getRetainForm()
true
if the link should preserve its
shape, otherwise false
.public void setRetainForm(boolean value)
value
- true
if the link should preserve its
shape, otherwise false
.public int getCascadeOrientation()
Orientation
constants.public void setCascadeOrientation(int value)
value
- One of the Orientation
constants.public boolean getAllowMoveStart()
true
if the first control point can be moved,
otherwise false
.public void setAllowMoveStart(boolean value)
value
- true
if the first control point can be moved,
otherwise false
.public boolean getAllowMoveEnd()
true
if the last control point can be moved,
otherwise false
.public void setAllowMoveEnd(boolean value)
value
- true
if the last control point can be moved,
otherwise false
.public int getShape()
LinkShape
constants.public void setShape(int value)
value
- One of the LinkShape
constants.public Pen getHeadPen()
Pen
object.public void setHeadPen(Pen value)
value
- A Pen
object representing the arrowhead pen.public Pen getEffectiveHeadPen()
Pen
object representing the currently
effective head pen of the link.
This method returns a pen corresponding to the link's
HeadPen
if it is not
null
, or a pen with the
HeadStroke
and
HeadStrokeThickness
properties of the link's style.
public java.lang.String getText()
String
containing the label text.public void setText(java.lang.String value)
value
- A String
containing the label text.public LinkLabel addLabel(java.lang.String text)
text
- The label's text.
LinkLabel
instance.public void addLabel(LinkLabel label)
label
- A LinkLabel
instance.public void removeLabel(LinkLabel label)
label
- A LinkLabel
instance.public LinkLabel labelFromPoint(java.awt.geom.Point2D point)
point
- A Point2D
instance.
LinkLabel
that contains the specified point.public java.util.ArrayList<LinkLabel> getLabels()
public int getTextStyle()
LinkTextStyle
constants.public void setTextStyle(int value)
value
- One of the LinkTextStyle
constants.public Shape getHeadShape()
ArrowHeads
constants.public void setHeadShape(java.lang.String shapeId)
shapeId
- A string specifying the Shape id.public void setHeadShape(Shape value)
value
- One of the ArrowHeads
constants.public Shape getBaseShape()
ArrowHeads
constants.public void setBaseShape(java.lang.String shapeId)
shapeId
- A string specifying the Shape id.public void setBaseShape(Shape value)
value
- One of the ArrowHeads
constants.public Shape getIntermediateShape()
ArrowHeads
constants.public void setIntermediateShape(java.lang.String shapeId)
shapeId
- A string specifying the Shape id.public void setIntermediateShape(Shape value)
value
- One of the ArrowHeads
constants.public float getHeadShapeSize()
public void setHeadShapeSize(float value)
value
- A float value specifying the shape size.public float getBaseShapeSize()
public void setBaseShapeSize(float value)
value
- A float value specifying the shape size.public float getIntermediateShapeSize()
public void setIntermediateShapeSize(float value)
value
- A float value specifying the shape size.public int getHandlesStyle()
HandlesStyle
constants.public void setHandlesStyle(int value)
value
- One of the HandlesStyle
constants.public boolean containsPoint(java.awt.geom.Point2D point)
containsPoint
in class DiagramItem
point
- The point to check.
public java.awt.geom.Rectangle2D.Float getBounds()
getBounds
in class DiagramItem
Rectangle2D.Float
object representing the
link's bounding rectangle.protected java.awt.geom.Rectangle2D getRepaintRect(boolean includeConnected)
DiagramItem
getRepaintRect
in class DiagramItem
includeConnected
- true if related items should be considered too; otherwise, false.
public boolean getAutoRoute()
true
if the link is routed automatically,
otherwise false
.public void setAutoRoute(boolean value)
value
- true
if the link should be routed
automatically, otherwise false
.public boolean route()
public void reassignAnchorPoints()
public RouteDescriptor createRouteDescriptor()
createRouteDescriptor
in interface Routable
public void applyRoute(java.util.ArrayList<java.awt.Point> routePoints, RouteDescriptor routeDescriptor, PointList resultPoints)
applyRoute
in interface Routable
protected DiagramItemState createState()
DiagramItem.createState()
override.
createState
in class DiagramItem
protected void saveState(DiagramItemState state)
DiagramItem.saveState(com.mindfusion.diagramming.DiagramItemState)
override.
saveState
in class DiagramItem
protected void restoreState(DiagramItemState state)
DiagramItem.restoreState(com.mindfusion.diagramming.DiagramItemState)
override.
restoreState
in class DiagramItem
public boolean intersects(DiagramNode node)
node
- A DiagramNode
object.
true
if the link intersects the specified node,
otherwise false
.public int getLongestHSegment()
public float getLength()
public boolean getSnapToNodeBorder()
true
if the link ends are aligned to node
borders, otherwise false
.public void setSnapToNodeBorder(boolean value)
value
- true
if the link ends should be aligned to
node borders, otherwise false
.protected void onChangeFont()
onChangeFont
in class DiagramItem
protected DiagramItemProperties createProperties()
DiagramItem.createProperties()
override.
createProperties
in class DiagramItem
protected void saveProperties(DiagramItemProperties props)
DiagramItem.saveProperties(com.mindfusion.diagramming.DiagramItemProperties)
override.
saveProperties
in class DiagramItem
props
- A DiagramItemProperties-derived object where
the item's properties should be saved.protected void restoreProperties(DiagramItemProperties props)
DiagramItem.restoreProperties(com.mindfusion.diagramming.DiagramItemProperties)
override.
restoreProperties
in class DiagramItem
props
- A DiagramItemProperties -derived object containing a
snapshot of the item's properties.public java.awt.geom.Rectangle2D getEditRect(java.awt.geom.Point2D mousePosition)
getEditRect
in interface InplaceEditable
public java.lang.String getTextToEdit()
getTextToEdit
in interface InplaceEditable
public void setEditedText(java.lang.String newText)
setEditedText
in interface InplaceEditable
public int getCustomDraw()
public void setCustomDraw(int value)
value
- This property allows invoking custom painting code for a link.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |