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 ofUiAbstractWindoworUiChildWindow.- Since:
- 1.0.0
-
-
Field Summary
Fields Modifier and Type Field Description protected doubleheightprotected doublemaxHeightprotected doublemaxWidthprotected doublemaxXprotected doublemaxYprotected doubleminHeightprotected doubleminWidthprotected doubleminXprotected doubleminYprotected doublewidthprotected doublexprotected doubley
-
Constructor Summary
Constructors Constructor Description UiWindowPositionAndSize()The constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcenterOnScreen(boolean force)Initializes the position and size.protected static doubleclipMax(double max)protected static doubleclipSize(double size)protected static doubleclipZero(double pos)doublegetHeightInPixel()doublegetMaxHeight()doublegetMaxWidth()doublegetMaxX()doublegetMaxY()doublegetMinHeight()doublegetMinWidth()doublegetMinX()doublegetMinY()protected abstract doublegetScreenHeight()protected abstract doublegetScreenWidth()doublegetWidthInPixel()doublegetX()doublegetY()voidsetHeight(UiSize height)voidsetHeightInPixel(double height)voidsetMaxHeight(double maxHeight)voidsetMaxWidth(double maxWidth)voidsetMaxX(double maxX)voidsetMaxY(double maxY)voidsetMinHeight(double minHeight)voidsetMinWidth(double minWidth)voidsetMinX(double minX)voidsetMinY(double minY)voidsetPosition(double x, double y)voidsetSize(UiSize width, UiSize height)voidsetSizeInPixel(double width, double height)voidsetWidth(UiSize width)voidsetWidthInPixel(double width)voidsetX(double x)voidsetY(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 Detail
-
x
protected double x
- See Also:
getX()
-
y
protected double y
- See Also:
getY()
-
minX
protected double minX
- See Also:
getMinX()
-
minY
protected double minY
- See Also:
getMinY()
-
maxX
protected double maxX
- See Also:
getMaxX()
-
maxY
protected double maxY
- See Also:
getMaxY()
-
width
protected double width
- See Also:
AttributeReadSize.getWidth()
-
height
protected double height
- See Also:
AttributeReadSize.getHeight()
-
minWidth
protected double minWidth
- See Also:
getMinWidth()
-
minHeight
protected double minHeight
- See Also:
getMinHeight()
-
maxWidth
protected double maxWidth
- See Also:
getMaxWidth()
-
maxHeight
protected double maxHeight
- See Also:
getMaxHeight()
-
-
Method Detail
-
getWidthInPixel
public double getWidthInPixel()
- Specified by:
getWidthInPixelin interfaceAttributeReadSize
-
setWidthInPixel
public void setWidthInPixel(double width)
- Specified by:
setWidthInPixelin interfaceAttributeWriteSize- Specified by:
setWidthInPixelin interfaceAttributeWriteSizeInPixel
-
setWidth
public void setWidth(UiSize width)
- Specified by:
setWidthin interfaceAttributeWriteSize
-
getHeightInPixel
public double getHeightInPixel()
- Specified by:
getHeightInPixelin interfaceAttributeReadSize
-
setHeightInPixel
public void setHeightInPixel(double height)
- Specified by:
setHeightInPixelin interfaceAttributeWriteSize- Specified by:
setHeightInPixelin interfaceAttributeWriteSizeInPixel
-
setHeight
public void setHeight(UiSize height)
- Specified by:
setHeightin interfaceAttributeWriteSize
-
setSizeInPixel
public void setSizeInPixel(double width, double height)- Specified by:
setSizeInPixelin interfaceAttributeWriteSize- Specified by:
setSizeInPixelin interfaceAttributeWriteSizeInPixel
-
setSize
public void setSize(UiSize width, UiSize height)
- Specified by:
setSizein interfaceAttributeWriteSize
-
getMinWidth
public double getMinWidth()
- Specified by:
getMinWidthin interfaceAttributeWriteSizeRange
-
setMinWidth
public void setMinWidth(double minWidth)
- Specified by:
setMinWidthin interfaceAttributeWriteSizeRange
-
getMaxWidth
public double getMaxWidth()
- Specified by:
getMaxWidthin interfaceAttributeWriteSizeRange
-
setMaxWidth
public void setMaxWidth(double maxWidth)
- Specified by:
setMaxWidthin interfaceAttributeWriteSizeRange
-
getMinHeight
public double getMinHeight()
- Specified by:
getMinHeightin interfaceAttributeWriteSizeRange
-
setMinHeight
public void setMinHeight(double minHeight)
- Specified by:
setMinHeightin interfaceAttributeWriteSizeRange
-
getMaxHeight
public double getMaxHeight()
- Specified by:
getMaxHeightin interfaceAttributeWriteSizeRange
-
setMaxHeight
public void setMaxHeight(double maxHeight)
- Specified by:
setMaxHeightin interfaceAttributeWriteSizeRange
-
getX
public double getX()
- Specified by:
getXin interfaceAttributeReadPosition
-
setX
public void setX(double x)
- Specified by:
setXin interfaceAttributeWritePosition
-
getY
public double getY()
- Specified by:
getYin interfaceAttributeReadPosition
-
setY
public void setY(double y)
- Specified by:
setYin interfaceAttributeWritePosition
-
setPosition
public void setPosition(double x, double y)- Specified by:
setPositionin interfaceAttributeWritePosition
-
getMinX
public double getMinX()
- Specified by:
getMinXin interfaceAttributeWritePositionRange
-
setMinX
public void setMinX(double minX)
- Specified by:
setMinXin interfaceAttributeWritePositionRange
-
getMaxX
public double getMaxX()
- Specified by:
getMaxXin interfaceAttributeWritePositionRange
-
setMaxX
public void setMaxX(double maxX)
- Specified by:
setMaxXin interfaceAttributeWritePositionRange
-
getMinY
public double getMinY()
- Specified by:
getMinYin interfaceAttributeWritePositionRange
-
setMinY
public void setMinY(double minY)
- Specified by:
setMinYin interfaceAttributeWritePositionRange
-
getMaxY
public double getMaxY()
- Specified by:
getMaxYin interfaceAttributeWritePositionRange
-
setMaxY
public void setMaxY(double maxY)
- Specified by:
setMaxYin 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
sizeand100.
-
clipZero
protected static double clipZero(double pos)
- Parameters:
pos- the position value.- Returns:
- the maximum of the given
posand0.
-
clipMax
protected static double clipMax(double max)
- Parameters:
max- the maximum value.- Returns:
- the given
maxclipped to the range from0toInteger.MAX_VALUE.
-
-