Module io.github.mmm.ui.fx.window
Class FxAbstractWindowPositionAndSize
- java.lang.Object
-
- io.github.mmm.ui.spi.window.UiWindowPositionAndSize
-
- io.github.mmm.ui.fx.widget.window.FxAbstractWindowPositionAndSize
-
- All Implemented Interfaces:
AttributeReadPosition,AttributeReadSize,AttributeWritePosition,AttributeWritePositionRange,AttributeWriteSize,AttributeWriteSizeInPixel,AttributeWriteSizeRange
public class FxAbstractWindowPositionAndSize extends UiWindowPositionAndSize
Implementation ofUiWindowPositionAndSizefor JavaFx.- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description FxAbstractWindowPositionAndSize(javafx.stage.Stage stage)The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcenterOnScreen(boolean force)Initializes the position and size.doublegetHeightInPixel()protected doublegetScreenHeight()protected doublegetScreenWidth()doublegetWidthInPixel()doublegetX()doublegetY()voidsetHeightInPixel(double height)voidsetWidthInPixel(double width)voidsetX(double x)voidsetY(double y)-
Methods inherited from class io.github.mmm.ui.spi.window.UiWindowPositionAndSize
clipMax, clipSize, clipZero, getMaxHeight, getMaxWidth, getMaxX, getMaxY, getMinHeight, getMinWidth, getMinX, getMinY, setHeight, setMaxHeight, setMaxWidth, setMaxX, setMaxY, setMinHeight, setMinWidth, setMinX, setMinY, setPosition, setSize, setSizeInPixel, setWidth
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.github.mmm.ui.api.attribute.AttributeReadSize
getHeight, getWidth
-
Methods inherited from interface io.github.mmm.ui.api.attribute.AttributeWritePositionRange
setXRange, setYRange
-
Methods inherited from interface io.github.mmm.ui.api.attribute.AttributeWriteSize
setSize
-
Methods inherited from interface io.github.mmm.ui.api.attribute.AttributeWriteSizeRange
setHeightRange, setWidthRange
-
-
-
-
Method Detail
-
getX
public double getX()
- Specified by:
getXin interfaceAttributeReadPosition- Overrides:
getXin classUiWindowPositionAndSize- Returns:
- the x position of this object as the number of pixels from the left on the x-axis (horizontally).
-
setX
public void setX(double x)
- Specified by:
setXin interfaceAttributeWritePosition- Overrides:
setXin classUiWindowPositionAndSize- Parameters:
x- the newposition on the x-axis.
-
getY
public double getY()
- Specified by:
getYin interfaceAttributeReadPosition- Overrides:
getYin classUiWindowPositionAndSize- Returns:
- the y position of this object as the number of pixels from the top on the y-axis (vertically).
-
setY
public void setY(double y)
- Specified by:
setYin interfaceAttributeWritePosition- Overrides:
setYin classUiWindowPositionAndSize- Parameters:
y- the newposition on the y-axis.
-
getWidthInPixel
public double getWidthInPixel()
- Specified by:
getWidthInPixelin interfaceAttributeReadSize- Overrides:
getWidthInPixelin classUiWindowPositionAndSize- Returns:
- the width of this object in pixels.
NOTE: The result will typically be anintvalue. However, to be compatible withUiSize.getAmount()and with some underlying native toolkits we usedouble. You may cast the result toint.
-
setWidthInPixel
public void setWidthInPixel(double width)
- Specified by:
setWidthInPixelin interfaceAttributeWriteSize- Specified by:
setWidthInPixelin interfaceAttributeWriteSizeInPixel- Overrides:
setWidthInPixelin classUiWindowPositionAndSize- Parameters:
width- the newwidth in pixel.
-
getHeightInPixel
public double getHeightInPixel()
- Specified by:
getHeightInPixelin interfaceAttributeReadSize- Overrides:
getHeightInPixelin classUiWindowPositionAndSize- Returns:
- the height of this object in pixels.
NOTE: The result will typically be anintvalue. However, to be compatible withUiSize.getAmount()and with some underlying native toolkits we usedouble. You may cast the result toint.
-
setHeightInPixel
public void setHeightInPixel(double height)
- Specified by:
setHeightInPixelin interfaceAttributeWriteSize- Specified by:
setHeightInPixelin interfaceAttributeWriteSizeInPixel- Overrides:
setHeightInPixelin classUiWindowPositionAndSize- Parameters:
height- the newheight in pixel.
-
getScreenWidth
protected double getScreenWidth()
- Specified by:
getScreenWidthin classUiWindowPositionAndSize- Returns:
- the current width of the screen available for child windows.
-
getScreenHeight
protected double getScreenHeight()
- Specified by:
getScreenHeightin classUiWindowPositionAndSize- Returns:
- the current height of the screen available for child windows.
-
centerOnScreen
public void centerOnScreen(boolean force)
Description copied from class:UiWindowPositionAndSizeInitializes the position and size. If neither of those is set, size will be set to a quarter of the screen (half of screen width and height) and window is centered on the screen.- Overrides:
centerOnScreenin classUiWindowPositionAndSize- Parameters:
force-trueto always updateXandYto center the window on the screen,falseto only updateXandYin case they are uninitialized (-1).
-
-