moka.io
Class Graphics

java.lang.Object
  extended bymoka.lang.Object
      extended bymoka.io.Graphics

public class Graphics
extends Object

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)

Since:
MDK1.0a

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

addr

public moka.io.void_p addr
The graphic port address. LCD (addr: 0x4C00,) by default.


x_max

public short x_max
The maximum x coordinate.


y_max

public short y_max
The maximum y coordinate.


REVERSE_ATTR

public static final short REVERSE_ATTR
Draw with destination pixels turned off.

See Also:
Constant Field Values

NORMAL_ATTR

public static final short NORMAL_ATTR
Draw with destination pixels turned on.

See Also:
Constant Field Values

XOR_ATTR

public static final short XOR_ATTR
Draw with source pixels XORed with destination pixels.

See Also:
Constant Field Values

SHADED_ATTR

public static final short SHADED_ATTR
Draw with destination pixels masked so that every other pixel turned off

See Also:
Constant Field Values

REPLACE_ATTR

public static final short REPLACE_ATTR
Draw with source pixels replace destination pixels.

See Also:
Constant Field Values

OR_ATTR

public static final short OR_ATTR
Draw with source pixels ORed with destination pixels.

See Also:
Constant Field Values

AND_ATTR

public static final short AND_ATTR
AND the region to draw.

See Also:
Constant Field Values

THICK1_ATTR

public static final short THICK1_ATTR
Draw a double thick line.

See Also:
Constant Field Values

SHADE_V_ATTR

public static final short SHADE_V_ATTR
Draw the line using a vertical shading pattern.

See Also:
Constant Field Values

SHADE_H_ATTR

public static final short SHADE_H_ATTR
Draw the line using a horizontal shading pattern.

See Also:
Constant Field Values

SHADE_NS_ATTR

public static final short SHADE_NS_ATTR
Draw the line using a negative slope diagonal shading pattern.

See Also:
Constant Field Values

SHADE_PS_ATTR

public static final short SHADE_PS_ATTR
Draw the line using a positive slope diagonal shading pattern.

See Also:
Constant Field Values

uScrRect

public static moka.io.SCR_RECT_p uScrRect
A universal SCR_RECT.


level

public static short level
The actual grayscale level (the gray variant the graphic instructions will draw). Legal value are Gray.OFF(grayscale disabled), Gray.BLACK, Gray.LIGHT_GRAY and Gray.DARK_GRAY.


graymode

public static boolean graymode
Is in grayscale mode ? Should be only read

Constructor Detail

Graphics

public Graphics()
Creates a new Graphics object using the default display device.


Graphics

public Graphics(moka.io.void_p addr,
                short x_max,
                short y_max)
Creates a new Graphics object specifying the display device.

Parameters:
addr - The graphic port address
x_max - The maximum x coordinate
y_max - The maximum y coordinate
Method Detail

setGray

public static void setGray(short g)
Sets the grayscale level.

Parameters:
g - the grayscale level. Legal values are : Gray.OFF(grayscale disabled), Gray.BLACK, Gray.LIGHT_GRAY and Gray.DARK_GRAY.

clrscr

public static void clrscr()
Clears the current display device screen. The pen position is moved to (0, 0). The main difference of this method vs the System class' one is its grayscale support.


clrScr

public void clrScr()
Clears the Graphics' display device screen. The pen position will remain intact. Changes the current graphic port to the one of the graphic object.


drawChar

public void drawChar(short x,
                     short y,
                     char c,
                     short attr)
Draws a char on the Graphics' display device screen. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.REPLACE_ATTR, Graphics.XOR_ATTR, Graphics.SHADED_ATTR. Changes the current graphic port to the one of the graphic object.

Parameters:
x - The x coordinate
y - The y coordinate
c - The char to draw
attr - The attribute

drawPix

public void drawPix(short x,
                    short y,
                    short attr)
Draws a pixel on the Graphics' display device screen. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.XOR_ATTR. Changes the current graphic port to the one of the graphic object.

Parameters:
x - The x coordinate
y - The y coordinate
attr - The attribute

drawLine

public void drawLine(short x0,
                     short y0,
                     short x1,
                     short y1,
                     short attr)
Draws a line on the Graphics' display device screen. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.XOR_ATTR, Graphics.THICK1_ATTR, Graphics.SHADE_V_ATTR, Graphics.SHADE_H_ATTR, Graphics.SLOPE_NS_ATTR, Graphics.SLOPE_PS_ATTR. Changes the current graphic port to the one of the graphic object.

Parameters:
x0 - The x coordinate of the upper left corner
y0 - The y coordinate of the upper left corner
x1 - The x coordinate of the lower right corner
y1 - The y coordinate of the lower right corner
attr - The attribute

