Module io.github.mmm.ui.api.window
Package io.github.mmm.ui.spi.window
Class UiWindowPositionAndSize
java.lang.Object
io.github.mmm.ui.spi.window.UiWindowPositionAndSize
- All Implemented Interfaces:
AttributeReadPosition
,AttributeReadSize
,AttributeWritePosition
,AttributeWritePositionRange
,AttributeWriteSize
,AttributeWriteSizeInPixel
,AttributeWriteSizeRange
public abstract class UiWindowPositionAndSize
extends Object
implements AttributeWritePositionRange, AttributeWriteSizeRange
Abstract base implementation for position, size and controls related attributes of
UiAbstractWindow
or UiChildWindow
.- Since:
- 1.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected double
protected double
protected double
protected double
protected double
protected double
protected double
protected double
protected double
protected double
protected double
protected double
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
centerOnScreen
(boolean force) Initializes the position and size.protected static double
clipMax
(double max) protected static double
clipSize
(double size) protected static double
clipZero
(double pos) double
double
double
double
getMaxX()
double
getMaxY()
double
double
double
getMinX()
double
getMinY()
protected abstract double
protected abstract double
double
double
getX()
double
getY()
void
void
setHeightInPixel
(double height) void
setMaxHeight
(double maxHeight) void
setMaxWidth
(double maxWidth) void
setMaxX
(double maxX) void
setMaxY
(double maxY) void
setMinHeight
(double minHeight) void
setMinWidth
(double minWidth) void
setMinX
(double minX) void
setMinY
(double minY) void
setPosition
(double x, double y) void
void
setSizeInPixel
(double width, double height) void
void
setWidthInPixel
(double width) void
setX
(double x) void
setY
(double y) 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
-
Field Details
-
x
protected double x- See Also:
-
y
protected double y- See Also:
-
minX
protected double minX- See Also:
-
minY
protected double minY- See Also:
-
maxX
protected double maxX- See Also:
-
maxY
protected double maxY- See Also:
-
width
protected double width- See Also:
-
height
protected double height- See Also:
-
minWidth
protected double minWidth- See Also:
-
minHeight
protected double minHeight- See Also:
-
maxWidth
protected double maxWidth- See Also:
-
maxHeight
protected double maxHeight- See Also:
-
-
Constructor Details
-
UiWindowPositionAndSize
public UiWindowPositionAndSize()The constructor.
-
-
Method Details
-
getWidthInPixel
public double getWidthInPixel()- Specified by:
getWidthInPixel
in interfaceAttributeReadSize
-
setWidthInPixel
public void setWidthInPixel(double width) - Specified by:
setWidthInPixel
in interfaceAttributeWriteSize
- Specified by:
setWidthInPixel
in interfaceAttributeWriteSizeInPixel
-
setWidth
- Specified by:
setWidth
in interfaceAttributeWriteSize
-
getHeightInPixel
public double getHeightInPixel()- Specified by:
getHeightInPixel
in interfaceAttributeReadSize
-
setHeightInPixel
public void setHeightInPixel(double height) - Specified by:
setHeightInPixel
in interfaceAttributeWriteSize
- Specified by:
setHeightInPixel
in interfaceAttributeWriteSizeInPixel
-
setHeight
- Specified by:
setHeight
in interfaceAttributeWriteSize
-
setSizeInPixel
public void setSizeInPixel(double width, double height) - Specified by:
setSizeInPixel
in interfaceAttributeWriteSize
- Specified by:
setSizeInPixel
in interfaceAttributeWriteSizeInPixel
-
setSize
- Specified by:
setSize
in interfaceAttributeWriteSize
-
getMinWidth
public double getMinWidth()- Specified by:
getMinWidth
in interfaceAttributeWriteSizeRange
-
setMinWidth
public void setMinWidth(double minWidth) - Specified by:
setMinWidth
in interfaceAttributeWriteSizeRange
-
getMaxWidth
public double getMaxWidth()- Specified by:
getMaxWidth
in interfaceAttributeWriteSizeRange
-
setMaxWidth
public void setMaxWidth(double maxWidth) - Specified by:
setMaxWidth
in interfaceAttributeWriteSizeRange
-
getMinHeight
public double getMinHeight()- Specified by:
getMinHeight
in interfaceAttributeWriteSizeRange
-
setMinHeight
public void setMinHeight(double minHeight) - Specified by:
setMinHeight
in interfaceAttributeWriteSizeRange
-
getMaxHeight
public double getMaxHeight()- Specified by:
getMaxHeight
in interfaceAttributeWriteSizeRange
-
setMaxHeight
public void setMaxHeight(double maxHeight) - Specified by:
setMaxHeight
in interfaceAttributeWriteSizeRange
-
getX
public double getX()- Specified by:
getX
in interfaceAttributeReadPosition
-
setX
public void setX(double x) - Specified by:
setX
in interfaceAttributeWritePosition
-
getY
public double getY()- Specified by:
getY
in interfaceAttributeReadPosition
-
setY
public void setY(double y) - Specified by:
setY
in interfaceAttributeWritePosition
-
setPosition
public void setPosition(double x, double y) - Specified by:
setPosition
in interfaceAttributeWritePosition
-
getMinX
public double getMinX()- Specified by:
getMinX
in interfaceAttributeWritePositionRange
-
setMinX
public void setMinX(double minX) - Specified by:
setMinX
in interfaceAttributeWritePositionRange
-
getMaxX
public double getMaxX()- Specified by:
getMaxX
in interfaceAttributeWritePositionRange
-
setMaxX
public void setMaxX(double maxX) - Specified by:
setMaxX
in interfaceAttributeWritePositionRange
-
getMinY
public double getMinY()- Specified by:
getMinY
in interfaceAttributeWritePositionRange
-
setMinY
public void setMinY(double minY) - Specified by:
setMinY
in interfaceAttributeWritePositionRange
-
getMaxY
public double getMaxY()- Specified by:
getMaxY
in interfaceAttributeWritePositionRange
-
setMaxY
public void setMaxY(double maxY) - Specified by:
setMaxY
in interfaceAttributeWritePositionRange
-
getScreenWidth
protected abstract double getScreenWidth()- Returns:
- the current width of the screen available for child windows.
-
getScreenHeight
protected abstract double getScreenHeight()- Returns:
- the current height of the screen available for child windows.
-
centerOnScreen
public void centerOnScreen(boolean force) Initializes 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. -
clipSize
protected static double clipSize(double size) - Parameters:
size
- the width or height to clip.- Returns:
- the maximum of the given
size
and100
.
-
clipZero
protected static double clipZero(double pos) - Parameters:
pos
- the position value.- Returns:
- the maximum of the given
pos
and0
.
-
clipMax
protected static double clipMax(double max) - Parameters:
max
- the maximum value.- Returns:
- the given
max
clipped to the range from0
toInteger.MAX_VALUE
.
-