public static interface LLUIPainter.MicroUIGraphicsContext extends LLUIPainter.MicroUIImage
This interface is used by all drawing functions to target the destination. It can be mapped on byte array given as parameter in MicroUI natives. This byte array is retrieved in MicroEJ application using the method GraphicsContext.getSNIContext().
Modifier and Type | Method and Description |
---|---|
void |
configureClip(boolean enable)
Enables or disables the graphics context clip.
|
int |
getClipX1() |
int |
getClipX2() |
int |
getClipY1() |
int |
getClipY2() |
int |
getEllipsisWidth()
Tells if the ellipsis is enabled or not.
|
int |
getMicroUIColor()
Returns the current MicroUI drawing color to use to perform drawings.
|
int |
getRenderingColor()
Returns the color to use to render the drawings.
|
boolean |
isClipEnabled()
Tells if the clip is enabled or not.
|
boolean |
isHorizontalLineInClip(int x1,
int x2,
int y)
Tells if given horizontal line fully fits the clip or not.
|
boolean |
isPointInClip(int x,
int y)
Tells if given point fits the clip or not.
|
boolean |
isRectangleInClip(int x1,
int y1,
int x2,
int y2)
Tells if given rectangle fully fits the clip or not.
|
boolean |
isRegionInClip(int x,
int y,
int width,
int height)
Tells if given region (from x,y to x+width-1,y+height-1) fully fits the clip or not.
|
boolean |
isVerticalLineInClip(int y1,
int y2,
int x)
Tells if given vertical line fully fits the clip or not.
|
boolean |
requestDrawing()
Requests a drawing on the graphics context.
|
boolean |
setDrawingLimits(int xmin,
int ymin,
int xmax,
int ymax)
Updates the flush dirty area.
|
void configureClip(boolean enable)
enable
- false to disable the clip.int getClipX1()
int getClipX2()
int getClipY1()
int getClipY2()
int getEllipsisWidth()
int getMicroUIColor()
int getRenderingColor()
Equivalent of LLUIDisplay.Instance.convertARGBColorToColorToDraw(getMicroUIColor());
LLUIDisplay.convertARGBColorToColorToDraw(int)
boolean isClipEnabled()
When it is disabled, that means the caller considers the drawing is fitting the clip. In this case checking the clip bounds is useless.
boolean isHorizontalLineInClip(int x1, int x2, int y)
x1
- the first pixel line X coordinate.x2
- the last pixel line X coordinate.y
- the both pixels line Y coordinate.boolean isPointInClip(int x, int y)
x
- the pixel X coordinate.y
- the pixel Y coordinate.boolean isRectangleInClip(int x1, int y1, int x2, int y2)
x1
- the top-left pixel X coordinate.y1
- the top-left pixel Y coordinate.x2
- the bottom-right pixel X coordinate.y2
- the top-right pixel Y coordinate.boolean isRegionInClip(int x, int y, int width, int height)
x
- the top-left pixel X coordinate.y
- the top-left pixel Y coordinate.width
- the region width.height
- the region height.boolean isVerticalLineInClip(int y1, int y2, int x)
x
- the both pixels line X coordinate.y1
- the first pixel line Y coordinate.y2
- the last pixel line Y coordinate.boolean requestDrawing()
boolean setDrawingLimits(int xmin, int ymin, int xmax, int ymax)
LLUIDisplayImpl#flush(MicroUIGraphicsContext, Image, int, int, int, int)
method.
This method is useless when the given graphics context is not the display (in this case this call has no
effect). Caller should check that calling LLUIPainter.MicroUIImage.isLCD()
before.
xmin
- the dirty area top-left X coordinate.ymin
- the dirty area top-left Y coordinate.xmax
- the dirty area bottom-right X coordinate.ymax
- the dirty area bottom-right Y coordinate.