public class Display extends MicroUIDisplay
The filter image is used to define the display rendering area. Outside this area, the display buffer data is not
drawn. This image must have the same size (@see Widget.setWidth(int)
and Widget.setHeight(int)
) than the widget
itself. If not, an error is thrown in MicroUIDisplay.finalizeConfiguration()
.
MicroUIDisplay.AbstractDisplayExtension
Widget.WidgetAttribute, Widget.WidgetDescription
Modifier and Type | Field and Description |
---|---|
protected Image |
drawingBuffer
When the display is double buffered, the backBuffer represents the back buffer where drawings are done.
|
protected Image |
frameBuffer
This buffer contains the application drawings after the call to
MicroUIDisplay.flush() in double buffer mode or during
application rendering in simple buffer mode. |
protected Image |
visibleBuffer
Buffer visible on front panel viewer: contains application drawings (see
frameBuffer ) and some post
transformations like mask reduction, backlight and contrast. |
BACKLIGHT_MAX, BACKLIGHT_MIN, CONTRAST_MAX, CONTRAST_MIN
DEFAULT_LABEL
Constructor and Description |
---|
Display()
Creates the widget display
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Disposes the widget's associated resources (such as threads, images...).
|
protected void |
drawBacklight(Image imageSkin)
Transforms the skin data applying an algorithm to simulate the display backlight.
|
protected void |
drawContrast(Image imageSkin)
Transforms the skin data applying an algorithm to simulate the display contrast.
|
void |
flush(int x,
int y,
int width,
int height)
Flushes a part of the display limited by specified bounds.
|
Image |
getCurrentSkin()
Gets the current displayed skin.
|
Image |
getDrawingBuffer()
Gets the buffer where performing the drawings.
|
int |
getInitialColor()
Gets the initial color of the display.
|
boolean |
hasBacklight()
Overrides default behavior: backlight is always available on a pixalated display.
|
protected Image |
newDisplayImage()
Creates a new image with the same size than display (not widget size).
|
protected Image |
newWidgetImage()
Creates a new image with the same size than widget (not display size).
|
void |
setAlpha(int alpha)
Sets the opacity level (alpha) of the display in order to obtain a translucent display.
|
void |
setInitialColor(int initialColor)
Sets the initial color of the display (color used on startup, just before first drawing).
|
void |
showYourself(boolean appearSwitchedOn)
Called by front panel viewer to make widgets appear as if "switched on" or not.
|
void |
start()
Called by the parser after filling all the fields defined in the xml.
|
convertARGBColorToDisplayColor, convertDisplayColorToARGBColor, finalizeConfiguration, flush, getBacklight, getContrast, getDisplayHeight, getDisplayWidth, getNbBitsPerPixel, getNumberOfColors, isColor, isDoubleBuffered, prepareBlendingOfIndexedColors, setBacklight, setContrast, setDisplayHeight, setDisplayWidth, setExtensionClass, switchBacklight
protected Image drawingBuffer
protected Image frameBuffer
MicroUIDisplay.flush()
in double buffer mode or during
application rendering in simple buffer mode.protected Image visibleBuffer
frameBuffer
) and some post
transformations like mask reduction, backlight and contrast.public void setInitialColor(int initialColor)
This is a RGB color (24 bits: 8-8-8). Alpha level is ignored.
This method should only be called by front panel parser.
initialColor
- the initial color to set.public void setAlpha(int alpha)
This method should only be called by front panel parser.
alpha
- the opacity level to set, 0x00 is fully transparent and 0xff fully opaque.java.lang.IllegalArgumentException
- if the given argument is not between 0x0 and 0xff.public void showYourself(boolean appearSwitchedOn)
Widget
This method does nothing by default.
This method should only be called by front panel engine.
showYourself
in class Widget
appearSwitchedOn
- true to switch on widget, false to switch off.public void start()
start
in class MicroUIDisplay
public void dispose()
Widget
Default behavior disposes the common images and subclasses should override this method to define their own behavior.
This method should only be called by front panel engine.
public Image getCurrentSkin()
getCurrentSkin
in class Widget
Widget.setCurrentSkin(Image)
public Image getDrawingBuffer()
MicroUIDisplay
getDrawingBuffer
in class MicroUIDisplay
public int getInitialColor()
public boolean hasBacklight()
hasBacklight
in class MicroUIDisplay
public void flush(int x, int y, int width, int height)
MicroUIDisplay
backBuffer
(not double buffered), nothing is done.flush
in class MicroUIDisplay
x
- the x coordinate of the zone to flush.y
- the x coordinate of the zone to flush.width
- the width of the zone to flush.height
- the height of the zone to flush.protected Image newDisplayImage()
protected Image newWidgetImage()
protected void drawContrast(Image imageSkin)
The default implementation performs nothing.
imageSkin
- the image where applying the algorithm.protected void drawBacklight(Image imageSkin)
imageSkin
- the image where applying the algorithm.