public class DiagramLink extends DiagramItem implements InplaceEditable
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(com.mindfusion.diagramming.LinkShape)
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(com.mindfusion.diagramming.Orientation)
method lets you specify the orientation
of the first segment of a link of style Cascading
.
If #setSnapToNodeBorder
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.drawing.Pen)
.
Links can have some text associated with them, displayed as specified via
the setText(java.lang.String)
, DiagramItem.setTextBrush(com.mindfusion.drawing.Brush)
and setTextStyle(com.mindfusion.diagramming.LinkTextStyle)
methods.
brush, cycleDetected, cycleProtect, modifyDX, modifyDY, modifyHandle, modifying, pen, ptEnd, ptMdfLast, ptOrg, ptSavedEnd, ptSavedOrg, subordinateGroup
Constructor and Description |
---|
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,
android.graphics.PointF 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,
android.graphics.PointF 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,
android.graphics.PointF src,
android.graphics.PointF 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.
|
Modifier and Type | Method and Description |
---|---|
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(android.graphics.PointF current,
InteractionState ist)
|
protected boolean |
allowModify(android.graphics.PointF 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<android.graphics.Point> routePoints,
RouteDescriptor routeDescriptor,
PointList resultPoints) |
protected void |
cancelModify(InteractionState ist)
|
DiagramItem |
clone(boolean clipboard)
Creates a copy of this link.
|
protected void |
completeCreate(android.graphics.PointF end)
|
protected void |
completeModify(android.graphics.PointF end,
InteractionState ist)
Invoked when the item modification has been completed.
|
boolean |
containsPoint(android.graphics.PointF point)
|
protected DiagramItemProperties |
createProperties()
DiagramItem.createProperties() override. |
RouteDescriptor |
createRouteDescriptor() |
protected DiagramItemState |
createState()
DiagramItem.createState() override. |
protected void |
draw(android.graphics.Canvas graphics,
RenderOptions options)
|
void |
drawArrowhead(android.graphics.Canvas graphics,
Pen pen,
Brush b,
Shape shape,
android.graphics.PointF pivot,
android.graphics.PointF position,
android.graphics.PointF segmentStart,
float size,
boolean shadow)
Draws an arrowhead shape.
|
protected void |
drawShadow(android.graphics.Canvas 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.
|
boolean |
getAutoSnapToNode()
Gets a value indicating whether the end points of a link should
automatically align to the border of the nearest node while the user moves them.
|
Brush |
getBaseBrush()
Gets the brush used to fill the arrowhead drawn at the link base.
|
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.
|
android.graphics.RectF |
getBounds()
Gets the smallest rectangle that bounds all points of a link.
|
Orientation |
getCascadeOrientation()
Gets the orientation of the first segment of a cascading link.
|
PointList |
getControlPoints()
Gets the list of control points of a link.
|
CustomDraw |
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.
|
android.graphics.RectF |
getEditRect(DiagramItem item,
android.graphics.PointF pointerPosition)
Gets the location where the edit control should be displayed.
|
Pen |
getEffectiveHeadPen()
Creates a
Pen object representing the currently
effective head pen of the link. |
android.graphics.PointF |
getEndPoint()
Gets the position of the last control point of this link.
|
HandlesStyle |
getHandlesStyle()
Gets the appearance of the link's selection handles.
|
Brush |
getHeadBrush()
Gets the brush used to fill the arrowhead drawn at the link's destination.
|
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.
|
Brush |
getIntermediateBrush()
Gets the brush used to fill the arrowheads drawn at the middle of link segments.
|
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 android.graphics.RectF |
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.
|
int |
getSegmentCount()
Gets the number of segments of this link.
|
LinkShape |
getShape()
Gets the shape of a link.
|
android.graphics.PointF |
getStartPoint()
Gets the position of the first control point of this link.
|
java.lang.String |
getText()
Gets the text of the link's label.
|
LinkTextStyle |
getTextStyle()
Gets the link's text placement and orientation.
|
java.lang.String |
getTextToEdit()
Gets the current text content of this item.
|
AdjustmentHandle |
hitTestHandle(android.graphics.PointF point)
|
com.mindfusion.diagramming.builders.DiagramLinkBuilder |
init()
Returns a DiagramLinkBuilder object used to configure this DiagramLink instance.
|
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(android.graphics.PointF 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)
|
protected void |
onModify(android.graphics.PointF mousePosition,
int adjustmentHandle)
Called when an item is modified
|
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)
|
protected void |
restoreState(DiagramItemState state)
|
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)
|
protected void |
saveState(DiagramItemState state)
|
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 |
setAutoSnapToNode(boolean value)
Sets a value indicating whether the end points of a link should
automatically align to the border of the nearest node while the user moves them.
|
void |
setBaseBrush(Brush value)
Sets a brush used to fill the arrowhead drawn at the link base.
|
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(Orientation value)
Sets the orientation of the first segment of a cascading link.
|
void |
setCustomDraw(CustomDraw value)
Sets 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)
Sets the new text content of this item.
|
void |
setEndPoint(android.graphics.PointF value)
Sets the position of the last control point of this link.
|
void |
setHandlesStyle(HandlesStyle value)
Sets the appearance of the link's selection handles.
|
void |
setHeadBrush(Brush value)
Sets a brush used to fill the arrowhead drawn at the link's destination.
|
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 |
setIntermediateBrush(Brush value)
Sets a brush used to fill the arrowheads drawn at the middle of link segments.
|
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(LinkShape value)
Sets the shape of a link.
|
void |
setStartPoint(android.graphics.PointF value)
Sets the position of the first control point of this link.
|
void |
setText(java.lang.String value)
Sets the text of the link's label.
|
void |
setTextStyle(LinkTextStyle value)
Sets the link's text placement and orientation.
|
void |
setVisible(boolean value)
Specifies whether the link should be drawn on the screen.
|
protected void |
startCreate(android.graphics.PointF org)
|
protected void |
startModify(android.graphics.PointF org,
AdjustmentHandle handle,
InteractionState ist)
|
protected void |
updateCreate(android.graphics.PointF current)
|
void |
updateFromPoints()
Updates a link after its control point positions are changed programmatically.
|
void |
updateFromPoints(boolean updateGroups)
Updates the link's internal state after the link's control
points have been changed.
|
protected void |
updateModify(android.graphics.PointF current,
InteractionState ist)
|
static com.mindfusion.diagramming.builders.DiagramLinkBuilder |
with()
Returns a DiagramLinkBuilder object used to configure and create new DiagramLink instances.
|
void |
writeExternal(java.io.ObjectOutput out)
Implements Externalizable
|
getBrush, getEffectiveBrush, getEffectiveFont, getEffectivePen, getEffectiveShadowBrush, getEffectiveTextBrush, getFont, getHyperLink, getId, getIgnoreLayout, getLayerIndex, getLayoutTraits, getLocked, getMasterGroup, getMeasureUnit, getParent, getPen, getPrintable, getRuntimeIndex, getSelected, getShadowBrush, getShadowOffsetX, getShadowOffsetY, getStyle, getSubordinateGroup, getTag, getTextBrush, getTextPadding, getToolTip, getValue, getVisible, getWeight, getZIndex, hasSubordinates, onAdd, onChangeTextPadding, onChildModified, onClick, onDoubleClick, onMeasureUnitChanged, onRemove, onStyleChanged, putSelected, query, repaint, repaint, repaint, setBrush, setDiagramDirty, setFont, setHyperLink, setId, setIgnoreLayout, setLayerIndex, setLocked, setPen, setPrintable, setSelected, setShadowBrush, setShadowOffsetX, setShadowOffsetY, setStyle, setTag, setTextBrush, setTextPadding, setToolTip, setWeight, setZIndex, shouldRender, zBottom, zLevelDown, zLevelUp, zTop
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, android.graphics.PointF 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 PointF
object representing the
link destination point.public DiagramLink(Diagram parent, android.graphics.PointF src, DiagramNode dest)
parent
- A Diagram
instance whose default link
attributes are copied to this link.src
- A PointF
object representing the
link origin point.dest
- A DiagramNode
-derived object representing the
link destination node.public DiagramLink(Diagram parent, android.graphics.PointF src, android.graphics.PointF dest)
parent
- A Diagram
instance whose default link
attributes are copied to this link.src
- A PointF
object representing the
link origin point.dest
- A PointF
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()
public static com.mindfusion.diagramming.builders.DiagramLinkBuilder with()
DiagramLinkBuilder
instance.public com.mindfusion.diagramming.builders.DiagramLinkBuilder init()
DiagramLinkBuilder
instance.public DiagramItem clone(boolean clipboard)
clone
in class DiagramItem
clipboard
- true if the copy will be stored in the OS clipboard; or false otherwise.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)
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 methodsjavax.xml.transform.TransformerException
XmlException
protected void startCreate(android.graphics.PointF org)
startCreate
in class DiagramItem
org
- The initial position of the pointer.protected void updateCreate(android.graphics.PointF current)
updateCreate
in class DiagramItem
current
- The current position of the pointer.protected void completeCreate(android.graphics.PointF end)
completeCreate
in class DiagramItem
end
- The pointer position.protected boolean allowCreate(android.graphics.PointF current, InteractionState ist)
DiagramItem.allowCreate(android.graphics.PointF, com.mindfusion.diagramming.InteractionState)
override.allowCreate
in class DiagramItem
current
- The current pointer position.ist
- An InteractionState
object containing more information about the current state of the operation.protected boolean allowModify(android.graphics.PointF current, InteractionState ist)
DiagramItem
allowModify
in class DiagramItem
current
- The current pointer position.ist
- An InteractionState object containing more information about the current state of the operation.protected void startModify(android.graphics.PointF org, AdjustmentHandle handle, InteractionState ist)
DiagramItem.startModify(android.graphics.PointF, com.mindfusion.diagramming.AdjustmentHandle, com.mindfusion.diagramming.InteractionState)
override. Invoked when the user starts modifying this link interactively.startModify
in class DiagramItem
org
- The initial position of the pointer.handle
- The adjustment handle used to modify this item.ist
- An InteractionState
object containing more information about the current state of the operation.protected void updateModify(android.graphics.PointF current, InteractionState ist)
DiagramItem.updateModify(android.graphics.PointF, com.mindfusion.diagramming.InteractionState)
override. Invoked during interactive modification of this link.updateModify
in class DiagramItem
current
- The current position of the pointer.ist
- An InteractionState
object containing more information about the current state of the operation.protected void completeModify(android.graphics.PointF end, InteractionState ist)
DiagramItem
completeModify
in class DiagramItem
end
- The pointer position.ist
- An InteractionState
object containing more information about the current state of the operation.protected void cancelModify(InteractionState ist)
DiagramItem.cancelModify(com.mindfusion.diagramming.InteractionState)
override. Invoked when the interactive modification of this link has been canceled.cancelModify
in class DiagramItem
ist
- An InteractionState
object containing more information about the current state of the operation.protected void onModify(android.graphics.PointF mousePosition, int adjustmentHandle)
mousePosition
- Specifies the mouse position.adjustmentHandle
- The adjustment handle used to modify the node.protected void draw(android.graphics.Canvas graphics, RenderOptions options)
DiagramItem.draw(android.graphics.Canvas, com.mindfusion.diagramming.RenderOptions)
override. Draws this link on the specified Canvas surface.draw
in class DiagramItem
g
- An android.graphics.Canvas instance.options
- Provides options for the drawing operation.protected void drawShadow(android.graphics.Canvas graphics, RenderOptions options)
DiagramItem.drawShadow(android.graphics.Canvas, com.mindfusion.diagramming.RenderOptions)
override. Draws the link's shadow on the specified Canvas surface.drawShadow
in class DiagramItem
graphics
- An android.graphics.Canvas instance.options
- Provides options for the drawing operation.public void drawArrowhead(android.graphics.Canvas graphics, Pen pen, Brush b, Shape shape, android.graphics.PointF pivot, android.graphics.PointF position, android.graphics.PointF segmentStart, float size, boolean shadow)
graphics
- The Canvas where the arrowhead shape should be drawn.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 int 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) throws java.lang.Error
updateGroups
- true
to update the positions of nodes attached to the link; otherwise, false
.java.lang.Error
public android.graphics.PointF getStartPoint()
public void setStartPoint(android.graphics.PointF value)
value
- A PointF instance.public android.graphics.PointF getEndPoint()
public void setEndPoint(android.graphics.PointF value)
value
- A PointF instance.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 Orientation getCascadeOrientation()
Orientation
enumeration.public void setCascadeOrientation(Orientation value)
value
- A member of the Orientation
enumeration.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 LinkShape getShape()
LinkShape
enumeration.public void setShape(LinkShape value)
value
- A member of the LinkShape
enumeration.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(android.graphics.PointF point)
point
- A PointF
instance.LinkLabel
that contains the specified point.public java.util.ArrayList<LinkLabel> getLabels()
public LinkTextStyle getTextStyle()
LinkTextStyle
enumeration.public void setTextStyle(LinkTextStyle value)
value
- A member of the LinkTextStyle
enumeration.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 HandlesStyle getHandlesStyle()
HandlesStyle
enumeration.public void setHandlesStyle(HandlesStyle value)
value
- A member of the HandlesStyle
enumeration.public boolean containsPoint(android.graphics.PointF point)
DiagramItem.containsPoint(android.graphics.PointF)
override. Checks whether this link
contains the specified point. This method is called during hit-testing to determine
if the pointer is over the link.containsPoint
in class DiagramItem
point
- The point to check.public AdjustmentHandle hitTestHandle(android.graphics.PointF point)
DiagramItem.hitTestHandle(android.graphics.PointF)
override. Determines whether a selection handle of this link is located at the specified point.hitTestHandle
in class DiagramItem
point
- A PointF instance specifying the location where to look for adjustment handles.LinkAdjustmentHandle
instance representing the adjustment
handle found at the specified location, or null if there is none.public android.graphics.RectF getBounds()
getBounds
in class DiagramItem
RectF
object representing the
link's bounding rectangle.protected android.graphics.RectF 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()
public void applyRoute(java.util.ArrayList<android.graphics.Point> routePoints, RouteDescriptor routeDescriptor, PointList resultPoints)
protected DiagramItemState createState()
DiagramItem.createState()
override.createState
in class DiagramItem
protected void saveState(DiagramItemState state)
saveState
in class DiagramItem
protected void restoreState(DiagramItemState state)
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 getAutoSnapToNode()
true
to snap links to nearest node; otherwise, false
.public void setAutoSnapToNode(boolean value)
value
- true
to snap links to nearest node; otherwise, false
.protected void onChangeFont()
onChangeFont
in class DiagramItem
protected DiagramItemProperties createProperties()
DiagramItem.createProperties()
override.createProperties
in class DiagramItem
protected void saveProperties(DiagramItemProperties props)
saveProperties
in class DiagramItem
props
- A DiagramItemProperties-derived object where
the item's properties should be saved.protected void restoreProperties(DiagramItemProperties props)
restoreProperties
in class DiagramItem
props
- A DiagramItemProperties -derived object containing a
snapshot of the item's properties.public android.graphics.RectF getEditRect(DiagramItem item, android.graphics.PointF pointerPosition)
InplaceEditable
getEditRect
in interface InplaceEditable
item
- The DiagramItem
whose text will be edited or that contains the edited component.pointerPosition
- The current pointer position.public java.lang.String getTextToEdit()
InplaceEditable
getTextToEdit
in interface InplaceEditable
public void setEditedText(java.lang.String newText)
InplaceEditable
setEditedText
in interface InplaceEditable
newText
- A String containing the item text.public CustomDraw getCustomDraw()
CustomDraw
enumeration.public void setCustomDraw(CustomDraw value)
value
- A member of the CustomDraw
enumeration.public Brush getBaseBrush()
Brush
-derived class. The default value is null.public void setBaseBrush(Brush value)
value
- An instance of a Brush
-derived class. The default value is null.public Brush getHeadBrush()
Brush
-derived class. The default value is null.public void setHeadBrush(Brush value)
value
- An instance of a Brush
-derived class. The default value is null.public Brush getIntermediateBrush()
Brush
-derived class. The default value is null.