- All Superinterfaces:
ReadOnlyPropertyBean,RenderContext,WritableRenderContext
- All Known Implementing Classes:
AbstractDrawingView,SimpleDrawingView
DrawingView can display a Drawing in a JavaFX scene graph.
A DrawingView consists of the following layers:
- Background. Displays a background behind the drawing.
- Drawing. Displays the figures of the drawing.
- Grid. Displays a grid.
- Tools. Displays the handles used for editing figures.
DrawingView uses a DrawingModel to listen for changes on a
Drawing. Once a drawing is showing in a drawing view, all changes to
the drawing must be performed on the drawing model.
DrawingView invokes validate() on its DrawingModel
each time before it renders the drawing to ensure that the figures are laid
out and that CSS styles are applied before rendering the drawing.
- Author:
- Werner Randelshofer Responsibility, Handler.
-
Property Summary
PropertiesTypePropertyDescriptionThe active handle.The active layer of the drawing.@NonNull javafx.beans.property.ObjectProperty<ClipboardInputFormat> The clipboard input format.@NonNull javafx.beans.property.ObjectProperty<ClipboardOutputFormat> The clipboard output format.The constrainer.The drawing model.@NonNull javafx.beans.property.ObjectProperty<DrawingEditor> The drawing editor.@NonNull javafx.beans.property.ReadOnlyBooleanPropertyThe focused property is set to true, when the DrawingView has input focus.The handles.The drawing model.The selected figures.The tool which currently edits thisDrawingView.@NonNull javafx.beans.property.DoublePropertyThe scale factor of the drawing view. -
Field Summary
FieldsModifier and TypeFieldDescriptionThe name of the active handle property.The name of the active layer property.The name of the clipboardInputFormat property.The name of the clibpoardOutputFormat property.The name of the constrainer property.The name of the drawing property.The name of the editor property.The name of the focused property.The name of the model property.The name of the selection property.The name of the tool property.The name of the scale factor property.Fields inherited from interface org.jhotdraw8.draw.render.RenderContext
CLIP_BOUNDS, DPI, MAX_NODES_PER_LAYER, RENDER_NUMBER_OF_PAGES, RENDER_PAGE, RENDER_PAGE_INTERNAL_NUMBER, RENDER_PAGE_NUMBER, RENDER_TIMESTAMP, RENDERING_INTENT, SYSTEM_COLOR_CONVERTER_KEY, UNIT_CONVERTER_KEY -
Method Summary
Modifier and TypeMethodDescriptionThe active handle.The active layer of the drawing.@NonNull javafx.beans.property.ObjectProperty<ClipboardInputFormat> The clipboard input format.@NonNull javafx.beans.property.ObjectProperty<ClipboardOutputFormat> The clipboard output format.The constrainer.The drawing model.@NonNull javafx.beans.property.ObjectProperty<DrawingEditor> The drawing editor.findFigure(double vx, double vy) Finds the figure at the given view coordinates.findFigure(double vx, double vy, Predicate<Figure> predicate) Finds the figure at the given view coordinates.findFigure(double vx, double vy, Set<Figure> figures) Finds the figure at the given view coordinates.findFigure(@NonNull javafx.geometry.Point2D pointInView) Finds the figure at the given view coordinates.@Nullable javafx.scene.NodefindFigureNode(@NonNull Figure figure, double vx, double vy) Finds the front-most node of the specified figure that contains the specified view coordinates.findFigures(double vx, double vy, boolean decompose) Finds the figure at the given view coordinates behind the given figure.findFigures(double vx, double vy, boolean decompose, @NonNull Predicate<Figure> predicate) Finds the figure at the given view coordinates behind the given figure.findFigures(@NonNull javafx.geometry.Point2D pointInView, boolean decompose) Finds the figures at the given view coordinates.findFiguresInside(double vx, double vy, double vwidth, double vheight, boolean decompose) Returns all figures that lie within the specified bounds given in view coordinates.findFiguresInside(@NonNull javafx.geometry.Rectangle2D rectangleInView, boolean decompose) Returns all figures that are inside the specified bounds given in view coordinates.findFiguresIntersecting(double vx, double vy, double vwidth, double vheight, boolean decompose) Returns all figures that intersect the specified bounds given in view coordinates.findFiguresIntersecting(double vx, double vy, double vwidth, double vheight, boolean decompose, Predicate<Figure> predicate) Returns all figures that intersect the specified bounds given in view coordinates.findFiguresIntersecting(@NonNull javafx.geometry.Rectangle2D rectangleInView, boolean decompose) Returns all figures that intersect the specified bounds given in view coordinates.findHandle(double vx, double vy) Finds the handle at the given view coordinates.@NonNull javafx.beans.property.ReadOnlyBooleanPropertyThe focused property is set to true, when the DrawingView has input focus.Gets the value of theactiveHandleproperty.Gets the value of theactiveParentproperty.default @Nullable ClipboardInputFormatGets the value of theclipboardInputFormatproperty.default @Nullable ClipboardOutputFormatGets the value of theclipboardOutputFormatproperty.default FiguregetClosestFigure(List<Map.Entry<Figure, Double>> result) default @NonNull ConstrainerGets the value of theconstrainerproperty.Gets the value of thedrawingproperty.default @Nullable DrawingEditorGets the value of theeditorproperty.getFiguresWithCompatibleHandle(Collection<Figure> figures, Handle handle) Gets selected figures with the same handle.default javafx.collections.ObservableSet<Handle> Gets the value of thehandlesproperty.default DrawingModelgetModel()Returns the underlying drawing model.javafx.scene.NodegetNode()Returns thejavafx.scene.Nodeof the DrawingView.@Nullable javafx.scene.NodeGets the node which is used to render the specified figure by the drawing view.default javafx.collections.ObservableSet<Figure> Gets the value of theselectedFiguresproperty.getTool()Gets the value of thetoolproperty.@NonNull javafx.scene.transform.TransformReturns the view to world transformation.javafx.geometry.BoundsReturns the visible rectangle of the drawing view in view coordinates.@NonNull javafx.scene.transform.TransformReturns the world to view transformation.default doubleGets the value of thezoomFactorproperty.The handles.voidPlays a short animation on the handles to make them easier discoverable.The drawing model.voiddefault voidScrolls the specified figure to visible.voidscrollRectToVisible(javafx.geometry.Bounds boundsInView) Scrolls the specified rectangle to visible.default voidThe selected figures.default voidsetActiveHandle(@Nullable Handle newValue) Sets the value of theactiveHandleproperty.default voidsetActiveParent(@Nullable Figure newValue) Sets the value of theactiveParentproperty.default voidSets the value of theclipboardInputFormatproperty.default voidSets the value of theclipboardOutputFormatproperty.default voidsetConstrainer(@NonNull Constrainer newValue) Sets the value of theconstrainerproperty.default voidsetDrawing(@Nullable Drawing newValue) Sets the value of thedrawingproperty.default voidsetEditor(@Nullable DrawingEditor newValue) Sets the value of theeditorproperty.default voidsetModel(DrawingModel newValue) Sets a new underlying drawing model.default voidSets the value of thetoolproperty.default voidsetZoomFactor(double newValue) Sets the value of thezoomFactorproperty.The tool which currently edits thisDrawingView.default javafx.geometry.Point2DviewToWorld(double vx, double vy) Converts view coordinates into world coordinates.default javafx.geometry.BoundsviewToWorld(@NonNull javafx.geometry.Bounds view) Converts view coordinates into world coordinates.default javafx.geometry.Point2DviewToWorld(@NonNull javafx.geometry.Point2D view) Converts view coordinates into world coordinates.default javafx.geometry.Point2DworldToView(double dx, double dy) Converts world coordinates into view coordinates.default javafx.geometry.BoundsworldToView(@NonNull javafx.geometry.Bounds world) Converts world coordinates into view coordinates.default javafx.geometry.Point2DworldToView(@NonNull javafx.geometry.Point2D world) Converts world coordinates into view coordinates.@NonNull javafx.beans.property.DoublePropertyThe scale factor of the drawing view.Methods inherited from interface org.jhotdraw8.fxbase.beans.ReadOnlyPropertyBean
get, getNonNullMethods inherited from interface org.jhotdraw8.draw.render.WritableRenderContext
set
-
Property Details
-
model
@NonNull NonNullObjectProperty<DrawingModel> modelPropertyThe drawing model.- See Also:
-
drawing
The drawing model.- See Also:
-
editor
@NonNull javafx.beans.property.ObjectProperty<DrawingEditor> editorPropertyThe drawing editor.- See Also:
-
activeParent
The active layer of the drawing.- See Also:
-
tool
The tool which currently edits thisDrawingView.When a tool is set on the drawing view, then drawing view adds the
Nodeof the tool to its tool panel which is stacked on top of the drawing panel. It then invokestoolsetDrawingView(this).Setting a tool will removeChild the previous tool. The drawing view invokes
tool.setDrawingView(null)and then removes itsNodefrom its tool panel.- See Also:
-
zoomFactor
@NonNull javafx.beans.property.DoubleProperty zoomFactorPropertyThe scale factor of the drawing view.- See Also:
-
constrainer
@NonNull NonNullObjectProperty<Constrainer> constrainerPropertyThe constrainer.- See Also:
-
focused
@NonNull javafx.beans.property.ReadOnlyBooleanProperty focusedPropertyThe focused property is set to true, when the DrawingView has input focus.- See Also:
-
selectedFigures
The selected figures.Note: The selection is represented by a
SequencedSetbecause the sequence of the selection is important.The first figure in the selection is the 'anchor' of the selection.
The last figure in the selection is the 'lead' of the selection.
Operations that act on multiple selected figures, typically use the 'lead' figure as the reference figure.
- See Also:
-
handles
The handles.Note: The handles are represented by a
SequencedSetbecause the sequence of the handles is important.- See Also:
-
activeHandle
The active handle.This is the handle, on which the user has clicked the last time.
Tools that support keyboard input on handles, typically forward keyboard input to the active handle.
- See Also:
-
clipboardOutputFormat
@NonNull javafx.beans.property.ObjectProperty<ClipboardOutputFormat> clipboardOutputFormatPropertyThe clipboard output format.- See Also:
-
clipboardInputFormat
@NonNull javafx.beans.property.ObjectProperty<ClipboardInputFormat> clipboardInputFormatPropertyThe clipboard input format.- See Also:
-
-
Field Details
-
MODEL_PROPERTY
The name of the model property.- See Also:
-
TOOL_PROPERTY
The name of the tool property.- See Also:
-
FOCUSED_PROPERTY
The name of the focused property.- See Also:
-
ZOOM_FACTOR_PROPERTY
The name of the scale factor property.- See Also:
-
CONSTRAINER_PROPERTY
The name of the constrainer property.- See Also:
-
SELECTED_FIGURES_PROPERTY
The name of the selection property.- See Also:
-
ACTIVE_HANDLE_PROPERTY
The name of the active handle property.- See Also:
-
ACTIVE_PARENT_PROPERTY
The name of the active layer property.- See Also:
-
CLIPBOARD_INPUT_FORMAT_PROPERTY
The name of the clipboardInputFormat property.- See Also:
-
CLIPBOARD_OUTPUT_FORMAT_PROPERTY
The name of the clibpoardOutputFormat property.- See Also:
-
DRAWING_PROPERTY
The name of the drawing property.- See Also:
-
EDITOR_PROPERTY
The name of the editor property.- See Also:
-
-
Method Details
-
modelProperty
@NonNull NonNullObjectProperty<DrawingModel> modelProperty()The drawing model.- Returns:
- the drawing model property, with
getBean()returning this drawing view, andgetName()returningDRAWING_PROPERTY. - See Also:
-
drawingProperty
The drawing model.- Returns:
- the drawing model property
- See Also:
-
editorProperty
@NonNull javafx.beans.property.ObjectProperty<DrawingEditor> editorProperty()The drawing editor.- Returns:
- the editor property
- See Also:
-
activeParentProperty
The active layer of the drawing.- Returns:
- the active layer of the drawing. Returns null if the drawing has no layers or no layer has been activated.
- See Also:
-
scrollSelectedFiguresToVisible
default void scrollSelectedFiguresToVisible() -
toolProperty
The tool which currently edits thisDrawingView.When a tool is set on the drawing view, then drawing view adds the
Nodeof the tool to its tool panel which is stacked on top of the drawing panel. It then invokestoolsetDrawingView(this).Setting a tool will removeChild the previous tool. The drawing view invokes
tool.setDrawingView(null)and then removes itsNodefrom its tool panel.- Returns:
- the tool property, with
getBean()returning this drawing view, andgetName()returningTOOL_PROPERTY. - See Also:
-
zoomFactorProperty
@NonNull javafx.beans.property.DoubleProperty zoomFactorProperty()The scale factor of the drawing view.- Returns:
- The zoom factor. The value is always greater than 0. Values larger than 1 cause a magnification. Values between 0 and 1 causes a minification.
- See Also:
-
constrainerProperty
@NonNull NonNullObjectProperty<Constrainer> constrainerProperty()The constrainer.- Returns:
- the constrainer property, with
getBean()returning this drawing view, andgetName()returningCONSTRAINER_PROPERTY. - See Also:
-
focusedProperty
@NonNull javafx.beans.property.ReadOnlyBooleanProperty focusedProperty()The focused property is set to true, when the DrawingView has input focus.- Returns:
- the focused property, with
getBean()returning this drawing view, andgetName()returningFOCUSED_PROPERTY.
-
selectedFiguresProperty
The selected figures.Note: The selection is represented by a
SequencedSetbecause the sequence of the selection is important.The first figure in the selection is the 'anchor' of the selection.
The last figure in the selection is the 'lead' of the selection.
Operations that act on multiple selected figures, typically use the 'lead' figure as the reference figure.
- Returns:
- the currently selected figures
- See Also:
-
handlesProperty
The handles.Note: The handles are represented by a
SequencedSetbecause the sequence of the handles is important.- Returns:
- the handles that are currently being displayed on this drawing view.
- See Also:
-
activeHandleProperty
The active handle.This is the handle, on which the user has clicked the last time.
Tools that support keyboard input on handles, typically forward keyboard input to the active handle.
- Returns:
- the active handle if present
- See Also:
-
clipboardOutputFormatProperty
@NonNull javafx.beans.property.ObjectProperty<ClipboardOutputFormat> clipboardOutputFormatProperty()The clipboard output format.- Returns:
- the clipboard output format handle if present
- See Also:
-
clipboardInputFormatProperty
@NonNull javafx.beans.property.ObjectProperty<ClipboardInputFormat> clipboardInputFormatProperty()The clipboard input format.- Returns:
- the clipboard output format handle if present
- See Also:
-
getNode
javafx.scene.Node getNode()Returns thejavafx.scene.Nodeof the DrawingView.- Returns:
- a node
-
getNode
Gets the node which is used to render the specified figure by the drawing view.- Specified by:
getNodein interfaceRenderContext- Parameters:
f- The figure- Returns:
- The node associated to the figure
-
findHandle
Finds the handle at the given view coordinates. Handles are searched in Z-order from front to back. Skips handles which are not selectable.- Parameters:
vx- x in view coordinatesvy- y in view coordinates- Returns:
- A handle or null
-
findFigure
Finds the figure at the given view coordinates. Figures are searched in Z-order from front to back. Skips disabled figures.- Parameters:
vx- x in view coordinatesvy- y in view coordinatesfigures- Only searches in the provided list of figures- Returns:
- A figure or null
-
getClosestFigure
-
findFigure
Finds the figure at the given view coordinates. Figures are searched in Z-order from front to back. Only returns selectable figures.- Parameters:
vx- x in view coordinatesvy- y in view coordinates- Returns:
- A figure or null
-
findFigure
Finds the figure at the given view coordinates. Figures are searched in Z-order from front to back.- Parameters:
vx- x in view coordinatesvy- y in view coordinates- Returns:
- A figure or null
-
findFigureNode
Finds the front-most node of the specified figure that contains the specified view coordinates.- Parameters:
figure- the figurevx- x in view coordinatesvy- y in view coordinates- Returns:
- A node or null
-
findFigures
default @NonNull List<Map.Entry<Figure,Double>> findFigures(double vx, double vy, boolean decompose) Finds the figure at the given view coordinates behind the given figure. Figures are searched in Z-order from front to back. Only returns figures that are selectable.- Parameters:
vx- x in view coordinatesvy- y in view coordinatesdecompose- whether to decompose the figures- Returns:
- A list of figures from front to back. Each entry contains the figure and the distance of the figure to vx,vy. Distance 0 means that vx,vy is inside the figure.
-
findFigures
@NonNull List<Map.Entry<Figure,Double>> findFigures(double vx, double vy, boolean decompose, @NonNull Predicate<Figure> predicate) Finds the figure at the given view coordinates behind the given figure. Figures are searched in Z-order from front to back.- Parameters:
vx- x in view coordinatesvy- y in view coordinatesdecompose- whether to decompose the figures- Returns:
- A list of figures from front to back. Each entry contains the figure and the distance of the figure to vx,vy. Distance 0 means that vx,vy is inside the figure.
-
findFiguresInside
@NonNull List<Map.Entry<Figure,Double>> findFiguresInside(double vx, double vy, double vwidth, double vheight, boolean decompose) Returns all figures that lie within the specified bounds given in view coordinates. The figures are returned in Z-order from back to front. Skips disabled figures.- Parameters:
vx- x in view coordinatesvy- y in view coordinatesvwidth- width in view coordinatesvheight- height in view coordinatesdecompose- whether to decompose the figures- Returns:
- A list of figures from front to back. Each entry contains the figure and the distance of the figure to vx,vy. Distance 0 means that vx,vy is inside the figure.
-
findFiguresIntersecting
default @NonNull List<Map.Entry<Figure,Double>> findFiguresIntersecting(double vx, double vy, double vwidth, double vheight, boolean decompose) Returns all figures that intersect the specified bounds given in view coordinates. The figures are returned in Z-order from front to back. Skips disabled figures.- Parameters:
vx- x in view coordinatesvy- y in view coordinatesvwidth- width in view coordinatesvheight- height in view coordinatesdecompose- whether to decompose the figures- Returns:
- A list of figures from front to back
-
findFiguresIntersecting
@NonNull List<Map.Entry<Figure,Double>> findFiguresIntersecting(double vx, double vy, double vwidth, double vheight, boolean decompose, Predicate<Figure> predicate) Returns all figures that intersect the specified bounds given in view coordinates. The figures are returned in Z-order from front to back. Skips disabled figures.- Parameters:
vx- x in view coordinatesvy- y in view coordinatesvwidth- width in view coordinatesvheight- height in view coordinatesdecompose- whether to decompose the figurespredicate- predicate for filtering figures- Returns:
- A list of figures from front to back
-
getFiguresWithCompatibleHandle
Gets selected figures with the same handle.- Parameters:
figures- selected figureshandle- a handle- Returns:
- A collection containing the figures with compatible handles.
-
getWorldToView
@NonNull javafx.scene.transform.Transform getWorldToView()Returns the world to view transformation.- Returns:
- the transformation
-
getViewToWorld
@NonNull javafx.scene.transform.Transform getViewToWorld()Returns the view to world transformation.- Returns:
- the transformation;
-
findFigure
Finds the figure at the given view coordinates. Figures are searched in Z-order from front to back. Skips disabled figures and non-selectable figures.- Parameters:
pointInView- point in view coordinates- Returns:
- A figure or empty
-
findFigures
default @NonNull List<Map.Entry<Figure,Double>> findFigures(@NonNull javafx.geometry.Point2D pointInView, boolean decompose) Finds the figures at the given view coordinates. Figures are searched in Z-order from front to back. Skips disabled figures and non-selectable figures.- Parameters:
pointInView- point in view coordinatesdecompose- whether to decompose the figures- Returns:
- A list of figures from front to back. Each entry contains the figure and the distance of the figure to vx,vy. Distance 0 means that pointInView is inside the figure.
-
findFiguresInside
default @NonNull List<Map.Entry<Figure,Double>> findFiguresInside(@NonNull javafx.geometry.Rectangle2D rectangleInView, boolean decompose) Returns all figures that are inside the specified bounds given in view coordinates. The figures are returned in Z-order from front to back. Skips disabled figures and non-selectable figures.- Parameters:
rectangleInView- rectangle in view coordinatesdecompose- whether to decompose the figures- Returns:
- A list of figures from front to back. Each entry contains the figure and the distance of the figure to vx,vy. Distance 0 means that pointInView is inside the figure.
-
findFiguresIntersecting
default @NonNull List<Map.Entry<Figure,Double>> findFiguresIntersecting(@NonNull javafx.geometry.Rectangle2D rectangleInView, boolean decompose) Returns all figures that intersect the specified bounds given in view coordinates. The figures are returned in Z-order from back to front. Skips disabled figures and non-selectable figures.- Parameters:
rectangleInView- rectangle in view coordinatesdecompose- whether to decompose the figures- Returns:
- A list of figures from front to back
-
setDrawing
Sets the value of thedrawingproperty.- Property description:
- The drawing model.
- Parameters:
newValue- the value for thedrawingproperty- See Also:
-
getDrawing
Gets the value of thedrawingproperty.- Property description:
- The drawing model.
- Returns:
- the value of the
drawingproperty - See Also:
-
setEditor
Sets the value of theeditorproperty.- Property description:
- The drawing editor.
- Parameters:
newValue- the value for theeditorproperty- See Also:
-
getEditor
Gets the value of theeditorproperty.- Property description:
- The drawing editor.
- Returns:
- the value of the
editorproperty - See Also:
-
setConstrainer
Sets the value of theconstrainerproperty.- Property description:
- The constrainer.
- Parameters:
newValue- the value for theconstrainerproperty- See Also:
-
getConstrainer
Gets the value of theconstrainerproperty.- Property description:
- The constrainer.
- Returns:
- the value of the
constrainerproperty - See Also:
-
setTool
Sets the value of thetoolproperty.- Property description:
- The tool which currently edits this
DrawingView.When a tool is set on the drawing view, then drawing view adds the
Nodeof the tool to its tool panel which is stacked on top of the drawing panel. It then invokestoolsetDrawingView(this).Setting a tool will removeChild the previous tool. The drawing view invokes
tool.setDrawingView(null)and then removes itsNodefrom its tool panel. - Parameters:
newValue- the value for thetoolproperty- See Also:
-
getTool
Gets the value of thetoolproperty.- Property description:
- The tool which currently edits this
DrawingView.When a tool is set on the drawing view, then drawing view adds the
Nodeof the tool to its tool panel which is stacked on top of the drawing panel. It then invokestoolsetDrawingView(this).Setting a tool will removeChild the previous tool. The drawing view invokes
tool.setDrawingView(null)and then removes itsNodefrom its tool panel. - Returns:
- the value of the
toolproperty - See Also:
-
setActiveHandle
Sets the value of theactiveHandleproperty.- Property description:
- The active handle.
This is the handle, on which the user has clicked the last time.
Tools that support keyboard input on handles, typically forward keyboard input to the active handle.
- Parameters:
newValue- the value for theactiveHandleproperty- See Also:
-
getActiveHandle
Gets the value of theactiveHandleproperty.- Property description:
- The active handle.
This is the handle, on which the user has clicked the last time.
Tools that support keyboard input on handles, typically forward keyboard input to the active handle.
- Returns:
- the value of the
activeHandleproperty - See Also:
-
getSelectionLead
-
getSelectionAnchor
-
setActiveParent
Sets the value of theactiveParentproperty.- Property description:
- The active layer of the drawing.
- Parameters:
newValue- the value for theactiveParentproperty- See Also:
-
getActiveParent
Gets the value of theactiveParentproperty.- Property description:
- The active layer of the drawing.
- Returns:
- the value of the
activeParentproperty - See Also:
-
setZoomFactor
default void setZoomFactor(double newValue) Sets the value of thezoomFactorproperty.- Property description:
- The scale factor of the drawing view.
- Parameters:
newValue- the value for thezoomFactorproperty- See Also:
-
getZoomFactor
default double getZoomFactor()Gets the value of thezoomFactorproperty.- Property description:
- The scale factor of the drawing view.
- Returns:
- the value of the
zoomFactorproperty - See Also:
-
getSelectedFigures
Gets the value of theselectedFiguresproperty.- Property description:
- The selected figures.
Note: The selection is represented by a
SequencedSetbecause the sequence of the selection is important.The first figure in the selection is the 'anchor' of the selection.
The last figure in the selection is the 'lead' of the selection.
Operations that act on multiple selected figures, typically use the 'lead' figure as the reference figure.
- Returns:
- the value of the
selectedFiguresproperty - See Also:
-
getHandles
Gets the value of thehandlesproperty.- Property description:
- The handles.
Note: The handles are represented by a
SequencedSetbecause the sequence of the handles is important. - Returns:
- the value of the
handlesproperty - See Also:
-
viewToWorld
Converts view coordinates into world coordinates.- Parameters:
view- a point in view coordinates- Returns:
- the corresponding point in world coordinates
-
viewToWorld
Converts view coordinates into world coordinates.- Parameters:
view- a rectangle in view coordinates- Returns:
- the corresponding point in world coordinates
-
worldToView
Converts world coordinates into view coordinates.- Parameters:
world- a point in world coordinates- Returns:
- the corresponding point in view coordinates
-
worldToView
Converts world coordinates into view coordinates.- Parameters:
world- a box in world coordinates- Returns:
- the corresponding box in view coordinates
-
viewToWorld
default javafx.geometry.Point2D viewToWorld(double vx, double vy) Converts view coordinates into world coordinates.- Parameters:
vx- the x coordinate of a point in view coordinatesvy- the y coordinate of a point in view coordinates- Returns:
- the corresponding point in world coordinates
-
worldToView
default javafx.geometry.Point2D worldToView(double dx, double dy) Converts world coordinates into view coordinates.- Parameters:
dx- the x coordinate of a point in world coordinatesdy- the y coordinate of a point in world coordinates- Returns:
- the corresponding point in view coordinates
-
getModel
Returns the underlying drawing model.- Returns:
- a drawing model
-
setModel
Sets a new underlying drawing model.- Parameters:
newValue- a drawing model
-
setClipboardOutputFormat
Sets the value of theclipboardOutputFormatproperty.- Property description:
- The clipboard output format.
- Parameters:
newValue- the value for theclipboardOutputFormatproperty- See Also:
-
setClipboardInputFormat
Sets the value of theclipboardInputFormatproperty.- Property description:
- The clipboard input format.
- Parameters:
newValue- the value for theclipboardInputFormatproperty- See Also:
-
getClipboardOutputFormat
Gets the value of theclipboardOutputFormatproperty.- Property description:
- The clipboard output format.
- Returns:
- the value of the
clipboardOutputFormatproperty - See Also:
-
getClipboardInputFormat
Gets the value of theclipboardInputFormatproperty.- Property description:
- The clipboard input format.
- Returns:
- the value of the
clipboardInputFormatproperty - See Also:
-
recreateHandles
void recreateHandles() -
jiggleHandles
void jiggleHandles()Plays a short animation on the handles to make them easier discoverable. -
scrollFigureToVisible
Scrolls the specified figure to visible.- Parameters:
f- A figure in the drawing of this DrawingView.
-
scrollRectToVisible
void scrollRectToVisible(javafx.geometry.Bounds boundsInView) Scrolls the specified rectangle to visible.- Parameters:
boundsInView- A rectangle in view coordinates.
-
getVisibleRect
javafx.geometry.Bounds getVisibleRect()Returns the visible rectangle of the drawing view in view coordinates.- Returns:
- the portion of the DrawingView that is visible on screen.
-