Interface ZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
-
- Type Parameters:
T
- the type of the container.
- All Known Implementing Classes:
GisCanvas
,GisPane
,ZoomableCanvas
,ZoomablePane
public interface ZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
View of document elements that provides a basic UI to show them.The document elements are displayed within a
ZoomableCanvas
by thedrawers
that are declared as services.The
ZoomableViewer
provides advanced UI components (scroll bars, etc.) and interaction means (mouse support, etc.) for scrolling and zooming in and out.- Since:
- 15.0
- Version:
- 17.0 2020-01-04 14:41:52
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.advanced
- Maven Artifact Id:
- nodefx
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_DRAWABLE_ELEMENT_BUDGET
Default budget for drawable elements.static double
DEFAULT_SCALE_CHANGE
Default scaling delta.static String
DOCUMENT_BOUNDS_PROPERTY
Name of the property for the bounds of the document in document coordinates.static String
DOCUMENT_DRAWER_PROPERTY
Name of the property for the document drawer.static String
DOCUMENT_MODEL_PROPERTY
Name of the property for the document model.static String
DRAWABLE_ELEMENT_BUDGET_PROPERTY
Name of the property for the drawable element budget.static String
INVERTED_AXIS_X_PROPERTY
Name of the property that indicates if the X axis is inverted.static String
INVERTED_AXIS_Y_PROPERTY
Name of the property that indicates if the Y axis is inverted.static String
MAX_SCALE_VALUE_PROPERTY
Name of the property for the maximal scale value.static double
MAXIMUM_SCALE_VALUE
Maximal scale value.static int
MIN_DRAWABLE_ELEMENT_BUDGET
Default budget for drawable elements.static double
MIN_SCALE_CHANGE
Minimum scaling delta.static String
MIN_SCALE_VALUE_PROPERTY
Name of the property for the minimal scale value.static double
MINIMUM_SCALE_VALUE
Minimal scale value.static String
SCALE_CHANGE_PROPERTY
Name of the property for the factor to apply when zooming in or out.static String
SCALE_VALUE_PROPERTY
Name of the property that contains the zooming/scale value.static String
VIEWPORT_BOUNDS_PROPERTY
Name of the property for the bounds of the viewport in document coordinates.static String
VIEWPORT_CENTER_X_PROPERTY
Name of the property for the x coordinate of the viewport center in document coordinates.static String
VIEWPORT_CENTER_Y_PROPERTY
Name of the property for the y coordinate of the viewport center in document coordinates.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
addDrawingListener(DrawingListener listener)
Add a drawing listener.javafx.beans.property.ReadOnlyObjectProperty<Rectangle2afp<?,?,?,?,?,?>>
documentBoundsProperty()
Replies the property that contains the document bounds.javafx.beans.property.ObjectProperty<Drawer<? super T>>
documentDrawerProperty()
Replies the property that contains the document drawer.javafx.beans.property.ObjectProperty<T>
documentModelProperty()
Replies the property that contains the document model.javafx.beans.property.IntegerProperty
drawableElementBudgetProperty()
Replies the property that defines the maximal number of drawable elements to be render.void
drawContent()
Refresh the content of the viewer in order to have a new image drawn.Rectangle2afp<?,?,?,?,?,?>
getDocumentBounds()
Replies the bounds of the document.Drawer<? super T>
getDocumentDrawer()
Replies the drawer of the document.T
getDocumentModel()
Replies the model of the document.int
getDrawableElementBudget()
Replies the maximal number of drawable elements to be render.double
getMaxScaleValue()
Replies the maximum scale value.double
getMinScaleValue()
Replies the minimum scale value.double
getScaleChange()
Replies the delta value that is applied when zooming in or out.double
getScaleValue()
Replies the scale value.default double
getScaleValueToFit()
Replies the scale value to fit the content to the viewport.double
getScaleValueToFit(boolean minimizeOnly)
Replies the scale value to fit the content to the viewport.Rectangle2afp<?,?,?,?,?,?>
getViewportBounds()
Replies the bounds of the viewport in document coordinates.double
getViewportCenterX()
Replies the x coordinate of the viewport center in document coordinates.double
getViewportCenterY()
Replies the y coordinate of the viewport center in document coordinates.javafx.beans.property.BooleanProperty
invertedAxisXProperty()
Replies the property that indicates if the X axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.javafx.beans.property.BooleanProperty
invertedAxisYProperty()
Replies the property that indicates if the Y axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.boolean
isInvertedAxisX()
Replies if the x axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.boolean
isInvertedAxisY()
Replies if the Y axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.javafx.beans.property.DoubleProperty
maxScaleValueProperty()
Replies the property for the maximum scale value.javafx.beans.property.DoubleProperty
minScaleValueProperty()
Replies the property for the minimum scale value.void
removeDrawingListener(DrawingListener listener)
Remove a drawing listener.default void
resetScale()
Reset the scale value to avoid any zoom out or in.default void
resetViewportCenter()
Reset the viewer center to match the center of the document.javafx.beans.property.DoubleProperty
scaleChangeProperty()
Replies the property for the delta value that is applied when zooming in or out.javafx.beans.property.DoubleProperty
scaleValueProperty()
Replies the property for the scale value.void
setDocumentDrawer(Drawer<? super T> drawer)
Change the drawer of the document.void
setDocumentModel(T model)
Change the model of the document.void
setDrawableElementBudget(int budget)
Change the maximal number of drawable elements to be render.void
setInvertedAxisX(boolean inverted)
Change the flag if the x axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.void
setInvertedAxisY(boolean inverted)
Change the flag if the Y axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.void
setMaxScaleValue(double value)
Change the maximum scale value.void
setMinScaleValue(double value)
Change the minimum scale value.void
setScaleChange(double change)
Change the change factor that is applied when zooming in or out.void
setScaleValue(double value)
Change the scale value.void
setScaleValue(double scaleValue, double centerX, double centerY)
Change the zoom factor and center the view point at the given given position.default void
setScaleValueToFit(boolean minimizeOnly)
Zoom to fit the content.void
setViewportCenter(double x, double y)
Change the coordinates of the viewport center in document coordinates.void
setViewportCenterX(double x)
Change the x coordinate of the viewport center in document coordinates.void
setViewportCenterY(double y)
Change the y coordinate of the viewport center in document coordinates.default Point2d
toDocumentPosition(double x, double y)
Replies the position inside the document that corresponds to the given position on screen.default Point2d
toDocumentPosition(Point2D<?,?> position)
Replies the position inside the document that corresponds to the given position on screen.double
toDocumentPositionX(double x)
Replies the X position inside the document that corresponds to the given X position on screen.double
toDocumentPositionY(double y)
Replies the Y position inside the document that corresponds to the given Y position on screen.default Rectangle2d
toDocumentRect(double x, double y, double width, double height)
Replies the position inside the document that corresponds to the given rectangle on the screen..default Rectangle2d
toDocumentRect(Rectangle2afp<?,?,?,?,?,?> rect)
Replies the position inside the document that corresponds to the given rectangle on the screen..double
toDocumentSize(double size)
Replies the size inside the document that corresponds to the given size on screen.default Point2d
toScreenPosition(double x, double y)
Replies the position on the screen that corresponds to the given position within the document.default Point2d
toScreenPosition(Point2D<?,?> position)
Replies the position on the screen that corresponds to the given position within the document.double
toScreenPositionX(double x)
Replies the X position on the screen that corresponds to the given X position within the document.double
toScreenPositionY(double y)
Replies the Y position on the screen that corresponds to the given Y position within the document.default Rectangle2d
toScreenRect(double x, double y, double width, double height)
Replies the position on the screen that corresponds to the given rectangle inside the document.default Rectangle2d
toScreenRect(Rectangle2afp<?,?,?,?,?,?> rect)
Replies the position on the screen that corresponds to the given rectangle inside the document.double
toScreenSize(double size)
Replies the size on the screen that corresponds to the given size within the document.javafx.beans.property.ReadOnlyObjectProperty<Rectangle2afp<?,?,?,?,?,?>>
viewportBoundsProperty()
Replies the property that contains the viewport bounds in the document coordinates.javafx.beans.property.DoubleProperty
viewportCenterXProperty()
Replies the property for the x coordinate of the viewport center in document coordinates.javafx.beans.property.DoubleProperty
viewportCenterYProperty()
Replies the property for the y coordinate of the viewport center in document coordinates.default void
zoomIn()
Zoom in.default void
zoomIn(double centerX, double centerY)
Zoom in from a specific location, and center at the view point to the given location.default void
zoomOut()
Zoom out.default void
zoomOut(double centerX, double centerY)
Zoom out from a specific location, and center at the view point to the given location.
-
-
-
Field Detail
-
SCALE_VALUE_PROPERTY
static final String SCALE_VALUE_PROPERTY
Name of the property that contains the zooming/scale value. A value of 1 means that there is no scaling. A value greater than 1 means that the document is zooming in. A value below 1 means that the document is zoomed out.- See Also:
- Constant Field Values
-
MIN_SCALE_VALUE_PROPERTY
static final String MIN_SCALE_VALUE_PROPERTY
Name of the property for the minimal scale value.- See Also:
- Constant Field Values
-
MAX_SCALE_VALUE_PROPERTY
static final String MAX_SCALE_VALUE_PROPERTY
Name of the property for the maximal scale value.- See Also:
- Constant Field Values
-
DOCUMENT_BOUNDS_PROPERTY
static final String DOCUMENT_BOUNDS_PROPERTY
Name of the property for the bounds of the document in document coordinates.- See Also:
- Constant Field Values
-
VIEWPORT_BOUNDS_PROPERTY
static final String VIEWPORT_BOUNDS_PROPERTY
Name of the property for the bounds of the viewport in document coordinates.- See Also:
- Constant Field Values
-
VIEWPORT_CENTER_X_PROPERTY
static final String VIEWPORT_CENTER_X_PROPERTY
Name of the property for the x coordinate of the viewport center in document coordinates.- See Also:
- Constant Field Values
-
VIEWPORT_CENTER_Y_PROPERTY
static final String VIEWPORT_CENTER_Y_PROPERTY
Name of the property for the y coordinate of the viewport center in document coordinates.- See Also:
- Constant Field Values
-
INVERTED_AXIS_X_PROPERTY
static final String INVERTED_AXIS_X_PROPERTY
Name of the property that indicates if the X axis is inverted.- See Also:
- Constant Field Values
-
INVERTED_AXIS_Y_PROPERTY
static final String INVERTED_AXIS_Y_PROPERTY
Name of the property that indicates if the Y axis is inverted.- See Also:
- Constant Field Values
-
DOCUMENT_MODEL_PROPERTY
static final String DOCUMENT_MODEL_PROPERTY
Name of the property for the document model.- See Also:
- Constant Field Values
-
DOCUMENT_DRAWER_PROPERTY
static final String DOCUMENT_DRAWER_PROPERTY
Name of the property for the document drawer.- See Also:
- Constant Field Values
-
SCALE_CHANGE_PROPERTY
static final String SCALE_CHANGE_PROPERTY
Name of the property for the factor to apply when zooming in or out.- See Also:
- Constant Field Values
-
DRAWABLE_ELEMENT_BUDGET_PROPERTY
static final String DRAWABLE_ELEMENT_BUDGET_PROPERTY
Name of the property for the drawable element budget.- See Also:
- Constant Field Values
-
DEFAULT_DRAWABLE_ELEMENT_BUDGET
static final int DEFAULT_DRAWABLE_ELEMENT_BUDGET
Default budget for drawable elements.- See Also:
- Constant Field Values
-
MIN_DRAWABLE_ELEMENT_BUDGET
static final int MIN_DRAWABLE_ELEMENT_BUDGET
Default budget for drawable elements.- See Also:
- Constant Field Values
-
DEFAULT_SCALE_CHANGE
static final double DEFAULT_SCALE_CHANGE
Default scaling delta.- See Also:
- Constant Field Values
-
MIN_SCALE_CHANGE
static final double MIN_SCALE_CHANGE
Minimum scaling delta.- See Also:
- Constant Field Values
-
MINIMUM_SCALE_VALUE
static final double MINIMUM_SCALE_VALUE
Minimal scale value.- See Also:
- Constant Field Values
-
MAXIMUM_SCALE_VALUE
static final double MAXIMUM_SCALE_VALUE
Maximal scale value.- See Also:
- Constant Field Values
-
-
Method Detail
-
documentModelProperty
@Pure javafx.beans.property.ObjectProperty<T> documentModelProperty()
Replies the property that contains the document model.- Returns:
- the property.
-
getDocumentModel
@Pure T getDocumentModel()
Replies the model of the document.- Returns:
- the model of the document.
-
setDocumentModel
void setDocumentModel(T model)
Change the model of the document.- Parameters:
model
- the model of the document.
-
documentDrawerProperty
@Pure javafx.beans.property.ObjectProperty<Drawer<? super T>> documentDrawerProperty()
Replies the property that contains the document drawer.- Returns:
- the property.
-
getDocumentDrawer
@Pure Drawer<? super T> getDocumentDrawer()
Replies the drawer of the document.- Returns:
- the drawer of the document.
-
setDocumentDrawer
void setDocumentDrawer(Drawer<? super T> drawer)
Change the drawer of the document.- Parameters:
drawer
- the drawer of the document.
-
documentBoundsProperty
@Pure javafx.beans.property.ReadOnlyObjectProperty<Rectangle2afp<?,?,?,?,?,?>> documentBoundsProperty()
Replies the property that contains the document bounds.- Returns:
- the property.
-
getDocumentBounds
@Pure Rectangle2afp<?,?,?,?,?,?> getDocumentBounds()
Replies the bounds of the document.- Returns:
- the bounds of the document.
-
scaleValueProperty
@Pure javafx.beans.property.DoubleProperty scaleValueProperty()
Replies the property for the scale value.A scale value of
1
is neither zoom in nor zoom out. A value greater than 1 is a zoom in. A value lower than 1 is a zoom out.- Returns:
- the property.
-
getScaleValue
@Pure double getScaleValue()
Replies the scale value.A scale value of
1
is neither zoom in nor zoom out. A value greater than 1 is a zoom in. A value lower than 1 is a zoom out.- Returns:
- the scale value.
-
setScaleValue
void setScaleValue(double value)
Change the scale value.A scale value of
1
is neither zoom in nor zoom out. A value greater than 1 is a zoom in. A value lower than 1 is a zoom out.- Parameters:
value
- the scale value.
-
setScaleValue
void setScaleValue(double scaleValue, double centerX, double centerY)
Change the zoom factor and center the view point at the given given position.A scale value of
1
is neither zoom in nor zoom out. A value greater than 1 is a zoom in. A value lower than 1 is a zoom out.- Parameters:
scaleValue
- the scale value.centerX
- the position along the X axis of the viewport center. Value in [0;1].centerY
- the position along the Y axis of the viewport center. Value in [0;1].
-
minScaleValueProperty
@Pure javafx.beans.property.DoubleProperty minScaleValueProperty()
Replies the property for the minimum scale value.The min scale value has always precedence on the max scale value. It means that the min value becomes greater to the max value, or the max value becomes lower than the min value, the min value will be the valid reference and the max value will be changed accordingly.
- Returns:
- the property.
-
getMinScaleValue
@Pure double getMinScaleValue()
Replies the minimum scale value.- Returns:
- the minimum scale value.
-
setMinScaleValue
void setMinScaleValue(double value)
Change the minimum scale value.- Parameters:
value
- the minimum scale value.
-
maxScaleValueProperty
@Pure javafx.beans.property.DoubleProperty maxScaleValueProperty()
Replies the property for the maximum scale value.The min scale value has always precedence on the max scale value. It means that the min value becomes greater to the max value, or the max value becomes lower than the min value, the min value will be the valid reference and the max value will be changed accordingly.
- Returns:
- the property.
-
getMaxScaleValue
@Pure double getMaxScaleValue()
Replies the maximum scale value.- Returns:
- the maximum scale value.
-
setMaxScaleValue
void setMaxScaleValue(double value)
Change the maximum scale value.- Parameters:
value
- the maximum scale value.
-
viewportCenterXProperty
@Pure javafx.beans.property.DoubleProperty viewportCenterXProperty()
Replies the property for the x coordinate of the viewport center in document coordinates.- Returns:
- the property.
-
getViewportCenterX
@Pure double getViewportCenterX()
Replies the x coordinate of the viewport center in document coordinates.- Returns:
- the x coordinate of the viewport center in document coordinates.
-
setViewportCenterX
void setViewportCenterX(double x)
Change the x coordinate of the viewport center in document coordinates.- Parameters:
x
- the x coordinate of the viewport center in document coordinates.
-
viewportCenterYProperty
@Pure javafx.beans.property.DoubleProperty viewportCenterYProperty()
Replies the property for the y coordinate of the viewport center in document coordinates.- Returns:
- the property.
-
getViewportCenterY
@Pure double getViewportCenterY()
Replies the y coordinate of the viewport center in document coordinates.- Returns:
- the y coordinate of the viewport center in document coordinates.
-
setViewportCenterY
void setViewportCenterY(double y)
Change the y coordinate of the viewport center in document coordinates.- Parameters:
y
- the y coordinate of the viewport center in document coordinates.
-
setViewportCenter
void setViewportCenter(double x, double y)
Change the coordinates of the viewport center in document coordinates.- Parameters:
x
- the x coordinate of the viewport center in document coordinates.y
- the y coordinate of the viewport center in document coordinates.
-
viewportBoundsProperty
@Pure javafx.beans.property.ReadOnlyObjectProperty<Rectangle2afp<?,?,?,?,?,?>> viewportBoundsProperty()
Replies the property that contains the viewport bounds in the document coordinates.- Returns:
- the property.
-
getViewportBounds
@Pure Rectangle2afp<?,?,?,?,?,?> getViewportBounds()
Replies the bounds of the viewport in document coordinates.- Returns:
- the bounds of the viewport.
-
getScaleValueToFit
@Pure default double getScaleValueToFit()
Replies the scale value to fit the content to the viewport.- Returns:
- the scale value to apply for fitting the content to the viewport.
-
getScaleValueToFit
@Pure double getScaleValueToFit(boolean minimizeOnly)
Replies the scale value to fit the content to the viewport.- Parameters:
minimizeOnly
- If the content fits already into the viewport, then we don't zoom if this parameter is true.- Returns:
- the scale value to apply for fitting the content to the viewport.
-
setScaleValueToFit
default void setScaleValueToFit(boolean minimizeOnly)
Zoom to fit the content.- Parameters:
minimizeOnly
- If the content fits already into the viewport, then we don't zoom if this parameter is true.
-
resetScale
default void resetScale()
Reset the scale value to avoid any zoom out or in.
-
resetViewportCenter
default void resetViewportCenter()
Reset the viewer center to match the center of the document.- Since:
- 16.0
-
zoomOut
default void zoomOut()
Zoom out.
-
zoomOut
default void zoomOut(double centerX, double centerY)
Zoom out from a specific location, and center at the view point to the given location.- Parameters:
centerX
- the x coordinate on the point to zoom in.centerY
- the y coordinate on the point to zoom in.
-
zoomIn
default void zoomIn()
Zoom in.
-
zoomIn
default void zoomIn(double centerX, double centerY)
Zoom in from a specific location, and center at the view point to the given location.- Parameters:
centerX
- the x coordinate on the point to zoom in.centerY
- the y coordinate on the point to zoom in.
-
scaleChangeProperty
@Pure javafx.beans.property.DoubleProperty scaleChangeProperty()
Replies the property for the delta value that is applied when zooming in or out. The value is strictly greater than 1.- Returns:
- the property.
-
getScaleChange
@Pure double getScaleChange()
Replies the delta value that is applied when zooming in or out. The value is strictly greater than 1.- Returns:
- the change positive value. The value is greater than 1.
-
setScaleChange
void setScaleChange(double change)
Change the change factor that is applied when zooming in or out. The value is strictly greater than 1.- Parameters:
change
- the change positive value. Only positive values greater than 1 are accepted.
-
invertedAxisXProperty
@Pure javafx.beans.property.BooleanProperty invertedAxisXProperty()
Replies the property that indicates if the X axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.- Returns:
- the property.
-
isInvertedAxisX
@Pure boolean isInvertedAxisX()
Replies if the x axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.- Returns:
- the x coordinate of the viewport center in document coordinates.
-
setInvertedAxisX
void setInvertedAxisX(boolean inverted)
Change the flag if the x axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.- Parameters:
inverted
- the x coordinate of the viewport center in document coordinates.
-
invertedAxisYProperty
@Pure javafx.beans.property.BooleanProperty invertedAxisYProperty()
Replies the property that indicates if the Y axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.- Returns:
- the property.
-
isInvertedAxisY
@Pure boolean isInvertedAxisY()
Replies if the Y axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.- Returns:
- the Y coordinate of the viewport center in document coordinates.
-
setInvertedAxisY
void setInvertedAxisY(boolean inverted)
Change the flag if the Y axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.- Parameters:
inverted
- the Y coordinate of the viewport center in document coordinates.
-
drawableElementBudgetProperty
@Pure javafx.beans.property.IntegerProperty drawableElementBudgetProperty()
Replies the property that defines the maximal number of drawable elements to be render.The value of the budget is a strictly positive number greater than 100.
- Returns:
- the property.
-
getDrawableElementBudget
@Pure int getDrawableElementBudget()
Replies the maximal number of drawable elements to be render.The value of the budget is a strictly positive number greater than 100.
- Returns:
- the budget.
-
setDrawableElementBudget
void setDrawableElementBudget(int budget)
Change the maximal number of drawable elements to be render.The value of the budget is a strictly positive number greater than 100.
- Parameters:
budget
- the maximal number of elements to draw.
-
addDrawingListener
void addDrawingListener(DrawingListener listener)
Add a drawing listener.- Parameters:
listener
- the listener.- Since:
- 15.0
-
removeDrawingListener
void removeDrawingListener(DrawingListener listener)
Remove a drawing listener.- Parameters:
listener
- the listener.- Since:
- 15.0
-
toDocumentPosition
@Pure default Point2d toDocumentPosition(Point2D<?,?> position)
Replies the position inside the document that corresponds to the given position on screen.The position on the screen may be the mouse position.
- Parameters:
position
- the position on the screen.- Returns:
- the position in the document.
- Since:
- 15.0
-
toDocumentPosition
@Pure default Point2d toDocumentPosition(double x, double y)
Replies the position inside the document that corresponds to the given position on screen.The position on the screen may be the mouse position.
- Parameters:
x
- x coordinate of the position on the screen.y
- y coordinate of the position on the screen.- Returns:
- the position in the document.
- Since:
- 15.0
-
toDocumentPositionX
@Pure double toDocumentPositionX(double x)
Replies the X position inside the document that corresponds to the given X position on screen.The position on the screen may be the mouse position.
- Parameters:
x
- x coordinate of the position on the screen.- Returns:
- the position in the document.
- Since:
- 15.0
-
toDocumentPositionY
@Pure double toDocumentPositionY(double y)
Replies the Y position inside the document that corresponds to the given Y position on screen.The position on the screen may be the mouse position.
- Parameters:
y
- y coordinate of the position on the screen.- Returns:
- the position in the document.
- Since:
- 15.0
-
toDocumentSize
@Pure double toDocumentSize(double size)
Replies the size inside the document that corresponds to the given size on screen.The size on the screen is generally given in pixels.
- Parameters:
size
- the size on the screen.- Returns:
- the size in the document.
- Since:
- 15.0
-
toDocumentRect
@Pure default Rectangle2d toDocumentRect(Rectangle2afp<?,?,?,?,?,?> rect)
Replies the position inside the document that corresponds to the given rectangle on the screen..- Parameters:
rect
- the rectangle on the screen.- Returns:
- the rectangle in the document.
- Since:
- 15.0
-
toDocumentRect
@Pure default Rectangle2d toDocumentRect(double x, double y, double width, double height)
Replies the position inside the document that corresponds to the given rectangle on the screen..- Parameters:
x
- the minimum x coordinate within the rectangle.y
- the minimum y coordinate within the rectangle.width
- the width of rectangle.height
- the height of rectangle.- Returns:
- the rectangle in the document.
- Since:
- 15.0
-
toScreenPosition
@Pure default Point2d toScreenPosition(Point2D<?,?> position)
Replies the position on the screen that corresponds to the given position within the document.The position on the screen may be the mouse position.
- Parameters:
position
- the position within the document.- Returns:
- the position on the screen.
- Since:
- 15.0
-
toScreenPosition
@Pure default Point2d toScreenPosition(double x, double y)
Replies the position on the screen that corresponds to the given position within the document.The position on the screen may be the mouse position.
- Parameters:
x
- x coordinate of the position within the document.y
- y coordinate of the position within the document.- Returns:
- the position on the screen..
- Since:
- 15.0
-
toScreenPositionX
@Pure double toScreenPositionX(double x)
Replies the X position on the screen that corresponds to the given X position within the document.The position on the screen may be the mouse position.
- Parameters:
x
- x coordinate of the position within the document.- Returns:
- the position on the screen.
- Since:
- 15.0
-
toScreenPositionY
@Pure double toScreenPositionY(double y)
Replies the Y position on the screen that corresponds to the given Y position within the document.The position on the screen may be the mouse position.
- Parameters:
y
- y coordinate of the position within the document.- Returns:
- the position on the screen.
- Since:
- 15.0
-
toScreenSize
@Pure double toScreenSize(double size)
Replies the size on the screen that corresponds to the given size within the document.The size on the screen is generally given in pixels.
- Parameters:
size
- the size within the document.- Returns:
- the size on the screen.
- Since:
- 15.0
-
toScreenRect
@Pure default Rectangle2d toScreenRect(Rectangle2afp<?,?,?,?,?,?> rect)
Replies the position on the screen that corresponds to the given rectangle inside the document.- Parameters:
rect
- the rectangle within the document.- Returns:
- the rectangle on the screen.
- Since:
- 15.0
-
toScreenRect
@Pure default Rectangle2d toScreenRect(double x, double y, double width, double height)
Replies the position on the screen that corresponds to the given rectangle inside the document.- Parameters:
x
- the minimum x coordinate within the rectangle.y
- the minimum y coordinate within the rectangle.width
- the width of rectangle.height
- the height of rectangle.- Returns:
- the rectangle on the screen.
- Since:
- 15.0
-
drawContent
void drawContent()
Refresh the content of the viewer in order to have a new image drawn.- Since:
- 15.0
-
-