|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmoka.lang.Object
moka.io.Graphics
The Graphics class encapsulates the display device operations and provides methods to deal with bitmaps. Note that some methods has a static version. These methods are written with an uppercase letter in this document to differenciate them from their instance counterparts, but they must be write with a lowercase in a program. Ex: Graphics.drawTo(10, 10) (Althrought it is written DrawTo in this doccument)
Field Summary | |
moka.io.void_p |
addr
The graphic port address. |
static short |
AND_ATTR
AND the region to draw. |
static boolean |
graymode
Is in grayscale mode ? Should be only read |
static short |
level
The actual grayscale level (the gray variant the graphic instructions will draw). |
static short |
NORMAL_ATTR
Draw with destination pixels turned on. |
static short |
OR_ATTR
Draw with source pixels ORed with destination pixels. |
static short |
REPLACE_ATTR
Draw with source pixels replace destination pixels. |
static short |
REVERSE_ATTR
Draw with destination pixels turned off. |
static short |
SHADE_H_ATTR
Draw the line using a horizontal shading pattern. |
static short |
SHADE_NS_ATTR
Draw the line using a negative slope diagonal shading pattern. |
static short |
SHADE_PS_ATTR
Draw the line using a positive slope diagonal shading pattern. |
static short |
SHADE_V_ATTR
Draw the line using a vertical shading pattern. |
static short |
SHADED_ATTR
Draw with destination pixels masked so that every other pixel turned off |
static short |
THICK1_ATTR
Draw a double thick line. |
static moka.io.SCR_RECT_p |
uScrRect
A universal SCR_RECT. |
short |
x_max
The maximum x coordinate. |
static short |
XOR_ATTR
Draw with source pixels XORed with destination pixels. |
short |
y_max
The maximum y coordinate. |
Constructor Summary | |
Graphics()
Creates a new Graphics object using the default display device. |
|
Graphics(moka.io.void_p addr,
short x_max,
short y_max)
Creates a new Graphics object specifying the display device. |
Method Summary | |
static moka.io.BITMAP_p |
bitmapFromVar(java.lang.String file)
Converts a specified PIC file name to a bitmap. |
static void |
bitmapToVar(moka.io.BITMAP_p bmp,
java.lang.String file)
Saves a specified bitmap to a specified pic file. |
static moka.io.BITMAP_p |
cloneBitmap(moka.io.BITMAP_p bmp)
Returns a copy of the specified bitmap. |
static void |
clrscr()
Clears the current display device screen. |
void |
clrScr()
Clears the Graphics' display device screen. |
static void |
ClrScr()
Clears the current display device screen. |
void |
draw(short x,
short y,
moka.io.char_p str,
short attr)
Draws an ANSI string on the Graphics' display device screen. |
static void |
Draw(short x,
short y,
moka.io.char_p str,
short attr)
Draws an ANSI string on the current display device screen. |
void |
draw(short x,
short y,
char c,
short attr)
Draws a char on the Graphics' display device screen. |
static void |
Draw(short x,
short y,
char c,
short attr)
Draws a char on the current display device screen. |
void |
draw(short x,
short y,
double num,
short attr)
Draws a double on the Graphics' display device screen. |
static void |
Draw(short x,
short y,
double num,
short attr)
Draws a double on the current display device screen. |
void |
draw(short x,
short y,
int num,
short attr)
Draws an int on the Graphics' display device screen. |
static void |
Draw(short x,
short y,
int num,
short attr)
Draws an int on the current display device screen. |
void |
draw(short x,
short y,
long num,
short attr)
Draws a long on the Graphics' display device screen. |
static void |
Draw(short x,
short y,
long num,
short attr)
Draws a long on the current display device screen. |
void |
draw(short x,
short y,
short num,
short attr)
Draws a short on the Graphics' display device screen. |
static void |
Draw(short x,
short y,
short num,
short attr)
Draws a short on the current display device screen. |
void |
draw(short x,
short y,
java.lang.String str,
short attr)
Draws a String object on the Graphics' display device screen then finalizes the String object. |
static void |
Draw(short x,
short y,
java.lang.String str,
short attr)
Draws a String object on the current display device screen then finalizes the String object. |
void |
drawChar(short x,
short y,
char c,
short attr)
Draws a char on the Graphics' display device screen. |
static void |
DrawChar(short x,
short y,
char c,
short attr)
Draws a char on the current display device screen. |
void |
drawElipse(short x,
short y,
short a,
short b,
short attr)
Draws a elipse on the Graphics' display device screen. |
void |
drawEllipse(short x,
short y,
short a,
short b,
short attr)
Draws a ellipse on the Graphics' display device screen. |
static void |
DrawEllipse(short x,
short y,
short a,
short b,
short attr)
Draws an ellipse on the current display device screen. |
void |
drawLine(short x0,
short y0,
short x1,
short y1,
short attr)
Draws a line on the Graphics' display device screen. |
static void |
DrawLine(short x0,
short y0,
short x1,
short y1,
short attr)
Draws a line on the current display device screen. |
void |
drawPix(short x,
short y,
short attr)
Draws a pixel on the Graphics' display device screen. |
static void |
DrawPix(short x,
short y,
short attr)
Draws a pixel on the current display device screen. |
void |
drawTo(short x,
short y)
Draws a line from the current pen position (set by moveTo) on the Graphics' display device screen. |
static void |
DrawTo(short x,
short y)
Draws a line from the current pen position (set by moveTo) on the current display device screen. |
static moka.io.BITMAP_p |
getBitmap(short x,
short y,
short width,
short height)
Return a bitmap, taken from a specified zone of the screen. |
static void |
getPicVar(java.lang.String file,
short x,
short y,
short width,
short height)
Saves a zone of the screen to a TIOS' PIC variable. |
boolean |
getPix(short x,
short y)
Gets the status of a pixel on the Graphics' display device screen. |
static boolean |
GetPix(short x,
short y)
Gets the status of a pixel on the current display device screen. |
static short |
getPixGray(short x,
short y)
Gets the status of a pixel on the current display device screen. |
static void |
lcdRestore(moka.io.void_p buffer)
Restores the saved content of the LCD screen. |
static moka.io.void_p |
lcdSave()
Saves the content of the LCD screen to a new LCD_BUFFER. |
static moka.io.void_p |
lcdSave(moka.io.void_p buffer)
Saves the content of the LCD screen to an existing LCD_BUFFER. |
static void |
MoveTo(short x,
short y)
Move the current pen position. |
static void |
picVarPut(moka.io.char_p SymName,
short x,
short y,
short attr)
Puts a TIOS PIC variable on the screen. |
static void |
picVarPut(java.lang.String file,
short x,
short y,
short attr)
Puts a TIOS PIC variable on the screen. |
void |
portSet()
Sets the virtual screen to the Graphics' display device screen. |
static void |
portSet(moka.io.void_p addr,
short x_max,
short y_max)
Sets the virtual screen. |
static void |
putBitmap(moka.io.BITMAP_p b,
short x,
short y,
short attr)
Puts a BITMAP on the screen. |
static void |
putGray(moka.io.BITMAP_p d,
moka.io.BITMAP_p l,
short x,
short y,
short attr)
Puts a set of TIOS on the screen. |
static void |
putGray(java.lang.String d,
java.lang.String l,
short x,
short y,
short attr)
Puts a set of TIOS PIC variables on the screen. |
static void |
setGray(short g)
Sets the grayscale level. |
Methods inherited from class moka.lang.Object |
equals, finalize, getClassName, toString |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public moka.io.void_p addr
public short x_max
public short y_max
public static final short REVERSE_ATTR
public static final short NORMAL_ATTR
public static final short XOR_ATTR
public static final short SHADED_ATTR
public static final short REPLACE_ATTR
public static final short OR_ATTR
public static final short AND_ATTR
public static final short THICK1_ATTR
public static final short SHADE_V_ATTR
public static final short SHADE_H_ATTR
public static final short SHADE_NS_ATTR
public static final short SHADE_PS_ATTR
public static moka.io.SCR_RECT_p uScrRect
public static short level
public static boolean graymode
Constructor Detail |
public Graphics()
public Graphics(moka.io.void_p addr, short x_max, short y_max)
addr
- The graphic port addressx_max
- The maximum x coordinatey_max
- The maximum y coordinateMethod Detail |
public static void setGray(short g)
g
- the grayscale level. Legal values are : Gray.OFF(grayscale disabled), Gray.BLACK, Gray.LIGHT_GRAY and Gray.DARK_GRAY.public static void clrscr()
public void clrScr()
public void drawChar(short x, short y, char c, short attr)
x
- The x coordinatey
- The y coordinatec
- The char to drawattr
- The attributepublic void drawPix(short x, short y, short attr)
x
- The x coordinatey
- The y coordinateattr
- The attributepublic void drawLine(short x0, short y0, short x1, short y1, short attr)
x0
- The x coordinate of the upper left cornery0
- The y coordinate of the upper left cornerx1
- The x coordinate of the lower right cornery1
- The y coordinate of the lower right cornerattr
- The attributepublic void draw(short x, short y, moka.io.char_p str, short attr)
x
- The x coordinatey
- The y coordinatestr
- The ANSI string to drawattr
- The attributepublic void draw(short x, short y, java.lang.String str, short attr)
x
- The x coordinatey
- The y coordinatestr
- The String to drawattr
- The attributepublic void draw(short x, short y, short num, short attr)
x
- The x coordinatey
- The y coordinatenum
- The short to drawattr
- The attributepublic void draw(short x, short y, int num, short attr)
x
- The x coordinatey
- The y coordinatenum
- The int to drawattr
- The attributepublic void draw(short x, short y, long num, short attr)
x
- The x coordinatey
- The y coordinatenum
- The long to drawattr
- The attributepublic void draw(short x, short y, double num, short attr)
x
- The x coordinatey
- The y coordinatenum
- The double to drawattr
- The attributepublic void draw(short x, short y, char c, short attr)
x
- The x coordinatey
- The y coordinatec
- The char to drawattr
- The attributepublic boolean getPix(short x, short y)
x
- The x coordinatey
- The y coordinate
public void portSet()
public void drawElipse(short x, short y, short a, short b, short attr)
x
- The x coordinate of the elipsey
- The y coordinate of the elipsea
- The horizontal semiaxe of the elipseb
- The vertical semiaxe of the elipseattr
- The attributepublic void drawTo(short x, short y)
x
- The x coordinatey
- The y coordinatepublic static moka.io.void_p lcdSave()
public static moka.io.void_p lcdSave(moka.io.void_p buffer)
buffer
- The LCD_BUFFER
public static void lcdRestore(moka.io.void_p buffer)
buffer
- The saved LCD_BUFFERpublic static void portSet(moka.io.void_p addr, short x_max, short y_max)
addr
- The memory addressx_max
- The maximum x coordinatey_max
- The maximum x coordinatepublic static void ClrScr()
public static void DrawChar(short x, short y, char c, short attr)
x
- The x coordinatey
- The y coordinatec
- The char to drawattr
- The attributepublic static void DrawPix(short x, short y, short attr)
x
- The x coordinatey
- The y coordinateattr
- The attributepublic static void DrawLine(short x0, short y0, short x1, short y1, short attr)
x0
- The x coordinate of the upper left cornery0
- The y coordinate of the upper left cornerx1
- The x coordinate of the lower right cornery1
- The y coordinate of the lower right cornerattr
- The attributepublic void drawEllipse(short x, short y, short a, short b, short attr)
x
- The x coordinate of the ellipsey
- The y coordinate of the ellipsea
- The horizontal semiaxe of the ellipseb
- The vertical semiaxe of the ellipseattr
- The attributepublic static short getPixGray(short x, short y)
x
- The x coordinatey
- The y coordinate
public static void DrawTo(short x, short y)
x
- The x coordinatey
- The y coordinatepublic static void MoveTo(short x, short y)
x
- The x coordinatey
- The y coordinatepublic static void Draw(short x, short y, moka.io.char_p str, short attr)
x
- The x coordinatey
- The y coordinatestr
- The ANSI string to drawattr
- The attributepublic static void Draw(short x, short y, java.lang.String str, short attr)
x
- The x coordinatey
- The y coordinatestr
- The String to drawattr
- The attributepublic static void Draw(short x, short y, short num, short attr)
x
- The x coordinatey
- The y coordinatenum
- The short to drawattr
- The attributepublic static void Draw(short x, short y, int num, short attr)
x
- The x coordinatey
- The y coordinatenum
- The int to drawattr
- The attributepublic static void Draw(short x, short y, long num, short attr)
x
- The x coordinatey
- The y coordinatenum
- The long to drawattr
- The attributepublic static void Draw(short x, short y, double num, short attr)
x
- The x coordinatey
- The y coordinatenum
- The double to drawattr
- The attributepublic static void Draw(short x, short y, char c, short attr)
x
- The x coordinatey
- The y coordinatec
- The char to drawattr
- The attributepublic static void DrawEllipse(short x, short y, short a, short b, short attr)
x
- The x coordinate of the ellipsey
- The y coordinate of the ellipsea
- The horizontal semiaxe of the ellipseb
- The vertical semiaxe of the ellipseattr
- The attributepublic static boolean GetPix(short x, short y)
x
- The x coordinatey
- The y coordinate
public static moka.io.BITMAP_p bitmapFromVar(java.lang.String file)
file
- The PIC file name
public static void bitmapToVar(moka.io.BITMAP_p bmp, java.lang.String file)
bmp
- The bitmapfile
- The PIC file namepublic static moka.io.BITMAP_p getBitmap(short x, short y, short width, short height)
x
- Absolute horizontal coordinatey
- Absolute vertical coordinatewidth
- The width of the zoneheight
- The height of the zonepublic static void getPicVar(java.lang.String file, short x, short y, short width, short height)
file
- The PIC file namex
- Absolute horizontal coordinatey
- Absolute vertical coordinatewidth
- The width of the zoneheight
- The height of the zonepublic static void picVarPut(java.lang.String file, short x, short y, short attr)
file
- The PIC file namex
- Absolute horizontal coordinatey
- Absolute vertical coordinateattr
- Display attributepublic static void picVarPut(moka.io.char_p SymName, short x, short y, short attr)
SymName
- TIOS variable name, in vat string formatx
- Absolute horizontal coordinatey
- Absolute vertical coordinateattr
- Display attributepublic static moka.io.BITMAP_p cloneBitmap(moka.io.BITMAP_p bmp)
bmp
- The bitmap
public static void putBitmap(moka.io.BITMAP_p b, short x, short y, short attr)
b
- The BITMAPx
- Absolute horizontal coordinatey
- Absolute vertical coordinateattr
- Display attributepublic static void putGray(moka.io.BITMAP_p d, moka.io.BITMAP_p l, short x, short y, short attr)
d
- The BITMAP of the dark plane (layer 1)l
- The BITMAP of the light plane (layer 2)x
- Absolute horizontal coordinatey
- Absolute vertical coordinateattr
- Display attributepublic static void putGray(java.lang.String d, java.lang.String l, short x, short y, short attr)
d
- The PIC file name of the dark plane (layer 1)l
- The PIC file name of the light plane (layer 2)x
- Absolute horizontal coordinatey
- Absolute vertical coordinateattr
- Display attribute
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |