public class DisplayBufferManager
extends java.lang.Object
implements ej.fp.Image
| Constructor and Description |
|---|
DisplayBufferManager(DisplayBufferPolicy bufferPolicy,
BufferRefreshStrategy refreshStrategy,
ej.fp.Widget displayWidget,
int displayWidth,
int displayHeight,
int initialColor)
Creates a buffer manager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
crop(ej.fp.Image mask) |
void |
dispose() |
void |
drawImage(ej.fp.Image image,
int sx,
int sy,
int sWidth,
int sHeight,
int dx,
int dy,
int dWidth,
int dHeight) |
void |
drawLine(int x1,
int y1,
int x2,
int y2,
int color) |
void |
drawPixel(int x,
int y,
int color) |
void |
drawRectangle(int x,
int y,
int width,
int height,
int color) |
void |
drawString(java.lang.String s,
int x,
int y,
int textColor,
int backColor) |
void |
drawTransparentImage(ej.fp.Image image,
byte alpha,
int sx,
int sy,
int sWidth,
int sHeight,
int dx,
int dy,
int dWidth,
int dHeight) |
void |
fillOval(int x,
int y,
int width,
int height,
int color) |
void |
fillRectangle(int x,
int y,
int width,
int height,
int color) |
void |
fillTransparentRectangle(int x,
int y,
int width,
int height,
int argbColor) |
void |
flush()
Flushes a part of the display limited by the specified bounds when the display is double buffered.
|
void |
flush(ej.microui.display.Rectangle[] rectangles)
Flushes the display with the help of the given rectangles.
|
ej.fp.Image |
getCurrentBackBuffer()
Gets the current drawing buffer.
|
ej.fp.Image |
getDisplayImage()
Gets the display image.
|
int |
getHeight() |
java.lang.Object |
getMonitor()
Gets the monitor.
|
void |
getPixels(int[] pixels) |
java.lang.Object |
getRAWImage() |
ej.fp.Image |
getTransparentImage(byte alpha) |
int |
getWidth() |
boolean |
isCleanBuffer()
Tells whether the buffer is clean (if nothing is drawn since flush) or not.
|
boolean |
isDoubleBuffered()
Gets whether or not there are several buffers for the display.
|
void |
newDrawingRegion(int x1,
int y1,
int x2,
int y2,
boolean drawingNow)
Called before a drawing is done.
|
int |
readPixel(int x,
int y) |
void |
restore(ej.microui.display.Rectangle rectangle)
Restores (copies) the given rectangular region from old back buffer to the graphics context's current buffer.
|
void |
setFlushTime(int ms)
Simulates the embedded display's flush time when double buffering mode is enabled.
|
void |
setPixels(int[] pixels) |
void |
setRefreshTime(int ms)
Simulates the embedded display's refresh rate when double buffering mode is enabled.
|
void |
setTransparentMode(boolean transparent) |
void |
simulateFlushTime()
Simulates the flush time.
|
void |
waitFlush()
Simulates the waiting of end of an asynchronous flush when the display is double buffered.
|
public DisplayBufferManager(DisplayBufferPolicy bufferPolicy, BufferRefreshStrategy refreshStrategy, ej.fp.Widget displayWidget, int displayWidth, int displayHeight, int initialColor)
public boolean isDoubleBuffered()
In other words, if the drawings are done in a buffer different than the one used by the display or not.
true if there is more than one buffer, false otherwise.public java.lang.Object getMonitor()
public ej.fp.Image getDisplayImage()
public ej.fp.Image getCurrentBackBuffer()
public void flush()
public void waitFlush()
flush() performs a synchronous flush, this method should stay empty because there is
nothing to wait (implementation).
When the call to flush() performs an asynchronous flush (to simulate the same behavior than embedded
side): this method is useful to wait the end of this asynchronous flush.
If the display does not have a backBuffer (not double buffered), nothing is done. This method should
stay empty.public void flush(ej.microui.display.Rectangle[] rectangles)
rectangles - the modified rectangles.public void restore(ej.microui.display.Rectangle rectangle)
rectangle - the rectangle to restore.public boolean isCleanBuffer()
true if nothing has been drawn since flush, false otherwise.public void setFlushTime(int ms)
The buffer manager will wait this time before unlocking the caller to waitFlush().
The time is expressed in milliseconds. A negative or zero value (value) indicates the flush time is instantaneous. Typical values are between 5 and 10ms.
ms - the flush time in milliseconds.public void setRefreshTime(int ms)
When set, the widget is only allowed to initiate a flush action at every refresh tick. It is synchronized on the hardware display's periodic signal (tearing).
ms - the refresh time in ms.public void simulateFlushTime()
public void newDrawingRegion(int x1,
int y1,
int x2,
int y2,
boolean drawingNow)
x1 - the dirty region left x coordinatey1 - the dirty region top y coordinatex2 - the dirty region right y coordinatey2 - the dirty region bottom y coordinatedrawingNow - true if a drawing is following this call, false otherwise.public int getWidth()
getWidth in interface ej.fp.Imagepublic int getHeight()
getHeight in interface ej.fp.Imagepublic void setPixels(int[] pixels)
setPixels in interface ej.fp.Imagepublic int readPixel(int x,
int y)
readPixel in interface ej.fp.Imagepublic void drawPixel(int x,
int y,
int color)
drawPixel in interface ej.fp.Imagepublic void fillRectangle(int x,
int y,
int width,
int height,
int color)
fillRectangle in interface ej.fp.Imagepublic ej.fp.Image getTransparentImage(byte alpha)
getTransparentImage in interface ej.fp.Imagepublic java.lang.Object getRAWImage()
getRAWImage in interface ej.fp.Imagepublic void getPixels(int[] pixels)
getPixels in interface ej.fp.Imagepublic void fillTransparentRectangle(int x,
int y,
int width,
int height,
int argbColor)
fillTransparentRectangle in interface ej.fp.Imagepublic void fillOval(int x,
int y,
int width,
int height,
int color)
fillOval in interface ej.fp.Imagepublic void drawTransparentImage(ej.fp.Image image,
byte alpha,
int sx,
int sy,
int sWidth,
int sHeight,
int dx,
int dy,
int dWidth,
int dHeight)
drawTransparentImage in interface ej.fp.Imagepublic void drawString(java.lang.String s,
int x,
int y,
int textColor,
int backColor)
drawString in interface ej.fp.Imagepublic void drawRectangle(int x,
int y,
int width,
int height,
int color)
drawRectangle in interface ej.fp.Imagepublic void drawLine(int x1,
int y1,
int x2,
int y2,
int color)
drawLine in interface ej.fp.Imagepublic void drawImage(ej.fp.Image image,
int sx,
int sy,
int sWidth,
int sHeight,
int dx,
int dy,
int dWidth,
int dHeight)
drawImage in interface ej.fp.Imagepublic void setTransparentMode(boolean transparent)
setTransparentMode in interface ej.fp.Imagepublic void crop(ej.fp.Image mask)
throws java.lang.IllegalArgumentException
crop in interface ej.fp.Imagejava.lang.IllegalArgumentExceptionpublic void dispose()
dispose in interface ej.fp.Image