- 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
PropertiesTypePropertyDescriptionjavafx.beans.property.ObjectProperty<Handle> The active handle.javafx.beans.property.ObjectProperty<Figure> The active layer of the drawing.javafx.beans.property.ObjectProperty<ClipboardInputFormat> The clipboard input format.javafx.beans.property.ObjectProperty<ClipboardOutputFormat> The clipboard output format.The constrainer.javafx.beans.property.ReadOnlyObjectProperty<Drawing> The drawing model.javafx.beans.property.ObjectProperty<DrawingEditor> The drawing editor.javafx.beans.property.ReadOnlyBooleanPropertyThe focused property is set to true, when the DrawingView has input focus.javafx.beans.property.ReadOnlySetProperty<Handle> The handles.The drawing model.javafx.beans.property.ReadOnlySetProperty<Figure> The selected figures.javafx.beans.property.ObjectProperty<Tool> The tool which currently edits thisDrawingView.javafx.beans.property.DoublePropertyThe scale factor of the drawing view. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name of the active handle property.static final StringThe name of the active layer property.static final StringThe name of the clipboardInputFormat property.static final StringThe name of the clibpoardOutputFormat property.static final StringThe name of the constrainer property.static final StringThe name of the drawing property.static final StringThe name of the editor property.static final StringThe name of the focused property.static final StringThe name of the model property.static final StringThe name of the selection property.static final StringThe name of the tool property.static final StringThe 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 TypeMethodDescriptionjavafx.beans.property.ObjectProperty<Handle> The active handle.javafx.beans.property.ObjectProperty<Figure> The active layer of the drawing.javafx.beans.property.ObjectProperty<ClipboardInputFormat> The clipboard input format.javafx.beans.property.ObjectProperty<ClipboardOutputFormat> The clipboard output format.The constrainer.javafx.beans.property.ReadOnlyObjectProperty<Drawing> The drawing model.javafx.beans.property.ObjectProperty<DrawingEditor> The drawing editor.default @Nullable FigurefindFigure(double vx, double vy) Finds the figure at the given view coordinates.default @Nullable FigurefindFigure(double vx, double vy, Predicate<Figure> predicate) Finds the figure at the given view coordinates.default @Nullable FigurefindFigure(double vx, double vy, Set<Figure> figures) Finds the figure at the given view coordinates.default @Nullable FigurefindFigure(javafx.geometry.Point2D pointInView) Finds the figure at the given view coordinates.@Nullable javafx.scene.NodefindFigureNode(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, Predicate<Figure> predicate) Finds the figure at the given view coordinates behind the given figure.findFigures(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(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(javafx.geometry.Rectangle2D rectangleInView, boolean decompose) Returns all figures that intersect the specified bounds given in view coordinates.@Nullable HandlefindHandle(double vx, double vy) Finds the handle at the given view coordinates.javafx.beans.property.ReadOnlyBooleanPropertyThe focused property is set to true, when the DrawingView has input focus.default @Nullable HandleGets the value of theactiveHandleproperty.default @Nullable FigureGets 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 ConstrainerGets the value of theconstrainerproperty.default @Nullable DrawingGets 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.default @Nullable Figuredefault @Nullable Figuredefault @Nullable ToolgetTool()Gets the value of thetoolproperty.javafx.scene.transform.TransformReturns the view to world transformation.javafx.geometry.BoundsReturns the visible rectangle of the drawing view in view coordinates.javafx.scene.transform.TransformReturns the world to view transformation.default doubleGets the value of thezoomFactorproperty.javafx.beans.property.ReadOnlySetProperty<Handle> 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 voidjavafx.beans.property.ReadOnlySetProperty<Figure> The selected figures.default voidsetActiveHandle(@Nullable Handle newValue) Sets the value of theactiveHandleproperty.default voidsetActiveParent(@Nullable Figure newValue) Sets the value of theactiveParentproperty.default voidsetClipboardInputFormat(@Nullable ClipboardInputFormat newValue) Sets the value of theclipboardInputFormatproperty.default voidsetClipboardOutputFormat(@Nullable ClipboardOutputFormat newValue) Sets the value of theclipboardOutputFormatproperty.default voidsetConstrainer(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.javafx.beans.property.ObjectProperty<Tool> The tool which currently edits thisDrawingView.default javafx.geometry.Point2DviewToWorld(double vx, double vy) Converts view coordinates into world coordinates.default javafx.geometry.BoundsviewToWorld(javafx.geometry.Bounds view) Converts view coordinates into world coordinates.default javafx.geometry.Point2DviewToWorld(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(javafx.geometry.Bounds world) Converts world coordinates into view coordinates.default javafx.geometry.Point2DworldToView(javafx.geometry.Point2D world) Converts world coordinates into view coordinates.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
NonNullObjectProperty<DrawingModel> modelPropertyThe drawing model.- See Also:
-
drawing
javafx.beans.property.ReadOnlyObjectProperty<Drawing> drawingPropertyThe drawing model.- See Also:
-
editor
javafx.beans.property.ObjectProperty<DrawingEditor> editorPropertyThe drawing editor.- See Also:
-
activeParent
javafx.beans.property.ObjectProperty<Figure> activeParentPropertyThe active layer of the drawing.- See Also:
-
tool
javafx.beans.property.ObjectProperty<Tool> toolPropertyThe 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
javafx.beans.property.DoubleProperty zoomFactorPropertyThe scale factor of the drawing view.- See Also:
-
constrainer
NonNullObjectProperty<Constrainer> constrainerPropertyThe constrainer.- See Also:
-
focused
javafx.beans.property.ReadOnlyBooleanProperty focusedPropertyThe focused property is set to true, when the DrawingView has input focus.- See Also:
-
selectedFigures
javafx.beans.property.ReadOnlySetProperty<Figure> selectedFiguresPropertyThe 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
javafx.beans.property.ReadOnlySetProperty<Handle> handlesPropertyThe handles.Note: The handles are represented by a
SequencedSetbecause the sequence of the handles is important.- See Also:
-
activeHandle
javafx.beans.property.ObjectProperty<Handle> activeHandlePropertyThe 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
javafx.beans.property.ObjectProperty<ClipboardOutputFormat> clipboardOutputFormatPropertyThe clipboard output format.- See Also:
-
clipboardInputFormat
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
NonNullObjectProperty<DrawingModel> modelProperty()The drawing model.- Returns:
- the drawing model property, with
getBean()returning this drawing view, andgetName()returningDRAWING_PROPERTY. - See Also:
-
drawingProperty
javafx.beans.property.ReadOnlyObjectProperty<Drawing> drawingProperty()The drawing model.- Returns:
- the drawing model property
- See Also:
-
editorProperty
javafx.beans.property.ObjectProperty<DrawingEditor> editorProperty()The drawing editor.- Returns:
- the editor property
- See Also:
-
activeParentProperty
javafx.beans.property.ObjectProperty<Figure> 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
javafx.beans.property.ObjectProperty<Tool> 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
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
NonNullObjectProperty<Constrainer> constrainerProperty()The constrainer.- Returns:
- the constrainer property, with
getBean()returning this drawing view, andgetName()returningCONSTRAINER_PROPERTY. - See Also:
-
focusedProperty
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
javafx.beans.property.ReadOnlySetProperty<Figure> 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
javafx.beans.property.ReadOnlySetProperty<Handle> 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
javafx.beans.property.ObjectProperty<Handle> 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
javafx.beans.property.ObjectProperty<ClipboardOutputFormat> clipboardOutputFormatProperty()The clipboard output format.- Returns:
- the clipboard output format handle if present
- See Also:
-
clipboardInputFormatProperty
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
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
List<Map.Entry<Figure,Double>> findFigures(double vx, double vy, boolean decompose, 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
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 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
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
javafx.scene.transform.Transform getWorldToView()Returns the world to view transformation.- Returns:
- the transformation
-
getViewToWorld
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 List<Map.Entry<Figure,Double>> findFigures(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 List<Map.Entry<Figure,Double>> findFiguresInside(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 List<Map.Entry<Figure,Double>> findFiguresIntersecting(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
default javafx.geometry.Point2D viewToWorld(javafx.geometry.Point2D view) Converts view coordinates into world coordinates.- Parameters:
view- a point in view coordinates- Returns:
- the corresponding point in world coordinates
-
viewToWorld
default javafx.geometry.Bounds viewToWorld(javafx.geometry.Bounds view) Converts view coordinates into world coordinates.- Parameters:
view- a rectangle in view coordinates- Returns:
- the corresponding point in world coordinates
-
worldToView
default javafx.geometry.Point2D worldToView(javafx.geometry.Point2D world) Converts world coordinates into view coordinates.- Parameters:
world- a point in world coordinates- Returns:
- the corresponding point in view coordinates
-
worldToView
default javafx.geometry.Bounds worldToView(javafx.geometry.Bounds world) 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.
-