public class Diagram extends DiagramBase implements IItemFactory, java.awt.image.ImageObserver
It acts as a container for diagram elements such as nodes and links. Nodes are
instances of DiagramNode
-derived classes. The nodes
can be accessed through getNodes()
.
Links in JDiagram are instances of the DiagramLink
class and can be accessed
through the getLinks()
method. Diagram items can be grouped in
hierarchical structures and the so formed groups can be accessed via
getGroups()
.
Managing items: Use the Factory.createShapeNode(double, double, double, double)
, Factory.createTableNode(double, double, double, double)
and
Factory.createDiagramLink(com.mindfusion.diagramming.DiagramNode, com.mindfusion.diagramming.DiagramNode)
methods to create new diagram items. Optionally, items
can be created using the new
operator and added to the diagram
with the add(com.mindfusion.diagramming.DiagramItem)
method. Items are deleted using the deleteItem(com.mindfusion.diagramming.DiagramItem)
method.
The Factory.createGroup(com.mindfusion.diagramming.DiagramItem)
method creates a new hierarchical Group
of
items. The subordinated items in a group always follow the movement of their
master item. Use the destroyGroup(com.mindfusion.diagramming.Group)
method to destroy a group.
Searching for a particular kind of items is done with the
findLink(java.lang.Object)
, findNode(java.lang.Object)
and findGroup(java.lang.Object)
methods, which
look for an item that has a particular Tag
. To get
whatever object is placed at a certain location, use the getItemAt(java.awt.geom.Point2D, boolean)
,
getNodeAt(java.awt.geom.Point2D)
and getLinkAt(java.awt.geom.Point2D.Float, float)
methods.
Serialization: Binary serialization of diagrams is provided by the
saveTo(java.io.ObjectOutputStream)
and loadFrom(java.io.ObjectInputStream)
methods which serialize diagrams
to / from Java streams or files. Use the saveToXml(java.lang.String)
and loadFromXml(java.lang.String)
methods to serialize a diagram into/from XML documents.
Controlling users actions: Users actions can be validated by handling
some events declared in DiagramListener
, fired while items are
being created or modified. In addition, the Diagram
class
provides some properties that control user interaction. The DiagramView.setBehavior(com.mindfusion.diagramming.Behavior)
method specifies how users actions with the mouse are interpreted by creating
nodes, links, selection, etc. The order in which items are hit-tested when clicking
on them depends on the value assigned via setHitTestPriority(com.mindfusion.diagramming.HitTestPriority)
.
The following attribute setters let you control what kind of links users can
create: setAllowLinksRepeat(boolean)
, setAllowSelfLoops(boolean)
,
setAllowUnanchoredLinks(boolean)
, setAllowUnconnectedLinks(boolean)
. To
specify whether users are allowed to edit the text of nodes by double-clicking,
use DiagramView.setAllowInplaceEdit(boolean)
.
Constructor and Description |
---|
Diagram()
Initializes a new instance of the Diagram class.
|
Modifier and Type | Method and Description |
---|---|
void |
add(DiagramItem item)
Adds a new item to the diagram.
|
void |
add(DiagramItem item,
boolean select)
Adds a new item to the diagram and optionally selects it.
|
void |
addDiagramListener(DiagramListener listener)
Registers
listener so that it will receive events when
users create, modify or delete diagram items. |
java.awt.geom.Point2D.Float |
alignPointToGrid(java.awt.geom.Point2D.Float point)
Aligns a point to the alignment grid.
|
void |
arrangeLinkLabels()
Rearranges link labels whose AutoArrange property is enabled.
|
void |
changeUnit(GraphicsUnit newUnit)
Sets new MeasureUnit value and scales the coordinates of diagram items
so that their absolute size remains unchanged.
|
void |
clearAll()
Deletes all items from the diagram.
|
SelectionCopy |
copySelection(Diagram source,
boolean unconnectedLinks,
boolean copyGroups)
Creates a copy of the currently selected objects and groups.
|
java.awt.image.BufferedImage |
createImage()
Creates a bitmap image representing the diagram contents.
|
java.awt.image.BufferedImage |
createImage(int imageType)
Creates a bitmap image representing the diagram contents.
|
java.lang.Object |
createItem(java.lang.String itemClass)
Implements the IItemFactory interface.
|
java.lang.Object |
createStyledText(java.awt.Graphics2D graphics,
java.lang.String text,
java.awt.Font font) |
Theme |
createThemeFromDefaults()
Creates a
Theme object representing the default properties of the diagram. |
void |
destroyGroup(Group group)
Destroys the specified group.
|
void |
draw(java.awt.Graphics2D graphics,
RenderOptions options,
java.awt.geom.Rectangle2D clipRect)
Renders the diagram on the specified Graphics2D object.
|
void |
drawAlignmentGuides(java.awt.Graphics2D graphics)
Draws the current alignment guides.
|
void |
drawLayer(java.awt.Graphics2D g,
java.awt.geom.Rectangle2D backgroundRect,
int layerIndex,
RenderOptions options)
Renders all items of a layer to the specified graphics.
|
void |
drawString(java.lang.String text,
java.awt.Graphics2D graphics,
java.awt.Font font,
Brush brush,
java.awt.geom.Rectangle2D bounds,
TextFormat format) |
void |
drawStyledText(java.awt.Graphics2D graphics,
java.lang.String text,
java.awt.Font font,
java.awt.geom.Rectangle2D textBounds,
TextFormat format,
Brush textBrush) |
void |
drawTextObject(java.awt.Graphics2D graphics,
java.lang.Object text,
java.awt.Font font,
java.awt.geom.Rectangle2D textBounds,
TextFormat format,
Brush textBrush) |
void |
enumByReverseZ(java.awt.geom.Point2D hitTest,
double threshold,
com.mindfusion.diagramming.ProcessItem<DiagramItem> processItem) |
void |
enumByReverseZ(java.awt.geom.Point2D hitTest,
com.mindfusion.diagramming.ProcessItem<DiagramItem> processItem) |
void |
enumTopLevelByReverseZ(java.awt.geom.Point2D hitTest,
double threshold,
com.mindfusion.diagramming.ProcessItem<DiagramItem> processItem) |
void |
enumTopLevelByReverseZ(java.awt.geom.Point2D hitTest,
com.mindfusion.diagramming.ProcessItem<DiagramItem> processItem) |
void |
executeCommand(Command cmd)
Executes a command and saves it in the undo/redo history.
|
Group |
findGroup(java.lang.Object tag)
Finds the group that has the specified tag.
|
DiagramLink |
findLink(java.lang.Object tag)
Finds the link that has the specified tag.
|
DiagramLink |
findLinkById(java.lang.Object id)
Finds the link that has the specified id value.
|
DiagramNode |
findNode(java.lang.Object tag)
Finds the node that has the specified tag.
|
DiagramNode |
findNodeById(java.lang.Object id)
Finds the node that has the specified id value.
|
DiagramItem |
getActiveItem()
Gets the active item.
|
HandlesVisualStyle |
getActiveItemHandlesStyle()
Gets the visual style of the manipulation handles displayed around the active item.
|
int |
getActiveLayer()
Gets the zero-based index of the active layer.
|
float |
getAdjustmentHandlesSize()
Gets the size of selection handles.
|
Pen |
getAlignmentGuidePen()
Gets the pen used to draw alignment guides.
|
boolean |
getAlignToGrid()
Gets a value indicating whether items are aligned to the
alignment grid while users draw them with the mouse.
|
boolean |
getAllowLinksRepeat()
Gets a value indicating whether users are allowed to
draw more than one links between the same nodes.
|
boolean |
getAllowMultipleResize()
Gets whether multiple selected nodes can be resized simultaneously.
|
boolean |
getAllowSelfLoops()
Gets whether users are allowed to draw reflexive links.
|
boolean |
getAllowSplitLinks()
Gets whether link segments can be added and removed interactively.
|
boolean |
getAllowUnanchoredLinks()
Gets a value indicating whether users are allowed to attach links to
nodes that do not have any anchor points.
|
boolean |
getAllowUnconnectedLinks()
Gets a value indicating whether users are allowed to draw unconnected links.
|
float |
getAutoAlignDistance()
Gets the maximal horizontal or vertical distance at which
a node aligns to the borders of other nodes.
|
boolean |
getAutoAlignNodes()
Gets whether nodes should automatically align to
the borders of other nodes during user interaction.
|
float |
getAutoCloseDistance()
Gets the maximum distance between first and last points of a
FreeFormNode
for which the node's outline is closed automatically. |
AutoResize |
getAutoResize()
Gets a value specifying whether the document scrollable area is
resized automatically when users draw items near the edges of the diagram.
|
float |
getAutoSnapDistance()
Specifies the maximum distance at which links auto-snap to nodes.
|
boolean |
getAutoSnapLinks()
Gets the default value for the AutoSnapToNode property of new links.
|
Brush |
getBackBrush()
Gets the diagram's background brush.
|
java.awt.Image |
getBackgroundImage()
Gets the background image.
|
ImageAlign |
getBackgroundImageAlign()
Gets how the background image is positioned relatively to
the scrollable area of the diagram.
|
java.lang.String |
getBackgroundImageUrl()
Gets the URL of the background image.
|
java.awt.geom.Rectangle2D.Float |
getBounds()
Gets the bounds of the scrollable area of the diagram.
|
Pen |
getBoundsPen()
Gets the pen with which the diagram bounds are drawn.
|
CustomDraw |
getCellCustomDraw()
Gets the default type of custom painting applied to cells of new tables.
|
CellFrameStyle |
getCellFrameStyle()
Gets the default style of the cell frames of new tables.
|
java.util.HashMap<java.lang.String,ClassDescriptor> |
getClsidTable()
Gets the table of registered item identifiers.
|
java.lang.String |
getContainerCaption()
Gets the default value for the Caption property of containers.
|
float |
getContainerCaptionHeight()
Gets the default value for the CaptionHeight property of containers.
|
Pen |
getContainerHighlightPen()
Gets the default value for the HighlightPen property of containers.
|
float |
getContainerMargin()
Gets the default value for the Margin property of containers.
|
java.awt.geom.Dimension2D |
getContainerMinimumSize()
Gets the default value for the MinimumSize property of containers.
|
ContainerNodeStyle |
getContainerNodeStyle()
Gets the theme-level style for container nodes.
|
boolean |
getContainersFoldable()
Gets the default value for the Foldable property of containers.
|
java.awt.geom.Rectangle2D |
getContentBounds(boolean forPrint,
boolean onlyVisible)
Returns the smallest rectangle that bounds all diagram objects.
|
float |
getCrossingRadius()
Gets the radius of the shapes drawn at link crossing points.
|
java.lang.Class<? extends java.awt.Component> |
getDefaultControlType()
Gets the type of components that will be hosted by default
in newly created
ControlNode objects. |
Shape |
getDefaultShape()
Gets the default shape of nodes.
|
DiagramLinkStyle |
getDiagramLinkStyle()
Gets the theme-level style for diagram links.
|
DiagramStyle |
getDiagramStyle()
Gets the theme-level style for the diagram.
|
boolean |
getDirty()
Indicates whether the diagram has changed since the last save.
|
HandlesVisualStyle |
getDisabledHandlesStyle()
Gets the visual style of disabled manipulation handles.
|
DummyNode |
getDummy() |
boolean |
getDynamicLinks()
Gets a value indicating whether links automatically update their end
points positions so that they will always point towards the node centers.
|
Brush |
getEffectiveBackBrush()
Gets the currently effective background brush of the diagram.
|
boolean |
getEnableLanes()
Gets whether lanes are enabled.
|
boolean |
getEnableSpatialIndex()
Gets whether to index item positions for faster hit-testing and viewport clipping queries.
|
boolean |
getEnableStyledText()
Gets a value indicating whether new nodes display richly formatted text.
|
ExpandButtonAction |
getExpandButtonAction()
Gets what should happen when a user clicks the +/- button
that is displayed near expandable nodes.
|
ExpandButtonPosition |
getExpandButtonPosition()
Gets where expand/collapse buttons are located relatively to their nodes.
|
boolean |
getExpandOnIncoming()
Gets which direction of links is considered the tree direction
when expanding or collapsing diagram branches.
|
Factory |
getFactory()
Gets a Factory instance that lets you add programmatically new items to the diagram.
|
ComponentBase |
getFocusedComponent()
Gets the component within this diagram which is currently
holding the input focus.
|
Manipulator |
getFocusedManipulator()
Gets the manipulator currently holding the input focus.
|
java.awt.geom.Dimension2D |
getFoldedContainerSize()
Gets the size of folded containers.
|
java.awt.Font |
getFont()
Gets the default font for new diagram items.
|
static int |
getFormatBeingLoaded() |
float |
getFreeFormAttractDistance()
Gets the radius around dragged free-form adjustment handle
in which other points of FreeFormNode are modified too.
|
Shape[] |
getFreeFormTargets()
Gets an array of Shape objects used to replace FreeFormNode instances with
ShapeNode ones when Behavior is set to LinkFreeShapes or DrawFreeShapes.
|
java.awt.Color |
getGridColor()
Gets the color of the alignment grid.
|
float |
getGridOffsetX()
Gets the horizontal offset of the first point of the alignment grid.
|
float |
getGridOffsetY()
Gets the vertical offset of the first point of the alignment grid.
|
float |
getGridSizeX()
Gets the horizontal distance between grid points.
|
float |
getGridSizeY()
Gets the vertical distance between grid points.
|
GridStyle |
getGridStyle()
Gets the appearance style of the alignment grid.
|
GroupList |
getGroups()
Gets a collection of all groups in the diagram.
|
HitTestPriority |
getHitTestPriority()
Gets a value indicating the order in which items are hit-tested.
|
int |
getImageDpiX()
Specifies the default resolution of images.
|
int |
getImageDpiY() |
InteractionState |
getInteraction()
Gets an
InteractionState instance representing the current action being carried out by the user. |
DiagramItem |
getItemAt(java.awt.geom.Point2D point,
boolean excludeLocked)
Returns the top-most item that contains the specified point.
|
DiagramItem |
getItemAt(java.awt.geom.Point2D point,
boolean excludeLocked,
boolean excludeModified,
boolean includeHandles,
boolean includeLabels)
Returns the top-most item that contains the specified point.
|
DiagramItemList |
getItems()
Gets a collection of all items in the diagram.
|
com.mindfusion.diagramming.lanes.Grid |
getLaneGrid()
Gets a Grid object that represents the diagram's swimlane grid.
|
java.util.List<Layer> |
getLayers()
Gets a list of the layers in the current diagram.
|
DiagramLink |
getLinkAt(java.awt.geom.Point2D.Float point,
float maxDist)
Returns the top-most link that passes near the specified point.
|
DiagramLink |
getLinkAt(java.awt.geom.Point2D point,
double maxDist,
boolean exclLocked)
Returns the top-most link that passes near the specified point.
|
DiagramLink |
getLinkAt(java.awt.geom.Point2D point,
double maxDist,
boolean excludeLocked,
boolean excludeModified)
Returns the top-most link that passes near the specified point.
|
DiagramLink |
getLinkAt(java.awt.geom.Point2D point,
double maxDist,
boolean excludeLocked,
boolean excludeModified,
com.mindfusion.common.ByRef<java.lang.Integer> segmNum)
Returns the top-most link that passes near the specified point.
|
Shape |
getLinkBaseShape()
Gets the default shape displayed at the origin of new links.
|
float |
getLinkBaseShapeSize()
Gets the default size of the shape displayed at the origin of new links.
|
BranchIndicator |
getLinkBranchIndicator() |
Brush |
getLinkBrush()
Deprecated.
|
Orientation |
getLinkCascadeOrientation()
Gets the default orientation of the first segments of cascading links.
|
LinkCrossings |
getLinkCrossings()
Gets what shapes are drawn at link crossing points.
|
CustomDraw |
getLinkCustomDraw()
Gets the default type of custom painting done on links.
|
boolean |
getLinkEndsMovable()
Gets a value indicating users are allowed to move the end points
of an link after the link is created.
|
HandlesStyle |
getLinkHandlesStyle()
Gets the default style of link selection handles.
|
Shape |
getLinkHeadShape()
Gets the default shape displayed as arrowhead of new links.
|
float |
getLinkHeadShapeSize()
Gets the default size of the shape displayed as arrowhead of new links.
|
Shape |
getLinkIntermediateShape()
Gets the default shape displayed at the middle of links segments.
|
float |
getLinkIntermediateShapeSize()
Gets the default size of the shape displayed at the middle of links segments.
|
Pen |
getLinkPen()
Deprecated.
|
LinkRouter |
getLinkRouter()
Gets the component used to find paths for auto-routed links
when diagram nodes are added or their positions change.
|
DiagramLinkList |
getLinks()
Gets a collection of all links in the diagram.
|
DiagramLinkList |
getLinksAt(java.awt.geom.Point2D.Float point)
Returns the links that contain the specified point.
|
int |
getLinkSegments()
Gets the default number of link segments.
|
LinkShape |
getLinkShape()
Gets the default style of links.
|
boolean |
getLinksRetainForm()
Gets a value indicating whether new links are set to maintain their
shapes while the nodes they connect are moved around.
|
java.lang.String |
getLinkText()
Gets the default text assigned to new links.
|
LinkTextStyle |
getLinkTextStyle()
Gets the default placement and orientation of the links labels.
|
GraphicsUnit |
getMeasureUnit()
Gets the current unit of measure.
|
float |
getMergeThreshold()
Gets the maximum distance between adjacent control points of a link
at which the respective segments can be merged.
|
DiagramNode |
getNearestNode(java.awt.geom.Point2D point,
float maxDistance,
DiagramNode ignored)
Returns the nearest node whose bounding rectangle is
intersected by the circle, defined by origin point and radius.
|
DiagramNode |
getNodeAt(java.awt.geom.Point2D point)
Returns the top-most node that contains the specified point.
|
DiagramNode |
getNodeAt(java.awt.geom.Point2D point,
boolean excludeLocked)
Returns the topmost node that lies at the specified position.
|
DiagramNode |
getNodeAt(java.awt.geom.Point2D point,
boolean excludeLocked,
boolean excludeSelected)
Returns the top-most node that contains the specified point.
|
DiagramNode |
getNodeAt(java.awt.geom.Point2D point,
float threshold)
Returns the top-most node that contains the specified point.
|
java.util.List<NodeEffect> |
getNodeEffects()
Gets a collection with all effects applied to the nodes of this diagram.
|
DiagramNodeList |
getNodes()
Gets a collection of all nodes in the diagram.
|
DiagramNodeList |
getNodesAt(java.awt.geom.Point2D.Float point)
Returns the nodes that contain the specified point.
|
boolean |
getNodesExpandable()
Gets whether the tree branches that start from new nodes
are expandable by default.
|
boolean |
getRecursiveExpand()
Gets whether tree branches are expanded recursively.
|
RenderOptions |
getRenderOptions() |
RestrictToBounds |
getRestrictItemsToBounds()
Gets a value indicating whether users are allowed to move items
outside the currently define document bounds.
|
boolean |
getRoundedLinks()
Gets if the joins between segments of Polyline
and Cascading links should be rounded.
|
float |
getRoundedLinksRadius()
Gets the radius of arc joins of rounded links' segments.
|
boolean |
getRouteLinks()
Gets a value indicating whether newly created links will
automatically find their way between nodes.
|
RoutingOptions |
getRoutingOptions()
Gets a
RoutingOptions instance that lets you set various
attributes of the link routing algorithm. |
boolean |
getSelectAfterCreate()
Gets a value indicating whether newly created items are selected automatically.
|
HandlesVisualStyle |
getSelectedItemHandlesStyle()
Gets the visual style of the manipulation handles displayed around selected items.
|
Selection |
getSelection()
Gets a
Selection instance representing the current selection. |
boolean |
getSelectionOnTop()
Gets a value indicating whether selected items are
drawn on top of the non-selected ones.
|
Brush |
getShadowBrush()
Deprecated.
|
float |
getShadowOffsetX()
Gets the default horizontal distance between shadows
and the items that cast them.
|
float |
getShadowOffsetY()
Gets the default vertical distance between shadows
and the items that cast them.
|
ShadowsStyle |
getShadowsStyle()
Gets the style of shadows.
|
Brush |
getShapeBrush()
Deprecated.
|
CustomDraw |
getShapeCustomDraw()
Gets whether new nodes should be custom drawn
and what type of custom drawing will be performed on them.
|
HandlesStyle |
getShapeHandlesStyle()
Gets the default value for the HandlesStyle property of new shape nodes.
|
ShapeNodeStyle |
getShapeNodeStyle()
Gets the theme-level style for shape nodes.
|
float |
getShapeOrientation()
Gets the default shape definition orientation angle assigned to new nodes.
|
Pen |
getShapePen()
Deprecated.
|
java.lang.String |
getShapeText()
Gets the default text assigned to new nodes.
|
ShowAnchors |
getShowAnchors()
Gets a value indicating whether anchor points should be shown on screen.
|
boolean |
getShowDisabledHandles()
Gets whether disabled manipulation handles are displayed.
|
boolean |
getShowGrid()
Gets a value indicating whether the alignment grid is displayed.
|
boolean |
getShowHandlesOnDrag()
Gets whether selection handles of objects under the mouse are
displayed while another object is being modified.
|
SnapToAnchor |
getSnapToAnchor()
Gets a value indicating when links should snap to anchor points.
|
DiagramStyle |
getStyle()
Gets the style associated with the diagram.
|
SvgNodeStyle |
getSvgNodeStyle()
Gets the theme-level style for SVG nodes.
|
Brush |
getTableBrush()
Deprecated.
|
java.lang.String |
getTableCaption()
Gets the default caption text assigned to new tables.
|
float |
getTableCaptionHeight()
Gets the default height of the caption area of new tables.
|
int |
getTableColumnCount()
Gets how many columns new tables have by default.
|
float |
getTableColumnWidth()
Gets the default width of the columns of new tables.
|
TableConnectionStyle |
getTableConnectionStyle()
Gets how users are allowed to link tables to each other - as integral entities, by rows, or both.
|
CustomDraw |
getTableCustomDraw()
Gets the default type of custom painting applied to new tables.
|
HandlesStyle |
getTableHandlesStyle()
Gets the default style of table selection handles.
|
TableNodeStyle |
getTableNodeStyle()
Gets the theme-level style for table nodes.
|
Pen |
getTablePen()
Deprecated.
|
int |
getTableRowCount()
Gets how many rows new tables have by default.
|
float |
getTableRowHeight()
Gets the default height of the row of new tables.
|
SimpleShape |
getTableShape()
Gets the default value of the Shape property of new tables.
|
boolean |
getTablesScrollable()
Gets a value indicating whether users are allowed to scroll new tables.
|
java.lang.Object |
getTag()
Gets the custom data associated with this diagram.
|
java.awt.Color |
getTextColor()
Deprecated.
|
TextFormat |
getTextFormat()
Gets the default format and alignment of the text of new items.
|
Theme |
getTheme()
Gets the theme associated with the diagram.
|
java.lang.String |
getToolTip()
Gets the tooltip text.
|
TreeViewNodeStyle |
getTreeViewNodeStyle()
Gets the theme-level style for tree view nodes.
|
java.util.HashMap<java.lang.Class<?>,ClassDescriptor> |
getTypeTable()
Gets the table of registered item types.
|
UndoManager |
getUndoManager()
Gets the diagram's
UndoManager . |
boolean |
getValidityChecks() |
protected java.lang.Object |
getValue(java.lang.String name)
Gets the effective value of the style property with the specified name.
|
boolean |
handleKeyDown(int keyCode,
int modifiers)
Propagates keyboard input to interested manipulators and components.
|
void |
handleKeyPress(char keyChar)
Propagates keyboard input to interested manipulators.
|
void |
handleKeyUp(int keyCode,
int modifiers)
Propagates keyboard input to interested components.
|
CursorHint |
handlePointerMove(java.awt.geom.Point2D point)
Propagates mouse input to interested manipulators.
|
ComponentBase |
hitTestComponents(java.awt.geom.Point2D point) |
ItemLabel |
hitTestLabels(java.awt.geom.Point2D point)
Returns the item label located at specified position.
|
java.awt.geom.Point2D.Float |
imageToDoc(int x,
int y)
Transforms points from the image coordinate space to the document coordinate space.
|
double |
imageToDocX(int x)
Converts from image coordinates to document coordinates.
|
double |
imageToDocY(int y)
Converts from image coordinates to document coordinates.
|
boolean |
imageUpdate(java.awt.Image img,
int infoflags,
int x,
int y,
int width,
int height) |
DiagramBuilder |
init()
Returns a DiagramBuilder object used to configure this Diagram instance.
|
static boolean |
isClassRegistered(java.lang.Class classType)
Checks if a class is registered for serialization support.
|
static boolean |
isClientClassRegistered(java.lang.Class classType)
Checks if a class is registered for JSON serialization support.
|
boolean |
isItemInteractive(DiagramItem item)
Checks if the specified item can be modified interactively.
|
boolean |
isItemLocked(DiagramItem item)
Checks if the specified item is locked.
|
boolean |
isItemVisible(DiagramItem item)
Checks if the specified item is currently visible.
|
<T extends DiagramItem> |
items(java.lang.Class<T> desiredType)
Iterates over diagram items of the desired type
|
void |
loadFrom(java.io.InputStream in)
Loads the diagram contents from a stream.
|
void |
loadFrom(java.lang.String fileName)
Loads the diagram contents from a file.
|
void |
loadFromJson(java.lang.String json)
Loads the diagram from a JSON-formatted string.
|
void |
loadFromJsonFile(java.lang.String fileName)
Loads the diagram from a JSON file.
|
void |
loadFromJsonObject(com.mindfusion.common.JsonObject diagramObj,
JsonPersistContext context)
Loads the diagram from a JSON object.
|
void |
loadFromString(java.lang.String chartData)
Loads the diagram contents from a string.
|
void |
loadFromXml(org.w3c.dom.Document document,
boolean freeProcessedXml)
Loads the contents of the XML diagram document.
|
void |
loadFromXml(org.xml.sax.InputSource source)
Loads the contents of the XML diagram document.
|
void |
loadFromXml(java.io.InputStream stream)
Loads the contents of the XML diagram document.
|
void |
loadFromXml(java.lang.String fileName)
Loads the contents of the XML diagram document.
|
java.awt.geom.Dimension2D |
measureString(java.lang.String text,
java.awt.Font font)
Measures a text taking into consideration the current affine transform of the diagram.
|
boolean |
pasteSelection(Diagram doc,
SelectionCopy data,
CompositeCmd cmd,
float dx,
float dy)
Adds the specified items and groups to the specified diagram document.
|
void |
raiseActionRedone(Command command) |
void |
raiseActionUndone(Command command) |
void |
raiseCellTextEdited(Cell cell,
java.lang.String oldText,
java.lang.String newText,
int column,
int row)
|
boolean |
raiseCellTextEditing(TableNode table,
int column,
int row)
Raises the
DiagramListener.cellTextEditing(com.mindfusion.diagramming.CellValidationEvent) event to validate entering inplace edit mode. |
void |
raiseClicked(DiagramItem item,
java.awt.geom.Point2D mousePosition,
int mouseButton)
Raises the appropriate Clicked event.
|
void |
raiseClicked(int mouseButton,
java.awt.geom.Point2D mousePosition)
Raises the
DiagramListener.clicked(com.mindfusion.diagramming.DiagramEvent) event. |
boolean |
raiseDeleting(DiagramItem item)
Raises the appropriate Deleting event.
|
void |
raiseDoubleClicked(DiagramItem item,
java.awt.geom.Point2D mousePosition,
int mouseButton)
Raises the appropriate DoubleClicked event.
|
void |
raiseDoubleClicked(int mouseButton,
java.awt.geom.Point2D mousePosition)
Raises the
DiagramListener.doubleClicked(com.mindfusion.diagramming.DiagramEvent) event. |
void |
raiseLinkTextEdited(DiagramLink link,
java.lang.String oldText,
java.lang.String newText,
LinkLabel label)
|
boolean |
raiseLinkTextEditing(DiagramLink link)
Raises the
DiagramListener.linkTextEditing(com.mindfusion.diagramming.LinkValidationEvent) event to validate entering inplace edit mode. |
void |
raiseNodeTextEdited(DiagramNode node,
java.lang.String oldText,
java.lang.String newText,
NodeLabel label)
|
boolean |
raiseNodeTextEditing(DiagramNode node,
NodeLabel label)
Raises the
DiagramListener.nodeTextEditing(com.mindfusion.diagramming.NodeValidationEvent) event to validate entering inplace edit mode. |
void |
raiseTreeCollapsed(DiagramNode root)
Raises the TreeCollapsed event.
|
void |
raiseTreeExpanded(DiagramNode root)
Raises the TreeExpanded event.
|
void |
raiseTreeItemTextEdited(TreeViewItem item,
java.lang.String oldText,
java.lang.String newText)
Raises the
treeItemTextEdited event. |
void |
raiseViewRemoved()
Raises the
DiagramListener.viewRemoved(com.mindfusion.diagramming.ValidationEvent) event. |
static void |
registerClass(java.lang.Class<?> classType,
java.lang.String classId,
int classVersion)
Registers a diagram item or lane header class for serialization support.
|
static void |
registerClass(java.lang.Class<?> classType,
java.lang.String classId,
int classVersion,
java.lang.String clientClass)
Registers a diagram item or lane header class for serialization support.
|
static void |
registerItemClass(java.lang.Class<?> itemClass,
java.lang.String classId,
int classVersion)
Registers a diagram item class for serialization support.
|
static void |
registerItemClass(java.lang.Class<?> itemClass,
java.lang.String classId,
int classVersion,
java.lang.String clientClass)
Registers a diagram item class for serialization support.
|
void |
removeDiagramListener(DiagramListener listener)
Unregisters
listener so that it will no longer
receive diagram events. |
void |
repaint()
Repaints the diagram.
|
void |
repaint(boolean redrawCacheImage)
Causes the entire visible diagram area to be repainted.
|
void |
repaint(java.lang.Object sender,
java.awt.geom.Rectangle2D docRect)
Repaints the specified region of the diagram.
|
void |
repaint(java.awt.geom.Rectangle2D docRect)
Repaints the specified region of the diagram.
|
void |
resizeToFitItems(float margins)
Resizes the document area so that it fits exactly the diagram items.
|
void |
resizeToFitItems(float margins,
boolean onlyVisible)
Resizes the document area so that it fits exactly the diagram items.
|
void |
resumeLinkRouter(boolean routeDeferredLinks)
Called when the control ends a batch update operation that might affect many links.
|
void |
routeAllLinks()
Routes all links in the diagram so that they will not cross any node.
|
void |
routeAllLinks(DiagramLinkList linksToRoute)
Reroutes the specified links.
|
void |
saveTo(java.io.OutputStream out)
Saves the diagram contents into a stream.
|
void |
saveTo(java.lang.String fileName)
Saves the diagram contents into a file.
|
java.lang.String |
saveToJson()
Saves the diagram to a JSON-formatted string.
|
void |
saveToJsonFile(java.lang.String fileName)
Saves the diagram into a JSON file.
|
void |
saveToJsonObject(com.mindfusion.common.JsonObject diagramObj,
JsonPersistContext context)
Saves the diagram to a JSON object.
|
java.lang.String |
saveToString()
Saves the diagram contents into a string.
|
java.lang.String |
saveToString(SaveToStringFormat format,
boolean includeUnalteredProperties)
Saves the diagram contents into a string.
|
void |
saveToXml(org.w3c.dom.Document document)
Saves the diagram to the specified XML document.
|
void |
saveToXml(org.w3c.dom.Document document,
boolean includeUnalteredProperties)
Saves the diagram to the specified XML document.
|
void |
saveToXml(java.io.OutputStream stream,
boolean includeUnalteredProperties)
Saves the diagram to the specified XML document.
|
void |
saveToXml(java.lang.String fileName)
Saves the diagram to the specified XML document.
|
void |
setActiveItem(DiagramItem value)
Sets the active item.
|
void |
setActiveLayer(int value)
Sets the zero-based index of the active layer.
|
void |
setAdjustmentHandlesSize(float value)
Sets the size of selection handles.
|
void |
setAlignmentGuidePen(Pen value)
Sets the pen used to draw alignment guides.
|
void |
setAlignToGrid(boolean value)
Sets a value indicating whether items should be aligned to the
alignment grid while users draw them with the mouse.
|
void |
setAllowLinksRepeat(boolean value)
Sets a value indicating whether users are allowed to
draw more than one links between the same nodes.
|
void |
setAllowMultipleResize(boolean value)
Sets whether multiple selected nodes can be resized simultaneously.
|
void |
setAllowSelfLoops(boolean value)
Sets whether users are allowed to draw reflexive links.
|
void |
setAllowSplitLinks(boolean value)
Sets whether link segments can be added and removed interactively.
|
void |
setAllowUnanchoredLinks(boolean value)
Sets a value indicating whether users are allowed to attach links to
nodes that do not have any anchor points.
|
void |
setAllowUnconnectedLinks(boolean value)
Sets a value indicating whether users are allowed to draw unconnected links.
|
void |
setAutoAlignDistance(float value)
Sets the maximal horizontal or vertical distance at which
a node aligns to the borders of other nodes.
|
void |
setAutoAlignNodes(boolean value)
Sets whether nodes should automatically align to
the borders of other nodes during user interaction.
|
void |
setAutoCloseDistance(float value)
Sets the maximum distance between first and last points of a
FreeFormNode
for which the node's outline is closed automatically. |
void |
setAutoResize(AutoResize value)
Sets a value specifying whether the document scrollable area should be
resized automatically when users draw items near the edges of the diagram.
|
void |
setAutoSnapDistance(float value)
Specifies the maximum distance at which links auto-snap to nodes.
|
void |
setAutoSnapLinks(boolean value)
Sets the default value for the AutoSnapToNode property of new links.
|
void |
setBackBrush(Brush value)
Sets the diagram's background brush.
|
void |
setBackgroundImage(java.awt.Image value)
Sets the background image.
|
void |
setBackgroundImage(java.awt.Image img,
java.lang.String url)
Allows setting of both image and imageUrl properties as other setters reset the skipped argument.
|
void |
setBackgroundImageAlign(ImageAlign value)
Sets how the background image should be positioned relatively to
the scrollable area of the diagram.
|
void |
setBackgroundImageUrl(java.lang.String value)
Sets the URL of the background image.
|
void |
setBounds(java.awt.geom.Rectangle2D.Float value)
Sets the size of the diagram's scrollable area.
|
void |
setBounds(java.awt.geom.Rectangle2D value)
Sets the bounds of the scrollable area of the diagram.
|
void |
setBoundsPen(Pen value)
Sets the pen with which document bounds are drawn.
|
void |
setCellCustomDraw(CustomDraw value)
Sets the default type of custom painting applied to cells of new tables.
|
void |
setCellFrameStyle(CellFrameStyle value)
Sets the default style of the cell frames of new tables.
|
void |
setContainerCaption(java.lang.String containerCaption)
Sets the default value for the Caption property of containers.
|
void |
setContainerCaptionHeight(float containerCaptionHeight)
Sets the default value for the CaptionHeight property of containers.
|
void |
setContainerHighlightPen(Pen containerHighlightPen)
Sets the default value for the HighlightPen property of containers.
|
void |
setContainerMargin(float containerMargin)
Sets the default value for the Margin property of containers.
|
void |
setContainerMinimumSize(java.awt.geom.Dimension2D containerMinimumSize)
Sets the default value for the MinimumSize property of containers.
|
void |
setContainersFoldable(boolean containersFoldable)
Sets the default value for the Foldable property of containers.
|
void |
setCrossingRadius(float value)
Sets the radius of the shapes drawn at link crossing points.
|
void |
setDefaultControlType(java.lang.Class<? extends java.awt.Component> value)
Sets the type of components that will be hosted by default
in newly created
ControlNode objects. |
void |
setDefaultShape(Shape value)
Sets the default shape that should be assigned to new nodes.
|
void |
setDirty()
Marks the diagram as modified.
|
void |
setDirty(boolean value)
Lets you set or clear the diagram's modification flag.
|
void |
setDynamicLinks(boolean value)
Sets a value indicating whether links should automatically update their end
points positions so that they will always point towards the node centers.
|
void |
setEnableLanes(boolean value)
Sets whether lanes are enabled.
|
void |
setEnableSpatialIndex(boolean value)
Sets whether to index item positions for faster hit-testing and viewport clipping queries.
|
void |
setEnableStyledText(boolean value)
Sets a value indicating whether newly created nodes
should display richly formatted text.
|
void |
setExpandButtonAction(ExpandButtonAction value)
Sets what should happen when a user clicks the +/- button
that is displayed near expandable nodes.
|
void |
setExpandButtonPosition(ExpandButtonPosition value)
Sets where expand/collapse buttons are located relatively to their nodes.
|
void |
setExpandOnIncoming(boolean value)
Sets which direction of links is considered the tree direction
when expanding or collapsing diagram branches.
|
void |
setFocusedComponent(ComponentBase value)
Sets the component within this diagram which is currently
holding the input focus.
|
void |
setFocusedManipulator(Manipulator value)
Sets the manipulator currently holding the input focus.
|
void |
setFoldedContainerSize(java.awt.geom.Dimension2D value)
Sets the size of folded containers.
|
void |
setFont(java.awt.Font value)
Sets the default font for new diagram items.
|
void |
setFreeFormAttractDistance(float value)
Sets the radius around dragged free-form adjustment handle
in which other points of FreeFormNode are modified too.
|
void |
setFreeFormTargets(Shape[] value)
Sets an array of Shape objects used to replace FreeFormNode instances with
ShapeNode ones when Behavior is set to LinkFreeShapes or DrawFreeShapes.
|
void |
setGridColor(java.awt.Color value)
Sets the color of the alignment grid.
|
void |
setGridOffsetX(float value)
Sets the horizontal offset of the first point of the alignment grid.
|
void |
setGridOffsetY(float value)
Sets the vertical offset of the first point of the alignment grid.
|
void |
setGridSizeX(float value)
Sets the horizontal distance between grid points.
|
void |
setGridSizeY(float value)
Sets the vertical distance between grid points.
|
void |
setGridStyle(GridStyle value)
Sets the appearance style of the alignment grid.
|
void |
setHitTestPriority(HitTestPriority value)
Sets a value indicating the order in which items are hit-tested.
|
void |
setImageDpiX(int dpi) |
void |
setImageDpiY(int dpi) |
void |
setLinkBaseShape(Shape value)
Sets what shape should be displayed at the origin of new links.
|
void |
setLinkBaseShapeSize(float value)
Sets the default size of the shape displayed at the origin of new links.
|
void |
setLinkBranchIndicator(BranchIndicator value) |
void |
setLinkBrush(Brush value)
Deprecated.
|
void |
setLinkCascadeOrientation(Orientation value)
Sets the default orientation of the first segments of cascading links.
|
void |
setLinkCrossings(LinkCrossings value)
Sets what shapes should be drawn at the points where links cross.
|
void |
setLinkCustomDraw(CustomDraw value)
Sets the default type of custom painting done on links.
|
void |
setLinkEndsMovable(boolean value)
Sets a value indicating users are allowed to move the end points
of a link after the link is created.
|
void |
setLinkHandlesStyle(HandlesStyle value)
Sets the style of selection handles that should be assigned to new links.
|
void |
setLinkHeadShape(Shape value)
Sets what shape should be displayed as arrowhead of new links.
|
void |
setLinkHeadShapeSize(float value)
Sets the default size of the shape displayed as arrowhead of new links.
|
void |
setLinkIntermediateShape(Shape value)
Sets what shape should be displayed at the middle of links segments.
|
void |
setLinkIntermediateShapeSize(float value)
Sets the default size of the shape displayed at the middle of links segments.
|
void |
setLinkPen(Pen value)
Deprecated.
|
void |
setLinkRouter(LinkRouter value)
Sets the component used to find paths for auto-routed links
when diagram nodes are added or their positions change.
|
void |
setLinkSegments(int value)
Sets the default number of link segments.
|
void |
setLinkShape(LinkShape value)
Sets the style that should be assigned to new links.
|
void |
setLinksRetainForm(boolean value)
Sets a value indicating whether new links are set to maintain their
shapes while the nodes they connect are moved around.
|
void |
setLinkText(java.lang.String value)
Sets the default text that should be assigned to new links.
|
void |
setLinkTextStyle(LinkTextStyle value)
Sets the default placement and orientation of the links labels.
|
void |
setMeasureUnit(GraphicsUnit value)
Sets in what units JDiagram should measure lengths and sizes.
|
void |
setMergeThreshold(float value)
Sets the maximum distance between adjacent control points of a link
at which the respective segments can be merged.
|
void |
setNodesExpandable(boolean value)
Sets whether the tree branches that start from new nodes
should be expandable by default.
|
void |
setRecursiveExpand(boolean value)
Sets whether tree branches should be expanded recursively.
|
void |
setRestrictItemsToBounds(RestrictToBounds value)
Sets a value indicating whether users are allowed to move items
outside the currently define document bounds.
|
void |
setRoundedLinks(boolean roundedLinks)
Sets if the joins between segments of Polyline
and Cascading links should be rounded.
|
void |
setRoundedLinksRadius(float radius)
Sets the radius of arc joins of rounded links' segments.
|
void |
setRouteLinks(boolean value)
Sets a value indicating whether newly created links will
automatically find their way between nodes.
|
void |
setSelectAfterCreate(boolean value)
Sets a value indicating whether newly created items should be selected automatically.
|
void |
setSelectionOnTop(boolean value)
Sets a value indicating whether selected items should be
drawn on top of the non-selected ones.
|
void |
setShadowBrush(Brush value)
Deprecated.
|
void |
setShadowOffset(float x,
float y)
Sets the distance at which shadows are offset from the items that cast them.
|
void |
setShadowOffsetX(float value)
Sets the default horizontal distance between shadows
and the items that cast them.
|
void |
setShadowOffsetY(float value)
Sets the default vertical distance between shadows
and the items that cast them.
|
void |
setShadowsStyle(ShadowsStyle value)
Sets the style of shadows.
|
void |
setShapeBrush(Brush value)
Deprecated.
|
void |
setShapeCustomDraw(CustomDraw value)
Sets whether new nodes should be custom drawn
and what type of custom drawing will be performed on them.
|
void |
setShapeHandlesStyle(HandlesStyle value)
Sets the default value for the HandlesStyle property of new shape nodes.
|
void |
setShapeOrientation(float value)
Sets the default shape definition orientation angle assigned to new nodes.
|
void |
setShapePen(Pen value)
Deprecated.
|
void |
setShapeText(java.lang.String value)
Sets the default text that should be assigned to new nodes.
|
void |
setShowAnchors(ShowAnchors value)
Sets a value indicating whether anchor points should be shown on screen.
|
void |
setShowDisabledHandles(boolean value)
Sets whether disabled manipulation handles should be displayed.
|
void |
setShowGrid(boolean value)
Sets a value indicating whether the alignment grid should be displayed.
|
void |
setShowHandlesOnDrag(boolean value)
Sets whether selection handles of objects under the mouse should be
displayed while another object is being modified.
|
void |
setSnapToAnchor(SnapToAnchor value)
Sets a value indicating when links should snap to anchor points.
|
void |
setStyle(DiagramStyle value)
Sets the style associated with the diagram.
|
void |
setTableBrush(Brush value)
Deprecated.
|
void |
setTableCaption(java.lang.String value)
Sets the default caption text that should be assigned to new tables.
|
void |
setTableCaptionHeight(float value)
Sets the default height of the caption area of new tables.
|
void |
setTableColumnCount(int value)
Sets how many columns should be allocated to new tables.
|
void |
setTableColumnWidth(float value)
Sets the default width of columns in newly created tables.
|
void |
setTableConnectionStyle(TableConnectionStyle value)
Sets how users are allowed to link tables to each other - as integral entities, by rows, or both.
|
void |
setTableCustomDraw(CustomDraw value)
Sets the default type of custom painting applied to new tables.
|
void |
setTableHandlesStyle(HandlesStyle value)
Sets the style of selection handles that should be assigned to new tables.
|
void |
setTablePen(Pen value)
Deprecated.
|
void |
setTableRowCount(int value)
Sets how many rows should be allocated to new tables.
|
void |
setTableRowHeight(float value)
Sets the default height of rows in newly created tables.
|
void |
setTableShape(SimpleShape value)
Sets the default value of the Shape property of new tables.
|
void |
setTablesScrollable(boolean value)
Sets a value indicating whether users are allowed to scroll new tables.
|
void |
setTag(java.lang.Object value)
Associates a custom data with this diagram.
|
void |
setTextColor(java.awt.Color value)
Deprecated.
|
void |
setTextFormat(TextFormat value)
Sets the default format and alignment of the text of new items.
|
void |
setTheme(Theme value)
Sets the theme associated with the diagram.
|
void |
setToolTip(java.lang.String value)
Sets the tooltip text that should be displayed when the mouse hovers
over an unoccupied area of the diagram.
|
void |
setValidityChecks(boolean value) |
void |
suspendLinkRouter()
Called when the control starts a batch update operation that might affect many links.
|
void |
updateRuntimeIndices()
Assigns consecutive values to the RuntimeIndex property of items.
|
static DiagramBuilder |
with()
Returns a DiagramBuilder object used to configure and create new Diagram instances.
|
public static DiagramBuilder with()
DiagramBuilder
instance.public DiagramBuilder init()
DiagramBuilder
instance.public void addDiagramListener(DiagramListener listener)
listener
so that it will receive events when
users create, modify or delete diagram items.addDiagramListener
in class DiagramBase
listener
- An object implementing the DiagramListener
interface.public void removeDiagramListener(DiagramListener listener)
listener
so that it will no longer
receive diagram events.removeDiagramListener
in class DiagramBase
listener
- An object implementing the DiagramListener
interface.public void raiseClicked(DiagramItem item, java.awt.geom.Point2D mousePosition, int mouseButton)
item
- The DiagramItem
that has been clicked.mousePosition
- The mouse position in logical diagram coordinates.mouseButton
- Indicates which button has been clicked.public void raiseDoubleClicked(DiagramItem item, java.awt.geom.Point2D mousePosition, int mouseButton)
item
- The DiagramItem
that has been clicked.mousePosition
- The mouse position in logical diagram coordinates.mouseButton
- Indicates which button has been clicked.public void raiseTreeExpanded(DiagramNode root)
root
- The root node of the expanded branch.public void raiseTreeCollapsed(DiagramNode root)
root
- The root node of the collapsed branch.public boolean raiseDeleting(DiagramItem item)
item
- The DiagramItem
that will be deleted.true
if the item should be deleted, otherwise false
.public boolean raiseLinkTextEditing(DiagramLink link)
DiagramListener.linkTextEditing(com.mindfusion.diagramming.LinkValidationEvent)
event to validate entering inplace edit mode.link
- The DiagramLink
whose text will be edited.true
if the event handlers allow the operation, otherwise false
.public boolean raiseNodeTextEditing(DiagramNode node, NodeLabel label)
DiagramListener.nodeTextEditing(com.mindfusion.diagramming.NodeValidationEvent)
event to validate entering inplace edit mode.node
- The DiagramNode
whose text will be edited.label
- The NodeLabel related to the eventtrue
if the event handlers allow the operation, otherwise false
.public boolean raiseCellTextEditing(TableNode table, int column, int row)
DiagramListener.cellTextEditing(com.mindfusion.diagramming.CellValidationEvent)
event to validate entering inplace edit mode.table
- The TableNode
related to the event.column
- The zero-based index of the table column related to the event.row
- The zero-based index of the table row related to the event.true
if the event handlers allow the operation, otherwise false
.public void raiseClicked(int mouseButton, java.awt.geom.Point2D mousePosition)
DiagramListener.clicked(com.mindfusion.diagramming.DiagramEvent)
event.mouseButton
- Indicates which mouse button has been pressed.mousePosition
- The mouse position in logical diagram coordinates.public void raiseDoubleClicked(int mouseButton, java.awt.geom.Point2D mousePosition)
DiagramListener.doubleClicked(com.mindfusion.diagramming.DiagramEvent)
event.mouseButton
- Indicates which mouse button has been pressed.mousePosition
- The mouse position in logical diagram coordinates.public void raiseNodeTextEdited(DiagramNode node, java.lang.String oldText, java.lang.String newText, NodeLabel label)
node
- The node whose text has been edited.oldText
- The old text.newText
- The new text.label
- The NodeLabel related to the event.public void raiseLinkTextEdited(DiagramLink link, java.lang.String oldText, java.lang.String newText, LinkLabel label)
link
- The DiagramLink
whose text has been edited.oldText
- The old text.newText
- The new text.label
- The LinkLabel related to the event.public void raiseCellTextEdited(Cell cell, java.lang.String oldText, java.lang.String newText, int column, int row)
cell
- The Cell
whose text has been edited.oldText
- The old text.newText
- The new text.column
- The column index of the cell.row
- The row index of the cell.public void raiseTreeItemTextEdited(TreeViewItem item, java.lang.String oldText, java.lang.String newText)
treeItemTextEdited
event.item
- A TreeViewItem
instance.oldText
- The item's original text.newText
- The item's old text.public void raiseActionUndone(Command command)
public void raiseActionRedone(Command command)
public void raiseViewRemoved()
DiagramListener.viewRemoved(com.mindfusion.diagramming.ValidationEvent)
event.public UndoManager getUndoManager()
UndoManager
.UndoManager
object.public void executeCommand(Command cmd)
cmd
- The Command
to execute.public void saveTo(java.io.OutputStream out) throws java.io.IOException
out
- A OutputStream
where the diagram contents should be saved.java.io.IOException
public java.lang.String saveToString()
String
containing the base64 encoded diagram contents.public java.lang.String saveToString(SaveToStringFormat format, boolean includeUnalteredProperties)
format
- A member of the SaveToStringFormat
enumeration indicating the output format.includeUnalteredProperties
- true to serialize all properties; false to serialize only properties with non-default values.public void loadFrom(java.io.InputStream in) throws java.io.IOException
in
- An InputStream from which to load the diagram contents.java.io.IOException
public void loadFromString(java.lang.String chartData)
chartData
- A String
from which to load the diagram contents.public void saveTo(java.lang.String fileName) throws java.io.FileNotFoundException, java.io.IOException
fileName
- The name of the file into which the diagram
contents should be saved.java.io.FileNotFoundException
java.io.IOException
public void loadFrom(java.lang.String fileName) throws java.io.FileNotFoundException, java.io.IOException
fileName
- The name of the file from which the diagram
contents should be loaded.java.io.FileNotFoundException
java.io.IOException
public void saveToXml(java.lang.String fileName) throws java.io.IOException, XmlException
fileName
- The full path and name of the disk file where the diagram should be saved.java.io.IOException
XmlException
public void saveToXml(java.io.OutputStream stream, boolean includeUnalteredProperties) throws XmlException, java.io.UnsupportedEncodingException
stream
- An OutputStream
where the XML markup should be serialized.XmlException
java.io.UnsupportedEncodingException
public void saveToXml(org.w3c.dom.Document document) throws java.lang.Exception
document
- A DOM Document object where the diagram should be saved.java.lang.Exception
public void saveToXml(org.w3c.dom.Document document, boolean includeUnalteredProperties)
document
- A DOM Document object where the diagram should be saved.public void loadFromXml(java.lang.String fileName) throws java.io.FileNotFoundException, java.io.IOException, XmlException
fileName
- The name of the XML file the data should be read from.java.io.FileNotFoundException
java.io.IOException
XmlException
public void loadFromXml(java.io.InputStream stream) throws XmlException
stream
- An InputStream
where the XML markup should be read from.XmlException
public void loadFromXml(org.xml.sax.InputSource source) throws XmlException
source
- An InputSource
where the XML markup should be read from.XmlException
public void loadFromXml(org.w3c.dom.Document document, boolean freeProcessedXml) throws XmlException
document
- A DOM Document object from which to load the diagram data.XmlException
public void saveToJsonFile(java.lang.String fileName)
fileName
- A string specifying the file name or full path.public void loadFromJsonFile(java.lang.String fileName)
fileName
- A string specifying the file name or full path.public java.lang.String saveToJson()
public void saveToJsonObject(com.mindfusion.common.JsonObject diagramObj, JsonPersistContext context)
diagramObj
- A JsonObject the diagram's data should be stored into.context
- A JsonPersistContext object providing contextual information
about the serialization process and helper serialization methods.public void loadFromJson(java.lang.String json)
json
- A string created by the saveToJson method.public void loadFromJsonObject(com.mindfusion.common.JsonObject diagramObj, JsonPersistContext context)
diagramObj
- A JsonObject containing diagram data.context
- A JsonPersistContext object providing contextual information about the serialization process and helper serialization methods.public static void registerItemClass(java.lang.Class<?> itemClass, java.lang.String classId, int classVersion)
itemClass
- A Class
instance identifying the item class.classId
- A class identifier to use when saving and loading items of the specified type.classVersion
- A revision number of the item's class serialization format.public static void registerItemClass(java.lang.Class<?> itemClass, java.lang.String classId, int classVersion, java.lang.String clientClass)
itemClass
- A Class
instance identifying the item class.classId
- A class identifier to use when saving and loading items of the specified type.classVersion
- A revision number of the item's class serialization format.clientClass
- A class identifier to use when serializing item of the specified type to JSON.public static void registerClass(java.lang.Class<?> classType, java.lang.String classId, int classVersion, java.lang.String clientClass)
classType
- A Type instance identifying the class.classId
- A class identifier to use when saving and loading objects of the specified type.classVersion
- A revision number of the serialization format.clientClass
- A class identifier to use when serializing objects of the specified type to JSON.public static void registerClass(java.lang.Class<?> classType, java.lang.String classId, int classVersion)
classType
- A Type instance identifying the class.classId
- A class identifier to use when saving and loading objects of the specified type.classVersion
- A revision number of the serialization format.public static boolean isClassRegistered(java.lang.Class classType)
classType
- A Type instance identifying the class.public static boolean isClientClassRegistered(java.lang.Class classType)
classType
- A Type instance identifying the class.public java.util.HashMap<java.lang.Class<?>,ClassDescriptor> getTypeTable()
getTypeTable
in interface IItemFactory
public java.util.HashMap<java.lang.String,ClassDescriptor> getClsidTable()
getClsidTable
in interface IItemFactory
public java.lang.Object createItem(java.lang.String itemClass)
createItem
in interface IItemFactory
public java.awt.geom.Point2D.Float alignPointToGrid(java.awt.geom.Point2D.Float point)
point
- A Point2D.Float
object representing the
point that should be aligned to the grid.Point2D.Float
object representing the aligned point.public java.awt.image.BufferedImage createImage()
java.awt.image.BufferedImage
object containing
a representation of the diagram.public java.awt.image.BufferedImage createImage(int imageType)
imageType
- One of the BufferedImage type constants.java.awt.image.BufferedImage
object containing
a representation of the diagram.public void drawAlignmentGuides(java.awt.Graphics2D graphics)
graphics
- A Graphics2D
instance.public void draw(java.awt.Graphics2D graphics, RenderOptions options, java.awt.geom.Rectangle2D clipRect)
graphics
- The Graphics2D surface to draw the diagram on.options
- A RenderOptions
object specifying options for the drawing operation.clipRect
- A Rectangle2D specifying the current clipping rectangle.public void drawString(java.lang.String text, java.awt.Graphics2D graphics, java.awt.Font font, Brush brush, java.awt.geom.Rectangle2D bounds, TextFormat format)
public java.lang.Object createStyledText(java.awt.Graphics2D graphics, java.lang.String text, java.awt.Font font)
public void drawStyledText(java.awt.Graphics2D graphics, java.lang.String text, java.awt.Font font, java.awt.geom.Rectangle2D textBounds, TextFormat format, Brush textBrush)
public void drawTextObject(java.awt.Graphics2D graphics, java.lang.Object text, java.awt.Font font, java.awt.geom.Rectangle2D textBounds, TextFormat format, Brush textBrush)
public GraphicsUnit getMeasureUnit()
GraphicsUnit
enumeration.public void setMeasureUnit(GraphicsUnit value)
value
- A member of the GraphicsUnit
enumeration.public double imageToDocX(int x)
x
- An image point x coordinatepublic double imageToDocY(int y)
y
- An image point y coordinatepublic java.awt.geom.Point2D.Float imageToDoc(int x, int y)
x
- y
- Point2D.Float
object, which represents the
document coordinates of image pointpublic void drawLayer(java.awt.Graphics2D g, java.awt.geom.Rectangle2D backgroundRect, int layerIndex, RenderOptions options)
public boolean isItemVisible(DiagramItem item)
item
- The DiagramItem to check.public boolean isItemInteractive(DiagramItem item)
item
- The DiagramItem to check.public boolean isItemLocked(DiagramItem item)
item
- The DiagramItem to check.public java.awt.geom.Dimension2D measureString(java.lang.String text, java.awt.Font font)
text
- The String
to measure.font
- A Font
that will be used to render the text.public RenderOptions getRenderOptions()
public boolean getDirty()
true
if there diagram has changed since
the last save, otherwise false
.public void setDirty(boolean value)
value
- true
to mark the diagram as changed,
otherwise false
.public java.awt.Font getFont()
Font
object.public void setFont(java.awt.Font value)
value
- A Font
object.public Shape getLinkHeadShape()
Shape
class. Predefined arrowhead shapes are exposed as members of ArrowHeads
.public void setLinkHeadShape(Shape value)
value
- An instance of the Shape
class. Predefined arrowhead shapes are exposed as members of ArrowHeads
.public Shape getLinkBaseShape()
Shape
class. Predefined arrowhead shapes are exposed as members of ArrowHeads
.public void setLinkBaseShape(Shape value)
value
- An instance of the Shape
class. Predefined arrowhead shapes are exposed as members of ArrowHeads
.public Shape getLinkIntermediateShape()
Shape
class. Predefined arrowhead shapes are exposed as members of ArrowHeads
.public void setLinkIntermediateShape(Shape value)
value
- An instance of the Shape
class. Predefined arrowhead shapes are exposed as members of ArrowHeads
.public float getLinkHeadShapeSize()
public void setLinkHeadShapeSize(float value)
value
- A float value specifying the default arrowhead size.public float getLinkBaseShapeSize()
public void setLinkBaseShapeSize(float value)
value
- A float value specifying the default size of the shapes
displayed at the link base.public float getLinkIntermediateShapeSize()
public void setLinkIntermediateShapeSize(float value)
value
- A float value specifying the default size of the shapes
displayed in the middles of link segments.public boolean getShowHandlesOnDrag()
true
to display selection handles,
otherwise false
.public void setShowHandlesOnDrag(boolean value)
value
- true
to display selection handles,
otherwise false
.public ShadowsStyle getShadowsStyle()
ShadowsStyle
enumeration.public void setShadowsStyle(ShadowsStyle value)
value
- A member of the ShadowsStyle
enumeration.public boolean getLinkEndsMovable()
true
if users are allowed to move the end points
of new links, otherwise false
.public void setLinkEndsMovable(boolean value)
value
- true
if users are allowed to move the end points
of new links, otherwise false
.public boolean getAllowSplitLinks()
true
to make new links splittable by default,
otherwise false
.public void setAllowSplitLinks(boolean value)
value
- true
to make new links splittable by default,
otherwise false
.public InteractionState getInteraction()
InteractionState
instance representing the current action being carried out by the user.InteractionState
.public java.lang.String getLinkText()
String
containing the default link text.public void setLinkText(java.lang.String value)
value
- A String
containing the default link text.public LinkTextStyle getLinkTextStyle()
LinkTextStyle
enumeration.public void setLinkTextStyle(LinkTextStyle value)
value
- A member of the LinkTextStyle
enumeration.@Deprecated public Pen getShapePen()
Pen
object.@Deprecated public void setShapePen(Pen value)
value
- A Pen
object.@Deprecated public Brush getShapeBrush()
Brush
object.@Deprecated public void setShapeBrush(Brush value)
value
- A Brush
object.@Deprecated public Pen getLinkPen()
Pen
object that is assigned to newly created links.@Deprecated public void setLinkPen(Pen value)
value
- A Pen
object that should be assigned
to newly created links.public Pen getBoundsPen()
public void setBoundsPen(Pen value)
value
- A Pen
object that should be assigned
to newly created links.public boolean getEnableSpatialIndex()
public void setEnableSpatialIndex(boolean value)
value
- true to enable spatial indexing, or false otherwise.public Manipulator getFocusedManipulator()
public void setFocusedManipulator(Manipulator value)
public ComponentBase getFocusedComponent()
public void setFocusedComponent(ComponentBase value)
@Deprecated public Brush getLinkBrush()
Brush
object that is assigned to newly created links.@Deprecated public void setLinkBrush(Brush value)
value
- A Brush
object that should be assigned
to newly created links.@Deprecated public Pen getTablePen()
Pen
object that is assigned to newly created tables.@Deprecated public void setTablePen(Pen value)
value
- A Pen
object that should be assigned to newly created tables.@Deprecated public Brush getTableBrush()
Brush
object that is assigned to newly created tables.@Deprecated public void setTableBrush(Brush value)
value
- A Brush
object that should be assigned to newly created tables.public boolean getAlignToGrid()
true
if items are automatically aligned
to the grid, otherwise false
.public void setAlignToGrid(boolean value)
value
- true
if items should be automatically aligned
to the grid, otherwise false
.public boolean getShowGrid()
true
if the alignment grid is drawn on
the screen, otherwise false
.public void setShowGrid(boolean value)
value
- true
if the alignment grid should be drawn on
the screen, otherwise false
.public java.awt.Color getGridColor()
Color
object representing the grid color.public void setGridColor(java.awt.Color value)
value
- A Color
object representing the grid color.public float getGridSizeX()
public void setGridSizeX(float value)
value
- An integer value specifying the horizontal distance
between grid points.public float getGridSizeY()
public void setGridSizeY(float value)
value
- An integer value specifying the vertical distance
between grid points.public float getGridOffsetX()
public void setGridOffsetX(float value)
value
- A float value that specifies the horizontal grid offset.public float getGridOffsetY()
public void setGridOffsetY(float value)
value
- A float value that specifies the vertical grid offset.public GridStyle getGridStyle()
GridStyle
enumeration.public void setGridStyle(GridStyle value)
value
- A member of the GridStyle
enumeration.public boolean getAutoAlignNodes()
public void setAutoAlignNodes(boolean value)
value
- true if nodes should align, otherwise false.public float getAutoAlignDistance()
public void setAutoAlignDistance(float value)
value
- A float value specifying the maximal distance.public Pen getAlignmentGuidePen()
Pen
instance.public void setAlignmentGuidePen(Pen value)
value
- A Pen
instance.public SimpleShape getTableShape()
SimpleShape
enumeration.public void setTableShape(SimpleShape value)
value
- A member of the SimpleShape
enumeration.@Deprecated public Brush getShadowBrush()
Brush
object representing the shadow brush.@Deprecated public void setShadowBrush(Brush value)
value
- A Brush
object representing the shadow brush.public ImageAlign getBackgroundImageAlign()
ImageAlign
enumeration.public void setBackgroundImageAlign(ImageAlign value)
value
- A member of the ImageAlign
enumeration.public int getImageDpiX()
public void setImageDpiX(int dpi)
public int getImageDpiY()
public void setImageDpiY(int dpi)
public boolean getTablesScrollable()
true
if the rows of newly created tables
can be scrolled up or down, otherwise false
.public void setTablesScrollable(boolean value)
value
- true
if the rows of newly created tables
can be scrolled up or down, otherwise false
.public boolean imageUpdate(java.awt.Image img, int infoflags, int x, int y, int width, int height)
imageUpdate
in interface java.awt.image.ImageObserver
public Factory getFactory()
public DiagramLinkList getLinks()
DiagramLinkList
containing all links in the diagram.public DiagramNodeList getNodes()
ShapeNodeList
containing all nodes in the diagram.public GroupList getGroups()
GroupList
containing all groups in the diagram.public DiagramItemList getItems()
DiagramItemList
containing all items in the diagram.public <T extends DiagramItem> java.lang.Iterable<T> items(java.lang.Class<T> desiredType)
T
- desiredTypedesiredType
- public DummyNode getDummy()
@Deprecated public java.awt.Color getTextColor()
Color
object representing the default text color.@Deprecated public void setTextColor(java.awt.Color value)
value
- A Color
object representing the default text color.public LinkShape getLinkShape()
LinkShape
enumeration.public void setLinkShape(LinkShape value)
value
- A member of the LinkShape
enumeration.public int getLinkSegments()
public void setLinkSegments(int value)
value
- An integer value specifying the default number of link segments.public DiagramItem getActiveItem()
DiagramItem
.public java.util.List<Layer> getLayers()
Layer
objects.public void setActiveItem(DiagramItem value)
value
- A reference to an DiagramItem
that should be made the active one.public void add(DiagramItem item)
item
- An DiagramItem
that should be added to the diagram.public void add(DiagramItem item, boolean select)
item
- An DiagramItem
that should be added to the diagram.select
- true
if the item should be selected,
otherwise false
.public DiagramNode findNode(java.lang.Object tag)
tag
- An Object
to which the tag of the
found node should be equal.DiagramNode
.public DiagramLink findLink(java.lang.Object tag)
tag
- An Object
to which the tag of the
found link should be equal.DiagramLink
.public Group findGroup(java.lang.Object tag)
tag
- An Object
to which the tag of the
found group should be equal.Group
.public DiagramNode findNodeById(java.lang.Object id)
id
- An Object
to which the id of the found node should be equal.DiagramNode
.public DiagramLink findLinkById(java.lang.Object id)
id
- An Object
to which the id of the found link should be equal.DiagramLink
.public boolean getShowDisabledHandles()
true
if disabled selection handles are shown,
otherwise false
.public void setShowDisabledHandles(boolean value)
value
- true
if disabled selection handles should be
drawn, otherwise false
.public HandlesStyle getShapeHandlesStyle()
HandlesStyle
enumeration.public void setShapeHandlesStyle(HandlesStyle value)
value
- A member of the HandlesStyle
enumeration.public HandlesStyle getLinkHandlesStyle()
HandlesStyle
enumeration.public void setLinkHandlesStyle(HandlesStyle value)
value
- A member of the HandlesStyle
enumeration.public HandlesStyle getTableHandlesStyle()
HandlesStyle
enumeration.public void setTableHandlesStyle(HandlesStyle value)
value
- A member of the HandlesStyle
enumeration.public java.awt.geom.Rectangle2D getContentBounds(boolean forPrint, boolean onlyVisible)
forPrint
- Specifies whether only printable items should be considered.onlyVisible
- Specifies whether only visible items should be considered.public void resizeToFitItems(float margins)
margins
- A float value specifying how much space to leave
between the items and the document borders.public void resizeToFitItems(float margins, boolean onlyVisible)
margins
- A float value specifying how much space to leave
between the items and the document borders.onlyVisible
- true
to include only visible items in
the new document size, otherwise false
.public boolean getAllowSelfLoops()
true
if users are allowed to draw reflexive links,
otherwise false
.public void setAllowSelfLoops(boolean value)
value
- true
if users are allowed to draw reflexive links,
otherwise false
.public Shape getDefaultShape()
Shape
object that is assigned to
newly created nodes.public void setDefaultShape(Shape value)
ShapeNode.setShape(com.mindfusion.diagramming.Shape)
method.value
- The default Shape
object that should be assigned to
newly created nodes.public Shape[] getFreeFormTargets()
public void setFreeFormTargets(Shape[] value)
value
- A Shape array.public float getAutoCloseDistance()
FreeFormNode
for which the node's outline is closed automatically.public void setAutoCloseDistance(float value)
FreeFormNode
for which the node's outline is closed automatically.value
- A float value.public float getFreeFormAttractDistance()
public void setFreeFormAttractDistance(float value)
value
- A float value.public java.lang.String getShapeText()
String
containing the default box text.public void setShapeText(java.lang.String value)
value
- A String
containing the default box text.public java.lang.String getContainerCaption()
public void setContainerCaption(java.lang.String containerCaption)
containerCaption
- A String containing the default caption string.public float getContainerCaptionHeight()
public void setContainerCaptionHeight(float containerCaptionHeight)
public Pen getContainerHighlightPen()
public void setContainerHighlightPen(Pen containerHighlightPen)
public float getContainerMargin()
public void setContainerMargin(float containerMargin)
public java.awt.geom.Dimension2D getContainerMinimumSize()
public void setContainerMinimumSize(java.awt.geom.Dimension2D containerMinimumSize)
public boolean getContainersFoldable()
public void setContainersFoldable(boolean containersFoldable)
public java.awt.geom.Dimension2D getFoldedContainerSize()
public void setFoldedContainerSize(java.awt.geom.Dimension2D value)
public TextFormat getTextFormat()
TextFormat
object specifying the text format and alignment.public void setTextFormat(TextFormat value)
value
- A TextFormat
object specifying the text format and alignment.public float getMergeThreshold()
public void setMergeThreshold(float value)
value
- A float value specifying the maximal merge distance.public boolean getSelectAfterCreate()
true
if newly created items are selected
automatically, otherwise false
.public void setSelectAfterCreate(boolean value)
value
- true
if newly created items should be selected
automatically, otherwise false
.public void setShadowOffset(float x, float y)
x
- Specifies the horizontal shadow offset.y
- Specifies the vertical shadow offset.public java.awt.geom.Rectangle2D.Float getBounds()
Rectangle2D.Float
object representing the
current document scrollable region.public void setBounds(java.awt.geom.Rectangle2D.Float value)
public void setBounds(java.awt.geom.Rectangle2D value)
value
- A Rectangle2D
object representing the
document scrollable region.public java.lang.Object getTag()
DiagramListener.serializeTag(com.mindfusion.diagramming.SerializeTagEvent)
event.setTag(java.lang.Object)
.public void setTag(java.lang.Object value)
value
- An Object containing custom data.public void clearAll()
public CustomDraw getShapeCustomDraw()
CustomDraw
enumeration.public void setShapeCustomDraw(CustomDraw value)
value
- A member of the CustomDraw
enumeration.public CustomDraw getTableCustomDraw()
CustomDraw
enumeration.public void setTableCustomDraw(CustomDraw value)
value
- A member of the CustomDraw
enumeration.public CustomDraw getCellCustomDraw()
CustomDraw
enumeration.public void setCellCustomDraw(CustomDraw value)
value
- A member of the CustomDraw
enumeration.public CustomDraw getLinkCustomDraw()
CustomDraw
enumeration.public void setLinkCustomDraw(CustomDraw value)
value
- A member of the CustomDraw
enumeration.public float getShadowOffsetX()
public void setShadowOffsetX(float value)
value
- A float value specifying the horizontal shadow offset.public float getShadowOffsetY()
public void setShadowOffsetY(float value)
value
- A float value specifying the vertical shadow offset.public RestrictToBounds getRestrictItemsToBounds()
RestrictToBounds
enumeration.public void setRestrictItemsToBounds(RestrictToBounds value)
value
- A member of the RestrictToBounds
enumeration.public boolean getDynamicLinks()
true
if newly created links are set to update
their end point positions automatically, otherwise false
.public void setDynamicLinks(boolean value)
value
- true
if newly created links should be
set to update their end point positions automatically,
otherwise false
.public boolean getAutoSnapLinks()
true
if newly created links are set to align
automatically to node borders when modified, otherwise
false
.public void setAutoSnapLinks(boolean value)
value
- true
if newly created links are set to align
automatically to node borders when modified, otherwise
false
.public float getAutoSnapDistance()
public void setAutoSnapDistance(float value)
value
- A float value specifying the maximum distance.public boolean getLinksRetainForm()
true
if newly created links keep their shapes,
otherwise false
.public void setLinksRetainForm(boolean value)
value
- true
if newly created links should preserve
their shapes, otherwise false
.public boolean getRouteLinks()
true
if newly created links are set to find
their routes automatically, otherwise false
.public void setRouteLinks(boolean value)
value
- true
if newly created links should be set to
find their routes automatically, otherwise false
.public RoutingOptions getRoutingOptions()
RoutingOptions
instance that lets you set various
attributes of the link routing algorithm.RoutingOptions
object.public LinkRouter getLinkRouter()
public void setLinkRouter(LinkRouter value)
public void routeAllLinks(DiagramLinkList linksToRoute)
linksToRoute
- A list of diagram links.public void routeAllLinks()
public void suspendLinkRouter()
public void resumeLinkRouter(boolean routeDeferredLinks)
routeDeferredLinks
- true if the links should be routed, otherwise false.public int getTableRowCount()
public void setTableRowCount(int value)
value
- An integer value specifying the default number of table rows.public int getTableColumnCount()
public void setTableColumnCount(int value)
value
- An integer value specifying the default number of table columns.public float getTableColumnWidth()
public void setTableColumnWidth(float value)
value
- A float value specifying the default width of table columns.public float getTableRowHeight()
public void setTableRowHeight(float value)
value
- A float value specifying the default height of table rows.public float getTableCaptionHeight()
public void setTableCaptionHeight(float value)
value
- A float value specifying the default height of table caption bars.public TableConnectionStyle getTableConnectionStyle()
TableConnectionStyle
enumeration.public void setTableConnectionStyle(TableConnectionStyle value)
value
- A member of the TableConnectionStyle
enumeration.public void destroyGroup(Group group)
autoDeleteItems
attribute is set.group
- The Group
to destroy.public SelectionCopy copySelection(Diagram source, boolean unconnectedLinks, boolean copyGroups)
public boolean pasteSelection(Diagram doc, SelectionCopy data, CompositeCmd cmd, float dx, float dy)
public java.lang.String getTableCaption()
String
containing the default table caption.public void setTableCaption(java.lang.String value)
value
- A String
containing the default table caption.public Orientation getLinkCascadeOrientation()
Orientation
enumeration.public void setLinkCascadeOrientation(Orientation value)
value
- A member of the Orientation
enumeration.public CellFrameStyle getCellFrameStyle()
CellFrameStyle
enumeration.public void setCellFrameStyle(CellFrameStyle value)
value
- A member of the CellFrameStyle
enumeration.public void updateRuntimeIndices()
public void enumByReverseZ(java.awt.geom.Point2D hitTest, com.mindfusion.diagramming.ProcessItem<DiagramItem> processItem)
public void enumByReverseZ(java.awt.geom.Point2D hitTest, double threshold, com.mindfusion.diagramming.ProcessItem<DiagramItem> processItem)
public void enumTopLevelByReverseZ(java.awt.geom.Point2D hitTest, com.mindfusion.diagramming.ProcessItem<DiagramItem> processItem)
public void enumTopLevelByReverseZ(java.awt.geom.Point2D hitTest, double threshold, com.mindfusion.diagramming.ProcessItem<DiagramItem> processItem)
public DiagramNode getNodeAt(java.awt.geom.Point2D point)
point
- A Point2D
object
specifying where to look for a node.DiagramNode
found at the specified position.public DiagramNode getNodeAt(java.awt.geom.Point2D point, boolean excludeLocked)
point
- A Point2D
object specifying where to look for a node.excludeLocked
- Specifies whether locked nodes should be excluded from the search.DiagramNode
instance if a node lies at the specified location, otherwise null.public DiagramNode getNodeAt(java.awt.geom.Point2D point, float threshold)
point
- A Point2D
object specifying where to look for a node.threshold
- Allowed distance from the node.DiagramNode
found at the specified position.public DiagramNodeList getNodesAt(java.awt.geom.Point2D.Float point)
point
- A Point2D.Float
object
specifying where to look for nodes.DiagramNodeList
containing all nodes
found at the specified position.public DiagramLinkList getLinksAt(java.awt.geom.Point2D.Float point)
point
- A Point2D object specifying the location at which to look for links.public DiagramLink getLinkAt(java.awt.geom.Point2D.Float point, float maxDist)
point
- A Point2D.Float
object
specifying where to look for a link.maxDist
- Specifies the maximum allowed distance
from the point to the link.DiagramLink
found at the specified position.public DiagramLink getLinkAt(java.awt.geom.Point2D point, double maxDist, boolean exclLocked)
point
- A Point2D
object
specifying where to look for a link.maxDist
- Specifies the maximum allowed distance
from the point to the link.exclLocked
- true
if locked links should be
excluded from the search, otherwise false
.DiagramLink
found at the specified position.public DiagramLink getLinkAt(java.awt.geom.Point2D point, double maxDist, boolean excludeLocked, boolean excludeModified)
point
- A Point2D
object
specifying where to look for a link.maxDist
- Specifies the maximum allowed distance
from the point to the link.excludeLocked
- true
if locked links should be
excluded from the search, otherwise false
.DiagramLink
found at the specified position.public DiagramLink getLinkAt(java.awt.geom.Point2D point, double maxDist, boolean excludeLocked, boolean excludeModified, com.mindfusion.common.ByRef<java.lang.Integer> segmNum)
point
- A Point2D
object
specifying where to look for a link.maxDist
- Specifies the maximum allowed distance
from the point to the link.excludeLocked
- true
if locked links should be
excluded from the search, otherwise false
.segmNum
- An output parameter that returns the index of the
link segment that is closest to the specified pointDiagramLink
found at the specified position.public DiagramItem getItemAt(java.awt.geom.Point2D point, boolean excludeLocked)
point
- A Point2D
object
specifying where to look for an item.excludeLocked
- true
if locked items should be excluded
from the search, otherwise false
.DiagramItem
found at the specified position.public DiagramItem getItemAt(java.awt.geom.Point2D point, boolean excludeLocked, boolean excludeModified, boolean includeHandles, boolean includeLabels)
point
- A Point2D
object
specifying where to look for an item.excludeLocked
- true
if locked items should be excluded
from the search, otherwise false
.DiagramItem
found at the specified position.public DiagramNode getNodeAt(java.awt.geom.Point2D point, boolean excludeLocked, boolean excludeSelected)
point
- A Point2D
object
specifying where to look for a node.excludeLocked
- true
if locked items should be excluded
from the search, otherwise false
.excludeSelected
- true
if selected items should be excluded
from the search, otherwise false
.DiagramNode
found at the specified position.public DiagramNode getNearestNode(java.awt.geom.Point2D point, float maxDistance, DiagramNode ignored)
point
- A Point2D object specifying where to look for nodes.maxDistance
- The maximum distance from point where to look for nodes.ignored
- Exclude this node from the search.public float getAdjustmentHandlesSize()
public void setAdjustmentHandlesSize(float value)
value
- A float value specifying the size of selection handles.public Selection getSelection()
Selection
instance representing the current selection.Selection
object.public ItemLabel hitTestLabels(java.awt.geom.Point2D point)
point
- A Point2D specifying where to look for labels.public ComponentBase hitTestComponents(java.awt.geom.Point2D point)
public boolean getExpandOnIncoming()
true
is tree branches are expanded in the direction
of incoming links, otherwise false
.public void setExpandOnIncoming(boolean value)
value
- true
is tree branches should be expanded in
the direction of incoming links, otherwise false
.public boolean getRecursiveExpand()
true
if tree branches are expanded recursively.public void setRecursiveExpand(boolean value)
value
- true
if tree branches should be expanded recursively.public boolean getNodesExpandable()
true
if nodes are expandable by default,
otherwise false
.public void setNodesExpandable(boolean value)
value
- true
if nodes should be expandable by default,
otherwise false
.public void setDirty()
public void repaint(java.awt.geom.Rectangle2D docRect)
docRect
- A Rectangle2D
object representing the
region of the diagram that should be repainted.public void repaint(java.lang.Object sender, java.awt.geom.Rectangle2D docRect)
sender
- docRect
- public void repaint()
public void repaint(boolean redrawCacheImage)
redrawCacheImage
- public boolean getAllowLinksRepeat()
true
if users are allowed to draw more than one
link between the same nodes, otherwise false
.public void setAllowLinksRepeat(boolean value)
value
- true
if users are allowed to draw more than one
link between the same nodes, otherwise false
.public HitTestPriority getHitTestPriority()
HitTestPriority
enumeration.public void setHitTestPriority(HitTestPriority value)
value
- A member of the HitTestPriority
enumeration.public boolean getSelectionOnTop()
true
if selected items are drawn above non-selected
ones, otherwise false
.public void setSelectionOnTop(boolean value)
value
- true
if selected items should be drawn
above non-selected ones, otherwise false
.public ShowAnchors getShowAnchors()
ShowAnchors
enumeration.public void setShowAnchors(ShowAnchors value)
value
- A member of the ShowAnchors
enumeration.public SnapToAnchor getSnapToAnchor()
SnapToAnchor
enumeration.public void setSnapToAnchor(SnapToAnchor value)
value
- A member of the SnapToAnchor
enumeration.public int getActiveLayer()
public void setActiveLayer(int value)
value
- An integer value that specifies the index of the active layer.public float getShapeOrientation()
public void setShapeOrientation(float value)
value
- The default orientation applied to shape definitions when
assigning shapes to nodes.public boolean getAllowUnconnectedLinks()
true
if users are allowed to draw unconnected
links, otherwise false
.public void setAllowUnconnectedLinks(boolean value)
value
- true
if users are allowed to draw unconnected
links, otherwise false
.public AutoResize getAutoResize()
AutoResize
enumeration.public void setAutoResize(AutoResize value)
value
- A member of the AutoResize
enumeration.public boolean getAllowMultipleResize()
public void setAllowMultipleResize(boolean value)
value
- true to let the user resize multiple selected nodes; otherwise, false.public boolean getEnableStyledText()
true
if text formatting tags are processed
by default, otherwise false
.public void setEnableStyledText(boolean value)
value
- true
if text formatting tags should be
processed by default, otherwise false
.public Brush getBackBrush()
Brush
.public void setBackBrush(Brush value)
value
- A Brush
object representing the background brush.public Brush getEffectiveBackBrush()
BackBrush
if it is not null
,
or the brush from the associated style or theme otherwise.public LinkCrossings getLinkCrossings()
LinkCrossings
enumeration.public void setLinkCrossings(LinkCrossings value)
value
- A member of the LinkCrossings
enumeration.public float getCrossingRadius()
public void setCrossingRadius(float value)
value
- A float value specifying the size of the shapes drawn
at link intersection points.public boolean getAllowUnanchoredLinks()
true
if users are allowed to attach links to nodes
that do not have anchor points, otherwise false
.public void setAllowUnanchoredLinks(boolean value)
value
- true
to lets users attach links to nodes that do
not have anchor points, otherwise false
.public java.awt.Image getBackgroundImage()
java.awt.Image
object.public void setBackgroundImage(java.awt.Image value)
value
- The background java.awt.Image
object.public void setBackgroundImageUrl(java.lang.String value)
value
- The URL of the background image.public void setBackgroundImage(java.awt.Image img, java.lang.String url)
img
- The Image
object that should be displayed in the background.url
- A string specifying the image URL.public java.lang.String getBackgroundImageUrl()
public java.lang.String getToolTip()
String
containing the tooltip text.public void setToolTip(java.lang.String value)
value
- A String
containing the tooltip text.public Theme createThemeFromDefaults()
Theme
object representing the default properties of the diagram.
This method is only for compatibility with files saved with versions earlier than 4.0.Theme
class.public void changeUnit(GraphicsUnit newUnit)
newUnit
- A member of the GraphicsUnit
enumeration.public void arrangeLinkLabels()
public ExpandButtonAction getExpandButtonAction()
ExpandButtonAction
enumeration; the default value is ExpandTreeBranch.public void setExpandButtonAction(ExpandButtonAction value)
value
- A member of the ExpandButtonAction
enumeration; the default value is ExpandTreeBranch.public ExpandButtonPosition getExpandButtonPosition()
ExpandButtonPosition
enumeration.public void setExpandButtonPosition(ExpandButtonPosition value)
value
- A member of the ExpandButtonPosition
enumeration.public HandlesVisualStyle getActiveItemHandlesStyle()
HandlesVisualStyle
object representing the visual style of the
selection handles of the active item.public HandlesVisualStyle getSelectedItemHandlesStyle()
HandlesVisualStyle
object representing the visual style of
selection handles.public HandlesVisualStyle getDisabledHandlesStyle()
HandlesVisualStyle
object representing the visual style of
disabled selection handles.public com.mindfusion.diagramming.lanes.Grid getLaneGrid()
Grid
instance.public boolean getEnableLanes()
public void setEnableLanes(boolean value)
public CursorHint handlePointerMove(java.awt.geom.Point2D point)
public boolean handleKeyDown(int keyCode, int modifiers)
public void handleKeyUp(int keyCode, int modifiers)
public void handleKeyPress(char keyChar)
public java.lang.Class<? extends java.awt.Component> getDefaultControlType()
ControlNode
objects.Class
instance specifying a java.awt.Component
-derived type.public void setDefaultControlType(java.lang.Class<? extends java.awt.Component> value)
ControlNode
objects.value
- A Class
instance specifying a java.awt.Component
-derived type.protected java.lang.Object getValue(java.lang.String name)
public Theme getTheme()
public void setTheme(Theme value)
public DiagramStyle getStyle()
public void setStyle(DiagramStyle value)
public DiagramStyle getDiagramStyle()
public DiagramLinkStyle getDiagramLinkStyle()
public ShapeNodeStyle getShapeNodeStyle()
public SvgNodeStyle getSvgNodeStyle()
public TableNodeStyle getTableNodeStyle()
public ContainerNodeStyle getContainerNodeStyle()
public TreeViewNodeStyle getTreeViewNodeStyle()
public void setRoundedLinks(boolean roundedLinks)
public boolean getRoundedLinks()
public void setRoundedLinksRadius(float radius)
public float getRoundedLinksRadius()
public void setLinkBranchIndicator(BranchIndicator value)
public BranchIndicator getLinkBranchIndicator()
public void setValidityChecks(boolean value)
public boolean getValidityChecks()
public static int getFormatBeingLoaded()
public java.util.List<NodeEffect> getNodeEffects()