public class CanvasControl extends Control implements ILookup
CanvasControl
can be used to efficiently display all kinds of data.
The control supports high performance zooming and panning of visual content and provides a high level view of the visual tree. The control uses double precision world-coordinates to render items that are composed using a visual tree. In its most simple form the scene graph is a tree-like structure of elements that will be rendered in depth-first-search order.
The scene graph tree is made up of ICanvasObject
elements. Multiple elements are grouped in ICanvasObjectGroup
elements. An ICanvasObject
consists of a user object
and an ICanvasObjectDescriptor
that is used by the rendering engine to query interfaces that perform the actual creation of the
Node
s, hit testing, and bounds calculation.
This control comes with a number of default com.yworks.yfiles.view.CanvasControl.getCommandBindings()
that work on the view port:
ICommand.INCREASE_ZOOM
ICommand.DECREASE_ZOOM
ICommand.ZOOM
ICommand.FIT_CONTENT
ICommand.SCROLL_PAGE_DOWN
ICommand.SCROLL_PAGE_UP
ICommand.SCROLL_PAGE_LEFT
ICommand.SCROLL_PAGE_RIGHT
The handlers for ICommand.INCREASE_ZOOM
and ICommand.DECREASE_ZOOM
use the parameter passed to the command
as the factor by which the Zoom
value is multiplied or divided, respectively. The parameter is not
required. If it is not present a default value is used. The handler for the ICommand.ZOOM
command needs a
parameter. The parameter can either be a number which is interpreted as the new zoom level, or it can be a suitable
object. Supported objects are RectD
, PointD
and ILookup
. If a rectangle is specified as the
parameter for the ICommand.ZOOM
command, the handler adjusts the Viewport
such that the
rectangle tightly fits into it. If a point is specified, the handler sets the Center
to that point.
If the parameter implements ILookup
, then the handler tries to get a IBoundsProvider
from the lookup and
uses the bounds obtained from the bounds provider as the rectangle to zoom to.
All commands can be removed from the com.yworks.yfiles.view.CanvasControl.getCommandBindings()
if desired.
CanvasControl
is discussed in detail in the section
The Control for Displaying Graphs.
IVisualCreator
,
IHitTestable
,
IVisibilityTestable
Type | Property and Description |
---|---|
BooleanProperty |
autoDragEnabled
A property that causes the control to automatically pan the view
when the mouse gets dragged outside of the bounds of the control.
|
ObjectProperty<InsetsD> |
autoDragInsets
The property for the
auto drag insets . |
ObjectProperty<IEventRecognizer> |
centerZoomEventRecognizer
The property for the
getCenterZoomEventRecognizer() event recognizer} that determines whether the zooming to the center of the view, rather than at the
mouse location should be used. |
ReadOnlyIntegerProperty |
computedHorizontalScrollBarState
Returns an
IntegerProperty that holds the state of the horizontal scroll bar. |
ReadOnlyIntegerProperty |
computedVerticalScrollBarState
Returns an
IntegerProperty that holds the state of the vertical scroll bar. |
ObjectProperty<RectD> |
contentRect
Returns an
ObjectProperty that holds a rectangle containing the whole graph content of this
CanvasControl . |
ObjectProperty<SizeD> |
doubleClickSize
The property for the
area in view coordinates the mouse needs to stay in before multiple clicks are considered multiple single clicks
instead of multi-clicks. |
ObjectProperty<Duration> |
doubleClickTime
The property for the
double click time that indicates the amount of time
that may pass within which two subsequent mouse clicks are considered multi clicks. |
ObjectProperty<Duration> |
doubleTapDuration
The property for the
double tap time that indicates the amount of time that may pass
within which two subsequent touch taps are considered multi taps. |
ObjectProperty<SizeD> |
doubleTapSize
The property for the
area in view coordinates the touch pointer needs to stay in before multiple taps are considered multiple single
taps instead of multi-taps. |
ObjectProperty<SizeD> |
dragSize
The property for the
the area in view coordinates the mouse may stay in before a movement is considered a drag. |
ObjectProperty<Duration> |
dragTime
|
BooleanProperty |
editable
Property that sets the editable state of this canvas.
|
ObjectProperty<InsetsD> |
fitContentViewMargins
The property for the
insets in view coordinates that should be used by the fitContent() operation. |
DoubleProperty |
hitTestRadius
The property for the
radius of the area around the mouse in view coordinates in which a IHitTestable
may lie to be considered a valid hit. |
DoubleProperty |
horizontalOffset
Returns a
DoubleProperty that holds the current value of the horizontal scroll bar. |
ObjectProperty<ScrollPane.ScrollBarPolicy> |
horizontalScrollBarPolicy
Returns an
ObjectProperty that holds the visibility policy for the horizontal scroll bar. |
ObjectProperty<IInputMode> |
inputMode
The property for the
the single input mode instance that is installed in this canvas . |
ReadOnlyDoubleProperty |
largeHorizontalChange
Returns a
DoubleProperty that holds the change of the horizontal scroll bar when the track of the bar is
clicked. |
ReadOnlyDoubleProperty |
largeVerticalChange
Returns a
DoubleProperty that holds the change of the vertical scroll bar when the track of the bar is
clicked. |
ObjectProperty<Duration> |
longPressDuration
The property for the
long press time that indicates the amount of time that may pass before a touch down is considered a
long press when the pointer stays within its getDragSize() area. |
ReadOnlyDoubleProperty |
maximumHorizontalOffset
Returns a
DoubleProperty that holds the the maximum value for the vertical scroll bar. |
ReadOnlyDoubleProperty |
maximumVerticalOffset
Returns a
DoubleProperty that holds the maximum value for the vertical scroll bar. |
DoubleProperty |
maximumZoom
Returns a
DoubleProperty that holds the maximum zoom level that is valid for this canvas control. |
ReadOnlyDoubleProperty |
minimumHorizontalOffset
Returns a
DoubleProperty that holds the minimum value for the horizontal scroll bar. |
ReadOnlyDoubleProperty |
minimumVerticalOffset
Returns a
DoubleProperty that holds the minimum value for the vertical scroll bar. |
DoubleProperty |
minimumZoom
Returns a
DoubleProperty that holds the minimum the minimum zoom level for this canvas control. |
BooleanProperty |
mouseEventConsumingDisabled
Defines whether consuming mouse events during the bubbling phase for this control is
disabled or not.
|
ObjectProperty<MouseWheelBehaviors> |
mouseWheelBehavior
The property for the
behavior of the mouse wheel . |
DoubleProperty |
mouseWheelScrollFactor
The property for the
factor that controls how fast the viewport scrolls when the mouse wheel is turned. |
DoubleProperty |
mouseWheelZoomFactor
The property for the
factor by which the zoom level changes when the mouse wheel is turned. |
BooleanProperty |
navigationCommandsEnabled
The property for the
value indicating whether navigation related command bindings are enabled. |
ObjectProperty<EventHandler<? super CompoundKeyEvent>> |
onCompoundKeyPressed
Defines a function to be called when the user has
pressed a key on the CanvasControl . |
ObjectProperty<EventHandler<? super CompoundKeyEvent>> |
onCompoundKeyReleased
Defines a function to be called when the user has
released a key on the CanvasControl . |
ObjectProperty<EventHandler<? super CompoundKeyEvent>> |
onCompoundKeyTyped
Defines a function to be called when the user has
typed a key on the CanvasControl . |
ObjectProperty<EventHandler<? super Mouse2DEvent>> |
onMouse2DClicked
Defines a function to be called when the user has
clicked on the CanvasControl
with the mouse. |
ObjectProperty<EventHandler<? super Mouse2DEvent>> |
onMouse2DDragged
Defines a function to be called when the mouse has been
dragged over the
CanvasControl , i.e. the mouse is being moved while at least one of the mouse buttons is pressed. |
ObjectProperty<EventHandler<? super Mouse2DEvent>> |
onMouse2DEntered
Defines a function to be called when the mouse has
entered the CanvasControl . |
ObjectProperty<EventHandler<? super Mouse2DEvent>> |
onMouse2DExited
Defines a function to be called when the mouse has
exited the CanvasControl . |
ObjectProperty<EventHandler<? super Mouse2DEvent>> |
onMouse2DMoved
Defines a function to be called when the mouse has been
moved in the CanvasControl . |
ObjectProperty<EventHandler<? super Mouse2DEvent>> |
onMouse2DPressed
Defines a function to be called when the mouse has been
pressed in the CanvasControl . |
ObjectProperty<EventHandler<? super Mouse2DEvent>> |
onMouse2DReleased
Defines a function to be called when the mouse has been
released on the CanvasControl . |
ObjectProperty<EventHandler<? super Mouse2DEvent>> |
onMouse2DWheelTurned
Defines a function to be called when the mouse wheel has
turned over the CanvasControl . |
BooleanProperty |
scrollCommandAnimationEnabled
The property for the
value that indicates if scrolling should be animated . |
ReadOnlyDoubleProperty |
smallHorizontalChange
Returns a
DoubleProperty that holds the step size by which the horizontal scroll bar is changed when calling
ScrollBar.increment() or ScrollBar.decrement() . |
ReadOnlyDoubleProperty |
smallVerticalChange
Returns a
DoubleProperty that holds the step size by which the vertical scroll bar is changed when calling
ScrollBar.increment() or ScrollBar.decrement() . |
DoubleProperty |
verticalOffset
Returns a
DoubleProperty that holds the current value of the vertical scroll bar. |
ObjectProperty<ScrollPane.ScrollBarPolicy> |
verticalScrollBarPolicy
Returns an
ObjectProperty that holds the visibility policy for the vertical scroll bar. |
ObjectProperty<PointD> |
viewPoint
Returns an
ObjectProperty that holds current view point. |
ReadOnlyDoubleProperty |
viewportHeight
Returns a
DoubleProperty that holds the height of the current viewport. |
ReadOnlyObjectPropertyBase<RectD> |
viewport
The property for the
view port . |
ReadOnlyDoubleProperty |
viewportWidth
Returns a
DoubleProperty that holds the width of the current viewport. |
DoubleProperty |
zoom
Gets a
DoubleProperty that holds the current zoom factor for this canvas control. |
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
Modifier and Type | Field and Description |
---|---|
static int |
SCROLL_BAR_ENABLED
Constant to describe the state of a scroll bar.
|
static int |
SCROLL_BAR_VISIBLE
Constant that describes the state of a scroll bar.
|
USE_COMPUTED_SIZE, USE_PREF_SIZE
BASELINE_OFFSET_SAME_AS_HEIGHT
Constructor and Description |
---|
CanvasControl()
Creates a new instance of
CanvasControl . |
Modifier and Type | Method and Description |
---|---|
void |
addBackgroundGroupChangedListener(IEventHandler backgroundGroupChangedEvent)
Adds the given listener for the
BackgroundGroupChanged event that occurs when the BackgroundGroup
property has been changed. |
void |
addContentGroupChangedListener(IEventHandler contentGroupChangedEvent)
Adds the given listener for the
ContentGroupChanged event that occurs when the ContentGroup
property has been changed. |
void |
addFocusGroupChangedListener(IEventHandler focusGroupChangedEvent)
Adds the given listener for the
FocusGroupChanged event that occurs when the FocusGroup
property has been changed. |
void |
addHighlightGroupChangedListener(IEventHandler highlightGroupChangedEvent)
Adds the given listener for the
HighlightGroupChanged event that occurs when the HighlightGroup
property has been changed. |
void |
addInputModeContextChangedListener(IEventHandler<PropertyChangedEventArgs> inputModeContextChangedEvent)
Adds the given listener for the
InputModeContextChanged event that occurs when the InputModeContext
property has been changed. |
void |
addInputModeGroupChangedListener(IEventHandler inputModeGroupChangedEvent)
Adds the given listener for the
InputModeGroupChanged event that occurs when the InputModeGroup
property has been changed. |
void |
addSelectionGroupChangedListener(IEventHandler selectionGroupChangedEvent)
Adds the given listener for the
SelectionGroupChanged event that occurs when the SelectionGroup
property has been changed. |
void |
animateScrollTo(PointD viewPoint,
double zoom)
Scrolls to the provided view point and zoom level in an animated fashion.
|
BooleanProperty |
autoDragEnabledProperty()
A property that causes the control to automatically pan the view
when the mouse gets dragged outside of the bounds of the control.
|
ObjectProperty<InsetsD> |
autoDragInsetsProperty()
The property for the
auto drag insets . |
ObjectProperty<IEventRecognizer> |
centerZoomEventRecognizerProperty()
The property for the
getCenterZoomEventRecognizer() event recognizer} that determines whether the zooming to the center of the view, rather than at the
mouse location should be used. |
void |
coerceViewportLimits()
Helper method that ensures that the view port limit as returned by the
ViewportLimiter are
obeyed. |
int |
compareRenderOrder(ICanvasObject canvasObject1,
ICanvasObject canvasObject2)
Compares two
ICanvasObject instances that are live in this canvas. |
ReadOnlyIntegerProperty |
computedHorizontalScrollBarStateProperty()
Returns an
IntegerProperty that holds the state of the horizontal scroll bar. |
ReadOnlyIntegerProperty |
computedVerticalScrollBarStateProperty()
Returns an
IntegerProperty that holds the state of the vertical scroll bar. |
ObjectProperty<RectD> |
contentRectProperty()
Returns an
ObjectProperty that holds a rectangle containing the whole graph content of this
CanvasControl . |
protected ICanvasObjectGroup |
createBackgroundGroup()
Factory method for the BackgroundGroup property.
|
protected ICanvasObjectGroup |
createContentGroup()
Factory method for the ContentGroup property.
|
protected ICanvasObjectGroup |
createFocusGroup()
Factory method for the
FocusGroup property. |
protected ICanvasObjectGroup |
createHighlightGroup()
Factory method for the HighlightGroup property.
|
protected IInputModeContext |
createInputModeContext()
Factory method for the
InputModeContext property. |
protected ICanvasObjectGroup |
createInputModeGroup()
Factory method for the InputModeGroup property.
|
IRenderContext |
createRenderContext()
Creates an appropriate
render context that can be used to create visuals
using IVisualCreator implementations. |
protected ICanvasObjectGroup |
createSelectionGroup()
Factory method for the SelectionGroup property.
|
static Node |
createVisualFromTemplate(IVisualTemplate template,
PointD origin,
IRenderContext context)
Creates a visual representation (
Node ) using the given template. |
static Node |
createVisualFromTemplate(IVisualTemplate template,
PointD origin,
IRenderContext context,
RectD initialBounds)
Creates a visual representation (
Node ) using the given template. |
static Node |
createVisualFromTemplate(IVisualTemplate template,
PointD origin,
IRenderContext context,
RectD initialBounds,
Object dataObject)
Creates a visual representation (
Node ) using the given template. |
ObjectProperty<SizeD> |
doubleClickSizeProperty()
The property for the
area in view coordinates the mouse needs to stay in before multiple clicks are considered multiple single clicks
instead of multi-clicks. |
ObjectProperty<Duration> |
doubleClickTimeProperty()
The property for the
double click time that indicates the amount of time
that may pass within which two subsequent mouse clicks are considered multi clicks. |
ObjectProperty<Duration> |
doubleTapDurationProperty()
The property for the
double tap time that indicates the amount of time that may pass
within which two subsequent touch taps are considered multi taps. |
ObjectProperty<SizeD> |
doubleTapSizeProperty()
The property for the
area in view coordinates the touch pointer needs to stay in before multiple taps are considered multiple single
taps instead of multi-taps. |
ObjectProperty<SizeD> |
dragSizeProperty()
The property for the
the area in view coordinates the mouse may stay in before a movement is considered a drag. |
ObjectProperty<Duration> |
dragTimeProperty()
|
BooleanProperty |
editableProperty()
Property that sets the editable state of this canvas.
|
Node |
exportContent(IRenderContext context)
Exports the graphical content for this
CanvasControl . |
void |
fitContent()
Adjusts the view port to fully encompass the
ContentRect . |
ObjectProperty<InsetsD> |
fitContentViewMarginsProperty()
The property for the
insets in view coordinates that should be used by the fitContent() operation. |
InsetsD |
getAutoDragInsets()
Gets the auto drag insets.
|
ICanvasObjectGroup |
getBackgroundGroup()
Gets the BackgroundGroup property.
|
RectD |
getBounds(ICanvasObject canvasObject)
Convenience method that calculates the bounds for a given canvas object in the scene graph.
|
ICanvasContext |
getCanvasContext()
Returns an implementation of
ICanvasContext that describes the state of this CanvasControl . |
ICanvasObject |
getCanvasObject(PointD location)
Returns the top most canvas object instance that is hit at the given coordinate set.
|
IEnumerable<ICanvasObject> |
getCanvasObjects()
Enumerates over all possible
ICanvasObject instances in the tree. |
IEnumerable<ICanvasObject> |
getCanvasObjects(ICanvasObjectGroup group)
Enumerates over all possible
ICanvasObject instances in the tree below the given group. |
IEnumerable<ICanvasObject> |
getCanvasObjects(PointD location)
Returns a list of all canvas objects in hit order at the given world coordinate location.
|
PointD |
getCenter()
Gets the world coordinate at the center of the control.
|
IEventRecognizer |
getCenterZoomEventRecognizer()
Specifies an
IEventRecognizer that determines whether the zooming to the center of the view, rather than at the
mouse location should be used. |
int |
getComputedHorizontalScrollBarState()
Determines the state of the horizontal scroll bar.
|
int |
getComputedVerticalScrollBarState()
Determines the state of the vertical scroll bar.
|
ICanvasObjectGroup |
getContentGroup()
Gets the ContentGroup property.
|
RectD |
getContentRect()
Gets the Rectangle in world coordinates that holds the contents.
|
VisualGroup |
getContentVisualGroup()
Returns the container holding the content of the CanvasControl.
|
IListEnumerable<Touch2DPoint> |
getCurrentTouchDevices()
Gets a list of the active
Touch2DPoint s at the time of invocation. |
SizeD |
getDoubleClickSize()
The area in view coordinates the mouse needs to stay in before multiple clicks are considered multiple single clicks
instead of multi-clicks.
|
Duration |
getDoubleClickTime()
The value of the double click time.
|
Duration |
getDoubleTapDuration()
Gets the value of the double tap time.
|
SizeD |
getDoubleTapSize()
Gets the area in view coordinates the touch pointer needs to stay in before multiple taps are considered multiple single
taps instead of multi-taps.
|
SizeD |
getDragSize()
Gets the area in view coordinates the mouse may stay in before a movement is considered a drag.
|
Duration |
getDragTime()
Gets the value of the drag time.
|
InsetsD |
getFitContentViewMargins()
Gets the insets in view coordinates that should be used by the
fitContent() operation. |
ICanvasObjectGroup |
getFocusGroup()
Gets the HighlightGroup property.
|
ICanvasObjectGroup |
getHighlightGroup()
Gets the HighlightGroup property.
|
double |
getHitTestRadius()
Specifies the radius of the area around the mouse in view coordinates in which a
IHitTestable
may lie to be considered a valid hit. |
double |
getHorizontalOffset() |
ScrollPane.ScrollBarPolicy |
getHorizontalScrollBarPolicy()
Specifies the visibility policy for the vertical scrollbar.
|
IInputMode |
getInputMode()
Specifies the single
IInputMode instance that shall be installed for this canvas. |
IInputModeContext |
getInputModeContext()
Gets the InputModeContext property.
|
LookupChain |
getInputModeContextLookupChain()
Retrieves the
LookupChain that can be used do decorate the ILookup.lookup(Class) call in the
InputModeContext . |
ICanvasObjectGroup |
getInputModeGroup()
Gets the InputModeGroup property.
|
double |
getLargeHorizontalChange()
Returns the change of the horizontal scroll bar when the track of the bar is clicked.
|
double |
getLargeVerticalChange()
Returns the change of the vertical scroll bar when the track of the bar is clicked.
|
PointD |
getLastEventLocation()
Gets the last location provided by a pointing device (for instance mouse or touch).
|
Mouse2DEvent |
getLastMouse2DEvent()
Gets the last
mouse event triggered by this instance. |
Touch2DEvent |
getLastTouch2DEvent()
Gets the last
touch event triggered by this instance. |
Duration |
getLongPressDuration()
Gets the value of the long press time.
|
double |
getMaximumHorizontalOffset()
Returns the maximum value for the horizontal scroll bar.
|
double |
getMaximumVerticalOffset()
Returns the maximum value for the vertical scroll bar.
|
double |
getMaximumZoom()
Gets the maximum zoom level that is valid for
Zoom . |
double |
getMinimumHorizontalOffset()
Returns the minimum value for the horizontal scroll bar.
|
double |
getMinimumVerticalOffset()
Returns the minimum value for the vertical scroll bar.
|
double |
getMinimumZoom()
Gets the minimum zoom factor for this canvas control.
|
MouseWheelBehaviors |
getMouseWheelBehavior()
Determines the behavior of the mouse wheel.
|
double |
getMouseWheelScrollFactor()
Gets a factor that controls how fast the viewport scrolls when the mouse wheel is turned.
|
double |
getMouseWheelZoomFactor()
Gets the factor by which the zoom level changes when the mouse wheel is turned.
|
EventHandler<? super CompoundKeyEvent> |
getOnCompoundKeyPressed()
Returns the value of the property onCompoundKeyPressed.
|
EventHandler<? super CompoundKeyEvent> |
getOnCompoundKeyReleased()
Returns the value of the property onCompoundKeyReleased.
|
EventHandler<? super CompoundKeyEvent> |
getOnCompoundKeyTyped()
Returns the value of the property onCompoundKeyTyped.
|
EventHandler<? super Mouse2DEvent> |
getOnMouse2DClicked()
Returns the value of the property onMouse2DClicked.
|
EventHandler<? super Mouse2DEvent> |
getOnMouse2DDragged()
Returns the value of the property onMouse2DDragged.
|
EventHandler<? super Mouse2DEvent> |
getOnMouse2DEntered()
Returns the value of the property onMouse2DEntered.
|
EventHandler<? super Mouse2DEvent> |
getOnMouse2DExited()
Returns the value of the property onMouse2DExited.
|
EventHandler<? super Mouse2DEvent> |
getOnMouse2DMoved()
Returns the value of the property onMouse2DMoved.
|
EventHandler<? super Mouse2DEvent> |
getOnMouse2DPressed()
Returns the value of the property onMouse2DPressed.
|
EventHandler<? super Mouse2DEvent> |
getOnMouse2DReleased()
Returns the value of the property onMouse2DReleased.
|
EventHandler<? super Mouse2DEvent> |
getOnMouse2DWheelTurned()
Returns the value of the property onMouse2DWheelTurned.
|
ICanvasObjectGroup |
getRootGroup()
Gets the root of the scene graph.
|
ICanvasObjectGroup |
getSelectionGroup()
Gets the SelectionGroup property.
|
SizeD |
getSize()
Returns the size of this
CanvasControl . |
double |
getSmallHorizontalChange()
Returns the step size by which the horizontal scroll bar is changed when calling
ScrollBar.increment() or ScrollBar.decrement() . |
double |
getSmallVerticalChange()
Returns the step size by which the vertical scroll bar is changed when calling
ScrollBar.increment() or ScrollBar.decrement() . |
double |
getVerticalOffset()
Returns the current value of the vertical scroll bar.
|
ScrollPane.ScrollBarPolicy |
getVerticalScrollBarPolicy()
Specifies the visibility policy for the vertical scrollbar.
|
PointD |
getViewPoint()
Gets the current view point.
|
RectD |
getViewport()
Returns the currently visible viewing region in world coordinates.
|
double |
getViewportHeight()
Returns the height of the current viewport.
|
ViewportLimiter |
getViewportLimiter()
Gets the
ViewportLimiter instance that can be used to limit the explorable region. |
double |
getViewportWidth()
Returns the width of the current viewport.
|
Node |
getVisual(ICanvasObject canvasObject)
Gets the
Node that is currently visualizing the given ICanvasObject . |
VisualCachingPolicy |
getVisualCaching()
Gets the policy for caching
Node s which are temporarily removed from the visual tree. |
IVisualCreator |
getVisualCreator(ICanvasObject canvasObject)
Convenience method that retrieves the
IVisualCreator for a given ICanvasObject . |
double |
getZoom()
Gets the zoom factor for this
CanvasControl . |
Duration |
getZoomAnimationDuration()
Gets the duration of the zooming animation.
|
void |
growContentRect(RectD rectangle)
Assures that the
content rectangle encompasses the given rectangle. |
IEnumerable<ICanvasObject> |
hitElementsAt(IInputModeContext context,
PointD location)
Enumerates all hit elements in the canvas below the given group that are accepted by a given filter using a specific
ICanvasContext
as the argument to the IHitTestable.isHit(IInputModeContext, PointD) method. |
IEnumerable<ICanvasObject> |
hitElementsAt(IInputModeContext context,
PointD location,
ICanvasObjectGroup root)
Enumerates all hit elements in the canvas below the given group that are accepted by a given filter using a specific
ICanvasContext
as the argument to the IHitTestable.isHit(IInputModeContext, PointD) method. |
IEnumerable<ICanvasObject> |
hitElementsAt(IInputModeContext context,
PointD location,
ICanvasObjectGroup root,
Predicate<ICanvasObject> filter)
Enumerates all hit elements in the canvas below the given group that are accepted by a given filter using a specific
ICanvasContext
as the argument to the IHitTestable.isHit(IInputModeContext, PointD) method. |
IEnumerable<ICanvasObject> |
hitElementsAt(PointD location)
Enumerates all hit elements in the canvas below the given group that are accepted by a given filter.
|
IEnumerable<ICanvasObject> |
hitElementsAt(PointD location,
ICanvasObjectGroup root)
Enumerates all hit elements in the canvas below the given group that are accepted by a given filter.
|
IEnumerable<ICanvasObject> |
hitElementsAt(PointD location,
ICanvasObjectGroup root,
Predicate<ICanvasObject> filter)
Enumerates all hit elements in the canvas below the given group that are accepted by a given filter.
|
DoubleProperty |
hitTestRadiusProperty()
The property for the
radius of the area around the mouse in view coordinates in which a IHitTestable
may lie to be considered a valid hit. |
DoubleProperty |
horizontalOffsetProperty()
Returns a
DoubleProperty that holds the current value of the horizontal scroll bar. |
ObjectProperty<ScrollPane.ScrollBarPolicy> |
horizontalScrollBarPolicyProperty()
Returns an
ObjectProperty that holds the visibility policy for the horizontal scroll bar. |
protected Object |
inputModeContextLookup(Class type)
Callback that is used by the default implementation of
InputModeContext to resolve ILookup.lookup(Class)
calls. |
ObjectProperty<IInputMode> |
inputModeProperty()
The property for the
the single input mode instance that is installed in this canvas . |
void |
invalidate()
Invalidates the current control.
|
boolean |
isAllKeyboardInputCapturingEnabled()
Gets a value indicating whether all keyboard input should be captured by this control, even if it hosts UI elements that
would otherwise capture those events.
|
boolean |
isAllPointerInputCapturingEnabled()
Gets a value indicating whether all mouse or touch input should be captured by this control, even if it hosts UI
elements that would otherwise capture those events.
|
boolean |
isAutoDragEnabled()
Gets a property that causes the control to automatically pan the view when the mouse gets dragged outside of the bounds
of the control.
|
boolean |
isDeviceDown()
Checks if at least one finger is on the touch screen.
|
boolean |
isEditable()
Property that sets the editable state of this canvas.
|
boolean |
isHit(ICanvasObject canvasObject,
PointD location)
Convenience method that calculates the hit tests a given canvas object in the scene graph.
|
boolean |
isKeyboardFocusWithin()
Determines whether the keyboard focus is within the visual tree.
|
boolean |
isMouseEventConsumingDisabled()
Returns whether the behavior of consuming mouse events during the bubbling phase is
disabled.
|
boolean |
isNavigationCommandsEnabled()
Gets a value indicating whether navigation related command bindings are enabled.
|
boolean |
isScrollCommandAnimationEnabled()
Gets a value indicating whether
ICommand s for scrolling like for example
ICommand.SCROLL_PAGE_DOWN , the scrolling should be performed in animated fashion. |
boolean |
isZoomAnimationEnabled()
Gets a value indicating whether zooming operations (e.g. turning the mouse wheel, executing
ICommand.ZOOM etc.) should be performed in animated fashion. |
ReadOnlyDoubleProperty |
largeHorizontalChangeProperty()
Returns a
DoubleProperty that holds the change of the horizontal scroll bar when the track of the bar is
clicked. |
ReadOnlyDoubleProperty |
largeVerticalChangeProperty()
Returns a
DoubleProperty that holds the change of the vertical scroll bar when the track of the bar is
clicked. |
protected void |
layoutChildren() |
ObjectProperty<Duration> |
longPressDurationProperty()
The property for the
long press time that indicates the amount of time that may pass before a touch down is considered a
long press when the pointer stays within its getDragSize() area. |
<TLookup> TLookup |
lookup(Class<TLookup> type)
Returns an instance that implements the given type or
null . |
void |
makeVisible(RectD bounds)
Ensures that the provided bounds are visible in this control by adjusting the viewport correspondingly.
|
ReadOnlyDoubleProperty |
maximumHorizontalOffsetProperty()
Returns a
DoubleProperty that holds the the maximum value for the vertical scroll bar. |
ReadOnlyDoubleProperty |
maximumVerticalOffsetProperty()
Returns a
DoubleProperty that holds the maximum value for the vertical scroll bar. |
DoubleProperty |
maximumZoomProperty()
Returns a
DoubleProperty that holds the maximum zoom level that is valid for this canvas control. |
ReadOnlyDoubleProperty |
minimumHorizontalOffsetProperty()
Returns a
DoubleProperty that holds the minimum value for the horizontal scroll bar. |
ReadOnlyDoubleProperty |
minimumVerticalOffsetProperty()
Returns a
DoubleProperty that holds the minimum value for the vertical scroll bar. |
DoubleProperty |
minimumZoomProperty()
Returns a
DoubleProperty that holds the minimum the minimum zoom level for this canvas control. |
BooleanProperty |
mouseEventConsumingDisabledProperty()
Defines whether consuming mouse events during the bubbling phase for this control is
disabled or not.
|
ObjectProperty<MouseWheelBehaviors> |
mouseWheelBehaviorProperty()
The property for the
behavior of the mouse wheel . |
protected void |
mouseWheelScroll(Mouse2DEvent e)
This method will be called by the
onMouse2DWheelTurned(Mouse2DEvent) method, if the MouseWheelBehavior
property is set to MouseWheelBehaviors.SCROLL . |
DoubleProperty |
mouseWheelScrollFactorProperty()
The property for the
factor that controls how fast the viewport scrolls when the mouse wheel is turned. |
protected void |
mouseWheelZoom(Mouse2DEvent e)
This method will be called by the
onMouse2DWheelTurned(Mouse2DEvent) method, if the MouseWheelBehavior
property is set to MouseWheelBehaviors.ZOOM . |
DoubleProperty |
mouseWheelZoomFactorProperty()
The property for the
factor by which the zoom level changes when the mouse wheel is turned. |
BooleanProperty |
navigationCommandsEnabledProperty()
The property for the
value indicating whether navigation related command bindings are enabled. |
ObjectProperty<EventHandler<? super CompoundKeyEvent>> |
onCompoundKeyPressedProperty()
Defines a function to be called when the user has
pressed a key on the CanvasControl . |
ObjectProperty<EventHandler<? super CompoundKeyEvent>> |
onCompoundKeyReleasedProperty()
Defines a function to be called when the user has
released a key on the CanvasControl . |
ObjectProperty<EventHandler<? super CompoundKeyEvent>> |
onCompoundKeyTypedProperty()
Defines a function to be called when the user has
typed a key on the CanvasControl . |
protected void |
onKeyDown(KeyEvent event)
This will transform the key event to
ModifierKeys and redispatch the last mouse event. |
protected void |
onKeyPress(KeyEvent event)
This implementation will do nothing.
|
protected void |
onKeyUp(KeyEvent event)
This will transform the key event to
ModifierKeys and redispatch the last mouse event. |
protected void |
onMouse2DClicked(Mouse2DEvent e)
Callback method that is called when the mouse has been clicked.
|
ObjectProperty<EventHandler<? super Mouse2DEvent>> |
onMouse2DClickedProperty()
Defines a function to be called when the user has
clicked on the CanvasControl
with the mouse. |
protected void |
onMouse2DDragged(Mouse2DEvent e)
Callback method that is called when the mouse gets dragged.
|
ObjectProperty<EventHandler<? super Mouse2DEvent>> |
onMouse2DDraggedProperty()
Defines a function to be called when the mouse has been
dragged over the
CanvasControl , i.e. the mouse is being moved while at least one of the mouse buttons is pressed. |
protected void |
onMouse2DEntered(Mouse2DEvent e)
Callback method that is called when the mouse enters the control.
|
ObjectProperty<EventHandler<? super Mouse2DEvent>> |
onMouse2DEnteredProperty()
Defines a function to be called when the mouse has
entered the CanvasControl . |
protected void |
onMouse2DExited(Mouse2DEvent e)
Callback method that is called when the mouse exits the control.
|
ObjectProperty<EventHandler<? super Mouse2DEvent>> |
onMouse2DExitedProperty()
Defines a function to be called when the mouse has
exited the CanvasControl . |
protected void |
onMouse2DMoved(Mouse2DEvent e)
Callback method that is called when the mouse has been moved and no button has been pressed.
|
ObjectProperty<EventHandler<? super Mouse2DEvent>> |
onMouse2DMovedProperty()
Defines a function to be called when the mouse has been
moved in the CanvasControl . |
protected void |
onMouse2DPressed(Mouse2DEvent e)
Callback method that is called when a mouse button has been pressed.
|
ObjectProperty<EventHandler<? super Mouse2DEvent>> |
onMouse2DPressedProperty()
Defines a function to be called when the mouse has been
pressed in the CanvasControl . |
protected void |
onMouse2DReleased(Mouse2DEvent e)
Callback method that is called when a mouse button has been released.
|
ObjectProperty<EventHandler<? super Mouse2DEvent>> |
onMouse2DReleasedProperty()
Defines a function to be called when the mouse has been
released on the CanvasControl . |
protected void |
onMouse2DWheelTurned(Mouse2DEvent e)
Callback method that is called when the mouse wheel has been turned.
|
ObjectProperty<EventHandler<? super Mouse2DEvent>> |
onMouse2DWheelTurnedProperty()
Defines a function to be called when the mouse wheel has
turned over the CanvasControl . |
protected void |
onPrepareRenderContextEvent(RenderContextEvent args)
Raises the
RenderContextEvent.PREPARE event. |
protected void |
onSizeChanged(IEventArgs args)
Handles a size change of this
CanvasControl . |
protected void |
onTouch2DDown(Touch2DEvent e)
Callback method that is called when a finger has been put on the touch screen.
|
protected void |
onTouch2DEntered(Touch2DEvent e)
Callback method that is called when a finger on the touch screen enters the control.
|
protected void |
onTouch2DExited(Touch2DEvent e)
Callback method that is called when a finger on the touch screen exits the control.
|
protected void |
onTouch2DLongPress(Touch2DEvent e)
Callback method that is called when a long press gesture has been performed with a finger on the touch screen.
|
protected void |
onTouch2DLostCapture(Touch2DEvent e)
Callback method that is called when the touch capture is lost.
|
protected void |
onTouch2DMoved(Touch2DEvent e)
Callback method that is called when a finger has been moved on the touch screen.
|
protected void |
onTouch2DTapped(Touch2DEvent e)
Callback method that is called when a tap gesture has been performed with a finger on the touch screen.
|
protected void |
onTouch2DUp(Touch2DEvent e)
Callback method that is called when a finger has been removed from the surface of the touch screen.
|
protected void |
onTouchDown(TouchEvent e) |
protected void |
onTouchEnter(TouchEvent e) |
protected void |
onTouchLeave(TouchEvent e) |
protected void |
onTouchMove(TouchEvent e) |
protected void |
onTouchUp(TouchEvent e) |
protected void |
raiseUpdatedEvent()
Raises a
CanvasEvent of type CanvasEvent.UPDATED . |
protected void |
raiseUpdatingEvent()
Raises the
CanvasEvent.UPDATING event. |
protected void |
redispatchMouse2DEvent(ModifierKeys newModifiers)
Redispatches a previously fired mouse event appropriately, e.g. if the view port has changed.
|
void |
removeBackgroundGroupChangedListener(IEventHandler backgroundGroupChangedEvent)
Removes the given listener for the
BackgroundGroupChanged event that occurs when the BackgroundGroup
property has been changed. |
void |
removeContentGroupChangedListener(IEventHandler contentGroupChangedEvent)
Removes the given listener for the
ContentGroupChanged event that occurs when the ContentGroup
property has been changed. |
void |
removeFocusGroupChangedListener(IEventHandler focusGroupChangedEvent)
Removes the given listener for the
FocusGroupChanged event that occurs when the FocusGroup
property has been changed. |
void |
removeHighlightGroupChangedListener(IEventHandler highlightGroupChangedEvent)
Removes the given listener for the
HighlightGroupChanged event that occurs when the HighlightGroup
property has been changed. |
void |
removeInputModeContextChangedListener(IEventHandler<PropertyChangedEventArgs> inputModeContextChangedEvent)
Removes the given listener for the
InputModeContextChanged event that occurs when the InputModeContext
property has been changed. |
void |
removeInputModeGroupChangedListener(IEventHandler inputModeGroupChangedEvent)
Removes the given listener for the
InputModeGroupChanged event that occurs when the InputModeGroup
property has been changed. |
void |
removeSelectionGroupChangedListener(IEventHandler selectionGroupChangedEvent)
Removes the given listener for the
SelectionGroupChanged event that occurs when the SelectionGroup
property has been changed. |
void |
resize(double width,
double height) |
BooleanProperty |
scrollCommandAnimationEnabledProperty()
The property for the
value that indicates if scrolling should be animated . |
void |
setAllKeyboardInputCapturingEnabled(boolean value)
Sets a value indicating whether all keyboard input should be captured by this control, even if it hosts UI elements that
would otherwise capture those events.
|
void |
setAllPointerInputCapturingEnabled(boolean value)
Sets a value indicating whether all mouse or touch input should be captured by this control, even if it hosts UI
elements that would otherwise capture those events.
|
void |
setAutoDragEnabled(boolean value)
Sets a property that causes the control to automatically pan the view when the mouse gets dragged outside of the bounds
of the control.
|
void |
setAutoDragInsets(InsetsD value)
Sets the auto drag insets.
|
void |
setBackgroundGroup(ICanvasObjectGroup value)
Sets the BackgroundGroup property.
|
void |
setCenter(PointD value)
Sets the world coordinate at the center of the control.
|
void |
setCenterZoomEventRecognizer(IEventRecognizer value)
Specifies an
IEventRecognizer that determines whether the zooming to the center of the view, rather than at the
mouse location should be used. |
void |
setContentGroup(ICanvasObjectGroup value)
Sets the ContentGroup property.
|
void |
setContentRect(double x,
double y,
double w,
double h)
Sets the content rectangle.
|
void |
setContentRect(RectD value)
Sets the Rectangle in world coordinates that holds the contents.
|
void |
setDoubleClickSize(SizeD value)
The area in view coordinates the mouse needs to stay in before multiple clicks are considered multiple single clicks
instead of multi-clicks.
|
void |
setDoubleClickTime(Duration value)
The value of the double click time.
|
void |
setDoubleTapDuration(Duration value)
Sets the value of the double tap time.
|
void |
setDoubleTapSize(SizeD value)
Sets the area in view coordinates the touch pointer needs to stay in before multiple taps are considered multiple single
taps instead of multi-taps.
|
void |
setDragSize(SizeD value)
Sets the area in view coordinates the mouse may stay in before a movement is considered a drag.
|
void |
setDragTime(Duration value)
Sets the value of the drag time.
|
void |
setEditable(boolean value)
Property that sets the editable state of this canvas.
|
void |
setFitContentViewMargins(InsetsD value)
Sets the insets in view coordinates that should be used by the
fitContent() operation. |
void |
setFocusGroup(ICanvasObjectGroup value)
Sets the HighlightGroup property.
|
void |
setHighlightGroup(ICanvasObjectGroup value)
Sets the HighlightGroup property.
|
void |
setHitTestRadius(double value)
Specifies the radius of the area around the mouse in view coordinates in which a
IHitTestable
may lie to be considered a valid hit. |
void |
setHorizontalScrollBarPolicy(ScrollPane.ScrollBarPolicy value)
Specifies the visibility policy for the vertical scrollbar.
|
void |
setInputMode(IInputMode value)
Sets the single
IInputMode instance that shall be installed for this canvas. |
void |
setInputModeContext(IInputModeContext value)
Sets the InputModeContext property.
|
void |
setInputModeGroup(ICanvasObjectGroup value)
Sets the InputModeGroup property.
|
void |
setLongPressDuration(Duration value)
Sets the value of the long press time.
|
void |
setMaximumZoom(double value)
Sets the maximum zoom level that is valid for
Zoom . |
void |
setMinimumZoom(double value)
Sets the minimum zoom factor for this
CanvasControl . |
void |
setMouseEventConsumingDisabled(boolean mouseEventConsumingDisabled)
Sets the behavior of consuming mouse events during the bubbling phase.
|
void |
setMouseWheelBehavior(MouseWheelBehaviors value)
Determines the behavior of the mouse wheel.
|
void |
setMouseWheelScrollFactor(double value)
Sets a factor that controls how fast the viewport scrolls when the mouse wheel is turned.
|
void |
setMouseWheelZoomFactor(double value)
Sets the factor by which the zoom level changes when the mouse wheel is turned.
|
void |
setNavigationCommandsEnabled(boolean value)
Sets a value indicating whether navigation related command bindings are enabled.
|
void |
setOnCompoundKeyPressed(EventHandler<? super CompoundKeyEvent> value)
Sets the value of the property onCompoundKeyPressed.
|
void |
setOnCompoundKeyReleased(EventHandler<? super CompoundKeyEvent> value)
Sets the value of the property onCompoundKeyReleased.
|
void |
setOnCompoundKeyTyped(EventHandler<? super CompoundKeyEvent> value)
Sets the value of the property onCompoundKeyTyped.
|
void |
setOnMouse2DClicked(EventHandler<? super Mouse2DEvent> value)
Sets the value of the property onMouse2DClicked.
|
void |
setOnMouse2DDragged(EventHandler<? super Mouse2DEvent> value)
Sets the value of the property onMouse2DDragged.
|
void |
setOnMouse2DEntered(EventHandler<? super Mouse2DEvent> value)
Sets the value of the property onMouse2DEntered.
|
void |
setOnMouse2DExited(EventHandler<? super Mouse2DEvent> value)
Sets the value of the property onMouse2DExited.
|
void |
setOnMouse2DMoved(EventHandler<? super Mouse2DEvent> value)
Sets the value of the property onMouse2DMoved.
|
void |
setOnMouse2DPressed(EventHandler<? super Mouse2DEvent> value)
Sets the value of the property onMouse2DPressed.
|
void |
setOnMouse2DReleased(EventHandler<? super Mouse2DEvent> value)
Sets the value of the property onMouse2DReleased.
|
void |
setOnMouse2DWheelTurned(EventHandler<? super Mouse2DEvent> value)
Sets the value of the property onMouse2DWheelTurned.
|
void |
setScrollCommandAnimationEnabled(boolean value)
Sets a value indicating whether
ICommand s for scrolling like for example
ICommand.SCROLL_PAGE_DOWN , the scrolling should be performed in animated fashion. |
void |
setSelectionGroup(ICanvasObjectGroup value)
Sets the SelectionGroup property.
|
static void |
setTemplateLocation(Node visual,
PointD viewCoordinates)
Moves a node to the given coordinates.
|
void |
setVerticalScrollBarPolicy(ScrollPane.ScrollBarPolicy value)
Specifies the visibility policy for the vertical scrollbar.
|
void |
setViewPoint(PointD value)
Sets the current view point.
|
void |
setViewportLimiter(ViewportLimiter value)
Sets the
ViewportLimiter instance that can be used to limit the explorable region. |
void |
setVisualCaching(VisualCachingPolicy value)
Sets the policy for caching
Node s which are temporarily removed from the visual tree. |
void |
setZoom(double value)
Sets the zoom factor for this
CanvasControl . |
void |
setZoomAnimationDuration(Duration duration)
Sets the duration of the zooming animation.
|
void |
setZoomAnimationEnabled(boolean value)
Sets a value indicating whether zooming operations (e.g. turning the mouse wheel, executing
ICommand.ZOOM etc.) should be performed in animated fashion. |
ReadOnlyDoubleProperty |
smallHorizontalChangeProperty()
Returns a
DoubleProperty that holds the step size by which the horizontal scroll bar is changed when calling
ScrollBar.increment() or ScrollBar.decrement() . |
ReadOnlyDoubleProperty |
smallVerticalChangeProperty()
Returns a
DoubleProperty that holds the step size by which the vertical scroll bar is changed when calling
ScrollBar.increment() or ScrollBar.decrement() . |
PointD |
toViewCoordinates(PointD worldPoint)
Converts world coordinates to view coordinates expressed in the control's coordinate system.
|
PointD |
toWorldCoordinates(PointD viewPoint)
Converts view coordinates (expressed in the control's coordinate system) to world coordinates.
|
void |
updateContentRect()
Updates the
ContentRect to encompass the bounds by all elements in the current scene graph
plus the given margins. |
void |
updateContentRect(InsetsD margins)
Updates the
ContentRect to encompass the bounds by all elements in the current scene graph
plus the given margins. |
void |
updateContentRect(InsetsD margins,
ICanvasObjectGroup group)
Updates the
ContentRect to encompass the bounds by all elements in the current scene graph
plus the given margins. |
void |
updateImmediately()
Updates the visual tree that displays the contents of this control.
|
DoubleProperty |
verticalOffsetProperty()
Returns a
DoubleProperty that holds the current value of the vertical scroll bar. |
ObjectProperty<ScrollPane.ScrollBarPolicy> |
verticalScrollBarPolicyProperty()
Returns an
ObjectProperty that holds the visibility policy for the vertical scroll bar. |
ObjectProperty<PointD> |
viewPointProperty()
Returns an
ObjectProperty that holds current view point. |
ReadOnlyDoubleProperty |
viewportHeightProperty()
Returns a
DoubleProperty that holds the height of the current viewport. |
ReadOnlyObjectPropertyBase<RectD> |
viewportProperty()
The property for the
view port . |
ReadOnlyDoubleProperty |
viewportWidthProperty()
Returns a
DoubleProperty that holds the width of the current viewport. |
DoubleProperty |
zoomProperty()
Gets a
DoubleProperty that holds the current zoom factor for this canvas control. |
void |
zoomTo(PointD center,
double zoom)
Sets the zoom level and view port center to the given values.
|
void |
zoomTo(RectD bounds)
Sets the zoom level and view port center so that the given rectangle in world coordinates fits the viewport.
|
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 BooleanProperty autoDragEnabledProperty
public final ObjectProperty<InsetsD> autoDragInsetsProperty
auto drag insets
.public final ObjectProperty<IEventRecognizer> centerZoomEventRecognizerProperty
getCenterZoomEventRecognizer()
event recognizer} that determines whether the zooming to the center of the view, rather than at the
mouse location should be used.public final ReadOnlyIntegerProperty computedHorizontalScrollBarStateProperty
IntegerProperty
that holds the state of the horizontal scroll bar.
State can be any combination of SCROLL_BAR_ENABLED
and SCROLL_BAR_VISIBLE
.public final ReadOnlyIntegerProperty computedVerticalScrollBarStateProperty
IntegerProperty
that holds the state of the vertical scroll bar.
State can be any combination of SCROLL_BAR_ENABLED
and SCROLL_BAR_VISIBLE
.public final ObjectProperty<RectD> contentRectProperty
ObjectProperty
that holds a rectangle containing the whole graph content of this
CanvasControl
.public final ObjectProperty<SizeD> doubleClickSizeProperty
area in view coordinates
the mouse needs to stay in before multiple clicks are considered multiple single clicks
instead of multi-clicks.public final ObjectProperty<Duration> doubleClickTimeProperty
double click time
that indicates the amount of time
that may pass within which two subsequent mouse clicks are considered multi clicks.public final ObjectProperty<Duration> doubleTapDurationProperty
double tap time
that indicates the amount of time that may pass
within which two subsequent touch taps are considered multi taps.public final ObjectProperty<SizeD> doubleTapSizeProperty
area in view coordinates
the touch pointer needs to stay in before multiple taps are considered multiple single
taps instead of multi-taps.public final ObjectProperty<SizeD> dragSizeProperty
the area in view coordinates
the mouse may stay in before a movement is considered a drag.public final ObjectProperty<Duration> dragTimeProperty
public final BooleanProperty editableProperty
IInputMode
implementations should honor this property.
Events will still be delivered to the IInputModes, however they
should not modify the model.setEditable(boolean)
public final ObjectProperty<InsetsD> fitContentViewMarginsProperty
insets in view coordinates
that should be used by the fitContent()
operation.public final DoubleProperty hitTestRadiusProperty
radius of the area around the mouse in view coordinates
in which a IHitTestable
may lie to be considered a valid hit.public final DoubleProperty horizontalOffsetProperty
DoubleProperty
that holds the current value of the horizontal scroll bar.public final ObjectProperty<ScrollPane.ScrollBarPolicy> horizontalScrollBarPolicyProperty
ObjectProperty
that holds the visibility policy for the horizontal scroll bar.
Scroll bars don't need to be displayed in order to move the viewport. This can be achieved programmatically or
using special IInputMode instances.
The default is ScrollPane.ScrollBarPolicy#AS_NEEDED
.MoveViewportInputMode
,
getHorizontalScrollBarPolicy()
,
ScrollPane.ScrollBarPolicy#ALWAYS
,
ScrollPane.ScrollBarPolicy#AS_NEEDED
,
ScrollPane.ScrollBarPolicy#NEVER
public final ObjectProperty<IInputMode> inputModeProperty
the single input mode instance that is installed in this canvas
.public final ReadOnlyDoubleProperty largeHorizontalChangeProperty
DoubleProperty
that holds the change of the horizontal scroll bar when the track of the bar is
clicked.public final ReadOnlyDoubleProperty largeVerticalChangeProperty
DoubleProperty
that holds the change of the vertical scroll bar when the track of the bar is
clicked.public final ObjectProperty<Duration> longPressDurationProperty
long press time
that indicates the amount of time that may pass before a touch down is considered a
long press when the pointer stays within its getDragSize()
area.public final ReadOnlyDoubleProperty maximumHorizontalOffsetProperty
DoubleProperty
that holds the the maximum value for the vertical scroll bar.public final ReadOnlyDoubleProperty maximumVerticalOffsetProperty
DoubleProperty
that holds the maximum value for the vertical scroll bar.public final DoubleProperty maximumZoomProperty
DoubleProperty
that holds the maximum zoom level that is valid for this canvas control.
This property sets an upper bound for the allowed values of the
getZoom()
. Default value is 1000d
.getZoom()
,
getMinimumZoom()
public final ReadOnlyDoubleProperty minimumHorizontalOffsetProperty
DoubleProperty
that holds the minimum value for the horizontal scroll bar.public final ReadOnlyDoubleProperty minimumVerticalOffsetProperty
DoubleProperty
that holds the minimum value for the vertical scroll bar.public final DoubleProperty minimumZoomProperty
DoubleProperty
that holds the minimum the minimum zoom level for this canvas control.
This property sets a lower bound for the allowed values of the
getZoom()
property. If this property is written, the canvas will
zoom to the new value while keeping the center of view at the same world coordinates.
The default is 0.01d
but values as small as 0.0000001d are possible.getZoom()
,
getMaximumZoom()
public final BooleanProperty mouseEventConsumingDisabledProperty
Per default, this property is set to false
.
public final ObjectProperty<MouseWheelBehaviors> mouseWheelBehaviorProperty
behavior of the mouse wheel
.public final DoubleProperty mouseWheelScrollFactorProperty
factor
that controls how fast the viewport scrolls when the mouse wheel is turned.public final DoubleProperty mouseWheelZoomFactorProperty
factor
by which the zoom level changes when the mouse wheel is turned.public final BooleanProperty navigationCommandsEnabledProperty
value
indicating whether navigation related command bindings are enabled.public final ObjectProperty<EventHandler<? super CompoundKeyEvent>> onCompoundKeyPressedProperty
pressed
a key on the CanvasControl
.
This event delivers CompoundKeyEvent
.
public final ObjectProperty<EventHandler<? super CompoundKeyEvent>> onCompoundKeyReleasedProperty
released
a key on the CanvasControl
.
This event delivers CompoundKeyEvent
.
public final ObjectProperty<EventHandler<? super CompoundKeyEvent>> onCompoundKeyTypedProperty
typed
a key on the CanvasControl
.
This event delivers CompoundKeyEvent
.
public final ObjectProperty<EventHandler<? super Mouse2DEvent>> onMouse2DClickedProperty
clicked
on the CanvasControl
with the mouse. This happens if press and release happens at the same position.
An Mouse2DEvent
in world coordinates using double precision floating points is
delivered to the function.
public final ObjectProperty<EventHandler<? super Mouse2DEvent>> onMouse2DDraggedProperty
dragged
over the
CanvasControl
, i.e. the mouse is being moved while at least one of the mouse buttons is pressed.
An Mouse2DEvent
in world coordinates using double precision floating points is
delivered to the function.
public final ObjectProperty<EventHandler<? super Mouse2DEvent>> onMouse2DEnteredProperty
entered
the CanvasControl
.
An Mouse2DEvent
in world coordinates using double precision floating points is
delivered to the function.
public final ObjectProperty<EventHandler<? super Mouse2DEvent>> onMouse2DExitedProperty
exited
the CanvasControl
.
An Mouse2DEvent
in world coordinates using double precision floating points is
delivered to the function.
public final ObjectProperty<EventHandler<? super Mouse2DEvent>> onMouse2DMovedProperty
moved
in the CanvasControl
.
An Mouse2DEvent
in world coordinates using double precision floating points is
delivered to the function.
Move events are delivered if no mouse button is pressed.
This event will be fired, too, if the mouse does not
move but the world coordinates to which the current mouse position maps
change. E.g. this will happen if the zoom level or the view point is changed.
public final ObjectProperty<EventHandler<? super Mouse2DEvent>> onMouse2DPressedProperty
pressed
in the CanvasControl
.
An Mouse2DEvent
in world coordinates using double precision floating points is
delivered to the function.
public final ObjectProperty<EventHandler<? super Mouse2DEvent>> onMouse2DReleasedProperty
released
on the CanvasControl
.
An Mouse2DEvent
in world coordinates using double precision floating points is
delivered to the function.
public final ObjectProperty<EventHandler<? super Mouse2DEvent>> onMouse2DWheelTurnedProperty
turned
over the CanvasControl
.
An Mouse2DEvent
in world coordinates using double precision floating points is
delivered to the function.
public final BooleanProperty scrollCommandAnimationEnabledProperty
value that indicates if scrolling should be animated
.public final ReadOnlyDoubleProperty smallHorizontalChangeProperty
DoubleProperty
that holds the step size by which the horizontal scroll bar is changed when calling
ScrollBar.increment()
or ScrollBar.decrement()
.public final ReadOnlyDoubleProperty smallVerticalChangeProperty
DoubleProperty
that holds the step size by which the vertical scroll bar is changed when calling
ScrollBar.increment()
or ScrollBar.decrement()
.public final DoubleProperty verticalOffsetProperty
DoubleProperty
that holds the current value of the vertical scroll bar.public final ObjectProperty<ScrollPane.ScrollBarPolicy> verticalScrollBarPolicyProperty
ObjectProperty
that holds the visibility policy for the vertical scroll bar.
Scroll bars don't need to be displayed in order to move the viewport. This can be achieved programmatically or
using special IInputMode instances.
The default is ScrollPane.ScrollBarPolicy#AS_NEEDED
.MoveViewportInputMode
,
getHorizontalScrollBarPolicy()
,
ScrollPane.ScrollBarPolicy#ALWAYS
,
ScrollPane.ScrollBarPolicy#AS_NEEDED
,
ScrollPane.ScrollBarPolicy#NEVER
public final ObjectProperty<PointD> viewPointProperty
ObjectProperty
that holds current view point.
The view point is the point in world coordinates that is mapped to the top left corner point in the current
viewport.public final ReadOnlyDoubleProperty viewportHeightProperty
DoubleProperty
that holds the height of the current viewport.public final ReadOnlyObjectPropertyBase<RectD> viewportProperty
view port
.
The view port is the visible portion of the world rectangle in the world coordinate system.
getViewport()
public final ReadOnlyDoubleProperty viewportWidthProperty
DoubleProperty
that holds the width of the current viewport.public final DoubleProperty zoomProperty
DoubleProperty
that holds the current zoom factor for this canvas control.
A zoom level of 1.0f
will make each unit in world-coordinate space appear exactly one unit in screen
coordinates wide. The default is 1.0f
. If this property is written, the canvas will zoom to the new
value while keeping the center of view at the same world coordinates.
The valid range is bounded by getMinimumZoom()
and
getMaximumZoom()
getMinimumZoom()
,
getMaximumZoom()
public static final int SCROLL_BAR_ENABLED
public static final int SCROLL_BAR_VISIBLE
public CanvasControl()
CanvasControl
.
The canvas will be empty with no associated InputMode
s.
public final void addBackgroundGroupChangedListener(IEventHandler backgroundGroupChangedEvent)
BackgroundGroupChanged
event that occurs when the BackgroundGroup
property has been changed.backgroundGroupChangedEvent
- The listener to add.removeBackgroundGroupChangedListener(IEventHandler)
public final void addContentGroupChangedListener(IEventHandler contentGroupChangedEvent)
ContentGroupChanged
event that occurs when the ContentGroup
property has been changed.contentGroupChangedEvent
- The listener to add.removeContentGroupChangedListener(IEventHandler)
public final void addFocusGroupChangedListener(IEventHandler focusGroupChangedEvent)
FocusGroupChanged
event that occurs when the FocusGroup
property has been changed.focusGroupChangedEvent
- The listener to add.removeFocusGroupChangedListener(IEventHandler)
public final void addHighlightGroupChangedListener(IEventHandler highlightGroupChangedEvent)
HighlightGroupChanged
event that occurs when the HighlightGroup
property has been changed.highlightGroupChangedEvent
- The listener to add.removeHighlightGroupChangedListener(IEventHandler)
public final void addInputModeContextChangedListener(IEventHandler<PropertyChangedEventArgs> inputModeContextChangedEvent)
InputModeContextChanged
event that occurs when the InputModeContext
property has been changed.inputModeContextChangedEvent
- The listener to add.removeInputModeContextChangedListener(IEventHandler)
public final void addInputModeGroupChangedListener(IEventHandler inputModeGroupChangedEvent)
InputModeGroupChanged
event that occurs when the InputModeGroup
property has been changed.inputModeGroupChangedEvent
- The listener to add.removeInputModeGroupChangedListener(IEventHandler)
public final void addSelectionGroupChangedListener(IEventHandler selectionGroupChangedEvent)
SelectionGroupChanged
event that occurs when the SelectionGroup
property has been changed.selectionGroupChangedEvent
- The listener to add.removeSelectionGroupChangedListener(IEventHandler)
public void animateScrollTo(PointD viewPoint, double zoom)
viewPoint
- The new ViewPoint
zoom
- The new zoom level.public final BooleanProperty autoDragEnabledProperty()
public final ObjectProperty<InsetsD> autoDragInsetsProperty()
auto drag insets
.public final ObjectProperty<IEventRecognizer> centerZoomEventRecognizerProperty()
getCenterZoomEventRecognizer()
event recognizer} that determines whether the zooming to the center of the view, rather than at the
mouse location should be used.public void coerceViewportLimits()
ViewportLimiter
are
obeyed.
This method will zoomTo(RectD)
the limited bounds if necessary.
getViewportLimiter()
public final int compareRenderOrder(ICanvasObject canvasObject1, ICanvasObject canvasObject2)
ICanvasObject
instances that are live in this canvas.
The comparison will yield values greater than zero if and only if the second object is rendered after the first one.
canvasObject1
- the first object to comparecanvasObject2
- the second object to comparepublic final ReadOnlyIntegerProperty computedHorizontalScrollBarStateProperty()
IntegerProperty
that holds the state of the horizontal scroll bar.
State can be any combination of SCROLL_BAR_ENABLED
and SCROLL_BAR_VISIBLE
.public final ReadOnlyIntegerProperty computedVerticalScrollBarStateProperty()
IntegerProperty
that holds the state of the vertical scroll bar.
State can be any combination of SCROLL_BAR_ENABLED
and SCROLL_BAR_VISIBLE
.public final ObjectProperty<RectD> contentRectProperty()
ObjectProperty
that holds a rectangle containing the whole graph content of this
CanvasControl
.protected ICanvasObjectGroup createBackgroundGroup()
This method will be called upon first access to the BackgroundGroup
property.
protected ICanvasObjectGroup createContentGroup()
This method will be called upon first access to the ContentGroup
property.
protected ICanvasObjectGroup createFocusGroup()
FocusGroup
property.
This method will be called upon first access to the FocusGroup
property.
protected ICanvasObjectGroup createHighlightGroup()
This method will be called upon first access to the HighlightGroup
property.
protected IInputModeContext createInputModeContext()
InputModeContext
property.
This method will be called upon first access to the InputModeContext
property.
InputModeContext
that has this instance set as it's CanvasControl
and uses this instance's inputModeContextLookup(Class)
callback to satisfy requests.protected ICanvasObjectGroup createInputModeGroup()
This method will be called upon first access to the InputModeGroup
property.
public IRenderContext createRenderContext()
render context
that can be used to create visuals
using IVisualCreator
implementations.
This method is a convenience method to obtain a context for special visual creator implementations and normally needs not be used by application developers.
protected ICanvasObjectGroup createSelectionGroup()
This method will be called upon first access to the SelectionGroup
property.
public static final Node createVisualFromTemplate(IVisualTemplate template, PointD origin, IRenderContext context)
Node
) using the given template.template
- the template for the new Node
.origin
- public static final Node createVisualFromTemplate(IVisualTemplate template, PointD origin, IRenderContext context, RectD initialBounds)
Node
) using the given template.template
- the template for the new Node
.origin
- public static final Node createVisualFromTemplate(IVisualTemplate template, PointD origin, IRenderContext context, RectD initialBounds, Object dataObject)
Node
) using the given template.template
- the template for the new Node
.origin
- public final ObjectProperty<SizeD> doubleClickSizeProperty()
area in view coordinates
the mouse needs to stay in before multiple clicks are considered multiple single clicks
instead of multi-clicks.public final ObjectProperty<Duration> doubleClickTimeProperty()
double click time
that indicates the amount of time
that may pass within which two subsequent mouse clicks are considered multi clicks.public final ObjectProperty<Duration> doubleTapDurationProperty()
double tap time
that indicates the amount of time that may pass
within which two subsequent touch taps are considered multi taps.public final ObjectProperty<SizeD> doubleTapSizeProperty()
area in view coordinates
the touch pointer needs to stay in before multiple taps are considered multiple single
taps instead of multi-taps.public final ObjectProperty<SizeD> dragSizeProperty()
the area in view coordinates
the mouse may stay in before a movement is considered a drag.public final ObjectProperty<Duration> dragTimeProperty()
public final BooleanProperty editableProperty()
IInputMode
implementations should honor this property.
Events will still be delivered to the IInputModes, however they
should not modify the model.setEditable(boolean)
public Node exportContent(IRenderContext context)
CanvasControl
.
This method will create the visual content using the world coordinate system.
context
- The context to use.public void fitContent()
ContentRect
.
The zoom level will not be greater than 1.0d
(see the remarks). If the view port is limited by the ViewportLimiter
the zoom level might be greater than 1.0d
to respect the limits.
public final ObjectProperty<InsetsD> fitContentViewMarginsProperty()
insets in view coordinates
that should be used by the fitContent()
operation.public final InsetsD getAutoDragInsets()
If the mouse is being dragged within the insets of the control specified using this property, the control will automatically scroll.
isAutoDragEnabled()
,
setAutoDragInsets(InsetsD)
public final ICanvasObjectGroup getBackgroundGroup()
The background group is the ICanvasObjectGroup
that should be used by the application code to put background
elements in.
If the field has not yet been initialized upon first access, the factory method createBackgroundGroup()
will be
called. Upon change the onBackgroundGroupChanged(ICanvasObjectGroup, ICanvasObjectGroup)
method will be
called.
getContentGroup()
,
setBackgroundGroup(ICanvasObjectGroup)
public final RectD getBounds(ICanvasObject canvasObject)
This method queries the descriptor for the IBoundsProvider
for the user object and returns the result.
canvasObject
- the canvas object to query the bounds fromnull
boundspublic final ICanvasContext getCanvasContext()
ICanvasContext
that describes the state of this CanvasControl
.IHitTestable
,
IBoundsProvider
public final ICanvasObject getCanvasObject(PointD location)
This will return the canvas object that is painted last at the given position.
location
- the coordinates of the query in the world coordinate systempublic final IEnumerable<ICanvasObject> getCanvasObjects()
ICanvasObject
instances in the tree.ICanvasObject
s in the tree.public final IEnumerable<ICanvasObject> getCanvasObjects(ICanvasObjectGroup group)
ICanvasObject
instances in the tree below the given group.ICanvasObject
s in the tree below the given group.public final IEnumerable<ICanvasObject> getCanvasObjects(PointD location)
The order of the elements in the list is the natural hit test order, i.e. elements painted on top of others will be reported first in the list.
location
- the coordinates of the query in the world coordinate systempublic final PointD getCenter()
This can be used to move the view port.
setCenter(PointD)
public final IEventRecognizer getCenterZoomEventRecognizer()
IEventRecognizer
that determines whether the zooming to the center of the view, rather than at the
mouse location should be used.
The default is IEventRecognizer.SHORTCUT_PRESSED
.
setCenterZoomEventRecognizer(IEventRecognizer)
public final int getComputedHorizontalScrollBarState()
SCROLL_BAR_ENABLED
and SCROLL_BAR_VISIBLE
.public final int getComputedVerticalScrollBarState()
SCROLL_BAR_ENABLED
and SCROLL_BAR_VISIBLE
.public final ICanvasObjectGroup getContentGroup()
The content group is the ICanvasObjectGroup
that should be used by the application code to put actual content
in.
If the field has not yet been initialized upon first access, the factory method createContentGroup()
will be
called. Upon change the onContentGroupChanged(ICanvasObjectGroup, ICanvasObjectGroup)
method will be called.
setContentGroup(ICanvasObjectGroup)
public final RectD getContentRect()
This influences the display of the scroll bars. If the content rectangle is not currently visible in the viewport, scroll bars will be displayed, unless they are turned off completely. Note that in general the content rectangle is not updated automatically but declared as a fixed rectangle. Rather the application programmer needs to set this value or call respective automatic update methods.
setContentRect(RectD)
public VisualGroup getContentVisualGroup()
public final IListEnumerable<Touch2DPoint> getCurrentTouchDevices()
Touch2DPoint
s at the time of invocation.
Note that this is not a live view, but rather a snapshot.
Touch2DPoint
instances, which may be empty.public final SizeD getDoubleClickSize()
If the mouse stays within this within than DoubleClickTime
, multiple clicks will be
considered double or multi-clicks. The default value is (10, 10)
.
getDoubleClickTime()
,
setDoubleClickSize(SizeD)
public final Duration getDoubleClickTime()
This value indicates the amount of time that may pass within which two subsequent mouse clicks are considered multi clicks. The higher the value the easier it will be to double-click. The default value is 500 milliseconds.
getDoubleClickSize()
,
setDoubleClickTime(Duration)
public final Duration getDoubleTapDuration()
This value indicates the amount of time that may pass within which two subsequent touch taps are considered multi taps. The higher the value the easier it will be to double-tap. The default value is 500 milliseconds.
getDoubleTapSize()
,
setDoubleTapDuration(Duration)
public final SizeD getDoubleTapSize()
If the touch pointer stays within this within than DoubleTapDuration
, multiple taps will
be considered double or multi-taps. The default value is (20, 20)
.
getDoubleTapDuration()
,
setDoubleTapSize(SizeD)
public final SizeD getDragSize()
DragTime
milliseconds, the movement will be considered a drag,
nevertheless.
The larger the area the later a mouse movement will be recognized as a drag. This influences the click-sensitivity,
since a mouse button release is only considered a click if there was no drag since the last mouse button press. The
default value is (5, 5)
.
getDragSize()
,
onMouse2DDragged(Mouse2DEvent)
,
onMouse2DClicked(Mouse2DEvent)
,
setDragSize(SizeD)
public final Duration getDragTime()
This value indicates the amount of time that may pass before a mouse movement is considered a drag when the mouse stays
within its DragSize
area. The higher the value the later a mouse movement will be recognized as a
drag. This influences the click-sensitivity, since a mouse button release is only considered a click if there was no
drag since the last mouse button press. The default value is 300 milliseconds.
getDragSize()
,
onMouse2DDragged(Mouse2DEvent)
,
onMouse2DClicked(Mouse2DEvent)
,
setDragTime(Duration)
public final InsetsD getFitContentViewMargins()
fitContent()
operation.
This influences the amount of visible whitespace in the view coordinate system around the ContentRect
after a fitContent()
operation. The default value is (10,10,10,10)
.
Note limits that are enforced by the ViewportLimiter
have a higher priority than these
insets.
setFitContentViewMargins(InsetsD)
public final ICanvasObjectGroup getFocusGroup()
If the field has not yet been initialized upon first access, the factory method createHighlightGroup()
will be
called. Upon change the onHighlightGroupChanged(ICanvasObjectGroup, ICanvasObjectGroup)
method will be called.
setFocusGroup(ICanvasObjectGroup)
public final ICanvasObjectGroup getHighlightGroup()
If the field has not yet been initialized upon first access, the factory method createHighlightGroup()
will be
called. Upon change the onHighlightGroupChanged(ICanvasObjectGroup, ICanvasObjectGroup)
method will be called.
setHighlightGroup(ICanvasObjectGroup)
public final double getHitTestRadius()
IHitTestable
may lie to be considered a valid hit.
This value can be queried from within the IHitTestable
implementation from the HitTestRadius
property. The default value is 3.0d
setHitTestRadius(double)
public final double getHorizontalOffset()
public ScrollPane.ScrollBarPolicy getHorizontalScrollBarPolicy()
Scrollbars don't need to be displayed in order to move the viewport. This can be achieved programmatically or using
special IInputMode instances. The default is ScrollPane.ScrollBarPolicy#AS_NEEDED
.
MoveViewportInputMode
,
getVerticalScrollBarPolicy()
,
setHorizontalScrollBarPolicy(ScrollPane.ScrollBarPolicy)
public final IInputMode getInputMode()
IInputMode
instance that shall be installed for this canvas.setInputMode(IInputMode)
public final IInputModeContext getInputModeContext()
This context object is passed to IInputMode
instances during installation
and removal.
If the field has not yet been initialized upon first access, the factory method createInputModeContext()
will
be called. Upon change the onInputModeContextChanged(IInputModeContext, IInputModeContext)
method will be
called.
setInputModeContext(IInputModeContext)
public final LookupChain getInputModeContextLookupChain()
LookupChain
that can be used do decorate the ILookup.lookup(Class)
call in the
InputModeContext
.public final ICanvasObjectGroup getInputModeGroup()
This is the canvas object group where the IInputMode
s should add their temporary content to. This group by
default is in front of the ContentGroup
.
If the field has not yet been initialized upon first access, the factory method createInputModeGroup()
will be
called. Upon change the onInputModeGroupChanged(ICanvasObjectGroup, ICanvasObjectGroup)
method will be called.
getContentGroup()
,
getBackgroundGroup()
,
setInputModeGroup(ICanvasObjectGroup)
public final double getLargeHorizontalChange()
public final double getLargeVerticalChange()
public final PointD getLastEventLocation()
Unlike LastMouse2DEvent
and LastTouch2DEvent
this will
always contain the latest location, regardless of what input method generated it.
getLastMouse2DEvent()
,
getLastTouch2DEvent()
public final Mouse2DEvent getLastMouse2DEvent()
mouse event
triggered by this instance.public final Touch2DEvent getLastTouch2DEvent()
touch event
triggered by this instance.onTouch2DEntered(Touch2DEvent)
,
onTouch2DMoved(Touch2DEvent)
,
onTouch2DExited(Touch2DEvent)
,
onTouch2DDown(Touch2DEvent)
,
onTouch2DUp(Touch2DEvent)
,
onTouch2DLongPress(Touch2DEvent)
,
onTouch2DTapped(Touch2DEvent)
public final Duration getLongPressDuration()
This value indicates the amount of time that may pass before a touch down is considered a long press when the pointer
stays within its DragSize
area. The higher the value the later a touch pointer movement will be
recognized as a long press. The default value is 1000 milliseconds.
getDragSize()
,
onTouch2DDown(Touch2DEvent)
,
onTouch2DMoved(Touch2DEvent)
,
onTouch2DLongPress(Touch2DEvent)
,
setLongPressDuration(Duration)
public final double getMaximumHorizontalOffset()
public final double getMaximumVerticalOffset()
public final double getMaximumZoom()
Zoom
.
Default value is 1000d
setMaximumZoom(double)
public final double getMinimumHorizontalOffset()
public final double getMinimumVerticalOffset()
public final double getMinimumZoom()
This property sets a lower bound for the allowed values of the Zoom
property. If this property is
written, the canvas will zoom to the new value while keeping the center of view at the same world coordinates. The
default is 0.01d
but values as small as 0.0000001d are possible.
getZoom()
,
getMaximumZoom()
,
setMinimumZoom(double)
public final MouseWheelBehaviors getMouseWheelBehavior()
MouseWheelBehaviors.ZOOM
, MouseWheelBehaviors.SCROLL
and MouseWheelBehaviors.NONE
. Additionally, this property can be configured to perform the action
only when the control is focused
.setMouseWheelBehavior(MouseWheelBehaviors)
public final double getMouseWheelScrollFactor()
Scrolling can work either a few lines at a time (per notch of the scroll wheel) or one page at a time. This is a system setting. This property controls how many pixels represent a line if scrolling is done by line. In case scrolling is done by page, this property has no effect.
The default value of 5 pixels. To speed up scrolling, set a larger value, to slow down scrolling, set a smaller value.
getMouseWheelZoomFactor()
,
getMouseWheelBehavior()
,
Mouse2DEvent.getScrollAmount()
,
Mouse2DEvent.getScrollType()
,
setMouseWheelScrollFactor(double)
public final double getMouseWheelZoomFactor()
setMouseWheelZoomFactor(double)
public final EventHandler<? super CompoundKeyEvent> getOnCompoundKeyPressed()
public final EventHandler<? super CompoundKeyEvent> getOnCompoundKeyReleased()
public final EventHandler<? super CompoundKeyEvent> getOnCompoundKeyTyped()
public final EventHandler<? super Mouse2DEvent> getOnMouse2DClicked()
public final EventHandler<? super Mouse2DEvent> getOnMouse2DDragged()
public final EventHandler<? super Mouse2DEvent> getOnMouse2DEntered()
public final EventHandler<? super Mouse2DEvent> getOnMouse2DExited()
public final EventHandler<? super Mouse2DEvent> getOnMouse2DMoved()
public final EventHandler<? super Mouse2DEvent> getOnMouse2DPressed()
public final EventHandler<? super Mouse2DEvent> getOnMouse2DReleased()
public final EventHandler<? super Mouse2DEvent> getOnMouse2DWheelTurned()
public final ICanvasObjectGroup getRootGroup()
This group cannot be removed
.
public final ICanvasObjectGroup getSelectionGroup()
The selection group is the ICanvasObjectGroup
that should be used by the application code to put the selection
paintables in.
If the field has not yet been initialized upon first access, the factory method createSelectionGroup()
will be
called. Upon change the onSelectionGroupChanged(ICanvasObjectGroup, ICanvasObjectGroup)
method will be called.
setSelectionGroup(ICanvasObjectGroup)
public SizeD getSize()
CanvasControl
.Region.getWidth()
,
Region.getHeight()
public final double getSmallHorizontalChange()
ScrollBar.increment()
or ScrollBar.decrement()
.public final double getSmallVerticalChange()
ScrollBar.increment()
or ScrollBar.decrement()
.public final double getVerticalOffset()
public ScrollPane.ScrollBarPolicy getVerticalScrollBarPolicy()
Scrollbars don't need to be displayed in order to move the viewport. This can be achieved programmatically or using
special IInputMode instances. The default is ScrollPane.ScrollBarPolicy#AS_NEEDED
.
MoveViewportInputMode
,
getHorizontalScrollBarPolicy()
,
setVerticalScrollBarPolicy(ScrollPane.ScrollBarPolicy)
public final PointD getViewPoint()
The view point is the point in world coordinates that is mapped to the top left corner point in the current viewport. Setting this point to another value will redispatch the last mouse event as the mouse will appear to have been moved or dragged in the world coordinate system.
setViewPoint(PointD)
public final RectD getViewport()
getViewPoint()
,
getZoom()
public final double getViewportHeight()
public final ViewportLimiter getViewportLimiter()
ViewportLimiter
instance that can be used to limit the explorable region.
By default there are no limits set on the explorable region.
setViewportLimiter(ViewportLimiter)
public final double getViewportWidth()
public final Node getVisual(ICanvasObject canvasObject)
Node
that is currently visualizing the given ICanvasObject
.
Note that depending on the current state of the viewport and the control no such instance may be available and instead
this method will yield null
. However if a visual is currently being displayed for the given canvas object, it
will be returned. This method should be used with care. Manipulation of the given instance should normally be done
through the corresponding IVisualCreator
that created the visual in the first place. This method rather serves
as a utility method for UI testing frameworks and similar use cases.
canvasObject
- The canvas object.Node
that is currently used by the canvasObject
.public final VisualCachingPolicy getVisualCaching()
Node
s which are temporarily removed from the visual tree.
Visuals are temporarily removed when they are moved outside the visual part of the canvas (the
Viewport
) and re-added when they enter the Viewport
again. Caching
prevents the need to re-build the visuals from scratch.
Visuals are only cached if this property is set to another value than VisualCachingPolicy.NEVER
and if a IDisposeVisualCallback
is registered
during
creation
.
setVisualCaching(VisualCachingPolicy)
public final IVisualCreator getVisualCreator(ICanvasObject canvasObject)
IVisualCreator
for a given ICanvasObject
.canvasObject
- the canvas object to query the visual creator implementation fromICanvasObjectDescriptor.getVisualCreator(Object)
,
VoidVisualCreator.INSTANCE
public final double getZoom()
CanvasControl
.
A zoom level of 1.0f
will make each unit in world-coordinate space appear exactly one unit in screen coordinates
wide. The default is
1.0f
. If this property is written, the canvas will zoom to the new value while keeping the center of view at
the same world coordinates.
The valid range is bounded by MinimumZoom
and MaximumZoom
zoomProperty()
,
getMinimumZoom()
,
getMaximumZoom()
,
setZoom(double)
public final Duration getZoomAnimationDuration()
isZoomAnimationEnabled()
is set to true
, this property specifies how long this animation takes.0.15
seconds.isZoomAnimationEnabled()
,
setZoomAnimationDuration(Duration)
public final void growContentRect(RectD rectangle)
content rectangle
encompasses the given rectangle.
Note that this will not change the view port, it will only change the scroll bars if necessary.
rectangle
- the rectangle that should be included in the content rectanglepublic final IEnumerable<ICanvasObject> hitElementsAt(IInputModeContext context, PointD location)
ICanvasContext
as the argument to the IHitTestable.isHit(IInputModeContext, PointD)
method.
Hit testing is performed using the ICanvasObjectDescriptor.getHitTestable(Object)
instance returned for each visible ICanvasObject
in the current scene graph. The enumeration is performed
lazily.
context
- The context instance to pass to IHitTestable.isHit(IInputModeContext, PointD)
.location
- the coordinates to perform the hit test atIHitTestable
public final IEnumerable<ICanvasObject> hitElementsAt(IInputModeContext context, PointD location, ICanvasObjectGroup root)
ICanvasContext
as the argument to the IHitTestable.isHit(IInputModeContext, PointD)
method.
Hit testing is performed using the ICanvasObjectDescriptor.getHitTestable(Object)
instance returned for each visible ICanvasObject
in the current scene graph. The enumeration is performed
lazily.
context
- The context instance to pass to IHitTestable.isHit(IInputModeContext, PointD)
.location
- the coordinates to perform the hit test atroot
- the root of the scene graph to useIHitTestable
public final IEnumerable<ICanvasObject> hitElementsAt(IInputModeContext context, PointD location, ICanvasObjectGroup root, Predicate<ICanvasObject> filter)
ICanvasContext
as the argument to the IHitTestable.isHit(IInputModeContext, PointD)
method.
Hit testing is performed using the ICanvasObjectDescriptor.getHitTestable(Object)
instance returned for each visible ICanvasObject
in the current scene graph. The enumeration is performed
lazily.
context
- The context instance to pass to IHitTestable.isHit(IInputModeContext, PointD)
.location
- the coordinates to perform the hit test atroot
- the root of the scene graph to usefilter
- The predicate that decides whether a given canvas object should be considered for testing at all or null
.IHitTestable
public final IEnumerable<ICanvasObject> hitElementsAt(PointD location)
Hit testing is performed using the ICanvasObjectDescriptor.getHitTestable(Object)
instance returned for each visible ICanvasObject
in the current scene graph. The enumeration is performed
lazily.
location
- the coordinates to perform the hit test atIHitTestable
,
getHitTestRadius()
public final IEnumerable<ICanvasObject> hitElementsAt(PointD location, ICanvasObjectGroup root)
Hit testing is performed using the ICanvasObjectDescriptor.getHitTestable(Object)
instance returned for each visible ICanvasObject
in the current scene graph. The enumeration is performed
lazily.
location
- the coordinates to perform the hit test atroot
- the root of the scene graph to useIHitTestable
,
getHitTestRadius()
public final IEnumerable<ICanvasObject> hitElementsAt(PointD location, ICanvasObjectGroup root, Predicate<ICanvasObject> filter)
Hit testing is performed using the ICanvasObjectDescriptor.getHitTestable(Object)
instance returned for each visible ICanvasObject
in the current scene graph. The enumeration is performed
lazily.
location
- the coordinates to perform the hit test atroot
- the root of the scene graph to usefilter
- The predicate that decides whether a given canvas object should be considered for testing at all or null
.IHitTestable
,
getHitTestRadius()
public final DoubleProperty hitTestRadiusProperty()
radius of the area around the mouse in view coordinates
in which a IHitTestable
may lie to be considered a valid hit.public final DoubleProperty horizontalOffsetProperty()
DoubleProperty
that holds the current value of the horizontal scroll bar.public final ObjectProperty<ScrollPane.ScrollBarPolicy> horizontalScrollBarPolicyProperty()
ObjectProperty
that holds the visibility policy for the horizontal scroll bar.
Scroll bars don't need to be displayed in order to move the viewport. This can be achieved programmatically or
using special IInputMode instances.
The default is ScrollPane.ScrollBarPolicy#AS_NEEDED
.MoveViewportInputMode
,
getHorizontalScrollBarPolicy()
,
ScrollPane.ScrollBarPolicy#ALWAYS
,
ScrollPane.ScrollBarPolicy#AS_NEEDED
,
ScrollPane.ScrollBarPolicy#NEVER
protected Object inputModeContextLookup(Class type)
InputModeContext
to resolve ILookup.lookup(Class)
calls.type
- The Type to queryIInputModeContext
public final ObjectProperty<IInputMode> inputModeProperty()
the single input mode instance that is installed in this canvas
.public final void invalidate()
public final boolean isAllKeyboardInputCapturingEnabled()
true
if keyboard input should be captured exclusively by this control; false
otherwise.isAllPointerInputCapturingEnabled()
,
setAllKeyboardInputCapturingEnabled(boolean)
public final boolean isAllPointerInputCapturingEnabled()
true
if mouse or touch input should be captured exclusively by this control; false
otherwise.isAllKeyboardInputCapturingEnabled()
,
setAllPointerInputCapturingEnabled(boolean)
public final boolean isAutoDragEnabled()
setAutoDragEnabled(boolean)
public final boolean isDeviceDown()
touch device
that is down on the screen.public boolean isEditable()
IInputMode
implementations should honor this property. Events will still be delivered to the IInputModes,
however they should not modify the model.
setEditable(boolean)
public final boolean isHit(ICanvasObject canvasObject, PointD location)
This method queries the descriptor for the IHitTestable
for the user object and
returns the result of the hit test query. If there is no IHitTestable
returned by the descriptor this method
returns false
.
canvasObject
- the canvas object to query the bounds fromlocation
- the coordinates of the query in the world coordinate systempublic final boolean isKeyboardFocusWithin()
true
if keyboard focus is within the subtree; otherwise, false
.public boolean isMouseEventConsumingDisabled()
mouseEventConsumingDisabledProperty()
public final boolean isNavigationCommandsEnabled()
By default this feature is enabled.
This property enables/disables the following commands:
true
if the commands are enabled; otherwise, false
.setNavigationCommandsEnabled(boolean)
public final boolean isScrollCommandAnimationEnabled()
ICommand
s for scrolling like for example
ICommand.SCROLL_PAGE_DOWN
, the scrolling should be performed in animated fashion.true
if scrolling should be animated; false
otherwise. The default is true
.setScrollCommandAnimationEnabled(boolean)
public final boolean isZoomAnimationEnabled()
ICommand.ZOOM
etc.) should be performed in animated fashion.true
if zooming should be animated; otherwise, false
. The default is false
.setZoomAnimationEnabled(boolean)
public final ReadOnlyDoubleProperty largeHorizontalChangeProperty()
DoubleProperty
that holds the change of the horizontal scroll bar when the track of the bar is
clicked.public final ReadOnlyDoubleProperty largeVerticalChangeProperty()
DoubleProperty
that holds the change of the vertical scroll bar when the track of the bar is
clicked.protected void layoutChildren()
layoutChildren
in class Control
public final ObjectProperty<Duration> longPressDurationProperty()
long press time
that indicates the amount of time that may pass before a touch down is considered a
long press when the pointer stays within its getDragSize()
area.public <TLookup> TLookup lookup(Class<TLookup> type)
ILookup
null
.
Typically, this method will be called in order to obtain a different view or
aspect of the current instance. This is quite similar to casting or using
a super type or interface of this instance, but is not limited to inheritance or
compile time constraints. An instance implementing this method is not
required to return non-null
implementations for the types, nor does it
have to return the same instance any time. Also it depends on the
type and context whether the instance returned stays up to date or needs to
be reobtained for subsequent use.public void makeVisible(RectD bounds)
bounds
- The bounds to make visible.public final ReadOnlyDoubleProperty maximumHorizontalOffsetProperty()
DoubleProperty
that holds the the maximum value for the vertical scroll bar.public final ReadOnlyDoubleProperty maximumVerticalOffsetProperty()
DoubleProperty
that holds the maximum value for the vertical scroll bar.public final DoubleProperty maximumZoomProperty()
DoubleProperty
that holds the maximum zoom level that is valid for this canvas control.
This property sets an upper bound for the allowed values of the
getZoom()
. Default value is 1000d
.getZoom()
,
getMinimumZoom()
public final ReadOnlyDoubleProperty minimumHorizontalOffsetProperty()
DoubleProperty
that holds the minimum value for the horizontal scroll bar.public final ReadOnlyDoubleProperty minimumVerticalOffsetProperty()
DoubleProperty
that holds the minimum value for the vertical scroll bar.public final DoubleProperty minimumZoomProperty()
DoubleProperty
that holds the minimum the minimum zoom level for this canvas control.
This property sets a lower bound for the allowed values of the
getZoom()
property. If this property is written, the canvas will
zoom to the new value while keeping the center of view at the same world coordinates.
The default is 0.01d
but values as small as 0.0000001d are possible.getZoom()
,
getMaximumZoom()
public final BooleanProperty mouseEventConsumingDisabledProperty()
Per default, this property is set to false
.
public final ObjectProperty<MouseWheelBehaviors> mouseWheelBehaviorProperty()
behavior of the mouse wheel
.protected void mouseWheelScroll(Mouse2DEvent e)
onMouse2DWheelTurned(Mouse2DEvent)
method, if the MouseWheelBehavior
property is set to MouseWheelBehaviors.SCROLL
.
This method will scroll the view in vertical direction. If the Shift key modifier has been pressed this method will scroll in horizontal direction.
e
- the event describing the actiononMouse2DWheelTurned(Mouse2DEvent)
,
getMouseWheelBehavior()
,
getMouseWheelScrollFactor()
public final DoubleProperty mouseWheelScrollFactorProperty()
factor
that controls how fast the viewport scrolls when the mouse wheel is turned.protected void mouseWheelZoom(Mouse2DEvent e)
onMouse2DWheelTurned(Mouse2DEvent)
method, if the MouseWheelBehavior
property is set to MouseWheelBehaviors.ZOOM
.
This method will adjust the current zoom level. If the Control key modifier has been pressed this method will keep the world coordinates at the current mouse position, i.e. the zoom will not necessarily be into the center of the canvas.
e
- the event describing the actiononMouse2DWheelTurned(Mouse2DEvent)
,
getMouseWheelBehavior()
public final DoubleProperty mouseWheelZoomFactorProperty()
factor
by which the zoom level changes when the mouse wheel is turned.public final BooleanProperty navigationCommandsEnabledProperty()
value
indicating whether navigation related command bindings are enabled.public final ObjectProperty<EventHandler<? super CompoundKeyEvent>> onCompoundKeyPressedProperty()
pressed
a key on the CanvasControl
.
This event delivers CompoundKeyEvent
.
public final ObjectProperty<EventHandler<? super CompoundKeyEvent>> onCompoundKeyReleasedProperty()
released
a key on the CanvasControl
.
This event delivers CompoundKeyEvent
.
public final ObjectProperty<EventHandler<? super CompoundKeyEvent>> onCompoundKeyTypedProperty()
typed
a key on the CanvasControl
.
This event delivers CompoundKeyEvent
.
protected void onKeyDown(KeyEvent event)
ModifierKeys
and redispatch the last mouse event.event
- the event argumentprotected void onKeyPress(KeyEvent event)
event
- the event argumentprotected void onKeyUp(KeyEvent event)
ModifierKeys
and redispatch the last mouse event.event
- the event argumentprotected void onMouse2DClicked(Mouse2DEvent e)
onMouse2DReleased(Mouse2DEvent)
method has been invoked and only if the mouse has not been moved by a great amount since the last onMouse2DPressed(Mouse2DEvent)
event. This method will redispatch the event. Subclasses
overriding this method should make sure to invoke the super class implementation. Mouse 2D Events
use the world coordinate system rather than the view-coordinate system of the control itself.e
- the mouse event describing the actiononMouse2DEntered(Mouse2DEvent)
,
onMouse2DMoved(Mouse2DEvent)
,
onMouse2DExited(Mouse2DEvent)
,
onMouse2DPressed(Mouse2DEvent)
,
onMouse2DReleased(Mouse2DEvent)
,
onMouse2DDragged(Mouse2DEvent)
,
onMouse2DWheelTurned(Mouse2DEvent)
public final ObjectProperty<EventHandler<? super Mouse2DEvent>> onMouse2DClickedProperty()
clicked
on the CanvasControl
with the mouse. This happens if press and release happens at the same position.
An Mouse2DEvent
in world coordinates using double precision floating points is
delivered to the function.
protected void onMouse2DDragged(Mouse2DEvent e)
Mouse 2D Events
use the world coordinate system rather than the view-coordinate system of the control itself.e
- the mouse event describing the actiononMouse2DEntered(Mouse2DEvent)
,
onMouse2DMoved(Mouse2DEvent)
,
onMouse2DExited(Mouse2DEvent)
,
onMouse2DPressed(Mouse2DEvent)
,
onMouse2DReleased(Mouse2DEvent)
,
onMouse2DClicked(Mouse2DEvent)
,
onMouse2DWheelTurned(Mouse2DEvent)
public final ObjectProperty<EventHandler<? super Mouse2DEvent>> onMouse2DDraggedProperty()
dragged
over the
CanvasControl
, i.e. the mouse is being moved while at least one of the mouse buttons is pressed.
An Mouse2DEvent
in world coordinates using double precision floating points is
delivered to the function.
protected void onMouse2DEntered(Mouse2DEvent e)
Mouse 2D Events
use the world coordinate system rather than the view-coordinate system of the control itself.e
- the mouse event describing the actiononMouse2DMoved(Mouse2DEvent)
,
onMouse2DExited(Mouse2DEvent)
,
onMouse2DPressed(Mouse2DEvent)
,
onMouse2DReleased(Mouse2DEvent)
,
onMouse2DDragged(Mouse2DEvent)
,
onMouse2DClicked(Mouse2DEvent)
,
onMouse2DWheelTurned(Mouse2DEvent)
public final ObjectProperty<EventHandler<? super Mouse2DEvent>> onMouse2DEnteredProperty()
entered
the CanvasControl
.
An Mouse2DEvent
in world coordinates using double precision floating points is
delivered to the function.
protected void onMouse2DExited(Mouse2DEvent e)
Mouse 2D Events
use the world coordinate system rather than the view-coordinate system of the control itself.e
- the mouse event describing the actiononMouse2DEntered(Mouse2DEvent)
,
onMouse2DMoved(Mouse2DEvent)
,
onMouse2DExited(Mouse2DEvent)
,
onMouse2DPressed(Mouse2DEvent)
,
onMouse2DReleased(Mouse2DEvent)
,
onMouse2DDragged(Mouse2DEvent)
,
onMouse2DClicked(Mouse2DEvent)
,
onMouse2DWheelTurned(Mouse2DEvent)
public final ObjectProperty<EventHandler<? super Mouse2DEvent>> onMouse2DExitedProperty()
exited
the CanvasControl
.
An Mouse2DEvent
in world coordinates using double precision floating points is
delivered to the function.
protected void onMouse2DMoved(Mouse2DEvent e)
onMouse2DDragged(Mouse2DEvent)
method would have been called. This method will redispatch the
event. Subclasses overriding this method should make sure to invoke the super class implementation. Mouse 2D Events
use the world coordinate system rather than the view-coordinate system of the control itself.e
- the mouse event describing the actiononMouse2DEntered(Mouse2DEvent)
,
onMouse2DExited(Mouse2DEvent)
,
onMouse2DPressed(Mouse2DEvent)
,
onMouse2DReleased(Mouse2DEvent)
,
onMouse2DDragged(Mouse2DEvent)
,
onMouse2DClicked(Mouse2DEvent)
,
onMouse2DWheelTurned(Mouse2DEvent)
public final ObjectProperty<EventHandler<? super Mouse2DEvent>> onMouse2DMovedProperty()
moved
in the CanvasControl
.
An Mouse2DEvent
in world coordinates using double precision floating points is
delivered to the function.
Move events are delivered if no mouse button is pressed.
This event will be fired, too, if the mouse does not
move but the world coordinates to which the current mouse position maps
change. E.g. this will happen if the zoom level or the view point is changed.
protected void onMouse2DPressed(Mouse2DEvent e)
Mouse 2D Events
use the world coordinate system rather than the view-coordinate system of the control itself.e
- the mouse event describing the actiononMouse2DEntered(Mouse2DEvent)
,
onMouse2DExited(Mouse2DEvent)
,
onMouse2DReleased(Mouse2DEvent)
,
onMouse2DDragged(Mouse2DEvent)
,
onMouse2DMoved(Mouse2DEvent)
,
onMouse2DClicked(Mouse2DEvent)
,
onMouse2DWheelTurned(Mouse2DEvent)
public final ObjectProperty<EventHandler<? super Mouse2DEvent>> onMouse2DPressedProperty()
pressed
in the CanvasControl
.
An Mouse2DEvent
in world coordinates using double precision floating points is
delivered to the function.
protected void onMouse2DReleased(Mouse2DEvent e)
Mouse 2D Events
use the world coordinate system rather than the view-coordinate system of the control itself.e
- the mouse event describing the actiononMouse2DEntered(Mouse2DEvent)
,
onMouse2DMoved(Mouse2DEvent)
,
onMouse2DExited(Mouse2DEvent)
,
onMouse2DPressed(Mouse2DEvent)
,
onMouse2DDragged(Mouse2DEvent)
,
onMouse2DClicked(Mouse2DEvent)
,
onMouse2DWheelTurned(Mouse2DEvent)
public final ObjectProperty<EventHandler<? super Mouse2DEvent>> onMouse2DReleasedProperty()
released
on the CanvasControl
.
An Mouse2DEvent
in world coordinates using double precision floating points is
delivered to the function.
protected void onMouse2DWheelTurned(Mouse2DEvent e)
mouseWheelZoom(Mouse2DEvent)
or mouseWheelScroll(Mouse2DEvent)
methods, if the corresponding
behavior
is enabled. Mouse 2D Events
use the world coordinate
system rather than the view-coordinate system of the control itself.
In order to customize the mouse wheel behavior, set the behavior
to
None
. Register to the ScrollEvent
and execute the custom action.
e
- the mouse event describing the actiononMouse2DEntered(Mouse2DEvent)
,
onMouse2DExited(Mouse2DEvent)
,
onMouse2DPressed(Mouse2DEvent)
,
onMouse2DMoved(Mouse2DEvent)
,
onMouse2DDragged(Mouse2DEvent)
,
onMouse2DReleased(Mouse2DEvent)
,
onMouse2DClicked(Mouse2DEvent)
public final ObjectProperty<EventHandler<? super Mouse2DEvent>> onMouse2DWheelTurnedProperty()
turned
over the CanvasControl
.
An Mouse2DEvent
in world coordinates using double precision floating points is
delivered to the function.
protected void onPrepareRenderContextEvent(RenderContextEvent args)
RenderContextEvent.PREPARE
event.args
- The event to raise.protected final void onSizeChanged(IEventArgs args)
CanvasControl
.
This implementation adjusts the scrollbars and update the viewport.
protected void onTouch2DDown(Touch2DEvent e)
Touch 2D Events
use the world coordinate system rather than the view-coordinate system of the control itself.e
- the touch event describing the actiononTouch2DUp(Touch2DEvent)
,
onTouch2DEntered(Touch2DEvent)
,
onTouch2DExited(Touch2DEvent)
,
onTouch2DLongPress(Touch2DEvent)
,
onTouch2DMoved(Touch2DEvent)
,
onTouch2DTapped(Touch2DEvent)
,
onTouch2DLostCapture(Touch2DEvent)
protected void onTouch2DEntered(Touch2DEvent e)
Touch 2D Events
use the world coordinate system rather than the view-coordinate system of the control itself.e
- the touch event describing the actiononTouch2DDown(Touch2DEvent)
,
onTouch2DUp(Touch2DEvent)
,
onTouch2DExited(Touch2DEvent)
,
onTouch2DLongPress(Touch2DEvent)
,
onTouch2DMoved(Touch2DEvent)
,
onTouch2DTapped(Touch2DEvent)
,
onTouch2DLostCapture(Touch2DEvent)
protected void onTouch2DExited(Touch2DEvent e)
Touch 2D Events
use the world coordinate system rather than the view-coordinate system of the control itself.e
- the touch event describing the actiononTouch2DDown(Touch2DEvent)
,
onTouch2DUp(Touch2DEvent)
,
onTouch2DEntered(Touch2DEvent)
,
onTouch2DLongPress(Touch2DEvent)
,
onTouch2DMoved(Touch2DEvent)
,
onTouch2DTapped(Touch2DEvent)
,
onTouch2DLostCapture(Touch2DEvent)
protected void onTouch2DLongPress(Touch2DEvent e)
onTouch2DDown(Touch2DEvent)
method has been invoked after a specified amount
of time
and only if the finger has not been moved by a great amount. This method will
redispatch the event. Subclasses overriding this
method should make sure to invoke the super class implementation. Touch 2D Events
use the world
coordinate system rather than the view-coordinate system of the control itself.e
- the touch event describing the actiononTouch2DDown(Touch2DEvent)
,
onTouch2DUp(Touch2DEvent)
,
onTouch2DEntered(Touch2DEvent)
,
onTouch2DExited(Touch2DEvent)
,
onTouch2DMoved(Touch2DEvent)
,
onTouch2DTapped(Touch2DEvent)
,
onTouch2DLostCapture(Touch2DEvent)
,
getLongPressDuration()
protected void onTouch2DLostCapture(Touch2DEvent e)
Touch 2D Events
use the world coordinate system rather than the view-coordinate system of the control itself.e
- the touch event describing the actiononTouch2DDown(Touch2DEvent)
,
onTouch2DUp(Touch2DEvent)
,
onTouch2DEntered(Touch2DEvent)
,
onTouch2DExited(Touch2DEvent)
,
onTouch2DLongPress(Touch2DEvent)
,
onTouch2DMoved(Touch2DEvent)
,
onTouch2DTapped(Touch2DEvent)
protected void onTouch2DMoved(Touch2DEvent e)
Touch 2D Events
use the world coordinate system rather than the view-coordinate system of the control itself.e
- the touch event describing the actiononTouch2DDown(Touch2DEvent)
,
onTouch2DUp(Touch2DEvent)
,
onTouch2DEntered(Touch2DEvent)
,
onTouch2DExited(Touch2DEvent)
,
onTouch2DLongPress(Touch2DEvent)
,
onTouch2DTapped(Touch2DEvent)
,
onTouch2DLostCapture(Touch2DEvent)
protected void onTouch2DTapped(Touch2DEvent e)
onTouch2DUp(Touch2DEvent)
method has been invoked and only if the finger has not been
moved by a great amount since the last onTouch2DDown(Touch2DEvent)
event. This method will redispatch the
event. Subclasses overriding this method should make sure to invoke the super class implementation. Touch 2D Events
use the world coordinate system rather than the view-coordinate system of the control itself.e
- the touch event describing the actiononTouch2DDown(Touch2DEvent)
,
onTouch2DUp(Touch2DEvent)
,
onTouch2DEntered(Touch2DEvent)
,
onTouch2DExited(Touch2DEvent)
,
onTouch2DLongPress(Touch2DEvent)
,
onTouch2DMoved(Touch2DEvent)
,
onTouch2DLostCapture(Touch2DEvent)
protected void onTouch2DUp(Touch2DEvent e)
Touch 2D Events
use the world coordinate system
rather than the view-coordinate system of the control itself.e
- the touch event describing the actiononTouch2DDown(Touch2DEvent)
,
onTouch2DEntered(Touch2DEvent)
,
onTouch2DExited(Touch2DEvent)
,
onTouch2DLongPress(Touch2DEvent)
,
onTouch2DMoved(Touch2DEvent)
,
onTouch2DTapped(Touch2DEvent)
,
onTouch2DLostCapture(Touch2DEvent)
protected void onTouchDown(TouchEvent e)
protected void onTouchEnter(TouchEvent e)
protected void onTouchLeave(TouchEvent e)
protected void onTouchMove(TouchEvent e)
protected void onTouchUp(TouchEvent e)
protected void raiseUpdatedEvent()
CanvasEvent
of type CanvasEvent.UPDATED
.protected void raiseUpdatingEvent()
CanvasEvent.UPDATING
event.protected void redispatchMouse2DEvent(ModifierKeys newModifiers)
This is needed to supply IInputMode
implementations with the necessary events even if the mouse has not actually
been moved.
public final void removeBackgroundGroupChangedListener(IEventHandler backgroundGroupChangedEvent)
BackgroundGroupChanged
event that occurs when the BackgroundGroup
property has been changed.backgroundGroupChangedEvent
- The listener to remove.addBackgroundGroupChangedListener(IEventHandler)
public final void removeContentGroupChangedListener(IEventHandler contentGroupChangedEvent)
ContentGroupChanged
event that occurs when the ContentGroup
property has been changed.contentGroupChangedEvent
- The listener to remove.addContentGroupChangedListener(IEventHandler)
public final void removeFocusGroupChangedListener(IEventHandler focusGroupChangedEvent)
FocusGroupChanged
event that occurs when the FocusGroup
property has been changed.focusGroupChangedEvent
- The listener to remove.addFocusGroupChangedListener(IEventHandler)
public final void removeHighlightGroupChangedListener(IEventHandler highlightGroupChangedEvent)
HighlightGroupChanged
event that occurs when the HighlightGroup
property has been changed.highlightGroupChangedEvent
- The listener to remove.addHighlightGroupChangedListener(IEventHandler)
public final void removeInputModeContextChangedListener(IEventHandler<PropertyChangedEventArgs> inputModeContextChangedEvent)
InputModeContextChanged
event that occurs when the InputModeContext
property has been changed.inputModeContextChangedEvent
- The listener to remove.addInputModeContextChangedListener(IEventHandler)
public final void removeInputModeGroupChangedListener(IEventHandler inputModeGroupChangedEvent)
InputModeGroupChanged
event that occurs when the InputModeGroup
property has been changed.inputModeGroupChangedEvent
- The listener to remove.addInputModeGroupChangedListener(IEventHandler)
public final void removeSelectionGroupChangedListener(IEventHandler selectionGroupChangedEvent)
SelectionGroupChanged
event that occurs when the SelectionGroup
property has been changed.selectionGroupChangedEvent
- The listener to remove.addSelectionGroupChangedListener(IEventHandler)
public final BooleanProperty scrollCommandAnimationEnabledProperty()
value that indicates if scrolling should be animated
.public final void setAllKeyboardInputCapturingEnabled(boolean value)
value
- true
if keyboard input should be captured exclusively by this control; false
otherwise.isAllPointerInputCapturingEnabled()
,
isAllKeyboardInputCapturingEnabled()
public final void setAllPointerInputCapturingEnabled(boolean value)
value
- true
if mouse or touch input should be captured exclusively by this control; false
otherwise.isAllKeyboardInputCapturingEnabled()
,
isAllPointerInputCapturingEnabled()
public final void setAutoDragEnabled(boolean value)
value
- The AutoDragEnabled to set.isAutoDragEnabled()
public final void setAutoDragInsets(InsetsD value)
If the mouse is being dragged within the insets of the control specified using this property, the control will automatically scroll.
value
- The new auto drag insets.isAutoDragEnabled()
,
getAutoDragInsets()
public final void setBackgroundGroup(ICanvasObjectGroup value)
The background group is the ICanvasObjectGroup
that should be used by the application code to put background
elements in.
If the field has not yet been initialized upon first access, the factory method createBackgroundGroup()
will be
called. Upon change the onBackgroundGroupChanged(ICanvasObjectGroup, ICanvasObjectGroup)
method will be
called.
value
- The BackgroundGroup to set.getContentGroup()
,
getBackgroundGroup()
public final void setCenter(PointD value)
This can be used to move the view port.
value
- The Center to set.getCenter()
public final void setCenterZoomEventRecognizer(IEventRecognizer value)
IEventRecognizer
that determines whether the zooming to the center of the view, rather than at the
mouse location should be used.
The default is IEventRecognizer.SHORTCUT_PRESSED
.
value
- The CenterZoomEventRecognizer to set.getCenterZoomEventRecognizer()
public final void setContentGroup(ICanvasObjectGroup value)
The content group is the ICanvasObjectGroup
that should be used by the application code to put actual content
in.
If the field has not yet been initialized upon first access, the factory method createContentGroup()
will be
called. Upon change the onContentGroupChanged(ICanvasObjectGroup, ICanvasObjectGroup)
method will be called.
value
- The ContentGroup to set.getContentGroup()
public final void setContentRect(double x, double y, double w, double h)
The content rectangle is the space in world coordinates that the user should at least be able to scroll to. I.e. if the area currently visible in the control does not encompass the content rect, the scrollbars will be made visible, unless they are disabled.
public final void setContentRect(RectD value)
This influences the display of the scroll bars. If the content rectangle is not currently visible in the viewport, scroll bars will be displayed, unless they are turned off completely. Note that in general the content rectangle is not updated automatically but declared as a fixed rectangle. Rather the application programmer needs to set this value or call respective automatic update methods.
value
- The ContentRect to set.getContentRect()
public final void setDoubleClickSize(SizeD value)
If the mouse stays within this within than DoubleClickTime
, multiple clicks will be
considered double or multi-clicks. The default value is (10, 10)
.
value
- The DoubleClickSize to set.getDoubleClickTime()
,
getDoubleClickSize()
public final void setDoubleClickTime(Duration value)
This value indicates the amount of time that may pass within which two subsequent mouse clicks are considered multi clicks. The higher the value the easier it will be to double-click. The default value is 500 milliseconds.
value
- The DoubleClickTime to set.getDoubleClickSize()
,
getDoubleClickTime()
public final void setDoubleTapDuration(Duration value)
This value indicates the amount of time that may pass within which two subsequent touch taps are considered multi taps. The higher the value the easier it will be to double-tap. The default value is 500 milliseconds.
value
- The DoubleTapDuration to set.getDoubleTapSize()
,
getDoubleTapDuration()
public final void setDoubleTapSize(SizeD value)
If the touch pointer stays within this within than DoubleTapDuration
, multiple taps will
be considered double or multi-taps. The default value is (20, 20)
.
value
- The DoubleTapSize to set.getDoubleTapDuration()
,
getDoubleTapSize()
public final void setDragSize(SizeD value)
DragTime
milliseconds, the movement will be considered a drag,
nevertheless.
The larger the area the later a mouse movement will be recognized as a drag. This influences the click-sensitivity,
since a mouse button release is only considered a click if there was no drag since the last mouse button press. The
default value is (5, 5)
.
value
- The DragSize to set.getDragSize()
,
onMouse2DDragged(Mouse2DEvent)
,
onMouse2DClicked(Mouse2DEvent)
,
getDragSize()
public final void setDragTime(Duration value)
This value indicates the amount of time that may pass before a mouse movement is considered a drag when the mouse stays
within its DragSize
area. The higher the value the later a mouse movement will be recognized as a
drag. This influences the click-sensitivity, since a mouse button release is only considered a click if there was no
drag since the last mouse button press. The default value is 300 milliseconds.
value
- The DragTime to set.getDragSize()
,
onMouse2DDragged(Mouse2DEvent)
,
onMouse2DClicked(Mouse2DEvent)
,
getDragTime()
public void setEditable(boolean value)
IInputMode
implementations should honor this property. Events will still be delivered to the IInputModes,
however they should not modify the model.
value
- The Editable to set.isEditable()
public final void setFitContentViewMargins(InsetsD value)
fitContent()
operation.
This influences the amount of visible whitespace in the view coordinate system around the ContentRect
after a fitContent()
operation. The default value is (10,10,10,10)
.
Note limits that are enforced by the ViewportLimiter
have a higher priority than these
insets.
value
- The FitContentViewMargins to set.getFitContentViewMargins()
public final void setFocusGroup(ICanvasObjectGroup value)
If the field has not yet been initialized upon first access, the factory method createHighlightGroup()
will be
called. Upon change the onHighlightGroupChanged(ICanvasObjectGroup, ICanvasObjectGroup)
method will be called.
value
- The FocusGroup to set.getFocusGroup()
public final void setHighlightGroup(ICanvasObjectGroup value)
If the field has not yet been initialized upon first access, the factory method createHighlightGroup()
will be
called. Upon change the onHighlightGroupChanged(ICanvasObjectGroup, ICanvasObjectGroup)
method will be called.
value
- The HighlightGroup to set.getHighlightGroup()
public final void setHitTestRadius(double value)
IHitTestable
may lie to be considered a valid hit.
This value can be queried from within the IHitTestable
implementation from the HitTestRadius
property. The default value is 3.0d
value
- The HitTestRadius to set.getHitTestRadius()
public void setHorizontalScrollBarPolicy(ScrollPane.ScrollBarPolicy value)
Scrollbars don't need to be displayed in order to move the viewport. This can be achieved programmatically or using
special IInputMode instances. The default is ScrollPane.ScrollBarPolicy#AS_NEEDED
.
value
- The HorizontalScrollBarPolicy to set.MoveViewportInputMode
,
getVerticalScrollBarPolicy()
,
getHorizontalScrollBarPolicy()
public final void setInputMode(IInputMode value)
IInputMode
instance that shall be installed for this canvas.value
- The InputMode to set.getInputMode()
public final void setInputModeContext(IInputModeContext value)
This context object is passed to IInputMode
instances during installation
and removal.
If the field has not yet been initialized upon first access, the factory method createInputModeContext()
will
be called. Upon change the onInputModeContextChanged(IInputModeContext, IInputModeContext)
method will be
called.
value
- The InputModeContext to set.getInputModeContext()
public final void setInputModeGroup(ICanvasObjectGroup value)
This is the canvas object group where the IInputMode
s should add their temporary content to. This group by
default is in front of the ContentGroup
.
If the field has not yet been initialized upon first access, the factory method createInputModeGroup()
will be
called. Upon change the onInputModeGroupChanged(ICanvasObjectGroup, ICanvasObjectGroup)
method will be called.
value
- The InputModeGroup to set.getContentGroup()
,
getBackgroundGroup()
,
getInputModeGroup()
public final void setLongPressDuration(Duration value)
This value indicates the amount of time that may pass before a touch down is considered a long press when the pointer
stays within its DragSize
area. The higher the value the later a touch pointer movement will be
recognized as a long press. The default value is 1000 milliseconds.
value
- The LongPressDuration to set.getDragSize()
,
onTouch2DDown(Touch2DEvent)
,
onTouch2DMoved(Touch2DEvent)
,
onTouch2DLongPress(Touch2DEvent)
,
getLongPressDuration()
public final void setMaximumZoom(double value)
Zoom
.
Default value is 1000d
value
- The MaximumZoom to set.getMaximumZoom()
public final void setMinimumZoom(double value)
CanvasControl
.
This property sets a lower bound for the allowed values of the Zoom
property. If this property is
written, the canvas will zoom to the new value while keeping the center of view at the same world coordinates. The
default is 0.01d
but values as small as 0.0000001d are possible.
value
- The MinimumZoom to set.getZoom()
,
getMaximumZoom()
,
getMinimumZoom()
public void setMouseEventConsumingDisabled(boolean mouseEventConsumingDisabled)
mouseEventConsumingDisabledProperty()
public final void setMouseWheelBehavior(MouseWheelBehaviors value)
MouseWheelBehaviors.ZOOM
, MouseWheelBehaviors.SCROLL
and MouseWheelBehaviors.NONE
. Additionally, this property can be configured to perform the action
only when the control is focused
.value
- The MouseWheelBehavior to set.getMouseWheelBehavior()
public final void setMouseWheelScrollFactor(double value)
Scrolling can work either a few lines at a time (per notch of the scroll wheel) or one page at a time. This is a system setting. This property controls how many pixels represent a line if scrolling is done by line. In case scrolling is done by page, this property has no effect.
The default value of 5 pixels. To speed up scrolling, set a larger value, to slow down scrolling, set a smaller value.
value
- The MouseWheelScrollFactor to set.getMouseWheelZoomFactor()
,
getMouseWheelBehavior()
,
Mouse2DEvent.getScrollAmount()
,
Mouse2DEvent.getScrollType()
,
getMouseWheelScrollFactor()
public final void setMouseWheelZoomFactor(double value)
The default value is 1.2.
value
- The MouseWheelZoomFactor to set.getMouseWheelZoomFactor()
public final void setNavigationCommandsEnabled(boolean value)
By default this feature is enabled.
This property enables/disables the following commands:
value
- true
if the commands are enabled; otherwise, false
.isNavigationCommandsEnabled()
public final void setOnCompoundKeyPressed(EventHandler<? super CompoundKeyEvent> value)
public final void setOnCompoundKeyReleased(EventHandler<? super CompoundKeyEvent> value)
public final void setOnCompoundKeyTyped(EventHandler<? super CompoundKeyEvent> value)
public final void setOnMouse2DClicked(EventHandler<? super Mouse2DEvent> value)
public final void setOnMouse2DDragged(EventHandler<? super Mouse2DEvent> value)
public final void setOnMouse2DEntered(EventHandler<? super Mouse2DEvent> value)
public final void setOnMouse2DExited(EventHandler<? super Mouse2DEvent> value)
public final void setOnMouse2DMoved(EventHandler<? super Mouse2DEvent> value)
public final void setOnMouse2DPressed(EventHandler<? super Mouse2DEvent> value)
public final void setOnMouse2DReleased(EventHandler<? super Mouse2DEvent> value)
public final void setOnMouse2DWheelTurned(EventHandler<? super Mouse2DEvent> value)
public final void setScrollCommandAnimationEnabled(boolean value)
ICommand
s for scrolling like for example
ICommand.SCROLL_PAGE_DOWN
, the scrolling should be performed in animated fashion.value
- true
if scrolling should be animated; false
otherwise. The default is true
.isScrollCommandAnimationEnabled()
public final void setSelectionGroup(ICanvasObjectGroup value)
The selection group is the ICanvasObjectGroup
that should be used by the application code to put the selection
paintables in.
If the field has not yet been initialized upon first access, the factory method createSelectionGroup()
will be
called. Upon change the onSelectionGroupChanged(ICanvasObjectGroup, ICanvasObjectGroup)
method will be called.
value
- The SelectionGroup to set.getSelectionGroup()
public static final void setTemplateLocation(Node visual, PointD viewCoordinates)
visual
- the node to be moved.viewCoordinates
- the new coordinates.public void setVerticalScrollBarPolicy(ScrollPane.ScrollBarPolicy value)
Scrollbars don't need to be displayed in order to move the viewport. This can be achieved programmatically or using
special IInputMode instances. The default is ScrollPane.ScrollBarPolicy#AS_NEEDED
.
value
- The VerticalScrollBarPolicy to set.MoveViewportInputMode
,
getHorizontalScrollBarPolicy()
,
getVerticalScrollBarPolicy()
public final void setViewPoint(PointD value)
The view point is the point in world coordinates that is mapped to the top left corner point in the current viewport. Setting this point to another value will redispatch the last mouse event as the mouse will appear to have been moved or dragged in the world coordinate system.
value
- The ViewPoint to set.getViewPoint()
public final void setViewportLimiter(ViewportLimiter value)
ViewportLimiter
instance that can be used to limit the explorable region.
By default there are no limits set on the explorable region.
value
- The ViewportLimiter to set.getViewportLimiter()
public final void setVisualCaching(VisualCachingPolicy value)
Node
s which are temporarily removed from the visual tree.
Visuals are temporarily removed when they are moved outside the visual part of the canvas (the
Viewport
) and re-added when they enter the Viewport
again. Caching
prevents the need to re-build the visuals from scratch.
Visuals are only cached if this property is set to another value than VisualCachingPolicy.NEVER
and if a IDisposeVisualCallback
is registered
during
creation
.
value
- The VisualCaching to set.getVisualCaching()
public final void setZoom(double value)
CanvasControl
.
A zoom level of 1.0f
will make each unit in world-coordinate space appear exactly one unit in screen coordinates
wide. The default is
1.0f
. If this property is written, the canvas will zoom to the new value while keeping the center of view at
the same world coordinates.
The valid range is bounded by MinimumZoom
and MaximumZoom
value
- The Zoom to set.getMinimumZoom()
,
getMaximumZoom()
,
getZoom()
public final void setZoomAnimationDuration(Duration duration)
isZoomAnimationEnabled()
is set to true
, this property specifies how long this animation takes.duration
- The duration of the zooming animation. The default is 0.15
seconds.isZoomAnimationEnabled()
,
getZoomAnimationDuration()
public final void setZoomAnimationEnabled(boolean value)
ICommand.ZOOM
etc.) should be performed in animated fashion.value
- true
if zooming should be animated; otherwise, false
. The default is false
.isZoomAnimationEnabled()
public final ReadOnlyDoubleProperty smallHorizontalChangeProperty()
DoubleProperty
that holds the step size by which the horizontal scroll bar is changed when calling
ScrollBar.increment()
or ScrollBar.decrement()
.public final ReadOnlyDoubleProperty smallVerticalChangeProperty()
DoubleProperty
that holds the step size by which the vertical scroll bar is changed when calling
ScrollBar.increment()
or ScrollBar.decrement()
.public final PointD toViewCoordinates(PointD worldPoint)
worldPoint
- the coordinates in the world coordinate systempublic final PointD toWorldCoordinates(PointD viewPoint)
viewPoint
- the coordinates in pixels relative to the controls upper left cornerpublic final void updateContentRect()
ContentRect
to encompass the bounds by all elements in the current scene graph
plus the given margins.
This method will traverse all visible
elements in the scene graph and query their bounds
The resulting bounds will be set to the content rectangle plus the provided margins
.
IBoundsProvider
,
getContentRect()
public final void updateContentRect(InsetsD margins)
ContentRect
to encompass the bounds by all elements in the current scene graph
plus the given margins.
This method will traverse all visible
elements in the scene graph and query their bounds
The resulting bounds will be set to the content rectangle plus the provided margins
.
IBoundsProvider
,
getContentRect()
public void updateContentRect(InsetsD margins, ICanvasObjectGroup group)
ContentRect
to encompass the bounds by all elements in the current scene graph
plus the given margins.
This method will traverse all visible
elements in the scene graph and query their bounds
The resulting bounds will be set to the content rectangle plus the provided margins
.
IBoundsProvider
,
getContentRect()
public void updateImmediately()
This method will determine the Dirty
canvas objects using the ICanvasObjectDescriptor.isDirty(ICanvasContext, ICanvasObject)
method and will create
or update
the visuals that make up the visual tree. Calling invalidate()
will ultimately trigger this method, however
update calls will be coalesced and the actual execution of this method will be delayed.
public final DoubleProperty verticalOffsetProperty()
DoubleProperty
that holds the current value of the vertical scroll bar.public final ObjectProperty<ScrollPane.ScrollBarPolicy> verticalScrollBarPolicyProperty()
ObjectProperty
that holds the visibility policy for the vertical scroll bar.
Scroll bars don't need to be displayed in order to move the viewport. This can be achieved programmatically or
using special IInputMode instances.
The default is ScrollPane.ScrollBarPolicy#AS_NEEDED
.MoveViewportInputMode
,
getHorizontalScrollBarPolicy()
,
ScrollPane.ScrollBarPolicy#ALWAYS
,
ScrollPane.ScrollBarPolicy#AS_NEEDED
,
ScrollPane.ScrollBarPolicy#NEVER
public final ObjectProperty<PointD> viewPointProperty()
ObjectProperty
that holds current view point.
The view point is the point in world coordinates that is mapped to the top left corner point in the current
viewport.public final ReadOnlyDoubleProperty viewportHeightProperty()
DoubleProperty
that holds the height of the current viewport.public final ReadOnlyObjectPropertyBase<RectD> viewportProperty()
view port
.
The view port is the visible portion of the world rectangle in the world coordinate system.
getViewport()
public final ReadOnlyDoubleProperty viewportWidthProperty()
DoubleProperty
that holds the width of the current viewport.public final DoubleProperty zoomProperty()
DoubleProperty
that holds the current zoom factor for this canvas control.
A zoom level of 1.0f
will make each unit in world-coordinate space appear exactly one unit in screen
coordinates wide. The default is 1.0f
. If this property is written, the canvas will zoom to the new
value while keeping the center of view at the same world coordinates.
The valid range is bounded by getMinimumZoom()
and
getMaximumZoom()
getMinimumZoom()
,
getMaximumZoom()
public void zoomTo(PointD center, double zoom)
center
- the new center of the view port in world coordinateszoom
- the new zoom levelpublic void zoomTo(RectD bounds)
bounds
- The coordinates of the rectangle to zoom to.