public class RemoteGraphicsLCD extends java.lang.Object implements GraphicsLCD
BASELINE, BLACK, BOTTOM, DOTTED, HCENTER, LEFT, RIGHT, SOLID, TOP, TRANS_MIRROR, TRANS_MIRROR_ROT180, TRANS_MIRROR_ROT270, TRANS_MIRROR_ROT90, TRANS_NONE, TRANS_ROT180, TRANS_ROT270, TRANS_ROT90, VCENTER, WHITE
ROP_AND, ROP_ANDINVERTED, ROP_ANDREVERSE, ROP_CLEAR, ROP_COPY, ROP_COPYINVERTED, ROP_EQUIV, ROP_INVERT, ROP_NAND, ROP_NOOP, ROP_NOR, ROP_OR, ROP_ORINVERTED, ROP_ORREVERSE, ROP_SET, ROP_XOR
Constructor and Description |
---|
RemoteGraphicsLCD(RMIGraphicsLCD g) |
Modifier and Type | Method and Description |
---|---|
void |
bitBlt(byte[] src,
int sw,
int sh,
int sx,
int sy,
byte[] dst,
int dw,
int dh,
int dx,
int dy,
int w,
int h,
int rop)
Standard two input BitBlt function.
|
void |
bitBlt(byte[] src,
int sw,
int sh,
int sx,
int sy,
int dx,
int dy,
int w,
int h,
int rop)
Standard two input BitBlt function with the LCD display as the
destination.
|
void |
clear()
Clear the display.
|
void |
copyArea(int sx,
int sy,
int w,
int h,
int x,
int y,
int anchor)
Copy one rectangular area of the drawing surface to another.
|
void |
drawArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
Draw an arc, using the current color and style.
|
void |
drawChar(char character,
int x,
int y,
int anchor)
Draw a single character to the graphics surface using the current color.
|
void |
drawChars(char[] data,
int offset,
int length,
int x,
int y,
int anchor)
Draw a series of characters to the graphics surface using the current color.
|
void |
drawImage(Image src,
int x,
int y,
int anchor)
Draw the specified image to the graphics surface, using the supplied rop.
|
void |
drawLine(int x0,
int y0,
int x1,
int y1)
Draw a line between the specified points, using the current color and style.
|
void |
drawRect(int x,
int y,
int width,
int height)
Draw a rectangle using the current color and style.
|
void |
drawRegion(Image src,
int sx,
int sy,
int w,
int h,
int transform,
int x,
int y,
int anchor)
Draw the specified region of the supplied image to the graphics surface.
|
void |
drawRegionRop(Image src,
int sx,
int sy,
int w,
int h,
int x,
int y,
int anchor,
int rop)
Draw the specified image to the graphics surface, using the supplied rop.
|
void |
drawRegionRop(Image src,
int sx,
int sy,
int w,
int h,
int transform,
int x,
int y,
int anchor,
int rop)
Draw the specified region of the source image to the graphics surface
after applying the requested transformation, use the supplied rop.
|
void |
drawRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
Draw a rounded rectangle.
|
void |
drawString(java.lang.String str,
int x,
int y,
int anchor)
Draws the specified String using the current font and color.
|
void |
drawString(java.lang.String str,
int x,
int y,
int anchor,
boolean inverted)
Draws the specified String using the current font and color.
|
void |
drawSubstring(java.lang.String str,
int offset,
int len,
int x,
int y,
int anchor)
Draw a substring to the graphics surface using the current color.
|
void |
fillArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
Draw a filled arc, using the current color.
|
void |
fillRect(int x,
int y,
int w,
int h)
Draw a filled rectangle using the current color.
|
byte[] |
getDisplay()
Provide access to the LCD display frame buffer.
|
Font |
getFont()
Return the currently selected font object.
|
int |
getHeight()
Return the height of the associated drawing surface.
|
byte[] |
getHWDisplay()
Get access to hardware LCD display.
|
int |
getPixel(int x,
int y)
Method to get a pixel from the screen.
|
int |
getStrokeStyle()
Return the current stroke style.
|
int |
getTranslateX()
Gets the X coordinate of the translated origin of this graphics context.
|
int |
getTranslateY()
Gets the Y coordinate of the translated origin of this graphics context.
|
int |
getWidth()
Return the width of the associated drawing surface.
|
void |
refresh()
Refresh the display.
|
void |
setAutoRefresh(boolean on)
Turn on/off the automatic refresh of the LCD display.
|
int |
setAutoRefreshPeriod(int period)
Set the period used to perform automatic refreshing of the display.
|
void |
setColor(int rgb)
Set the current drawing color.
|
void |
setColor(int red,
int green,
int blue)
Sets the current color to the specified RGB values.
|
void |
setContrast(int contrast)
Set the LCD contrast.
|
void |
setFont(Font f)
Set the current font
|
void |
setPixel(int x,
int y,
int color)
Method to set a pixel on the screen.
|
void |
setStrokeStyle(int style)
Set the stroke style to be used for drawing operations.
|
void |
translate(int x,
int y)
Translates the origin of the graphics context to the point
(x, y) in the current coordinate system.
|
public RemoteGraphicsLCD(RMIGraphicsLCD g)
public void refresh()
CommonLCD
public void clear()
CommonLCD
public int getWidth()
CommonLCD
public int getHeight()
CommonLCD
public byte[] getDisplay()
CommonLCD
getDisplay
in interface CommonLCD
public byte[] getHWDisplay()
CommonLCD
getHWDisplay
in interface CommonLCD
public void setContrast(int contrast)
CommonLCD
setContrast
in interface CommonLCD
contrast
- 0 blank 0x60 full onpublic void bitBlt(byte[] src, int sw, int sh, int sx, int sy, int dx, int dy, int w, int h, int rop)
CommonLCD
bitBlt
in interface CommonLCD
src
- byte array containing the source imagesw
- Width of the source imagesh
- Height of the source imagesx
- X position to start the copy fromsy
- Y Position to start the copy fromdx
- X destinationdy
- Y destinationw
- width of the area to copyh
- height of the area to copyrop
- raster operation.public void bitBlt(byte[] src, int sw, int sh, int sx, int sy, byte[] dst, int dw, int dh, int dx, int dy, int w, int h, int rop)
CommonLCD
bitBlt
in interface CommonLCD
src
- byte array containing the source imagesw
- Width of the source imagesh
- Height of the source imagesx
- X position to start the copy fromsy
- Y Position to start the copy fromdst
- byte array containing the destination imagedw
- Width of the destination imagedh
- Height of the destination imagedx
- X destinationdy
- Y destinationw
- width of the area to copyh
- height of the area to copyrop
- raster operation.public void setAutoRefresh(boolean on)
CommonLCD
setAutoRefresh
in interface CommonLCD
on
- true to enable, false to disablepublic int setAutoRefreshPeriod(int period)
CommonLCD
setAutoRefreshPeriod
in interface CommonLCD
period
- time in mspublic void setPixel(int x, int y, int color)
GraphicsLCD
setPixel
in interface GraphicsLCD
x
- the x coordinatey
- the y coordinatecolor
- the pixel color (0 = white, 1 = black)public int getPixel(int x, int y)
GraphicsLCD
getPixel
in interface GraphicsLCD
x
- the x coordinatey
- the y coordinatepublic void drawString(java.lang.String str, int x, int y, int anchor, boolean inverted)
GraphicsLCD
drawString
in interface GraphicsLCD
str
- the String to be drawnx
- the x coordinate of the anchor pointy
- the y coordinate of the anchor pointanchor
- the anchor point for positioning the textinverted
- true to invert the text display.public void drawString(java.lang.String str, int x, int y, int anchor)
GraphicsLCD
drawString
in interface GraphicsLCD
str
- the String to be drawnx
- the x coordinate of the anchor pointy
- the y coordinate of the anchor pointanchor
- the anchor point for positioning the textpublic void drawSubstring(java.lang.String str, int offset, int len, int x, int y, int anchor)
GraphicsLCD
drawSubstring
in interface GraphicsLCD
str
- the base stringoffset
- the start of the sub stringlen
- the length of the sub stringx
- the x coordinate of the anchor pointy
- the x coordinate of the anchor pointanchor
- the anchor point used to position the text.public void drawChar(char character, int x, int y, int anchor)
GraphicsLCD
drawChar
in interface GraphicsLCD
character
- the character to drawx
- the x coordinate of the anchor pointy
- the x coordinate of the anchor pointanchor
- the anchor point used to position the text.public void drawChars(char[] data, int offset, int length, int x, int y, int anchor)
GraphicsLCD
drawChars
in interface GraphicsLCD
data
- the charactersoffset
- the start of the characters to be drawnlength
- the length of the character string to drawx
- the x coordinate of the anchor pointy
- the x coordinate of the anchor pointanchor
- the anchor point used to position the text.public int getStrokeStyle()
GraphicsLCD
getStrokeStyle
in interface GraphicsLCD
public void setStrokeStyle(int style)
GraphicsLCD
setStrokeStyle
in interface GraphicsLCD
style
- new style.public void drawRegionRop(Image src, int sx, int sy, int w, int h, int x, int y, int anchor, int rop)
GraphicsLCD
drawRegionRop
in interface GraphicsLCD
src
- image to draw (may be null for ops that do not require input.sx
- x offset in the sourcesy
- y offset in the sourcew
- width of area to drawh
- height of area to draw.x
- destinationy
- destinationanchor
- location of the anchor pointrop
- drawing operation.Image
public void drawRegionRop(Image src, int sx, int sy, int w, int h, int transform, int x, int y, int anchor, int rop)
GraphicsLCD
drawRegionRop
in interface GraphicsLCD
src
- The source imagesx
- x coordinate of the regionsy
- y coordinate of the regionw
- width of the regionh
- height of the regiontransform
- the required transformx
- x coordinate of the anchor pointy
- y coordinate of the anchor pointanchor
- type of anchorrop
- raster operation used to draw the output.public void drawRegion(Image src, int sx, int sy, int w, int h, int transform, int x, int y, int anchor)
GraphicsLCD
drawRegion
in interface GraphicsLCD
src
- image to draw (may be null for ops that do not require input.sx
- x offset to the regionsy
- y offset to the regionw
- width of the regionh
- height of the regionx
- destinationy
- destinationanchor
- location of the anchor pointImage
public void drawImage(Image src, int x, int y, int anchor)
GraphicsLCD
drawImage
in interface GraphicsLCD
src
- image to draw (may be null for ops that do not require input.x
- destinationy
- destinationanchor
- location of the anchor pointImage
public void drawLine(int x0, int y0, int x1, int y1)
GraphicsLCD
drawLine
in interface GraphicsLCD
x0
- x start pointy0
- y start pointx1
- x end pointy1
- y end pointpublic void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
GraphicsLCD
drawArc
in interface GraphicsLCD
public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
GraphicsLCD
fillArc
in interface GraphicsLCD
public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
GraphicsLCD
drawRoundRect
in interface GraphicsLCD
public void drawRect(int x, int y, int width, int height)
GraphicsLCD
drawRect
in interface GraphicsLCD
public void fillRect(int x, int y, int w, int h)
GraphicsLCD
fillRect
in interface GraphicsLCD
public void copyArea(int sx, int sy, int w, int h, int x, int y, int anchor)
GraphicsLCD
copyArea
in interface GraphicsLCD
sx
- Source xsy
- Source yw
- Source widthh
- Source heightx
- Destination xy
- Destination yanchor
- location of the anchor point of the destination.public Font getFont()
GraphicsLCD
getFont
in interface GraphicsLCD
public void setFont(Font f)
GraphicsLCD
setFont
in interface GraphicsLCD
f
- the fontpublic void translate(int x, int y)
GraphicsLCD
translate
in interface GraphicsLCD
x
- the new translation origin x valuey
- new translation origin y valueGraphicsLCD.getTranslateX()
,
GraphicsLCD.getTranslateY()
public int getTranslateX()
GraphicsLCD
getTranslateX
in interface GraphicsLCD
public int getTranslateY()
GraphicsLCD
getTranslateY
in interface GraphicsLCD
public void setColor(int rgb)
GraphicsLCD
setColor
in interface GraphicsLCD
rgb
- new color.public void setColor(int red, int green, int blue)
GraphicsLCD
setColor
in interface GraphicsLCD
red
- the red componentgreen
- the green componentblue
- the blue