public class GraphControl extends CanvasControl
IGraph
.
This is a specialized CanvasControl
that can hold, display, and edit an IGraph
instance. It provides
access to the Graph
and Selection
instances. Additionally it provides
convenience methods for exporting the graph to GraphML
and
importing a graph from GraphML
.
The following commands are bound to methods implemented by this class, but are disabled by default:
To enable these command, set the FileIOEnabled
property to true
.
Additionally, this class supports the following ICommand
s.
ICommand.FIT_GRAPH_BOUNDS
that invokes fitGraphBounds()
ICommand.SET_CURRENT_ITEM
for setting the CurrentItem
ICommand.ZOOM_TO_CURRENT_ITEM
for adjusting the Viewport
to the
CurrentItem
The ICommand.ZOOM_TO_CURRENT_ITEM
is enabled, if NavigationCommandsEnabled
is true
. All of these commands can be removed from the com.yworks.yfiles.view.CanvasControl.getCommandBindings()
collection if necessary.
The GraphControl
may be styled with backgrounds and borders using CSS. It has all style properties of
StackPane.
Example:
<GraphControl fx:id="graphControl" style="-fx-background-color: #DDDDDD"/>
The controls that can be used to display and edit a model are discussed in the section The Control for Displaying Graphs.
autoDragEnabledProperty, autoDragInsetsProperty, centerZoomEventRecognizerProperty, computedHorizontalScrollBarStateProperty, computedVerticalScrollBarStateProperty, contentRectProperty, doubleClickSizeProperty, doubleClickTimeProperty, doubleTapDurationProperty, doubleTapSizeProperty, dragSizeProperty, dragTimeProperty, editableProperty, fitContentViewMarginsProperty, hitTestRadiusProperty, horizontalOffsetProperty, horizontalScrollBarPolicyProperty, inputModeProperty, largeHorizontalChangeProperty, largeVerticalChangeProperty, longPressDurationProperty, maximumHorizontalOffsetProperty, maximumVerticalOffsetProperty, maximumZoomProperty, minimumHorizontalOffsetProperty, minimumVerticalOffsetProperty, minimumZoomProperty, mouseEventConsumingDisabledProperty, mouseWheelBehaviorProperty, mouseWheelScrollFactorProperty, mouseWheelZoomFactorProperty, navigationCommandsEnabledProperty, onCompoundKeyPressedProperty, onCompoundKeyReleasedProperty, onCompoundKeyTypedProperty, onMouse2DClickedProperty, onMouse2DDraggedProperty, onMouse2DEnteredProperty, onMouse2DExitedProperty, onMouse2DMovedProperty, onMouse2DPressedProperty, onMouse2DReleasedProperty, onMouse2DWheelTurnedProperty, scrollCommandAnimationEnabledProperty, smallHorizontalChangeProperty, smallVerticalChangeProperty, verticalOffsetProperty, verticalScrollBarPolicyProperty, viewPointProperty, viewportHeightProperty, viewportProperty, viewportWidthProperty, zoomProperty
contextMenuProperty, skinClassNameProperty, skinProperty, tooltipProperty
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, heightProperty, insetsProperty, maxHeightProperty, maxWidthProperty, minHeightProperty, minWidthProperty, opaqueInsetsProperty, paddingProperty, prefHeightProperty, prefWidthProperty, scaleShapeProperty, shapeProperty, snapToPixelProperty, widthProperty
impl_traversalEngineProperty, needsLayoutProperty
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, cacheHintProperty, cacheProperty, clipProperty, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, focusedProperty, focusTraversableProperty, hoverProperty, idProperty, impl_showMnemonicsProperty, impl_treeVisibleProperty, inputMethodRequestsProperty, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParentTransformProperty, localToSceneTransformProperty, managedProperty, mouseTransparentProperty, nodeOrientationProperty, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, pickOnBoundsProperty, pressedProperty, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, styleProperty, translateXProperty, translateYProperty, translateZProperty, visibleProperty
SCROLL_BAR_ENABLED, SCROLL_BAR_VISIBLE
USE_COMPUTED_SIZE, USE_PREF_SIZE
BASELINE_OFFSET_SAME_AS_HEIGHT
Constructor and Description |
---|
GraphControl()
Creates a new instance of the
GraphControl . |
Modifier and Type | Method and Description |
---|---|
protected FocusIndicatorManager<IModelItem> |
createFocusIndicatorManager()
Factory method for the FocusIndicatorManager property.
|
protected IGraph |
createGraph()
Factory method for the Graph property.
|
protected GraphClipboard |
createGraphClipboard()
Creates the default instance to use if no custom instance has been set.
|
protected GraphModelManager |
createGraphModelManager()
Factory method for the
GraphModelManager property. |
protected HighlightIndicatorManager<IModelItem> |
createHighlightIndicatorManager()
Factory method for the
HighlightIndicatorManager property. |
protected FileChooser |
createOpenFileDialog()
Helper callback method that creates the
FileChooser for use in the handling of the ICommand.OPEN
command. |
protected FileChooser |
createSaveFileDialog()
Helper callback method that creates the
FileChooser for use in the handling of the ICommand.SAVE and ICommand.SAVE_AS
commands. |
protected IGraphSelection |
createSelection()
Factory method for the Selection property.
|
protected SelectionIndicatorManager<IModelItem> |
createSelectionIndicatorManager()
Factory method for the
SelectionIndicatorManager property. |
ObjectProperty<IModelItem> |
currentItemProperty()
The property for the 'current item'.
|
void |
exportToGraphML(OutputStream stream)
|
void |
exportToGraphML(String filename)
|
void |
exportToGraphML(Writer writer)
|
BooleanProperty |
fileIOEnabledProperty()
The property for the
value indicating whether integrated handling of commands for ICommand.OPEN /ICommand.SAVE /ICommand.SAVE_AS
is enabled. |
void |
fitGraphBounds()
Updates the content rectangle for the ContentGroup
considering the provided insets and adjusts the viewport to encompass the contents . |
void |
fitGraphBounds(InsetsD insets)
Updates the content rectangle for the ContentGroup
considering the provided insets and adjusts the viewport to encompass the contents . |
ObjectProperty<FocusIndicatorManager<IModelItem>> |
focusIndicatorManagerProperty()
The property for the
getFocusIndicatorManager() focus indicator manager.} |
GraphClipboard |
getClipboard()
Gets the
GraphClipboard associated with this control. |
IModelItem |
getCurrentItem()
Gets the 'current' item.
|
FocusIndicatorManager<IModelItem> |
getFocusIndicatorManager()
Gets the FocusIndicatorManager property.
|
IGraph |
getGraph()
Gets the graph that is displayed in this control.
|
GraphMLIOHandler |
getGraphMLIOHandler()
Gets the
GraphMLIOHandler to use for the various I/O methods in this instance. |
GraphModelManager |
getGraphModelManager()
Gets the
GraphModelManager property. |
HighlightIndicatorManager<IModelItem> |
getHighlightIndicatorManager()
Gets the
HighlightIndicatorManager property. |
IGraphSelection |
getSelection()
Gets the selection model that is used for this control.
|
SelectionIndicatorManager<IModelItem> |
getSelectionIndicatorManager()
Gets the
SelectionIndicatorManager property. |
ObjectProperty<GraphModelManager> |
graphModelManagerProperty()
The property for the
getGraphModelManager() |
ObjectProperty<IGraph> |
graphProperty()
The property that holds the Graph.
|
ObjectProperty<HighlightIndicatorManager<IModelItem>> |
highlightIndicatorManagerProperty()
The property for the
getHighlightIndicatorManager() highlight indicator manager.} |
void |
importFromGraphML(File fileInfo)
|
void |
importFromGraphML(InputStream stream)
Convenience method that imports the
Graph
from a GraphML file. |
void |
importFromGraphML(InputStream stream,
URI baseUri)
Convenience method that imports the
Graph
from a GraphML file. |
void |
importFromGraphML(Reader reader)
|
void |
importFromGraphML(Reader reader,
URI baseUri)
Convenience method that imports the
Graph
from a GraphML file. |
void |
importFromGraphML(String filename)
|
void |
importFromGraphML(URL url)
|
boolean |
isFileIOEnabled()
Gets a value indicating whether integrated handling of commands for
ICommand.OPEN /ICommand.SAVE /ICommand.SAVE_AS
is enabled. |
void |
morphLayout(ILayoutAlgorithm layout,
Duration morphDuration)
Convenience method that runs a layout on the graph of a given graph control, animates the transition, and calls the
given
doneHandler once the animation has finished. |
void |
morphLayout(ILayoutAlgorithm layout,
Duration morphDuration,
IEventHandler<LayoutEventArgs> doneHandler)
Convenience method that runs a layout on the graph of a given graph control, animates the transition, and calls the
given
doneHandler once the animation has finished. |
void |
morphLayout(ILayoutAlgorithm layout,
Duration morphDuration,
LayoutData layoutData)
Convenience method that runs a layout on the graph of a given graph control, animates the transition, and calls the
given
doneHandler once the animation has finished. |
void |
morphLayout(ILayoutAlgorithm layout,
Duration morphDuration,
LayoutData layoutData,
IEventHandler<LayoutEventArgs> doneHandler)
Convenience method that runs a layout on the graph of a given graph control, animates the transition, and calls the
given
doneHandler once the animation has finished. |
protected void |
openFile()
|
protected void |
saveFile()
Default implementation of
ICommand.SAVE that possibly shows a save file dialog
and exportToGraphML(OutputStream) exports the GraphML} to the selected file or the last known file. |
protected void |
saveFileAs()
Default implementation of
ICommand.SAVE_AS that shows a save file dialog and exportToGraphML(OutputStream) exports the GraphML}
to the selected file. |
ObjectProperty<SelectionIndicatorManager<IModelItem>> |
selectionIndicatorManagerProperty()
The property for the
selection indicator manager. |
ObjectProperty<IGraphSelection> |
selectionProperty()
The property that holds the the GraphSelection.
|
void |
setClipboard(GraphClipboard value)
Sets the
GraphClipboard associated with this control. |
void |
setCurrentItem(IModelItem value)
Sets the 'current' item.
|
void |
setFileIOEnabled(boolean value)
Sets a value indicating whether integrated handling of commands for
ICommand.OPEN /ICommand.SAVE /ICommand.SAVE_AS
is enabled. |
void |
setFocusIndicatorManager(FocusIndicatorManager<IModelItem> value)
Sets the FocusIndicatorManager property.
|
void |
setGraph(IGraph value)
Sets the graph that is displayed in this control.
|
void |
setGraphMLIOHandler(GraphMLIOHandler ioHandler)
Sets the
GraphMLIOHandler to use for the various I/O methods in this instance. |
void |
setGraphModelManager(GraphModelManager value)
Sets the
GraphModelManager property. |
void |
setHighlightIndicatorManager(HighlightIndicatorManager<IModelItem> value)
Sets the
HighlightIndicatorManager property. |
void |
setSelection(IGraphSelection value)
Sets the selection model that is used for this control.
|
void |
setSelectionIndicatorManager(SelectionIndicatorManager<IModelItem> value)
Sets the
SelectionIndicatorManager property. |
addBackgroundGroupChangedListener, addContentGroupChangedListener, addFocusGroupChangedListener, addHighlightGroupChangedListener, addInputModeContextChangedListener, addInputModeGroupChangedListener, addSelectionGroupChangedListener, animateScrollTo, autoDragEnabledProperty, autoDragInsetsProperty, centerZoomEventRecognizerProperty, coerceViewportLimits, compareRenderOrder, computedHorizontalScrollBarStateProperty, computedVerticalScrollBarStateProperty, contentRectProperty, createBackgroundGroup, createContentGroup, createFocusGroup, createHighlightGroup, createInputModeContext, createInputModeGroup, createRenderContext, createSelectionGroup, createVisualFromTemplate, createVisualFromTemplate, createVisualFromTemplate, doubleClickSizeProperty, doubleClickTimeProperty, doubleTapDurationProperty, doubleTapSizeProperty, dragSizeProperty, dragTimeProperty, editableProperty, exportContent, fitContent, fitContentViewMarginsProperty, getAutoDragInsets, getBackgroundGroup, getBounds, getCanvasContext, getCanvasObject, getCanvasObjects, getCanvasObjects, getCanvasObjects, getCenter, getCenterZoomEventRecognizer, getComputedHorizontalScrollBarState, getComputedVerticalScrollBarState, getContentGroup, getContentRect, getContentVisualGroup, getCurrentTouchDevices, getDoubleClickSize, getDoubleClickTime, getDoubleTapDuration, getDoubleTapSize, getDragSize, getDragTime, getFitContentViewMargins, getFocusGroup, getHighlightGroup, getHitTestRadius, getHorizontalOffset, getHorizontalScrollBarPolicy, getInputMode, getInputModeContext, getInputModeContextLookupChain, getInputModeGroup, getLargeHorizontalChange, getLargeVerticalChange, getLastEventLocation, getLastMouse2DEvent, getLastTouch2DEvent, getLongPressDuration, getMaximumHorizontalOffset, getMaximumVerticalOffset, getMaximumZoom, getMinimumHorizontalOffset, getMinimumVerticalOffset, getMinimumZoom, getMouseWheelBehavior, getMouseWheelScrollFactor, getMouseWheelZoomFactor, getOnCompoundKeyPressed, getOnCompoundKeyReleased, getOnCompoundKeyTyped, getOnMouse2DClicked, getOnMouse2DDragged, getOnMouse2DEntered, getOnMouse2DExited, getOnMouse2DMoved, getOnMouse2DPressed, getOnMouse2DReleased, getOnMouse2DWheelTurned, getRootGroup, getSelectionGroup, getSize, getSmallHorizontalChange, getSmallVerticalChange, getVerticalOffset, getVerticalScrollBarPolicy, getViewPoint, getViewport, getViewportHeight, getViewportLimiter, getViewportWidth, getVisual, getVisualCaching, getVisualCreator, getZoom, getZoomAnimationDuration, growContentRect, hitElementsAt, hitElementsAt, hitElementsAt, hitElementsAt, hitElementsAt, hitElementsAt, hitTestRadiusProperty, horizontalOffsetProperty, horizontalScrollBarPolicyProperty, inputModeContextLookup, inputModeProperty, invalidate, isAllKeyboardInputCapturingEnabled, isAllPointerInputCapturingEnabled, isAutoDragEnabled, isDeviceDown, isEditable, isHit, isKeyboardFocusWithin, isMouseEventConsumingDisabled, isNavigationCommandsEnabled, isScrollCommandAnimationEnabled, isZoomAnimationEnabled, largeHorizontalChangeProperty, largeVerticalChangeProperty, layoutChildren, longPressDurationProperty, lookup, makeVisible, maximumHorizontalOffsetProperty, maximumVerticalOffsetProperty, maximumZoomProperty, minimumHorizontalOffsetProperty, minimumVerticalOffsetProperty, minimumZoomProperty, mouseEventConsumingDisabledProperty, mouseWheelBehaviorProperty, mouseWheelScroll, mouseWheelScrollFactorProperty, mouseWheelZoom, mouseWheelZoomFactorProperty, navigationCommandsEnabledProperty, onCompoundKeyPressedProperty, onCompoundKeyReleasedProperty, onCompoundKeyTypedProperty, onKeyDown, onKeyPress, onKeyUp, onMouse2DClicked, onMouse2DClickedProperty, onMouse2DDragged, onMouse2DDraggedProperty, onMouse2DEntered, onMouse2DEnteredProperty, onMouse2DExited, onMouse2DExitedProperty, onMouse2DMoved, onMouse2DMovedProperty, onMouse2DPressed, onMouse2DPressedProperty, onMouse2DReleased, onMouse2DReleasedProperty, onMouse2DWheelTurned, onMouse2DWheelTurnedProperty, onPrepareRenderContextEvent, onSizeChanged, onTouch2DDown, onTouch2DEntered, onTouch2DExited, onTouch2DLongPress, onTouch2DLostCapture, onTouch2DMoved, onTouch2DTapped, onTouch2DUp, onTouchDown, onTouchEnter, onTouchLeave, onTouchMove, onTouchUp, raiseUpdatedEvent, raiseUpdatingEvent, redispatchMouse2DEvent, removeBackgroundGroupChangedListener, removeContentGroupChangedListener, removeFocusGroupChangedListener, removeHighlightGroupChangedListener, removeInputModeContextChangedListener, removeInputModeGroupChangedListener, removeSelectionGroupChangedListener, resize, scrollCommandAnimationEnabledProperty, setAllKeyboardInputCapturingEnabled, setAllPointerInputCapturingEnabled, setAutoDragEnabled, setAutoDragInsets, setBackgroundGroup, setCenter, setCenterZoomEventRecognizer, setContentGroup, setContentRect, setContentRect, setDoubleClickSize, setDoubleClickTime, setDoubleTapDuration, setDoubleTapSize, setDragSize, setDragTime, setEditable, setFitContentViewMargins, setFocusGroup, setHighlightGroup, setHitTestRadius, setHorizontalScrollBarPolicy, setInputMode, setInputModeContext, setInputModeGroup, setLongPressDuration, setMaximumZoom, setMinimumZoom, setMouseEventConsumingDisabled, setMouseWheelBehavior, setMouseWheelScrollFactor, setMouseWheelZoomFactor, setNavigationCommandsEnabled, setOnCompoundKeyPressed, setOnCompoundKeyReleased, setOnCompoundKeyTyped, setOnMouse2DClicked, setOnMouse2DDragged, setOnMouse2DEntered, setOnMouse2DExited, setOnMouse2DMoved, setOnMouse2DPressed, setOnMouse2DReleased, setOnMouse2DWheelTurned, setScrollCommandAnimationEnabled, setSelectionGroup, setTemplateLocation, setVerticalScrollBarPolicy, setViewPoint, setViewportLimiter, setVisualCaching, setZoom, setZoomAnimationDuration, setZoomAnimationEnabled, smallHorizontalChangeProperty, smallVerticalChangeProperty, toViewCoordinates, toWorldCoordinates, updateContentRect, updateContentRect, updateContentRect, updateImmediately, verticalOffsetProperty, verticalScrollBarPolicyProperty, viewPointProperty, viewportHeightProperty, viewportProperty, viewportWidthProperty, zoomProperty, zoomTo, zoomTo
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, createDefaultSkin, executeAccessibleAction, getBaselineOffset, getClassCssMetaData, getContextMenu, getControlCssMetaData, getCssMetaData, getSkin, getTooltip, impl_cssGetFocusTraversableInitialValue, impl_processCSS, isResizable, queryAccessibleAttribute, setContextMenu, setSkin, setTooltip, skinClassNameProperty, skinProperty, tooltipProperty
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, impl_computeContains, impl_computeGeomBounds, impl_computeLayoutBounds, impl_createPeer, impl_notifyLayoutBoundsChanged, impl_pickNodeLocal, impl_updatePeer, insetsProperty, isCacheShape, isCenterShape, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapSize, snapSpace, snapToPixelProperty, widthProperty
getChildren, getChildrenUnmodifiable, getImpl_traversalEngine, getManagedChildren, getStylesheets, impl_getAllParentStylesheets, impl_processMXNode, impl_traversalEngineProperty, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setImpl_traversalEngine, setNeedsLayout, updateBounds
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, containsBounds, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, hasProperties, hoverProperty, idProperty, impl_clearDirty, impl_computeIntersects, impl_cssGetCursorInitialValue, impl_findStyles, impl_geomChanged, impl_getLeafTransform, impl_getMatchingStyles, impl_getPeer, impl_getPivotX, impl_getPivotY, impl_getPivotZ, impl_getStyleMap, impl_hasTransforms, impl_intersects, impl_intersectsBounds, impl_isDirty, impl_isDirtyEmpty, impl_isShowMnemonics, impl_isTreeVisible, impl_layoutBoundsChanged, impl_markDirty, impl_pickNode, impl_processCSS, impl_reapplyCSS, impl_setShowMnemonics, impl_setStyleMap, impl_showMnemonicsProperty, impl_syncPeer, impl_transformsChanged, impl_traverse, impl_treeVisibleProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, visibleProperty
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createDictionaryLookup, createDynamic, createSingle, createSingle, createWrapped, lookup, lookup, safeLookup
public final ObjectProperty<IModelItem> currentItemProperty
com.yworks.yfiles.canvas.GraphControl#getFocusInstallationManager()
.public final BooleanProperty fileIOEnabledProperty
value
indicating whether integrated handling of commands for ICommand.OPEN
/ICommand.SAVE
/ICommand.SAVE_AS
is enabled.public final ObjectProperty<FocusIndicatorManager<IModelItem>> focusIndicatorManagerProperty
getFocusIndicatorManager()
focus indicator manager.}public final ObjectProperty<GraphModelManager> graphModelManagerProperty
getGraphModelManager()
public final ObjectProperty<IGraph> graphProperty
public final ObjectProperty<HighlightIndicatorManager<IModelItem>> highlightIndicatorManagerProperty
getHighlightIndicatorManager()
highlight indicator manager.}public final ObjectProperty<SelectionIndicatorManager<IModelItem>> selectionIndicatorManagerProperty
selection indicator manager.
public final ObjectProperty<IGraphSelection> selectionProperty
public GraphControl()
GraphControl
.
If the Graph
and GraphSelection
properties are not populated externally they will be
initialized with default values upon first access. Thus this instance can be used right away without any further
initialization.
protected FocusIndicatorManager<IModelItem> createFocusIndicatorManager()
This method will be called upon first access to the FocusIndicatorManager
property.
protected IGraph createGraph()
This method will be called upon first access to the Graph
property.
DefaultGraph
protected GraphClipboard createGraphClipboard()
GraphClipboard
instance.protected GraphModelManager createGraphModelManager()
GraphModelManager
property.
This method will be called upon first access to the GraphModelManager
property.
protected HighlightIndicatorManager<IModelItem> createHighlightIndicatorManager()
HighlightIndicatorManager
property.
This method will be called upon first access to the HighlightIndicatorManager
property.
protected FileChooser createOpenFileDialog()
FileChooser
for use in the handling of the ICommand.OPEN
command.
The open command that is enabled if FileIOEnabled
is set to true
will use this method
to create the dialog for opening the files.
protected FileChooser createSaveFileDialog()
FileChooser
for use in the handling of the ICommand.SAVE
and ICommand.SAVE_AS
commands.
The save commands that are enabled if FileIOEnabled
is set to true
will use this
method to create the dialog for saving the files.
protected IGraphSelection createSelection()
This method will be called upon first access to the Selection
property.
GraphSelection
protected SelectionIndicatorManager<IModelItem> createSelectionIndicatorManager()
SelectionIndicatorManager
property.
This method will be called upon first access to the SelectionIndicatorManager
property.
SelectionIndicatorManager
public final ObjectProperty<IModelItem> currentItemProperty()
com.yworks.yfiles.canvas.GraphControl#getFocusInstallationManager()
.public void exportToGraphML(OutputStream stream) throws IOException
Graph
to a GraphML
file.
For full control over the output use the GraphMLIOHandler
class. This method uses getGraphMLIOHandler()
to determine the instance to use for the operation.
IOException
stream
- The stream to export the graph to.getGraphMLIOHandler()
public void exportToGraphML(String filename) throws IOException
Graph
to a GraphML
file.
For full control over the output use the GraphMLIOHandler
class. This method uses getGraphMLIOHandler()
to determine the instance to use for the operation.
IOException
filename
- The file name to export the graph to.getGraphMLIOHandler()
public void exportToGraphML(Writer writer) throws IOException
Graph
to a GraphML
file.
For full control over the output use the GraphMLIOHandler
class. This method uses getGraphMLIOHandler()
to determine the instance to use for the operation.
IOException
writer
- The writer to export the graph to.getGraphMLIOHandler()
public final BooleanProperty fileIOEnabledProperty()
value
indicating whether integrated handling of commands for ICommand.OPEN
/ICommand.SAVE
/ICommand.SAVE_AS
is enabled.public final void fitGraphBounds()
Updates the content rectangle
for the ContentGroup
considering the provided insets and adjusts the viewport to encompass the contents
.public void fitGraphBounds(InsetsD insets)
Updates the content rectangle
for the ContentGroup
considering the provided insets and adjusts the viewport to encompass the contents
.public final ObjectProperty<FocusIndicatorManager<IModelItem>> focusIndicatorManagerProperty()
getFocusIndicatorManager()
focus indicator manager.}public final GraphClipboard getClipboard()
GraphClipboard
associated with this control.
If no instance has been configured with this control, a default implementation will be used.
setClipboard(GraphClipboard)
public final IModelItem getCurrentItem()
FocusIndicatorManager
.setCurrentItem(IModelItem)
public final FocusIndicatorManager<IModelItem> getFocusIndicatorManager()
If the field has not yet been initialized upon first access, the factory method createFocusIndicatorManager()
will be called. Upon change the onFocusIndicatorManagerChanged(FocusIndicatorManager, FocusIndicatorManager)
method will be called.
setFocusIndicatorManager(FocusIndicatorManager)
public final IGraph getGraph()
Normally the GraphSelection
property must be adjusted accordingly if the graph instance is replaced. Also
depending on the IInputMode
implementation the instances used in this control might
need to be replaced or adjusted, too. If the field has not yet been initialized upon first access, the factory method createGraph()
will be called. Upon change the onGraphChanged(IGraph, IGraph)
method will be called.
setGraph(IGraph)
public GraphMLIOHandler getGraphMLIOHandler()
GraphMLIOHandler
to use for the various I/O methods in this instance.
This method will first look if a GraphMLIOHandler
was explicitly set
on this instance using setGraphMLIOHandler(GraphMLIOHandler)
. If not, it
will query the ILookup.lookup(Class)
method of this instance, then the lookup of the
Graph
,
public final GraphModelManager getGraphModelManager()
GraphModelManager
property.
If the field has not yet been initialized upon first access, the factory method createGraphModelManager()
will
be called. Upon change the onGraphModelManagerChanged(GraphModelManager, GraphModelManager)
method will be
called.
setGraphModelManager(GraphModelManager)
public final HighlightIndicatorManager<IModelItem> getHighlightIndicatorManager()
HighlightIndicatorManager
property.
If the field has not yet been initialized upon first access, the factory method createHighlightIndicatorManager()
will be called. Upon change the #onHighlightIndicatorManagerChanged(HighlightIndicatorManager, HighlightIndicatorManager)
method will be called.
setHighlightIndicatorManager(HighlightIndicatorManager)
public final IGraphSelection getSelection()
The selection model instance needs to be adjusted, normally if the Graph
instance is changed. If the
field has not yet been initialized upon first access, the factory method createSelection()
will be called. Upon
change the onSelectionChanged(IGraphSelection, IGraphSelection)
method will be called.
setSelection(IGraphSelection)
public final SelectionIndicatorManager<IModelItem> getSelectionIndicatorManager()
SelectionIndicatorManager
property.
If the field has not yet been initialized upon first access, the factory method createSelectionIndicatorManager()
will be called. Upon change the onSelectionIndicatorManagerChanged(SelectionIndicatorManager, SelectionIndicatorManager)
method will be called.
setSelectionIndicatorManager(SelectionIndicatorManager)
public final ObjectProperty<GraphModelManager> graphModelManagerProperty()
getGraphModelManager()
public final ObjectProperty<IGraph> graphProperty()
public final ObjectProperty<HighlightIndicatorManager<IModelItem>> highlightIndicatorManagerProperty()
getHighlightIndicatorManager()
highlight indicator manager.}public void importFromGraphML(File fileInfo) throws IOException
Graph
from a GraphML
file.
For full control over the input use the GraphMLIOHandler
class. This method uses getGraphMLIOHandler()
to determine the instance to use for the operation.
After the graph has been loaded the Viewport
will be updated
to display the entire graph. If undo is enabled the Graph
's UndoEngine
will be
cleared
.
IOException
fileInfo
- The file of the GraphML file to read the graph from.getGraphMLIOHandler()
public void importFromGraphML(InputStream stream) throws IOException
Graph
from a GraphML
file.
For full control over the input use the GraphMLIOHandler
class.
This method uses com.yworks.yfiles.canvas.GraphControl#getGraphMLIOHandler()
to determine the instance to use
for the operation.
After the graph has been loaded the Viewport
will be
updated
to display the entire graph. If
undo is enabled the undo engine
will be cleared
.
Note this method only supports GraphML with absolute paths.
For importing GraphML with relative paths, use importFromGraphML(java.io.InputStream, java.net.URI)
instead.
IOException
stream
- The stream to read the graph from.getGraphMLIOHandler()
public void importFromGraphML(InputStream stream, URI baseUri) throws IOException
Graph
from a GraphML
file.
For full control over the input use the GraphMLIOHandler
class.
This method uses com.yworks.yfiles.canvas.GraphControl#getGraphMLIOHandler()
to determine the instance to use
for the operation.
After the graph has been loaded the Viewport
will be
updated
to display the entire graph. If
undo is enabled the undo engine
will be cleared
.
IOException
stream
- The stream to read the graph from.baseUri
- The base URI which is used for the GraphML file being parsed to resolve relative paths.com.yworks.yfiles.canvas.GraphControl#getGraphMLIOHandler()
public void importFromGraphML(Reader reader) throws IOException
Graph
from a GraphML
file.
For full control over the input use the GraphMLIOHandler
class. This method uses getGraphMLIOHandler()
to determine the instance to use for the operation.
After the graph has been loaded the Viewport
will be updated
to display the entire graph. If undo is enabled the Graph
's undo engine will be
cleared
.
Note this method only supports GraphML with absolute paths.
For importing GraphML with relative paths, use importFromGraphML(java.io.Reader, java.net.URI)
instead.
IOException
reader
- The reader to read the graph from.getGraphMLIOHandler()
public void importFromGraphML(Reader reader, URI baseUri) throws IOException
Graph
from a GraphML
file.
For full control over the input use the GraphMLIOHandler
class.
This method uses com.yworks.yfiles.canvas.GraphControl#getGraphMLIOHandler()
to determine the instance to use
for the operation.
After the graph has been loaded the Viewport
will be
updated
to display the entire graph. If
undo is enabled the undo engine
will be cleared
.
IOException
reader
- The reader to read the graph from.baseUri
- The base URI which is used for the GraphML file being parsed to resolve relative paths.com.yworks.yfiles.canvas.GraphControl#getGraphMLIOHandler()
public void importFromGraphML(String filename) throws IOException
Graph
from a GraphML
file.
For full control over the input use the GraphMLIOHandler
class. This method uses getGraphMLIOHandler()
to determine the instance to use for the operation.
After the graph has been loaded the Viewport
will be updated
to display the entire graph. If undo is enabled the Graph
's undo engine will be
cleared
.
IOException
filename
- The file of the GraphML file to read the graph from.getGraphMLIOHandler()
public void importFromGraphML(URL url) throws IOException
Graph
from a GraphML
file.
For full control over the input use the GraphMLIOHandler
class. This method uses getGraphMLIOHandler()
to determine the instance to use for the operation.
After the graph has been loaded the Viewport
will be updated
to display the entire graph. If undo is enabled the Graph
's undo engine will be
cleared
.
IOException
url
- The URL of the GraphML file to read the graph from.com.yworks.yfiles.canvas.GraphControl#getGraphMLIOHandler()
public final boolean isFileIOEnabled()
ICommand.OPEN
/ICommand.SAVE
/ICommand.SAVE_AS
is enabled.
By default this feature is disabled.
Setting this property to true
enables handling of the following commands:
Note that this doesn't affect the convenience methods importFromGraphML(String)
, exportToGraphML(String)
and their overloads.
The default implementations delegate to the openFile()
, saveFile()
and saveFileAs()
methods
respectively.
true
if the commands are enabled; false
otherwise.createOpenFileDialog()
,
createSaveFileDialog()
,
openFile()
,
saveFile()
,
saveFileAs()
,
setFileIOEnabled(boolean)
public final void morphLayout(ILayoutAlgorithm layout, Duration morphDuration)
doneHandler
once the animation has finished.
The implementation simply delegates to a properly configured instance of
LayoutExecutor
. In addition to the default configuration, it enables
ViewportAnimationEnabled
,
EasedAnimationEnabled
, and
ContentRectUpdatingEnabled
. For more
fine-grained control of the animation, use LayoutExecutor
directly.
layout
- The layout to run.morphDuration
- The duration of the animation of the layout.morphLayout(ILayoutAlgorithm, Duration, LayoutData, IEventHandler)
,
IGraph.applyLayout(ILayoutAlgorithm, LayoutData)
public void morphLayout(ILayoutAlgorithm layout, Duration morphDuration, IEventHandler<LayoutEventArgs> doneHandler)
doneHandler
once the animation has finished.
The implementation simply delegates to a properly configured instance of
LayoutExecutor
. In addition to the default configuration, it enables
ViewportAnimationEnabled
,
EasedAnimationEnabled
, and
ContentRectUpdatingEnabled
. For more
fine-grained control of the animation, use LayoutExecutor
directly.
layout
- The layout to run.morphDuration
- The duration of the animation of the layout.doneHandler
- The handler that is called after the animation has finished. See
LayoutFinished
.morphLayout(ILayoutAlgorithm, Duration, LayoutData, IEventHandler)
,
IGraph.applyLayout(ILayoutAlgorithm, LayoutData)
public final void morphLayout(ILayoutAlgorithm layout, Duration morphDuration, LayoutData layoutData)
doneHandler
once the animation has finished.
The implementation simply delegates to a properly configured instance of
LayoutExecutor
. In addition to the default configuration, it enables
ViewportAnimationEnabled
,
EasedAnimationEnabled
, and
ContentRectUpdatingEnabled
. For more
fine-grained control of the animation, use LayoutExecutor
directly.
layout
- The layout to run.morphDuration
- The duration of the animation of the layout.layoutData
- The layout data to apply.morphLayout(ILayoutAlgorithm, Duration, IEventHandler)
,
IGraph.applyLayout(ILayoutAlgorithm, LayoutData)
public void morphLayout(ILayoutAlgorithm layout, Duration morphDuration, LayoutData layoutData, IEventHandler<LayoutEventArgs> doneHandler)
doneHandler
once the animation has finished.
The implementation simply delegates to a properly configured instance of
LayoutExecutor
. In addition to the default configuration, it enables
ViewportAnimationEnabled
,
EasedAnimationEnabled
, and
ContentRectUpdatingEnabled
. For more
fine-grained control of the animation, use LayoutExecutor
directly.
layout
- The layout to run.morphDuration
- The duration of the animation of the layout.layoutData
- The layout data to apply.doneHandler
- The handler that is called after the animation has finished. See
LayoutFinished
.morphLayout(ILayoutAlgorithm, Duration, IEventHandler)
,
IGraph.applyLayout(ILayoutAlgorithm, LayoutData)
protected void openFile()
ICommand.OPEN
that shows a open file dialog
and
imports the GraphML
.
This method is called in response to the ICommand.OPEN
commands if FileIOEnabled
is
true
.
Any exception thrown during loading of the GraphML file will be caught and an error message displayed to the user. For
more control over error behaviour it is recommended to use GraphMLIOHandler
directly, e.g. from a custom command
handler.
isFileIOEnabled()
,
saveFile()
,
saveFileAs()
protected void saveFile()
ICommand.SAVE
that possibly shows a save file dialog
and exportToGraphML(OutputStream)
exports the GraphML} to the selected file or the last known file.
This method is called in response to the ICommand.SAVE
command if FileIOEnabled
is
true
.
Any exception thrown during loading of the GraphML file will be caught and an error message displayed to the user. For
more control over error behaviour it is recommended to use GraphMLIOHandler
directly, e.g. from a custom command
handler.
isFileIOEnabled()
,
saveFileAs()
,
openFile()
protected void saveFileAs()
ICommand.SAVE_AS
that shows a save file dialog
and exportToGraphML(OutputStream)
exports the GraphML}
to the selected file.
This method is called in response to the ICommand.SAVE_AS
and possibly ICommand.SAVE
commands if FileIOEnabled
is true
.
Any exception thrown during loading of the GraphML file will be caught and an error message displayed to the user. For
more control over error behaviour it is recommended to use GraphMLIOHandler
directly, e.g. from a custom command
handler.
isFileIOEnabled()
,
saveFile()
,
openFile()
public final ObjectProperty<SelectionIndicatorManager<IModelItem>> selectionIndicatorManagerProperty()
selection indicator manager.
public final ObjectProperty<IGraphSelection> selectionProperty()
public final void setClipboard(GraphClipboard value)
GraphClipboard
associated with this control.
If no instance has been configured with this control, a default implementation will be used.
value
- The Clipboard to set.getClipboard()
public final void setCurrentItem(IModelItem value)
value
- The current item by default is given focus indication using the
FocusIndicatorManager
.getCurrentItem()
public final void setFileIOEnabled(boolean value)
ICommand.OPEN
/ICommand.SAVE
/ICommand.SAVE_AS
is enabled.
By default this feature is disabled.
Setting this property to true
enables handling of the following commands:
Note that this doesn't affect the convenience methods importFromGraphML(String)
, exportToGraphML(String)
and their overloads.
The default implementations delegate to the openFile()
, saveFile()
and saveFileAs()
methods
respectively.
value
- true
if the commands are enabled; false
otherwise.createOpenFileDialog()
,
createSaveFileDialog()
,
openFile()
,
saveFile()
,
saveFileAs()
,
isFileIOEnabled()
public final void setFocusIndicatorManager(FocusIndicatorManager<IModelItem> value)
If the field has not yet been initialized upon first access, the factory method createFocusIndicatorManager()
will be called. Upon change the onFocusIndicatorManagerChanged(FocusIndicatorManager, FocusIndicatorManager)
method will be called.
value
- The FocusIndicatorManager to set.getFocusIndicatorManager()
public final void setGraph(IGraph value)
Normally the GraphSelection
property must be adjusted accordingly if the graph instance is replaced. Also
depending on the IInputMode
implementation the instances used in this control might
need to be replaced or adjusted, too. If the field has not yet been initialized upon first access, the factory method createGraph()
will be called. Upon change the onGraphChanged(IGraph, IGraph)
method will be called.
value
- The Graph to set.getGraph()
public void setGraphMLIOHandler(GraphMLIOHandler ioHandler)
GraphMLIOHandler
to use for the various I/O methods in this instance.ioHandler
- The instance to use for IO.public final void setGraphModelManager(GraphModelManager value)
GraphModelManager
property.
If the field has not yet been initialized upon first access, the factory method createGraphModelManager()
will
be called. Upon change the onGraphModelManagerChanged(GraphModelManager, GraphModelManager)
method will be
called.
value
- The GraphModelManager to set.getGraphModelManager()
public final void setHighlightIndicatorManager(HighlightIndicatorManager<IModelItem> value)
HighlightIndicatorManager
property.
If the field has not yet been initialized upon first access, the factory method createHighlightIndicatorManager()
will be called. Upon change the #onHighlightIndicatorManagerChanged(HighlightIndicatorManager, HighlightIndicatorManager)
method will be called.
value
- The HighlightIndicatorManager to set.getHighlightIndicatorManager()
public final void setSelection(IGraphSelection value)
The selection model instance needs to be adjusted, normally if the Graph
instance is changed. If the
field has not yet been initialized upon first access, the factory method createSelection()
will be called. Upon
change the onSelectionChanged(IGraphSelection, IGraphSelection)
method will be called.
value
- The Selection to set.getSelection()
public final void setSelectionIndicatorManager(SelectionIndicatorManager<IModelItem> value)
SelectionIndicatorManager
property.
If the field has not yet been initialized upon first access, the factory method createSelectionIndicatorManager()
will be called. Upon change the onSelectionIndicatorManagerChanged(SelectionIndicatorManager, SelectionIndicatorManager)
method will be called.
value
- The SelectionIndicatorManager to set.getSelectionIndicatorManager()