public class DiagramView
extends javax.swing.JComponent
implements java.awt.print.Printable, javax.swing.Scrollable, javax.swing.event.AncestorListener, java.awt.datatransfer.ClipboardOwner, java.awt.dnd.DropTargetListener
Diagram
object.javax.swing.JComponent.AccessibleJComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
DiagramView()
Initializes a new instance of the DiagramView class.
|
DiagramView(Diagram diagram)
Initializes a new instance of the DiagramView class.
|
Modifier and Type | Method and Description |
---|---|
void |
adoptHostedControls(boolean onlyUnparented)
Adopts controls hosted in other views and moves them to this view.
|
void |
ancestorAdded(javax.swing.event.AncestorEvent event)
Implements AncestorListener.
|
void |
ancestorMoved(javax.swing.event.AncestorEvent event)
Implements AncestorListener.
|
void |
ancestorRemoved(javax.swing.event.AncestorEvent event)
Implements AncestorListener.
|
void |
beginEdit(DiagramItem diagItem,
InplaceEditable item,
java.awt.geom.Point2D mousePosition)
Enters inplace-edit mode, letting the user edit the text of the specified item.
|
void |
beginEdit(InplaceEditable item)
Enters inplace-edit mode, letting the user edit the text of the specified item.
|
void |
beginEdit(InplaceEditable item,
java.awt.geom.Point2D mousePosition) |
void |
bringIntoView(DiagramItem item)
Scrolls the viewport so that the specified item will be visible.
|
void |
bringIntoView(java.awt.geom.Rectangle2D rect)
Scrolls the view to make the specified rectangular area visible.
|
void |
cancelDrag() |
boolean |
copyToClipboard()
Copies the current selection of items to the system clipboard.
|
boolean |
copyToClipboard(boolean groups)
Copies the current selection of items to the system clipboard.
|
boolean |
cutToClipboard()
Cuts the currently selected items to the system clipboard.
|
boolean |
cutToClipboard(boolean groups)
Cuts the currently selected items to the system clipboard.
|
java.awt.geom.Point2D.Float |
deviceToDoc(int x,
int y)
Transforms points from the client coordinate space to the document coordinate space.
|
java.awt.geom.Point2D.Float |
deviceToDoc(java.awt.Point devPoint)
Transforms points from the client coordinate space to the document coordinate space.
|
java.awt.geom.Rectangle2D.Float |
deviceToDoc(java.awt.Rectangle devRect)
Transforms points from the client coordinate space to the document coordinate space.
|
void |
disableInteractionBuffer() |
java.awt.Point |
docToDevice(java.awt.geom.Point2D docPoint)
Transforms points from the document coordinate space to the device coordinate space.
|
java.awt.Rectangle |
docToDevice(java.awt.geom.Rectangle2D docRect)
Transforms points from the document coordinate space to the device coordinate space.
|
void |
dragEnter(java.awt.dnd.DropTargetDragEvent e) |
void |
dragExit(java.awt.dnd.DropTargetEvent dte) |
void |
dragOver(java.awt.dnd.DropTargetDragEvent e) |
void |
drop(java.awt.dnd.DropTargetDropEvent e) |
void |
dropActionChanged(java.awt.dnd.DropTargetDragEvent dtde) |
void |
endEdit(boolean accept)
Exits inplace-edit mode and either accepts or rejects the changes made to the item's text.
|
boolean |
getAllowInplaceEdit()
Gets a value indicating whether users are allowed
to edit the text of diagram items.
|
java.awt.Cursor |
getAllowLinkCursor()
Gets the cursor shown when the currently drawn link can be attached
to the item at the current mouse pointer location.
|
SmoothingMode |
getAntiAlias()
Gets the current anti-aliasing mode for non text objects.
|
boolean |
getAutoScroll()
Gets a value indicating whether the diagram will scroll automatically
when the mouse is dragged towards the edge of the view.
|
Behavior |
getBehavior()
Gets a value indicating how the control responds to users actions.
|
java.awt.Cursor |
getCounterDiagonalResizeCursor()
Gets the cursor shown when dragging from the current mouse pointer
location would start resizing an item along its secondary diagonal.
|
BehaviorBase |
getCustomBehavior()
Gets custom behavior object specifying how the control responds to mouse input.
|
java.lang.Class<? extends DiagramLink> |
getCustomLinkType()
Gets a custom type of DiagramLink-derived objects that will
be created when the users starts drawing with the mouse.
|
java.lang.Class<? extends DiagramNode> |
getCustomNodeType()
Gets the type of a DiagramNode-derived class whose
instance should be created when a user starts drawing.
|
DelKeyAction |
getDelKeyAction()
Gets a value that specifies what action should be carried out
when the user hits the Del key.
|
java.awt.Cursor |
getDiagonalResizeCursor()
Gets the cursor shown when dragging from the current mouse pointer
location would start resizing an item along its main diagonal.
|
Diagram |
getDiagram()
Gets the diagram displayed by this view.
|
java.awt.Cursor |
getDisallowCursor()
Gets the cursor shown when an item cannot be created
at the current mouse pointer location.
|
java.awt.Cursor |
getDisallowLinkCursor()
Gets the cursor shown when the currently created link cannot be attached
to the item at the current mouse pointer location.
|
float |
getDragIndicatorOpacity()
Gets the opacity of ghost image displayed during drag-and-drop from NodeListView.
|
int |
getDragThreshold()
Gets the minimum distance the mouse should be dragged, measured in pixels,
that would cause a drag event instead of click.
|
java.awt.Cursor |
getDrawLinkCursor()
Gets the cursor shown when a link can be drawn
from the current mouse pointer location.
|
java.awt.Cursor |
getEditTextCursor()
Gets the mouse cursor shown to the user when the mouse
is positioned over an edit component.
|
java.awt.Font |
getFont() |
GlassPane |
getGlassPane() |
com.mindfusion.common.HorizontalAlignment |
getHorizontalDropAlignment()
Gets the horizontal placement of nodes created by drag-and-drop operations, relatively to mouse cursor.
|
java.awt.Cursor |
getHorizontalResizeCursor()
Gets the cursor shown when dragging from the current
mouse pointer location would start resizing an item horizontally.
|
boolean |
getInplaceEditAcceptOnEnter()
Gets a value indicating whether pressing the ENTER key
ends inplace editing and accepts changes.
|
boolean |
getInplaceEditCancelOnEsc()
Gets a value indicating whether pressing the ESC key
ends inplace editing and cancels changes.
|
java.awt.Font |
getInplaceEditFont()
Gets the font used to display text in the inplace- edit text control.
|
java.awt.Cursor |
getLaneColumnResizeCursor()
Gets the mouse cursor shown to the user
when dragging would resize a lane column header.
|
java.awt.Cursor |
getLaneRowResizeCursor()
Gets the mouse cursor shown to the user
when dragging would resize a lane row header.
|
boolean |
getMagnifierEnabled()
Gets a value indicating whether the magnifier tool is currently enabled.
|
float |
getMagnifierFactor()
Gets the zoom factor of the magnifier tool.
|
java.awt.Color |
getMagnifierFrameColor()
Gets the color of the magnifier frame.
|
int |
getMagnifierFrameThickness()
Gets the thickness of the magnifier frame, expressed in pixels.
|
int |
getMagnifierHeight()
Gets the height of the magnifier tool, expressed in pixels.
|
java.awt.Color |
getMagnifierSecondaryFrameColor()
Gets the secondary color of the magnifier frame.
|
boolean |
getMagnifierShading()
Gets a value indicating whether to enhance the effect of
a magnifier lense by using a gradient shading.
|
Shape |
getMagnifierShape()
Gets the shape of the magnifier tool.
|
int |
getMagnifierWidth()
Gets the width of the magnifier tool, expressed in pixels.
|
java.util.EnumSet<MouseButtonAction> |
getMiddleButtonActions()
Gets what actions are performed via the middle mouse button.
|
ModificationStart |
getModificationStart()
Gets a value indicating how users can start modifying items in the diagram.
|
ModifierKeyActions |
getModifierKeyActions()
Gets an object that allows changing the function of keyboard modifier keys such as CTRL and ALT.
|
java.awt.Cursor |
getMoveCursor()
Gets the cursor shown when the item under
the mouse pointer can be modified.
|
java.awt.Cursor |
getPanCursor()
Gets the cursor shown when panning the diagram view.
|
java.awt.Cursor |
getPointerCursor()
Gets the mouse cursor shown when no modification is performed.
|
java.awt.Dimension |
getPreferredScrollableViewportSize()
Provides support for scrolling when the diagram in placed inside
a scroll pane.
|
java.awt.Dimension |
getPreferredSize()
Returns the size of the diagram in pixels, based on the currently
set document size and zoom level.
|
PrintOptions |
getPrintOptions()
Returns a
PrintOptions instance that allows customizing
various aspects of printing and print-preview. |
java.util.EnumSet<MouseButtonAction> |
getRightButtonActions()
Gets what actions are performed via the right mouse button.
|
java.awt.Cursor |
getRotateCursor()
Gets the cursor shown when dragging from the current
mouse pointer location would start rotating a box.
|
int |
getScrollableBlockIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
Provides support for scrolling when the diagram in placed inside
a scroll pane.
|
boolean |
getScrollableTracksViewportHeight()
Provides support for scrolling when the diagram in placed inside
a scroll pane.
|
boolean |
getScrollableTracksViewportWidth()
Provides support for scrolling when the diagram in placed inside
a scroll pane.
|
int |
getScrollableUnitIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
Provides support for scrolling when the diagram in placed inside
a scroll pane.
|
float |
getScrollX()
Gets the horizontal scroll position.
|
float |
getScrollY()
Gets the vertical scroll position.
|
int |
getScrollZoneSize()
Gets the size of the auto scroll zone near the edges of the control.
|
boolean |
getShowToolTips()
Gets a value indicating whether an item's ToolTip is shown
when the mouse hovers over the item.
|
SmoothingMode |
getTextAntiAlias()
Gets the current anti-aliasing mode for text.
|
java.lang.String |
getToolTipText(java.awt.event.MouseEvent event)
Returns the string to be used as the tooltip for
event . |
boolean |
getTrackPointedItem()
Gets a value indicating whether the control will raise the
nodePointerEnter and
nodePointerLeave events. |
com.mindfusion.common.VerticalAlignment |
getVerticalDropAlignment()
Gets the vertical placement of nodes created by drag-and-drop operations, relatively to mouse cursor.
|
java.awt.Cursor |
getVerticalResizeCursor()
Gets the cursor shown when dragging from the current
mouse pointer location would start resizing an item vertically.
|
boolean |
getXmlClipboard()
Gets a value that specifies whether XML serialization
will be used when saving/loading the selection to/from clipboard.
|
float |
getZoomFactor()
Gets the current zoom level.
|
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 specified JSON data.
|
void |
loadFromJsonFile(java.lang.String fileName)
Loads the diagram from a JSON 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.
|
void |
lostOwnership(java.awt.datatransfer.Clipboard arg0,
java.awt.datatransfer.Transferable arg1) |
protected void |
paintComponent(java.awt.Graphics g) |
boolean |
pasteFromClipboard(float dx,
float dy)
Pastes diagram items from the system clipboard.
|
boolean |
pasteFromClipboard(float dx,
float dy,
boolean unconnectedLinks)
Pastes diagram items from the system clipboard.
|
void |
print()
Prints the current diagram using the default page format.
|
int |
print(java.awt.Graphics graphics,
java.awt.print.PageFormat pageFormat,
int pageIndex)
Implements the Printable interface.
|
void |
print(java.awt.print.PageFormat pageFormat,
java.lang.String printer)
Prints the current diagram using the specified page format.
|
void |
print(java.lang.String printer)
Prints the current diagram using the default page format.
|
void |
printPreview()
Displays a print preview window, that shows how the diagram would
look when printed on paper.
|
void |
printPreview(java.awt.print.PageFormat pageFormat)
Displays a print preview window, that shows how the diagram would
look when printed on paper.
|
protected void |
processKeyEvent(java.awt.event.KeyEvent e) |
void |
recreateCacheImage()
Recreates the off-screen cache bitmap used for
fast drawing while modifying items.
|
void |
repaint()
Repaints the whole diagram.
|
void |
repaint(java.awt.geom.Rectangle2D docRect)
Repaints the specified region of the diagram.
|
void |
resumeRepaint()
Resumes repainting the control after a
suspendRepaint() call. |
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()
Serializes the DiagramView's data to JSON.
|
void |
saveToJsonFile(java.lang.String fileName)
Saves the diagram into a JSON file.
|
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 |
scrollTo(float x,
float y)
Scrolls the diagram to the specified position.
|
void |
setAllowInplaceEdit(boolean value)
Sets a value indicating whether users are allowed
to edit the text of diagram items.
|
void |
setAllowLinkCursor(java.awt.Cursor value)
Sets the cursor shown when the currently drawn link can be attached
to the item at the current mouse pointer location.
|
void |
setAntiAlias(SmoothingMode antiAlias)
Sets the current anti-aliasing mode for non text objects.
|
void |
setAutoScroll(boolean value)
Sets a value indicating whether the diagram should scroll automatically
when the mouse is dragged towards the edge of the view.
|
void |
setBehavior(Behavior value)
Sets a value indicating how the control should respond to users actions.
|
void |
setCounterDiagonalResizeCursor(java.awt.Cursor value)
Sets the cursor shown when dragging from the current mouse pointer
location would start resizing an item along its secondary diagonal.
|
void |
setCustomBehavior(BehaviorBase value)
Sets a custom behavior object specifying how the control responds to mouse input.
|
void |
setCustomLinkType(java.lang.Class<? extends DiagramLink> value)
Sets a custom type of DiagramLink-derived objects that will
be created when the users starts drawing with the mouse.
|
void |
setCustomNodeType(java.lang.Class<? extends DiagramNode> value)
Sets the type of a DiagramNode-derived class whose
instance should be created when a user starts drawing.
|
void |
setDelKeyAction(DelKeyAction delKeyAction)
Sets a value that specifies what action should be carried out
when the user hits the Del key.
|
void |
setDiagonalResizeCursor(java.awt.Cursor value)
Sets the cursor shown when dragging from the current mouse pointer
location would start resizing an item along its main diagonal.
|
void |
setDiagram(Diagram value)
Sets the diagram displayed by this view.
|
void |
setDisallowCursor(java.awt.Cursor value)
Sets the cursor shown when an item cannot be created
at the current mouse pointer location.
|
void |
setDisallowLinkCursor(java.awt.Cursor value)
Sets the cursor shown when the currently created link can be attached
to the item at the current mouse pointer location.
|
void |
setDragIndicatorOpacity(float value)
Sets the opacity of ghost image displayed during drag-and-drop from NodeListView.
|
void |
setDragThreshold(int dragThreshold)
Sets the minimum distance the mouse should be dragged, measured in pixels,
that would cause a drag event instead of click.
|
void |
setDrawLinkCursor(java.awt.Cursor value)
Sets the cursor shown when a link can be drawn
from the current mouse pointer location.
|
void |
setEditTextCursor(java.awt.Cursor value)
Gets the mouse cursor shown to the user when the mouse
is positioned over an edit component.
|
void |
setHorizontalDropAlignment(com.mindfusion.common.HorizontalAlignment value)
Sets the horizontal placement of nodes created by drag-and-drop operations, relatively to mouse cursor.
|
void |
setHorizontalResizeCursor(java.awt.Cursor value)
Sets the cursor shown when dragging from the current
mouse pointer location would start resizing an item horizontally.
|
void |
setInplaceEditAcceptOnEnter(boolean inplaceEditAcceptOnEnter)
Sets a value indicating whether pressing the ENTER key
ends inplace editing and accepts changes.
|
void |
setInplaceEditCancelOnEsc(boolean inplaceEditCancelOnEsc)
Sets a value indicating whether pressing the ESC key
ends inplace editing and cancels changes.
|
void |
setInplaceEditFont(java.awt.Font value)
Sets the font used to display text in the inplace- edit text control.
|
void |
setLaneColumnResizeCursor(java.awt.Cursor value)
Sets the mouse cursor shown to the user
when dragging would resize a lane column header.
|
void |
setLaneRowResizeCursor(java.awt.Cursor value)
Sets the mouse cursor shown to the user
when dragging would resize a lane row header.
|
static void |
setLicenseKey(java.lang.String licenseKey)
Sets the component's license key string, disabling evaluation mode.
|
void |
setMagnifierEnabled(boolean value)
Sets a value indicating whether the magnifier tool is currently enabled.
|
void |
setMagnifierFactor(float value)
Gets the zoom factor of the magnifier tool.
|
void |
setMagnifierFrameColor(java.awt.Color value)
Sets the color of the magnifier frame.
|
void |
setMagnifierFrameThickness(int value)
Sets the thickness of the magnifier frame, expressed in pixels.
|
void |
setMagnifierHeight(int value)
Sets the height of the magnifier tool, expressed in pixels.
|
void |
setMagnifierSecondaryFrameColor(java.awt.Color value)
Sets the secondary color of the magnifier frame.
|
void |
setMagnifierShading(boolean value)
Sets a value indicating whether to enhance the effect of
a magnifier lense by using a gradient shading.
|
void |
setMagnifierShape(Shape value)
Sets the shape of the magnifier tool.
|
void |
setMagnifierWidth(int value)
Sets the width of the magnifier tool, expressed in pixels.
|
void |
setMiddleButtonActions(java.util.EnumSet<MouseButtonAction> value)
Sets what actions are performed via the middle mouse button.
|
void |
setModificationStart(ModificationStart value)
Sets a value indicating how users can start modifying items in the
diagram.
|
void |
setMoveCursor(java.awt.Cursor value)
Sets the cursor shown when the item under
the mouse pointer can be modified.
|
void |
setPanCursor(java.awt.Cursor value)
Sets the cursor shown when panning the diagram view
|
void |
setPointerCursor(java.awt.Cursor value)
Sets the mouse cursor that should be shown when no modification is performed.
|
void |
setRightButtonActions(java.util.EnumSet<MouseButtonAction> value)
Sets what actions are performed via the right mouse button.
|
void |
setRotateCursor(java.awt.Cursor value)
Sets the cursor shown when dragging from the current
mouse pointer location would start rotating a box.
|
void |
setScrollX(float value)
Sets the horizontal scroll position.
|
void |
setScrollY(float value)
Sets the vertical scroll position.
|
void |
setScrollZoneSize(int value)
Sets the size of the auto scroll zone near the edges of the control.
|
void |
setShowToolTips(boolean value)
Sets a value indicating whether an item's ToolTip is shown
when the mouse hovers over the item.
|
void |
setTextAntiAlias(SmoothingMode antiAlias)
Sets the current anti-aliasing mode for text.
|
void |
setTrackPointedItem(boolean value)
Sets a value indicating whether the control should raise the
nodePointerEnter and
nodePointerLeave events. |
void |
setVerticalDropAlignment(com.mindfusion.common.VerticalAlignment value)
Sets the vertical placement of nodes created by drag-and-drop operations, relatively to mouse cursor.
|
void |
setVerticalResizeCursor(java.awt.Cursor value)
Sets the cursor shown when dragging from the current
mouse pointer location would start resizing an item vertically.
|
void |
setXmlClipboard(boolean xmlClipboard)
Sets a value that specifies whether XML serialization
will be used when saving/loading the selection to/from clipboard.
|
void |
setZoomFactor(float value)
Sets the zoom level.
|
void |
startInteraction(InteractionState interactionState,
java.awt.geom.Point2D.Float point)
Starts the specified interactive operation.
|
void |
suspendRepaint()
Stops repainting the control.
|
static java.lang.String |
toJson(DiagramView view)
Serializes the DiagramView's data to JSON.
|
void |
zoomToFit()
Zooms the diagram so that all its contents becomes visible.
|
void |
zoomToFit(java.awt.geom.Rectangle2D rect)
Zooms and scrolls the diagram so that the specified rectangular area
becomes visible.
|
void |
zoomToRect(java.awt.geom.Rectangle2D rect)
Zooms and scrolls the view to fit the specified document rectangle in the viewport.
|
void |
zoomToRect(java.awt.geom.Rectangle2D rect,
boolean centered)
Zooms and scrolls the view to fit the specified document rectangle in the viewport.
|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public DiagramView()
public DiagramView(Diagram diagram)
public void dragEnter(java.awt.dnd.DropTargetDragEvent e)
dragEnter
in interface java.awt.dnd.DropTargetListener
public void dragOver(java.awt.dnd.DropTargetDragEvent e)
dragOver
in interface java.awt.dnd.DropTargetListener
public void dragExit(java.awt.dnd.DropTargetEvent dte)
dragExit
in interface java.awt.dnd.DropTargetListener
public void drop(java.awt.dnd.DropTargetDropEvent e)
drop
in interface java.awt.dnd.DropTargetListener
public void dropActionChanged(java.awt.dnd.DropTargetDragEvent dtde)
dropActionChanged
in interface java.awt.dnd.DropTargetListener
public boolean getTrackPointedItem()
nodePointerEnter
and
nodePointerLeave
events.true
if nodePointerEnter
and
nodePointerLeave
events are raised when the mouse
pointer enters or leaves the bounds of an item, otherwise false.public void setTrackPointedItem(boolean value)
nodePointerEnter
and
nodePointerLeave
events.value
- true
if nodePointerEnter
and
nodePointerLeave
events should be raised when the mouse pointer
enters or leaves the bounds of an item, otherwise false
.public java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JComponent
Dimension
object representing the preferred size.public java.awt.Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize
in interface javax.swing.Scrollable
Dimension
object representing the preferred size.public int getScrollableBlockIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
getScrollableBlockIncrement
in interface javax.swing.Scrollable
public int getScrollableUnitIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
getScrollableUnitIncrement
in interface javax.swing.Scrollable
public boolean getScrollableTracksViewportHeight()
getScrollableTracksViewportHeight
in interface javax.swing.Scrollable
false
public boolean getScrollableTracksViewportWidth()
getScrollableTracksViewportWidth
in interface javax.swing.Scrollable
false
public java.lang.String getToolTipText(java.awt.event.MouseEvent event)
event
.getToolTipText
in class javax.swing.JComponent
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(SaveToStringFormat format, boolean includeUnalteredProperties)
format
- A member of the SaveToStringFormat
enumeration that indicates
the desired serialized string format.includeUnalteredProperties
- true to serialize all properties;
false to serialize only properties different from their default value.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)
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 void loadFromJson(java.lang.String json)
json
- The JSON stringpublic static java.lang.String toJson(DiagramView view)
view
- A DiagramView Objectpublic java.lang.String saveToJson()
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.protected void processKeyEvent(java.awt.event.KeyEvent e)
processKeyEvent
in class javax.swing.JComponent
public void suspendRepaint()
public void resumeRepaint()
suspendRepaint()
call.protected void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
public void recreateCacheImage()
public java.awt.Rectangle docToDevice(java.awt.geom.Rectangle2D docRect)
docRect
- A Rectangle2D
object, whose
coordinates should be transformed and returned.Rectangle
instance, which represents the device
coordinates of docRect.public java.awt.geom.Rectangle2D.Float deviceToDoc(java.awt.Rectangle devRect)
devRect
- An instance of the Rectangle
object, whose
coordinates should be transformed and returned.Rectangle2D.Float
object, which represents the
document coordinates of devRectpublic java.awt.Point docToDevice(java.awt.geom.Point2D docPoint)
docPoint
- A Point2D
object, whose
coordinates should be transformed and returned.Point
instance, which represents the device
coordinates of docPoint.public java.awt.geom.Point2D.Float deviceToDoc(java.awt.Point devPoint)
devPoint
- An instance of the Point
object, whose
coordinates should be transformed and returned.Point2D.Float
object, which represents the
document coordinates of devPointpublic java.awt.geom.Point2D.Float deviceToDoc(int x, int y)
x
- y
- Point2D.Float
object, which represents the
document coordinates of device point (x, y)public PrintOptions getPrintOptions()
PrintOptions
instance that allows customizing
various aspects of printing and print-preview.PrintOptions
object.public int print(java.awt.Graphics graphics, java.awt.print.PageFormat pageFormat, int pageIndex)
print
in interface java.awt.print.Printable
public void print()
public void print(java.lang.String printer)
printer
- Specifies the destination printerpublic void print(java.awt.print.PageFormat pageFormat, java.lang.String printer)
pageFormat
- The size and orientation of each page to be printed.printer
- Specifies the destination printerpublic void printPreview()
getPrintOptions()
. That
ensures uniform output of the printed document both on paper and in the
preview window. Print job settings include document title and several flags
that control whether images, shadows, headers, etc. are printed.public void printPreview(java.awt.print.PageFormat pageFormat)
getPrintOptions()
. That
ensures uniform output of the printed document both on paper and in the
preview window. Print job settings include document title and several flags
that control whether images, shadows, headers, etc. are printed.public boolean copyToClipboard() throws java.io.IOException, XmlException
java.io.IOException
XmlException
public boolean copyToClipboard(boolean groups) throws java.io.IOException, XmlException
groups
- true to copy item groups; otherwise, false.java.io.IOException
XmlException
public boolean cutToClipboard() throws java.io.IOException, XmlException
java.io.IOException
XmlException
public boolean cutToClipboard(boolean groups) throws java.io.IOException, XmlException
groups
- true to cut item groups; otherwise, false.java.io.IOException
XmlException
public boolean pasteFromClipboard(float dx, float dy) throws java.io.IOException, XmlException
dx
- Horizontal offset of pasted items from their original positions.dy
- Vertical offset of pasted items from their original positions.java.io.IOException
XmlException
public boolean pasteFromClipboard(float dx, float dy, boolean unconnectedLinks) throws java.io.IOException, XmlException
dx
- Horizontal offset of pasted items from their original positions.dy
- Vertical offset of pasted items from their original positions.unconnectedLinks
- true to allow pasting links whose origin or destination node
has not been copied; otherwise, false. Default is false.java.io.IOException
XmlException
public void lostOwnership(java.awt.datatransfer.Clipboard arg0, java.awt.datatransfer.Transferable arg1)
lostOwnership
in interface java.awt.datatransfer.ClipboardOwner
public java.awt.Font getFont()
getFont
in interface java.awt.MenuContainer
getFont
in class java.awt.Component
public java.awt.Font getInplaceEditFont()
java.awt.Font
object representing
the font of the inplace edit control.public void setInplaceEditFont(java.awt.Font value)
value
- A java.awt.Font
object representing
the font of the inplace edit control.public Behavior getBehavior()
Behavior
enumeration.public void setBehavior(Behavior value)
value
- A member of the Behavior
enumeration.public BehaviorBase getCustomBehavior()
public void setCustomBehavior(BehaviorBase value)
public void cancelDrag()
public float getScrollX()
public void setScrollX(float value)
value
- A float value specifying the horizontal scroll position.public float getScrollY()
public void setScrollY(float value)
value
- A float value specifying the vertical scroll position.public void scrollTo(float x, float y)
x
- A float value specifying the horizontal scroll position.y
- A float value specifying the vertical scroll position.public float getZoomFactor()
public void setZoomFactor(float value)
value
- A float value specifying the zoom factor
as percents of the original view size.public void zoomToFit()
public void zoomToFit(java.awt.geom.Rectangle2D rect)
rect
- A Rectangle2D
object representing the
region to which the view should be fitted.public void zoomToRect(java.awt.geom.Rectangle2D rect, boolean centered)
rect
- A Rectangle2D instance specifying the desired viewport's position and size.centered
- true to center the rectangle in viewport, or false to align it to top-left corner.public void zoomToRect(java.awt.geom.Rectangle2D rect)
rect
- A Rectangle2D instance specifying the desired viewport's position and size.public java.awt.Cursor getPointerCursor()
java.awt.Cursor
object.public void setPointerCursor(java.awt.Cursor value)
value
- A java.awt.Cursor
object.public java.awt.Cursor getDisallowCursor()
java.awt.Cursor
object.public void setDisallowCursor(java.awt.Cursor value)
value
- A java.awt.Cursor
object.public java.awt.Cursor getMoveCursor()
java.awt.Cursor
object.public void setMoveCursor(java.awt.Cursor value)
value
- A java.awt.Cursor
object.public java.awt.Cursor getDrawLinkCursor()
java.awt.Cursor
object.public void setDrawLinkCursor(java.awt.Cursor value)
value
- A java.awt.Cursor
object.public java.awt.Cursor getAllowLinkCursor()
java.awt.Cursor
object.public void setAllowLinkCursor(java.awt.Cursor value)
value
- A java.awt.Cursor
object.public java.awt.Cursor getDisallowLinkCursor()
java.awt.Cursor
object.public void setDisallowLinkCursor(java.awt.Cursor value)
value
- A java.awt.Cursor
object.public java.awt.Cursor getHorizontalResizeCursor()
java.awt.Cursor
object.public void setHorizontalResizeCursor(java.awt.Cursor value)
value
- A java.awt.Cursor
object.public java.awt.Cursor getRotateCursor()
java.awt.Cursor
object.public void setRotateCursor(java.awt.Cursor value)
value
- A java.awt.Cursor
object.public java.awt.Cursor getPanCursor()
java.awt.Cursor
object.public void setPanCursor(java.awt.Cursor value)
value
- A java.awt.Cursor
object.public java.awt.Cursor getVerticalResizeCursor()
java.awt.Cursor
object.public void setVerticalResizeCursor(java.awt.Cursor value)
value
- A java.awt.Cursor
object.public java.awt.Cursor getDiagonalResizeCursor()
java.awt.Cursor
object.public void setDiagonalResizeCursor(java.awt.Cursor value)
value
- A java.awt.Cursor
object.public java.awt.Cursor getCounterDiagonalResizeCursor()
java.awt.Cursor
object.public void setCounterDiagonalResizeCursor(java.awt.Cursor value)
value
- A java.awt.Cursor
object.public java.awt.Cursor getEditTextCursor()
java.awt.Cursor
object.public void setEditTextCursor(java.awt.Cursor value)
value
- A java.awt.Cursor
object.public int getDragThreshold()
public java.util.EnumSet<MouseButtonAction> getMiddleButtonActions()
public void setMiddleButtonActions(java.util.EnumSet<MouseButtonAction> value)
value
- An enumset of MouseButtonAction values.public java.util.EnumSet<MouseButtonAction> getRightButtonActions()
public void setRightButtonActions(java.util.EnumSet<MouseButtonAction> value)
value
- An enumset of MouseButtonAction values.public java.lang.Class<? extends DiagramNode> getCustomNodeType()
public void setCustomNodeType(java.lang.Class<? extends DiagramNode> value)
value
- public java.lang.Class<? extends DiagramLink> getCustomLinkType()
public void setCustomLinkType(java.lang.Class<? extends DiagramLink> value)
public float getMagnifierFactor()
public void setMagnifierFactor(float value)
public int getMagnifierWidth()
public void setMagnifierWidth(int value)
public int getMagnifierHeight()
public void setMagnifierHeight(int value)
public Shape getMagnifierShape()
public void setMagnifierShape(Shape value)
public int getMagnifierFrameThickness()
public void setMagnifierFrameThickness(int value)
public java.awt.Color getMagnifierFrameColor()
public void setMagnifierFrameColor(java.awt.Color value)
public java.awt.Color getMagnifierSecondaryFrameColor()
public void setMagnifierSecondaryFrameColor(java.awt.Color value)
public boolean getMagnifierShading()
public void setMagnifierShading(boolean value)
public boolean getMagnifierEnabled()
The magnifier tool can be alternatively enabled on-demand through a modifier key or a mouse button.
public void setMagnifierEnabled(boolean value)
The magnifier tool can be alternatively enabled on-demand through a modifier key or a mouse button.
public void setDragThreshold(int dragThreshold)
dragThreshold
- The minimal distance to move the mouse before starting a drag operation.public float getDragIndicatorOpacity()
public void setDragIndicatorOpacity(float value)
value
- A value in 0 - 1 range specifying opacity.public com.mindfusion.common.HorizontalAlignment getHorizontalDropAlignment()
public void setHorizontalDropAlignment(com.mindfusion.common.HorizontalAlignment value)
value
- A member of the HorizontalAlignment enumeration.public com.mindfusion.common.VerticalAlignment getVerticalDropAlignment()
public void setVerticalDropAlignment(com.mindfusion.common.VerticalAlignment value)
value
- A member of the VerticalAlignment enumeration.public boolean getAutoScroll()
true
if the diagram will scroll automatically,
otherwise false
.public void setAutoScroll(boolean value)
value
- true
if the diagram should scroll
automatically, otherwise false
.public int getScrollZoneSize()
public void setScrollZoneSize(int value)
value
- An integer value specifying the scroll zone size.public ModificationStart getModificationStart()
ModificationStart
enumeration.public void setModificationStart(ModificationStart value)
value
- A member of the ModificationStart
enumeration.public void bringIntoView(DiagramItem item)
item
- The DiagramItem
to bring into view.public void bringIntoView(java.awt.geom.Rectangle2D rect)
rect
- A Rectangle2D specifying the diagram region to show in the viewport.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()
repaint
in class java.awt.Component
public boolean getAllowInplaceEdit()
true
if users are allowed to edit the text
of diagram items, otherwise false
.public void setAllowInplaceEdit(boolean value)
value
- true
if users are allowed to edit the text
of diagram items, otherwise false
.public boolean getShowToolTips()
true
if tooltips are shown for the diagram
items that have them, otherwise false
.public void setShowToolTips(boolean value)
value
- true
if tooltips are shown for the diagram
items that have them, otherwise false
.public boolean getInplaceEditAcceptOnEnter()
true
if ENTER ends inplace editing, otherwise false
public void setInplaceEditAcceptOnEnter(boolean inplaceEditAcceptOnEnter)
inplaceEditAcceptOnEnter
- true
if ENTER should end
inplace editing, otherwise false
public boolean getInplaceEditCancelOnEsc()
true
if ESC should end inplace editing, otherwise false
public void setInplaceEditCancelOnEsc(boolean inplaceEditCancelOnEsc)
inplaceEditCancelOnEsc
- true
if ESC should end inplace editing, otherwise false
public void beginEdit(InplaceEditable item)
item
- The diagram item or table's cell whose text should be edited.public void beginEdit(InplaceEditable item, java.awt.geom.Point2D mousePosition)
public void beginEdit(DiagramItem diagItem, InplaceEditable item, java.awt.geom.Point2D mousePosition)
item
- The diagram item or table's cell whose text should be edited.public void endEdit(boolean accept)
accept
- true to accept changes made to text; false to reject them.public SmoothingMode getAntiAlias()
SmoothingMode
enumeration.public void setAntiAlias(SmoothingMode antiAlias)
antiAlias
- A member of the SmoothingMode
enumerationsetTextAntiAlias(com.mindfusion.diagramming.SmoothingMode)
public SmoothingMode getTextAntiAlias()
SmoothingMode
enumeration.public void setTextAntiAlias(SmoothingMode antiAlias)
antiAlias
- A member of the SmoothingMode
enumerationsetAntiAlias(com.mindfusion.diagramming.SmoothingMode)
public ModifierKeyActions getModifierKeyActions()
ModifierKeyActions
class.public DelKeyAction getDelKeyAction()
DelKeyAction
enumeration.public void setDelKeyAction(DelKeyAction delKeyAction)
delKeyAction
- A member of the DelKeyAction
enumeration.public boolean getXmlClipboard()
true
if XML serialization will be used;
otherwise false
.public void setXmlClipboard(boolean xmlClipboard)
xmlClipboard
- true
if XML serialization will be used;
otherwise false
.public void ancestorAdded(javax.swing.event.AncestorEvent event)
ancestorAdded
in interface javax.swing.event.AncestorListener
public void ancestorRemoved(javax.swing.event.AncestorEvent event)
ancestorRemoved
in interface javax.swing.event.AncestorListener
public void ancestorMoved(javax.swing.event.AncestorEvent event)
ancestorMoved
in interface javax.swing.event.AncestorListener
public Diagram getDiagram()
public void setDiagram(Diagram value)
public void adoptHostedControls(boolean onlyUnparented)
ControlNode
objects in multiple views.
For example, you might want to invoke it when a view becomes the topmost window in a MDI application.onlyUnparented
- true
if only controls that currently
do not have a parent view are adopted; false
to adopt all controls.public GlassPane getGlassPane()
public void startInteraction(InteractionState interactionState, java.awt.geom.Point2D.Float point)
public void disableInteractionBuffer()
public java.awt.Cursor getLaneRowResizeCursor()
public void setLaneRowResizeCursor(java.awt.Cursor value)
public java.awt.Cursor getLaneColumnResizeCursor()
public void setLaneColumnResizeCursor(java.awt.Cursor value)
public static void setLicenseKey(java.lang.String licenseKey)
licenseKey
- A string value containing encoded MindFusion.Diagramming license information.