draw

public void draw(short x,
                 short y,
                 moka.io.char_p str,
                 short attr)
Draws an ANSI string on the Graphics' display device screen. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.REPLACE_ATTR, Graphics.XOR_ATTR, Graphics.SHADED_ATTR. Changes the current graphic port to the one of the graphic object.

Parameters:
x - The x coordinate
y - The y coordinate
str - The ANSI string to draw
attr - The attribute

draw

public 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. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.REPLACE_ATTR, Graphics.XOR_ATTR, Graphics.SHADED_ATTR. Changes the current graphic port to the one of the graphic object.

Parameters:
x - The x coordinate
y - The y coordinate
str - The String to draw
attr - The attribute

draw

public void draw(short x,
                 short y,
                 short num,
                 short attr)
Draws a short on the Graphics' display device screen. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.REPLACE_ATTR, Graphics.XOR_ATTR, Graphics.SHADED_ATTR. Changes the current graphic port to the one of the graphic object.

Parameters:
x - The x coordinate
y - The y coordinate
num - The short to draw
attr - The attribute

draw

public void draw(short x,
                 short y,
                 int num,
                 short attr)
Draws an int on the Graphics' display device screen. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.REPLACE_ATTR, Graphics.XOR_ATTR, Graphics.SHADED_ATTR. Changes the current graphic port to the one of the graphic object.

Parameters:
x - The x coordinate
y - The y coordinate
num - The int to draw
attr - The attribute

draw

public void draw(short x,
                 short y,
                 long num,
                 short attr)
Draws a long on the Graphics' display device screen. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.REPLACE_ATTR, Graphics.XOR_ATTR, Graphics.SHADED_ATTR. Changes the current graphic port to the one of the graphic object.

Parameters:
x - The x coordinate
y - The y coordinate
num - The long to draw
attr - The attribute

draw

public void draw(short x,
                 short y,
                 double num,
                 short attr)
Draws a double on the Graphics' display device screen. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.REPLACE_ATTR, Graphics.XOR_ATTR, Graphics.SHADED_ATTR. Changes the current graphic port to the one of the graphic object.

Parameters:
x - The x coordinate
y - The y coordinate
num - The double to draw
attr - The attribute

draw

public void draw(short x,
                 short y,
                 char c,
                 short attr)
Draws a char on the Graphics' display device screen. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.REPLACE_ATTR, Graphics.XOR_ATTR, Graphics.SHADED_ATTR. Changes the current graphic port to the one of the graphic object.

Parameters:
x - The x coordinate
y - The y coordinate
c - The char to draw
attr - The attribute

getPix

public boolean getPix(short x,
                      short y)
Gets the status of a pixel on the Graphics' display device screen. Changes the current graphic port to the one of the graphic object.

Parameters:
x - The x coordinate
y - The y coordinate
Returns:
true if the pixel is on, false otherwize

portSet

public void portSet()
Sets the virtual screen to the Graphics' display device screen. All graphic commands which are built-in into TIOS does not expect that the video memory must be at 0x4C00, and that the video memory is always 240 x 128 pixels. Using portSet you can set up a virtual screen anywhere in a memory, and of any size.


drawElipse

public void drawElipse(short x,
                       short y,
                       short a,
                       short b,
                       short attr)
Draws a elipse on the Graphics' display device screen. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.XOR_ATTR. Changes the current graphic port to the one of the graphic object.

Parameters:
x - The x coordinate of the elipse
y - The y coordinate of the elipse
a - The horizontal semiaxe of the elipse
b - The vertical semiaxe of the elipse
attr - The attribute

drawTo

public void drawTo(short x,
                   short y)
Draws a line from the current pen position (set by moveTo) on the Graphics' display device screen. Changes the current graphic port to the one of the graphic object.

Parameters:
x - The x coordinate
y - The y coordinate

lcdSave

public static moka.io.void_p lcdSave()
Saves the content of the LCD screen to a new LCD_BUFFER.

Returns:
A pointer to a newly allocated LCD_BUFFER.

lcdSave

public static moka.io.void_p lcdSave(moka.io.void_p buffer)
Saves the content of the LCD screen to an existing LCD_BUFFER.

Parameters:
buffer - The LCD_BUFFER
Returns:
A pointer to the LCD_BUFFER.

lcdRestore

public static void lcdRestore(moka.io.void_p buffer)
Restores the saved content of the LCD screen.

Parameters:
buffer - The saved LCD_BUFFER

portSet

public static void portSet(moka.io.void_p addr,
                           short x_max,
                           short y_max)
Sets the virtual screen. All graphic commands which are built-in into TIOS does not expect that the video memory must be at 0x4C00, and that the video memory is always 240 x 128 pixels. Using portSet you can set up a virtual screen anywhere in a memory, and of any size.

Parameters:
addr - The memory address
x_max - The maximum x coordinate
y_max - The maximum x coordinate

ClrScr

public static void ClrScr()
Clears the current display device screen. The pen position will remain intact.


DrawChar

public static void DrawChar(short x,
                            short y,
                            char c,
                            short attr)
Draws a char on the current display device screen. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.REPLACE_ATTR, Graphics.XOR_ATTR, Graphics.SHADED_ATTR.

Parameters:
x - The x coordinate
y - The y coordinate
c - The char to draw
attr - The attribute

DrawPix

public static void DrawPix(short x,
                           short y,
                           short attr)
Draws a pixel on the current display device screen. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.XOR_ATTR.

Parameters:
x - The x coordinate
y - The y coordinate
attr - The attribute

DrawLine

public static void DrawLine(short x0,
                            short y0,
                            short x1,
                            short y1,
                            short attr)
Draws a line on the current display device screen. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.XOR_ATTR, Graphics.THICK1_ATTR, Graphics.SHADE_V_ATTR, Graphics.SHADE_H_ATTR, Graphics.SLOPE_NS_ATTR, Graphics.SLOPE_PS_ATTR.

Parameters:
x0 - The x coordinate of the upper left corner
y0 - The y coordinate of the upper left corner
x1 - The x coordinate of the lower right corner
y1 - The y coordinate of the lower right corner
attr - The attribute

drawEllipse

public void drawEllipse(short x,
                        short y,
                        short a,
                        short b,
                        short attr)
Draws a ellipse on the Graphics' display device screen. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.XOR_ATTR. Changes the current graphic port to the one of the graphic object.

Parameters:
x - The x coordinate of the ellipse
y - The y coordinate of the ellipse
a - The horizontal semiaxe of the ellipse
b - The vertical semiaxe of the ellipse
attr - The attribute

getPixGray

public static short getPixGray(short x,
                               short y)
Gets the status of a pixel on the current display device screen. Intented to be used while in grayscale mode.

Parameters:
x - The x coordinate
y - The y coordinate
Returns:
the status of the pixel (Gray.OFF if grayscale is turned off or the pixel is off, grayscale level otherwize).

DrawTo

public static void DrawTo(short x,
                          short y)
Draws a line from the current pen position (set by moveTo) on the current display device screen.

Parameters:
x - The x coordinate
y - The y coordinate

MoveTo

public static void MoveTo(short x,
                          short y)
Move the current pen position.

Parameters:
x - The x coordinate
y - The y coordinate

Draw

public static void Draw(short x,
                        short y,
                        moka.io.char_p str,
                        short attr)
Draws an ANSI string on the current display device screen. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.REPLACE_ATTR, Graphics.XOR_ATTR, Graphics.SHADED_ATTR.

Parameters:
x - The x coordinate
y - The y coordinate
str - The ANSI string to draw
attr - The attribute

Draw

public 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. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.REPLACE_ATTR, Graphics.XOR_ATTR, Graphics.SHADED_ATTR.

Parameters:
x - The x coordinate
y - The y coordinate
str - The String to draw
attr - The attribute

Draw

public static void Draw(short x,
                        short y,
                        short num,
                        short attr)
Draws a short on the current display device screen. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.REPLACE_ATTR, Graphics.XOR_ATTR, Graphics.SHADED_ATTR.

Parameters:
x - The x coordinate
y - The y coordinate
num - The short to draw
attr - The attribute

Draw

public static void Draw(short x,
                        short y,
                        int num,
                        short attr)
Draws an int on the current display device screen. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.REPLACE_ATTR, Graphics.XOR_ATTR, Graphics.SHADED_ATTR.

Parameters:
x - The x coordinate
y - The y coordinate
num - The int to draw
attr - The attribute

Draw

public static void Draw(short x,
                        short y,
                        long num,
                        short attr)
Draws a long on the current display device screen. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.REPLACE_ATTR, Graphics.XOR_ATTR, Graphics.SHADED_ATTR.

Parameters:
x - The x coordinate
y - The y coordinate
num - The long to draw
attr - The attribute

Draw

public static void Draw(short x,
                        short y,
                        double num,
                        short attr)
Draws a double on the current display device screen. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.REPLACE_ATTR, Graphics.XOR_ATTR, Graphics.SHADED_ATTR.

Parameters:
x - The x coordinate
y - The y coordinate
num - The double to draw
attr - The attribute

Draw

public static void Draw(short x,
                        short y,
                        char c,
                        short attr)
Draws a char on the current display device screen. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.REPLACE_ATTR, Graphics.XOR_ATTR, Graphics.SHADED_ATTR.

Parameters:
x - The x coordinate
y - The y coordinate
c - The char to draw
attr - The attribute

DrawEllipse

public static void DrawEllipse(short x,
                               short y,
                               short a,
                               short b,
                               short attr)
Draws an ellipse on the current display device screen. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.XOR_ATTR. Changes the current graphic port to the one of the graphic object.

Parameters:
x - The x coordinate of the ellipse
y - The y coordinate of the ellipse
a - The horizontal semiaxe of the ellipse
b - The vertical semiaxe of the ellipse
attr - The attribute
Since:
MDK2.1

GetPix

public static boolean GetPix(short x,
                             short y)
Gets the status of a pixel on the current display device screen.

Parameters:
x - The x coordinate
y - The y coordinate
Returns:
true if the pixel is on, false otherwize

bitmapFromVar

public static moka.io.BITMAP_p bitmapFromVar(java.lang.String file)
Converts a specified PIC file name to a bitmap. If the file string object risk to be used later, use a copy of the string object instead of the original, the string being finalized before the method returns.

Parameters:
file - The PIC file name
Returns:
The converted bitmap or null in case of error.

bitmapToVar

public static void bitmapToVar(moka.io.BITMAP_p bmp,
                               java.lang.String file)
Saves a specified bitmap to a specified pic file. If the file string object risk to be used later, use a copy of the string object instead of the original, the string being finalized before the method returns.

Parameters:
bmp - The bitmap
file - The PIC file name

getBitmap

public 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.

Parameters:
x - Absolute horizontal coordinate
y - Absolute vertical coordinate
width - The width of the zone
height - The height of the zone

getPicVar

public 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. If the file string object risk to be used later, use a copy of the string object instead of the original, the string being finalized before the method returns.

Parameters:
file - The PIC file name
x - Absolute horizontal coordinate
y - Absolute vertical coordinate
width - The width of the zone
height - The height of the zone

picVarPut

public static void picVarPut(java.lang.String file,
                             short x,
                             short y,
                             short attr)
Puts a TIOS PIC variable on the screen. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.REPLACE_ATTR, Graphics.XOR_ATTR, Graphics.SHADED_ATTR, Graphics.OR_ATTR, Graphics.AND_ATTR. If the file string object risk to be used later, use a copy of the string object instead of the original, the string being finalized before the method returns.

Parameters:
file - The PIC file name
x - Absolute horizontal coordinate
y - Absolute vertical coordinate
attr - Display attribute

picVarPut

public static void picVarPut(moka.io.char_p SymName,
                             short x,
                             short y,
                             short attr)
Puts a TIOS PIC variable on the screen. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.REPLACE_ATTR, Graphics.XOR_ATTR, Graphics.SHADED_ATTR, Graphics.OR_ATTR, Graphics.AND_ATTR.

Parameters:
SymName - TIOS variable name, in vat string format
x - Absolute horizontal coordinate
y - Absolute vertical coordinate
attr - Display attribute

cloneBitmap

public static moka.io.BITMAP_p cloneBitmap(moka.io.BITMAP_p bmp)
Returns a copy of the specified bitmap.

Parameters:
bmp - The bitmap
Returns:
A copy of the specified bitmap

putBitmap

public static void putBitmap(moka.io.BITMAP_p b,
                             short x,
                             short y,
                             short attr)
Puts a BITMAP on the screen. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.REPLACE_ATTR, Graphics.XOR_ATTR, Graphics.SHADED_ATTR, Graphics.OR_ATTR, Graphics.AND_ATTR.

Parameters:
b - The BITMAP
x - Absolute horizontal coordinate
y - Absolute vertical coordinate
attr - Display attribute

putGray

public 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. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.REPLACE_ATTR, Graphics.XOR_ATTR, Graphics.SHADED_ATTR, Graphics.OR_ATTR, Graphics.AND_ATTR. Be warned that this method will enable grayscale.

Parameters:
d - The BITMAP of the dark plane (layer 1)
l - The BITMAP of the light plane (layer 2)
x - Absolute horizontal coordinate
y - Absolute vertical coordinate
attr - Display attribute

putGray

public 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. The following attributes are supported: Graphics.NORMAL_ATTR, Graphics.REVERSE_ATTR, Graphics.REPLACE_ATTR, Graphics.XOR_ATTR, Graphics.SHADED_ATTR, Graphics.OR_ATTR, Graphics.AND_ATTR. Be warned that this method will enable grayscale.

Parameters:
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 coordinate
y - Absolute vertical coordinate
attr - Display attribute