- java.lang.Object
-
- io.github.mmm.ui.spi.AbstractUiScreen
-
- All Implemented Interfaces:
AttributeReadSize
,UiScreen
- Direct Known Subclasses:
FxScreen
,TestScreen
,TvmScreen
public abstract class AbstractUiScreen extends Object implements UiScreen
Abstract base implementation ofUiScreen
.- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description AbstractUiScreen()
The constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
doUpdate()
double
getDpi()
double
getHeightInPixel()
double
getSize()
UiScreenType
getType()
double
getWidthInPixel()
String
toString()
void
update()
Forces the display to update.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.github.mmm.ui.api.attribute.AttributeReadSize
getHeight, getWidth
-
-
-
-
Field Detail
-
width
protected double width
- See Also:
getWidthInPixel()
-
height
protected double height
- See Also:
getHeightInPixel()
-
dpi
protected double dpi
- See Also:
getDpi()
-
size
protected double size
- See Also:
getSize()
-
type
protected UiScreenType type
- See Also:
getType()
-
-
Method Detail
-
getWidthInPixel
public double getWidthInPixel()
- Specified by:
getWidthInPixel
in interfaceAttributeReadSize
- Returns:
- the width of this object in pixels.
NOTE: The result will typically be anint
value. However, to be compatible withUiSize.getAmount()
and with some underlying native toolkits we usedouble
. You may cast the result toint
.
-
getHeightInPixel
public double getHeightInPixel()
- Specified by:
getHeightInPixel
in interfaceAttributeReadSize
- Returns:
- the height of this object in pixels.
NOTE: The result will typically be anint
value. However, to be compatible withUiSize.getAmount()
and with some underlying native toolkits we usedouble
. You may cast the result toint
.
-
getDpi
public double getDpi()
-
getSize
public double getSize()
-
getType
public UiScreenType getType()
- Specified by:
getType
in interfaceUiScreen
- Returns:
- the
UiScreenType
that categorizes the display size.
-
update
public void update()
Description copied from interface:UiScreen
Forces the display to update. Typically the screen-resolution does not change while your application is running. Therefore values ofUiScreen
may be pre-calculated and cached. However, you can call this method before reading resolution or screen type to force that you are getting most recent values.
-
doUpdate
protected abstract void doUpdate()
-
-