net.sf.rej.gui.hexeditor
Class Drawer

java.lang.Object
  extended by net.sf.rej.gui.hexeditor.Drawer

public class Drawer
extends java.lang.Object

Class used to draw text into a graphics object.

Author:
Sami Koivu

Field Summary
static java.awt.Font PLAIN
           
 
Constructor Summary
Drawer(java.awt.Graphics g, java.awt.Dimension d)
          Initializes this drawer with the given Graphics object and the dimensions of the component in which the drawing takes place.
 
Method Summary
 void draw(java.lang.String text)
          Draws text without selections of highlighting.
 void draw(java.lang.String text, boolean selected, boolean hilite)
          Draws text with possible selection and possible highlight.
 int getOffset()
          Returns the current x position of this drawer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLAIN

public static final java.awt.Font PLAIN
Constructor Detail

Drawer

public Drawer(java.awt.Graphics g,
              java.awt.Dimension d)
Initializes this drawer with the given Graphics object and the dimensions of the component in which the drawing takes place.

Parameters:
g - the graphics object in which to draw.
d - the dimensions of the target.
Method Detail

draw

public void draw(java.lang.String text)
Draws text without selections of highlighting.

Parameters:
text - the text the draw.

draw

public void draw(java.lang.String text,
                 boolean selected,
                 boolean hilite)
Draws text with possible selection and possible highlight.

Parameters:
text - the text to draw.
selected - true if this text is selected.
hilite - true if the selection is to be highlighted.

getOffset

public int getOffset()
Returns the current x position of this drawer. In other words, the horizontal position in which the next character is to be drawn.

Returns:
horizontal drawing position.