public class FreeFormNode extends DiagramNode implements InplaceEditable
allowIncomingLinks, allowOutgoingLinks, anchorPattern, AV_Cancel, AV_EndModIncoming, AV_EndModOutgoing, AV_StartModIncoming, AV_StartModOutgoing, AV_UpdateIncoming, AV_UpdateOutgoing, AV_UpdIntscIncoming, AV_UpdIntscOutgoing, AV_UpdPosIncoming, AV_UpdPosOutgoing, bounds, enabledHandles, handlesStyle, incomingLinks, masterGroup, obstacle, outgoingLinks, savedBounds
brush, cycleDetected, cycleProtect, modifyDX, modifyDY, modifyHandle, modifying, pen, ptEnd, ptMdfLast, ptOrg, ptSavedEnd, ptSavedOrg, subordinateGroup
Constructor and Description |
---|
FreeFormNode()
Initializes a new instance of the
FreeFormNode class. |
FreeFormNode(Diagram parent)
Initializes a new instance of the
FreeFormNode class. |
FreeFormNode(FreeFormNode prototype)
Initializes a new instance of the FreeFormNode class using the specified node as a prototype.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
allowCreate(android.graphics.PointF current,
InteractionState ist)
|
protected void |
cancelModify(InteractionState ist)
|
protected void |
completeCreate(android.graphics.PointF end)
|
boolean |
containsPoint(android.graphics.PointF point)
DiagramNode.containsPoint(PointF) override. |
boolean |
containsPoint(android.graphics.PointF point,
float threshold)
DiagramNode.containsPoint(PointF, float) override. |
protected DiagramItemProperties |
createProperties()
DiagramNode.createProperties override.
|
protected DiagramItemState |
createState()
DiagramNode.createState override.
|
void |
draw(android.graphics.Canvas g,
RenderOptions options)
|
protected void |
drawShadow(android.graphics.Canvas g,
RenderOptions options)
|
boolean |
getClosed()
Gets if the node's shape is closed.
|
android.graphics.RectF |
getEditRect(DiagramItem item,
android.graphics.PointF pointerPosition)
Implements InplaceEditable.getEditRect.
|
java.util.ArrayList<android.graphics.PointF> |
getPoints()
Gets the node's outline points.
|
java.lang.String |
getText()
Gets the text displayed inside this node.
|
java.lang.String |
getTextToEdit()
Implements InplaceEditable.getTextToEdit.
|
AdjustmentHandle |
hitTestHandle(android.graphics.PointF point)
|
com.mindfusion.diagramming.builders.FreeFormNodeBuilder |
init()
Returns a FreeFormNodeBuilder object used to configure this FreeFormNode instance.
|
protected void |
loadFromXml(org.w3c.dom.Element xmlElement,
XmlPersistContext context)
Loads the item content from an XML element.
|
protected void |
onUpdateBounds()
DiagramNode.onUpdateBounds() override. |
void |
readExternal(java.io.ObjectInput in)
DiagramNode.readExternal override.
|
protected void |
restoreProperties(DiagramItemProperties props)
DiagramNode.restoreProperties override.
|
protected void |
restoreState(DiagramItemState state)
DiagramNode.restoreState override.
|
protected void |
saveProperties(DiagramItemProperties props)
DiagramNode.saveProperties override.
|
protected void |
saveState(DiagramItemState state)
DiagramNode.saveState override.
|
protected void |
saveToXml(org.w3c.dom.Element xmlElement,
XmlPersistContext context)
Saves the item content into an XML element.
|
void |
setClosed(boolean value)
Sets if the node's shape is closed.
|
void |
setEditedText(java.lang.String newText)
Implements InplaceEditable.setEditedText.
|
void |
setPoints(java.util.ArrayList<android.graphics.PointF> value)
Sets the node's outline points.
|
void |
setText(java.lang.String value)
Sets the text label displayed inside this node.
|
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 the node's internal state after its points have changed.
|
protected void |
updateModify(android.graphics.PointF current,
InteractionState ist)
|
static com.mindfusion.diagramming.builders.FreeFormNodeBuilder |
with()
Returns a FreeFormNodeBuilder object used to configure and create new FreeFormNode instances.
|
void |
writeExternal(java.io.ObjectOutput out)
DiagramNode.writeExternal override.
|
allowModify, allowModifyImpl, attachTo, attachTo, attachTo, completeModify, constraintsInfringed, createConnectionPoint, detach, drawLocal, drawShadowLocal, getAllIncomingLinks, getAllLinks, getAllOutgoingLinks, getAllowIncomingLinks, getAllowOutgoingLinks, getAnchorPattern, getBounds, getCenter, getConstraints, getEffects, getEnabledHandles, getExpandable, getExpanded, getHandlesStyle, getIncomingLinks, getLocalBounds, getLocalBoundsD, getLocalCenter, getMasterGroup, getObstacle, getOutgoingLinks, getRepaintRect, getRotatedBounds, getRotationAngle, groupContains, move, moveTo, nodesIntersect, onDragOut, onDragOver, onDropOver, onModify, onRemove, onRotationAngleChanged, parentConstraintsInfringed, putExpandable, rectFromPoints, resize, resizeToFitImage, scaleElements, setAllowIncomingLinks, setAllowOutgoingLinks, setAnchorPattern, setBounds, setBounds, setBounds, setBoundsDirect, setConstraints, setEnabledHandles, setExpandable, setExpanded, setExpandedFlag, setHandlesStyle, setObstacle, setReflexive, setRotationAngle, shouldRenderAnchors, updateLinkPositions
clone, getBrush, getEffectiveBrush, getEffectiveFont, getEffectivePen, getEffectiveShadowBrush, getEffectiveTextBrush, getFont, getHyperLink, getId, getIgnoreLayout, getLayerIndex, getLayoutTraits, getLocked, getMeasureUnit, getParent, getPen, getPrintable, getRuntimeIndex, getSelected, getShadowBrush, getShadowOffsetX, getShadowOffsetY, getStyle, getSubordinateGroup, getTag, getTextBrush, getTextPadding, getToolTip, getValue, getVisible, getWeight, getZIndex, hasSubordinates, onAdd, onChangeFont, onChangeTextPadding, onChildModified, onClick, onDoubleClick, onLoad, onMeasureUnitChanged, 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, setVisible, setWeight, setZIndex, shouldRender, zBottom, zLevelDown, zLevelUp, zTop
public FreeFormNode()
FreeFormNode
class.public FreeFormNode(Diagram parent)
FreeFormNode
class.parent
- The Diagram
from which to obtain default values for the node properties.public FreeFormNode(FreeFormNode prototype)
prototype
- The node to use as a prototype. The properties of the new node
are initialized from the property values of this node.public static com.mindfusion.diagramming.builders.FreeFormNodeBuilder with()
FreeFormNodeBuilder
instance.public com.mindfusion.diagramming.builders.FreeFormNodeBuilder init()
FreeFormNodeBuilder
instance.public java.util.ArrayList<android.graphics.PointF> getPoints()
public void setPoints(java.util.ArrayList<android.graphics.PointF> value)
value
- An ArrayListpublic boolean getClosed()
public void setClosed(boolean value)
value
- true if the node should be drawn as a closed polygon and filled, or false otherwise.protected void startCreate(android.graphics.PointF org)
startCreate
in class DiagramNode
org
- The initial position of the pointer.protected void updateCreate(android.graphics.PointF current)
updateCreate
in class DiagramNode
current
- The current position of the pointer.protected void completeCreate(android.graphics.PointF end)
completeCreate
in class DiagramNode
end
- The pointer position.protected boolean allowCreate(android.graphics.PointF current, InteractionState ist)
DiagramNode.allowCreate(android.graphics.PointF, com.mindfusion.diagramming.InteractionState)
override.allowCreate
in class DiagramNode
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)
DiagramNode.startModify(android.graphics.PointF, com.mindfusion.diagramming.AdjustmentHandle, com.mindfusion.diagramming.InteractionState)
override. Invoked when the user starts modifying this node interactively.startModify
in class DiagramNode
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)
DiagramNode.updateModify(android.graphics.PointF, com.mindfusion.diagramming.InteractionState)
override. Invoked during interactive modification of this node.updateModify
in class DiagramNode
current
- The current position of the pointer.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 node has been canceled.cancelModify
in class DiagramNode
ist
- An InteractionState
object containing more information about the current state of the operation.public void updateFromPoints()
protected void onUpdateBounds()
DiagramNode.onUpdateBounds()
override. Invoked when the bounding rectangle of this node has changed.onUpdateBounds
in class DiagramNode
public boolean containsPoint(android.graphics.PointF point)
DiagramNode.containsPoint(PointF)
override. Checks whether this node
contains the specified point. This method is called during hit-testing to determine
if the pointer is over the node.containsPoint
in class DiagramNode
point
- The point to check.public boolean containsPoint(android.graphics.PointF point, float threshold)
DiagramNode.containsPoint(PointF, float)
override. Tests whether
the specified point is inside this node or within the specified distance from its outlines.containsPoint
in class DiagramNode
point
- The point to check.threshold
- Specifies the size of the area around the node
outlines where the point is still considered inside the node.public void draw(android.graphics.Canvas g, RenderOptions options)
DiagramNode.draw(android.graphics.Canvas, com.mindfusion.diagramming.RenderOptions)
override. Draws this node on the specified Canvas surface.draw
in class DiagramNode
g
- An android.graphics.Canvas instance.options
- Provides options for the drawing operation.protected void drawShadow(android.graphics.Canvas g, RenderOptions options)
DiagramNode.drawShadow(android.graphics.Canvas, com.mindfusion.diagramming.RenderOptions)
override. Draws the node's shadow on the specified Canvas surface.drawShadow
in class DiagramNode
g
- An android.graphics.Canvas instance.options
- Provides options for the drawing operation.public AdjustmentHandle hitTestHandle(android.graphics.PointF point)
DiagramNode.hitTestHandle(android.graphics.PointF)
override. Determines whether a selection handle of this node is located at the specified point.hitTestHandle
in class DiagramNode
point
- A PointF instance specifying the location where to look for adjustment handles.NodeAdjustmentHandle
or FreeFormHandle
representing the adjustment
handle found at the specified location, or null if there is none.protected void saveToXml(org.w3c.dom.Element xmlElement, XmlPersistContext context)
saveToXml
in class DiagramNode
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
loadFromXml
in class DiagramNode
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
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
writeExternal
in class DiagramNode
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 DiagramNode
java.io.IOException
java.lang.ClassNotFoundException
protected DiagramItemState createState()
createState
in class DiagramNode
protected void saveState(DiagramItemState state)
saveState
in class DiagramNode
protected void restoreState(DiagramItemState state)
restoreState
in class DiagramNode
protected DiagramItemProperties createProperties()
createProperties
in class DiagramNode
protected void saveProperties(DiagramItemProperties props)
saveProperties
in class DiagramNode
props
- A DiagramItemProperties-derived object where
the item's properties should be saved.protected void restoreProperties(DiagramItemProperties props)
restoreProperties
in class DiagramNode
props
- A DiagramItemProperties -derived object containing a
snapshot of the item's properties.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 java.lang.String getTextToEdit()
getTextToEdit
in interface InplaceEditable
public void setEditedText(java.lang.String newText)
setEditedText
in interface InplaceEditable
newText
- The new text of this node.public android.graphics.RectF getEditRect(DiagramItem item, android.graphics.PointF pointerPosition)
getEditRect
in interface InplaceEditable
item
- A reference to this node.pointerPosition
- A PointF instance specifying the current pointer position.