|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.mindfusion.diagramming.Diagram
public class Diagram
The Diagram class represents a flow diagram.
The diagram document containing connected nodes and links. Nodes are
instances of the ShapeNode
and TableNode
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(int)
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(int)
.
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)
.
Field Summary |
---|
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
Diagram()
Initializes a new instance of the Diagram class. |
Method Summary | ||
---|---|---|
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 |
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.lang.Object |
createItem(java.lang.String itemClass)
Implements the IItemFactory interface. |
|
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 |
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. |
|
DiagramNode |
findNode(java.lang.Object tag)
Finds the node that has the specified tag. |
|
DiagramItem |
getActiveItem()
Gets the active item. |
|
HandlesVisualStyle |
getActiveItemHandlesStyle()
Gets the visual style of the manipulation handles displayed around the active item. |
|
float |
getAdjustmentHandlesSize()
Gets the size of selection handles. |
|
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 |
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. |
|
int |
getAutoResize()
Gets a value specifying whether the document scrollable area is resized automatically when users draw items near the edges of the diagram. |
|
Brush |
getBackBrush()
Gets the diagram's background brush. |
|
java.awt.Image |
getBackgroundImage()
Gets the background image. |
|
int |
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. |
|
int |
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. |
|
boolean |
getContainersFoldable()
Gets the default value for the Foldable property of containers. |
|
float |
getCrossingRadius()
Gets the radius of the shapes drawn at link crossing points. |
|
Shape |
getDefaultShape()
Gets the default shape of nodes. |
|
boolean |
getDirty()
Indicates whether the diagram has changed since the last save. |
|
HandlesVisualStyle |
getDisabledHandlesStyle()
Gets the visual style of disabled manipulation handles. |
|
boolean |
getDynamicLinks()
Gets a value indicating whether links automatically update their end points positions so that they will always point towards the node centers. |
|
boolean |
getEnableStyledText()
Gets a value indicating whether new nodes display richly formatted text. |
|
int |
getExpandButtonAction()
Gets what should happen when a user clicks the +/- button that is displayed near expandable nodes. |
|
int |
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. |
|
java.awt.Font |
getFont()
Gets the default font for new diagram items. |
|
java.awt.Color |
getGridColor()
Gets the color of the alignment grid. |
|
float |
getGridSizeX()
Gets the horizontal distance between grid points. |
|
float |
getGridSizeY()
Gets the vertical distance between grid points. |
|
int |
getGridStyle()
Gets the appearance style of the alignment grid. |
|
GroupList |
getGroups()
Gets a collection of all groups in the diagram. |
|
int |
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)
Returns the top-most item that contains the specified point. |
|
DiagramItemList |
getItems()
Gets a collection of all items in the 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,
ByRef<java.lang.Integer> segmNum)
Returns the top-most link that passes near the specified point. |
|
int |
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. |
|
Brush |
getLinkBrush()
Gets the default brush assigned to new links. |
|
int |
getLinkCascadeOrientation()
Gets the default orientation of the first segments of cascading links. |
|
int |
getLinkCrossings()
Gets what shapes are drawn at link crossing points. |
|
int |
getLinkCustomDraw()
|
|
boolean |
getLinkEndsMovable()
Gets a value indicating users are allowed to move the end points of an link after the link is created. |
|
int |
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. |
|
int |
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()
Gets the default pen assigned to new links. |
|
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. |
|
short |
getLinkSegments()
Gets the default number of link segments. |
|
boolean |
getLinksRetainForm()
Gets a value indicating whether new links are set to maintain their shapes while the nodes they connect are moved around. |
|
boolean |
getLinksSnapToBorders()
Gets a value indicating whether newly created links are set to align their end points to the borders of the nodes they connect. |
|
int |
getLinkStyle()
Gets the default style of links. |
|
java.lang.String |
getLinkText()
Gets the default text assigned to new links. |
|
int |
getLinkTextStyle()
Gets the default placement and orientation of the links labels. |
|
int |
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 |
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,
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. |
|
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. |
|
int |
getRestrictItemsToBounds()
Gets a value indicating whether users are allowed to move items outside the currently define document bounds. |
|
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. |
|
java.awt.Color |
getShadowColor()
Gets the color of items shadows. |
|
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. |
|
int |
getShadowsStyle()
Gets the style of shadows. |
|
Brush |
getShapeBrush()
Gets the default brush assigned to new nodes. |
|
int |
getShapeCustomDraw()
Gets whether new nodes should be custom drawn and what type of custom drawing will be performed on them. |
|
int |
getShapeHandlesStyle()
Gets the default style of box selection handles. |
|
float |
getShapeOrientation()
Gets the default shape definition orientation angle assigned to new nodes. |
|
Pen |
getShapePen()
Gets the default pen assigned to new nodes. |
|
java.lang.String |
getShapeText()
Gets the default text assigned to new nodes. |
|
int |
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. |
|
int |
getSnapToAnchor()
Gets a value indicating when links should snap to anchor points. |
|
Brush |
getTableBrush()
Gets the default brush assigned to new tables. |
|
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. |
|
int |
getTableConnectionStyle()
Gets how users are allowed to link tables one to another - as integral entities, by rows, or both. |
|
int |
getTableHandlesStyle()
Gets the default style of table selection handles. |
|
Pen |
getTablePen()
Gets the default pen assigned to new tables. |
|
int |
getTableRowCount()
Gets how many rows new tables have by default. |
|
float |
getTableRowHeight()
Gets the default height of the row of new tables. |
|
boolean |
getTablesScrollable()
Gets a value indicating whether users are allowed to scroll new tables. |
|
int |
getTableStyle()
Gets the default style of tables. |
|
java.lang.Object |
getTag()
Gets the custom data associated with this diagram. |
|
java.awt.Color |
getTextColor()
Gets the default text color that is assigned to new items. |
|
TextFormat |
getTextFormat()
Gets the default format and alignment of the text of new items. |
|
java.lang.String |
getToolTip()
Gets the tooltip text. |
|
java.util.HashMap<java.lang.Class,ClassDescriptor> |
getTypeTable()
Gets the table of registered item types. |
|
UndoManager |
getUndoManager()
Gets the diagram's UndoManager . |
|
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)
|
|
|
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 |
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)
Raises the DiagramListener.cellTextEdited(com.mindfusion.diagramming.EditCellTextEvent) event. |
|
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)
Raises the DiagramListener.linkTextEdited(com.mindfusion.diagramming.EditLinkTextEvent) event. |
|
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)
Raises the DiagramListener.nodeTextEdited(com.mindfusion.diagramming.EditNodeTextEvent) event. |
|
boolean |
raiseNodeTextEditing(DiagramNode node)
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 |
raiseTreeViewItemEdited(TreeViewItem item,
java.lang.String oldText,
java.lang.String newText)
|
|
void |
raiseViewRemoved()
Raises the DiagramListener.viewRemoved(com.mindfusion.diagramming.ValidationEvent) event. |
|
static void |
registerItemClass(java.lang.Class itemClass,
java.lang.String classId,
int classVersion)
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 |
routeAllLinks()
Routes all links in the diagram so that they will not cross any node. |
|
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 |
saveToString()
Saves the diagram contents into a string. |
|
java.lang.String |
saveToString(int 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 |
setAdjustmentHandlesSize(float value)
Sets the size of selection handles. |
|
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 |
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 |
setAutoResize(int 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 |
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(int 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 |
setCellFrameStyle(int 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 |
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 |
setEnableStyledText(boolean value)
Sets a value indicating whether newly created nodes should display richly formatted text. |
|
void |
setExpandButtonAction(int value)
Sets what should happen when a user clicks the +/- button that is displayed near expandable nodes. |
|
void |
setExpandButtonPosition(int 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 |
setFont(java.awt.Font font)
Sets the default font for new diagram items. |
|
void |
setGridColor(java.awt.Color value)
Sets the color of the alignment grid. |
|
void |
setGridSizeX(float value)
Sets or sets the horizontal distance between grid points. |
|
void |
setGridSizeY(float value)
Sets the vertical distance between grid points. |
|
void |
setGridStyle(int value)
Sets the appearance style of the alignment grid. |
|
void |
setHitTestPriority(int value)
Sets a value indicating the order in which items are hit-tested. |
|
void |
setImageDpiX(int dpi)
|
|
void |
setImageDpiY(int dpi)
|
|
void |
setLinkBaseShape(int 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 |
setLinkBrush(Brush value)
Sets the default brush that should be assigned to new links. |
|
void |
setLinkCascadeOrientation(int value)
Sets the default orientation of the first segments of cascading links. |
|
void |
setLinkCrossings(int value)
Sets what shapes should be drawn at the points where links cross. |
|
void |
setLinkCustomDraw(int value)
|
|
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 |
setLinkHeadShape(int 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(int 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)
Sets the default pen that should be assigned to new links. |
|
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(short value)
Sets the default number of link segments. |
|
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 |
setLinksSnapToBorders(boolean value)
Sets a value indicating whether newly created links are set to align their end points to the borders of the nodes they connect. |
|
void |
setLinkStyle(int value)
Sets the style that should be assigned to new links. |
|
void |
setLinkText(java.lang.String value)
Sets the default text that should be assigned to new links. |
|
void |
setLinkTextStyle(int value)
Sets the default placement and orientation of the links labels. |
|
void |
setMeasureUnit(int 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(int value)
Sets a value indicating whether users are allowed to move items outside the currently define document bounds. |
|
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 |
setShadowColor(java.awt.Color value)
Sets the color of items shadows. |
|
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(int value)
Sets the style of shadows. |
|
void |
setShapeBrush(Brush value)
Sets the default brush that should be assigned to new nodes. |
|
void |
setShapeCustomDraw(int value)
Sets whether new nodes should be custom drawn and what type of custom drawing will be performed on them. |
|
void |
setShapeHandlesStyle(int value)
Sets the style of selection handles that should be assigned to new nodes. |
|
void |
setShapeOrientation(float value)
Sets the default shape definition orientation angle assigned to new nodes. |
|
void |
setShapePen(Pen value)
Sets the default pen that should be assigned to new nodes. |
|
void |
setShapeText(java.lang.String value)
Sets the default text that should be assigned to new nodes. |
|
void |
setShowAnchors(int 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(int value)
Sets a value indicating when links should snap to anchor points. |
|
void |
setTableBrush(Brush value)
Sets the default brush that should be assigned to new links. |
|
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(int value)
Sets how users are allowed to link tables one to another - as integral entities, by rows, or both. |
|
void |
setTableHandlesStyle(int value)
Sets the style of selection handles that should be assigned to new tables. |
|
void |
setTablePen(Pen value)
Sets the default pen that should be assigned to new tables. |
|
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 |
setTablesScrollable(boolean value)
Sets a value indicating whether users are allowed to scroll new tables. |
|
void |
setTableStyle(int value)
Sets the default style of tables. |
|
void |
setTag(java.lang.Object value)
Associates a custom data with this diagram. |
|
void |
setTextColor(java.awt.Color value)
Sets the default text color that should be assigned to new items. |
|
void |
setTextFormat(TextFormat value)
Sets the default format and alignment of the text of new items. |
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Diagram()
Method Detail |
---|
public void addDiagramListener(DiagramListener listener)
listener
so that it will receive events when
users create, modify or delete diagram items.
listener
- An object implementing the DiagramListener
interface.public void removeDiagramListener(DiagramListener listener)
listener
so that it will no longer
receive diagram events.
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)
DiagramListener.nodeTextEditing(com.mindfusion.diagramming.NodeValidationEvent)
event to validate entering inplace edit mode.
node
- The DiagramNode
whose text will be edited.
true
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)
DiagramListener.nodeTextEdited(com.mindfusion.diagramming.EditNodeTextEvent)
event.
node
- The node whose text has been edited.oldText
- The old text.newText
- The new text.public void raiseLinkTextEdited(DiagramLink link, java.lang.String oldText, java.lang.String newText)
DiagramListener.linkTextEdited(com.mindfusion.diagramming.EditLinkTextEvent)
event.
link
- The DiagramLink
whose text has been edited.oldText
- The old text.newText
- The new text.public void raiseCellTextEdited(Cell cell, java.lang.String oldText, java.lang.String newText, int column, int row)
DiagramListener.cellTextEdited(com.mindfusion.diagramming.EditCellTextEvent)
event.
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 raiseTreeViewItemEdited(TreeViewItem item, java.lang.String oldText, java.lang.String newText)
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
- An 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(int format, boolean includeUnalteredProperties)
format
- A SaveToStringFormat
constant indicating the output format.includeUnalteredProperties
- true to serialize all property; 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.FileNotFoundException, java.io.IOException, XmlException
fileName
- The full path and name of the disk file where the diagram should be saved.
java.io.FileNotFoundException
java.io.IOException
XmlException
public void saveToXml(java.io.OutputStream stream, boolean includeUnalteredProperties) throws XmlException, java.io.IOException
stream
- An OutputStream
where the XML markup should be serialized.
XmlException
java.io.IOException
public void saveToXml(org.w3c.dom.Document document)
document
- A DOM Document object where the diagram should be saved.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 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 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 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 int getMeasureUnit()
GraphicsUnit
constants.public void setMeasureUnit(int value)
value
- One of the GraphicsUnit
constants.public double imageToDocX(int x)
x
- An image point x coordinate
public double imageToDocY(int y)
y
- An image point y coordinate
public java.awt.geom.Point2D.Float imageToDoc(int x, int y)
x
- y
-
Point2D.Float
object, which represents the
document coordinates of image pointpublic 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 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 font)
font
- A Font
object.public int getLinkHeadShape()
ArrowHead
constants.public void setLinkHeadShape(int value)
value
- One of the ArrowHead
constants.public int getLinkBaseShape()
ArrowHead
constants.public void setLinkBaseShape(int value)
value
- One of the ArrowHead
constants.public int getLinkIntermediateShape()
ArrowHead
constants.public void setLinkIntermediateShape(int value)
value
- One of the ArrowHead
constants.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 int getShadowsStyle()
ShadowsStyle
constants.public void setShadowsStyle(int value)
value
- One of the ShadowsStyle
constants.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 int getLinkTextStyle()
LinkTextStyle
constants.public void setLinkTextStyle(int value)
value
- One of the LinkTextStyle
constants.public Pen getShapePen()
Pen
object.public void setShapePen(Pen value)
value
- A Pen
object.public Brush getShapeBrush()
Brush
object.public void setShapeBrush(Brush value)
value
- A Brush
object.public Pen getLinkPen()
Pen
object that is assigned to newly created links.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 Brush getLinkBrush()
Brush
object that is assigned to newly created links.public void setLinkBrush(Brush value)
value
- A Brush
object that should be assigned
to newly created links.public Pen getTablePen()
Pen
object that is assigned to newly created tables.public void setTablePen(Pen value)
value
- A Pen
object that should be assigned to newly created tables.public Brush getTableBrush()
Brush
object that is assigned to newly created tables.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 int getGridStyle()
GridStyle
constants.public void setGridStyle(int value)
value
- One of the GridStyle
constants.public int getTableStyle()
TableStyle
constants.public void setTableStyle(int value)
value
- One of the TableStyle
constants.public java.awt.Color getShadowColor()
Color
object representing the shadow color.public void setShadowColor(java.awt.Color value)
value
- A Color
object representing the shadow color.public int getBackgroundImageAlign()
ImageAlign
constants.public void setBackgroundImageAlign(int value)
value
- One of the ImageAlign
constants.public int getImageDpiX()
Toolkit#getScreenResolution()
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 java.awt.Color getTextColor()
Color
object representing the default text color.public void setTextColor(java.awt.Color value)
value
- A Color
object representing the default text color.public int getLinkStyle()
LinkStyle
constants.public void setLinkStyle(int value)
value
- One of the LinkStyle
constants.public short getLinkSegments()
public void setLinkSegments(short value)
value
- An integer value specifying the default number of link segments.public DiagramItem getActiveItem()
DiagramItem
.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 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 int getShapeHandlesStyle()
HandlesStyle
constants.public void setShapeHandlesStyle(int value)
value
- One of the HandlesStyle
constants.public int getTableHandlesStyle()
HandlesStyle
constants.public void setTableHandlesStyle(int value)
value
- One of the HandlesStyle
constants.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 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 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 int getShapeCustomDraw()
CustomDraw
constants.public void setShapeCustomDraw(int value)
value
- One of the CustomDraw
constants.public int getLinkCustomDraw()
public void setLinkCustomDraw(int value)
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 int getRestrictItemsToBounds()
RestrictToBounds
constants.public void setRestrictItemsToBounds(int value)
value
- One of the RestrictToBounds
constants.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 getLinksSnapToBorders()
true
if newly created links are set to align
automatically to node borders when modified, otherwise
false
.public void setLinksSnapToBorders(boolean value)
value
- true
if newly created links are set to align
automatically to node borders when modified, otherwise
false
.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()
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 int getTableConnectionStyle()
TableConnectionStyle
constants.public void setTableConnectionStyle(int value)
value
- One of the TableConnectionStyle
constants.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 int getLinkCascadeOrientation()
Orientation
constants.public void setLinkCascadeOrientation(int value)
value
- One of the Orientation
constants.public int getCellFrameStyle()
CellFrameStyle
constants.public void setCellFrameStyle(int value)
value
- One of the CellFrameStyle
constants.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, 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 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, 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 point
DiagramLink
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)
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 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 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 int getHitTestPriority()
HitTestPriority
enumeration.public void setHitTestPriority(int 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 int getShowAnchors()
ShowAnchors
constants.public void setShowAnchors(int value)
value
- A bitwise combination of the ShowAnchors
constants.public int getSnapToAnchor()
SnapToAnchor
constants.public void setSnapToAnchor(int value)
value
- One of the SnapToAnchor
constants.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 int getAutoResize()
AutoResize
constants.public void setAutoResize(int value)
value
- One of the AutoResize
constants.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 int getLinkCrossings()
LinkCrossings
constants.public void setLinkCrossings(int value)
value
- One of the LinkCrossings
constants.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 int getExpandButtonAction()
public void setExpandButtonAction(int value)
value
- public int getExpandButtonPosition()
ExpandButtonPosition
enumeration.public void setExpandButtonPosition(int 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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |