dasher
Interface CDasherScreen

All Known Implementing Classes:
JDasherScreen, NetScreen

public interface CDasherScreen

Defines a screen which Dasher can use to draw graphics primitives.


Method Summary
 void Blank()
          Signals the beginning of a new frame.
 void Display()
          Signals the end of a frame.
 void DrawCircle(int iCX, int iCY, int iR, int iColour, boolean bFill)
          Draw a circle
 void DrawRectangle(int x1, int y1, int x2, int y2, int Color, int iOutlineColour, EColorSchemes ColorScheme, boolean bDrawOutline, boolean bFill, int iThickness)
          Draw a filled rectangle
 void DrawString(java.lang.String string, int x1, int y1, long Size)
          Draws a string
 int GetHeight()
          Gets the height, and hence maximum Y screen co-ordinate.
 int GetWidth()
          Gets the width, and hence maximum X screen co-ordinate.
 void Polygon(CDasherView.Point[] Points, int Number, int Color)
          Draw a filled polygon - given vertices and color id.
 void Polygon(CDasherView.Point[] Points, int Number, int Color, int iWidth)
          Draw a filled polygon - given vertices, width and color id.
 void Polyline(CDasherView.Point[] Points, int Number, int iWidth)
          Draws a sequence of lines in a fixed colour, usually black.
 void Polyline(CDasherView.Point[] Points, int Number, int iWidth, int Colour)
          Draws a sequence of lines.
 void SendMarker(int iMarker)
          Informs the screen of certain drawing phases.
 void SetColourScheme(CCustomColours ColourScheme)
          Sets the colour scheme to use
 CDasherView.Point TextSize(java.lang.String string, int Size)
          Determines / guesses the size of a given string as drawn on this screen.
 

Method Detail

GetWidth

int GetWidth()
Gets the width, and hence maximum X screen co-ordinate.

Returns:
width

GetHeight

int GetHeight()
Gets the height, and hence maximum Y screen co-ordinate.

Returns:
height

TextSize

CDasherView.Point TextSize(java.lang.String string,
                           int Size)
Determines / guesses the size of a given string as drawn on this screen.

This is used in determining how much to displace other drawn strings in order to prevent them from overlapping.

This must be carried out by the screen because only the actual drawing surface can know how fonts appear when rendered.

Parameters:
string - String whose size we wish to determine
Size - Font size in points
Returns:
Point specifying the width and height of this string.

DrawString

void DrawString(java.lang.String string,
                int x1,
                int y1,
                long Size)
Draws a string

Parameters:
string - String to draw
x1 - Top-left hand corner x co-ordinate
y1 - Top-left hand corner y co-ordinate
Size - Font size in points

SendMarker

void SendMarker(int iMarker)
Informs the screen of certain drawing phases.

A '0' will be sent when beginning to draw persistent features (ie. those which should remain the same from frame to frame), and a '1' will be sent prior to drawing ephemeral details which should vanish if not redrawn next frame.

Parameters:
iMarker - Marker number

DrawRectangle

void DrawRectangle(int x1,
                   int y1,
                   int x2,
                   int y2,
                   int Color,
                   int iOutlineColour,
                   EColorSchemes ColorScheme,
                   boolean bDrawOutline,
                   boolean bFill,
                   int iThickness)
Draw a filled rectangle

Parameters:
x1 - top left of rectangle (x coordinate)
y1 - top left corner of rectangle (y coordinate)
x2 - bottom right of rectangle (x coordinate)
y2 - bottom right of rectangle (y coordinate)
Color - the colour to be used (numeric)
ColorScheme - Which colourscheme is to be used
bDrawOutline - Whether to draw an outline or not
bFill - Whether to fill or not
iThickness - Line thickness for outline

DrawCircle

void DrawCircle(int iCX,
                int iCY,
                int iR,
                int iColour,
                boolean bFill)
Draw a circle

Parameters:
iCX - X co-ordinate of the centre
iCY - Y co-ordinate of the centre
iR - Radius in pixels
iColour - Colour number
bFill - Fill or outline?

Polyline

void Polyline(CDasherView.Point[] Points,
              int Number,
              int iWidth)
Draws a sequence of lines in a fixed colour, usually black.

Parameters:
Points - Array of Points describing the vertices of the line.
Number - Number of points
iWidth - Line width

Polyline

void Polyline(CDasherView.Point[] Points,
              int Number,
              int iWidth,
              int Colour)
Draws a sequence of lines.

Parameters:
Points - Array of Points describing the vertices of the line.
Number - Number of points
iWidth - Line width
Colour - Colour number

Polygon

void Polygon(CDasherView.Point[] Points,
             int Number,
             int Color)
Draw a filled polygon - given vertices and color id. This is not (currently) used in standard Dasher. However, it could be very useful in the future. Please implement unless it will be very difficult, in which case make this function call Polyline. Draw a filled polygon

Parameters:
Points - array of points defining the edge of the polygon
Number - number of points in the array
Color - colour of the polygon (numeric)

Polygon

void Polygon(CDasherView.Point[] Points,
             int Number,
             int Color,
             int iWidth)
Draw a filled polygon - given vertices, width and color id. This is not (currently) used in standard Dasher. However, it could be very useful in the future. Please implement unless it will be very difficult, in which case make this function call Polyline. Draw a filled polygon

Parameters:
Points - array of points defining the edge of the polygon
Number - number of points in the array
Color - colour of the polygon (numeric)
iWidth - Width of the polygon border to draw

Blank

void Blank()
Signals the beginning of a new frame.


Display

void Display()
Signals the end of a frame.


SetColourScheme

void SetColourScheme(CCustomColours ColourScheme)
Sets the colour scheme to use

Parameters:
ColourScheme - New colour scheme