dasher
Class CDelayedDraw

java.lang.Object
  extended by dasher.CDelayedDraw

public class CDelayedDraw
extends java.lang.Object

Simple class permitting the delayed drawing of Strings when drawing the DasherNodes to the screen.

The idea is that we can both
a) Cause all text to appear above other drawn objects, and b) Draw text at the same time as its Node, allowing the drawing process to remain modular.

Essentially, all strings which are drawn with this class are added to a list, which is emptied and drawn when Draw is called.


Nested Class Summary
protected  class CDelayedDraw.CTextString
          Class representing a String to be drawn plus information needed to draw it
 
Field Summary
protected  java.util.ArrayList<CDelayedDraw.CTextString> m_DrawTextString
          Internal list of objects we are waiting to draw
 
Constructor Summary
CDelayedDraw()
           
 
Method Summary
 void DelayDrawText(java.lang.String str, int x1, int y1, long Size)
          Queues up a piece of text for drawing.
 void Draw(CDasherScreen screen)
          Draws all queued up text to a given screen, and clears the queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_DrawTextString

protected java.util.ArrayList<CDelayedDraw.CTextString> m_DrawTextString
Internal list of objects we are waiting to draw

Constructor Detail

CDelayedDraw

public CDelayedDraw()
Method Detail

DelayDrawText

public void DelayDrawText(java.lang.String str,
                          int x1,
                          int y1,
                          long Size)
Queues up a piece of text for drawing.

Parameters:
str - String to draw
x1 - x co-ordinate of top-left corner of the string's bounding box
y1 - y co-ordinate of top-left corner of the string's bounding box
Size - Font size to use

Draw

public void Draw(CDasherScreen screen)
Draws all queued up text to a given screen, and clears the queue.

Parameters:
screen - Screen to which we should draw