sub_arctic.output
Class shadowed_text_renderer

java.lang.Object
  |
  +--sub_arctic.output.simple_text_renderer
        |
        +--sub_arctic.output.shadowed_text_renderer

public class shadowed_text_renderer
extends simple_text_renderer

Object for simple drawing of text in a given font and color with shadowed highlighting. The text is drawn in three parts: a hilight 1 pixel above the final text location, a shadow 1 pixel below the final text location, and finally the actual text itself. This is done in 3 colors: hilight_color, shadow_color, and draw_color respectively. For raised text values of white, black and gray, whereas inset text might be done with black, white, and gray.


Field Summary
protected  java.awt.Color _hilight_color
          Color for the hilight above the actual text
protected  java.awt.Color _shadow_color
          Color for the shadow below the actual text
 
Fields inherited from class sub_arctic.output.simple_text_renderer
_draw_color, _draw_font, _metrics
 
Constructor Summary
shadowed_text_renderer(java.awt.Font in_font, java.awt.Color in_color, java.awt.Color hi_color, java.awt.Color shad_color)
          Construct a renderer given a Font and 3 colors to draw the hilight, shadow, and text in.
 
Method Summary
 int baseline()
          The baseline location associated with this renderer.
 void draw_text(drawable on_surface, int at_x, int at_y, java.lang.String txt)
          Render text onto the given drawable object at the given location.
 int h(java.lang.String txt)
          Height that the image of a given string drawn would take up.
 java.awt.Color hilight_color()
          Color for the higlight above the actual text
 int leading()
          The amount of spacing to be placed between lines of text rendered with this renderer.
 void set_hilight_color(java.awt.Color clr)
          Set the color the highlight above the actual text gets drawn in.
 void set_shadow_color(java.awt.Color clr)
          Set the color the shadow below the actual text gets drawn in.
 java.awt.Color shadow_color()
          Color for the shadow below the actual text
 int w(java.lang.String txt)
          Width that the image of a given string drawn would take up.
 
Methods inherited from class sub_arctic.output.simple_text_renderer
draw_color, draw_font, set_draw_color, set_draw_font
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_hilight_color

protected java.awt.Color _hilight_color
Color for the hilight above the actual text

_shadow_color

protected java.awt.Color _shadow_color
Color for the shadow below the actual text
Constructor Detail

shadowed_text_renderer

public shadowed_text_renderer(java.awt.Font in_font,
                              java.awt.Color in_color,
                              java.awt.Color hi_color,
                              java.awt.Color shad_color)
Construct a renderer given a Font and 3 colors to draw the hilight, shadow, and text in.
Parameters:
Font - in_font font that this renderer uses.
Color - in_color color that the actual text is drawn in.
Color - hi_color color that the hilight above the text is drawn in.
Color - shad_color color that the shadow below the text is drawn in.
Method Detail

hilight_color

public java.awt.Color hilight_color()
Color for the higlight above the actual text
Returns:
Color the color used to draw the highlight with.

set_hilight_color

public void set_hilight_color(java.awt.Color clr)
Set the color the highlight above the actual text gets drawn in.
Parameters:
Color - clr the new color to draw the highlight with.

shadow_color

public java.awt.Color shadow_color()
Color for the shadow below the actual text
Returns:
Color the color used to draw the shadow with.

set_shadow_color

public void set_shadow_color(java.awt.Color clr)
Set the color the shadow below the actual text gets drawn in.
Parameters:
Color - clr the new color to draw the shadow with.

draw_text

public void draw_text(drawable on_surface,
                      int at_x,
                      int at_y,
                      java.lang.String txt)
Render text onto the given drawable object at the given location.
Parameters:
drawable - on_surface the drawing surface where we draw the result.
int - at_x x coordinate to draw at.
int - at_y y coordinate to draw at.
String - txt the text to draw.
Overrides:
draw_text in class simple_text_renderer

w

public int w(java.lang.String txt)
Width that the image of a given string drawn would take up.
Parameters:
String - txt the string that will be drawn.
Returns:
int the width of the resulting image.
Overrides:
w in class simple_text_renderer

h

public int h(java.lang.String txt)
Height that the image of a given string drawn would take up.
Parameters:
String - txt the string that will be drawn.
Returns:
int the height of the resulting image.
Overrides:
h in class simple_text_renderer

baseline

public int baseline()
The baseline location associated with this renderer. This is the offset from the top of the image that the text baseline will appear at.
Returns:
int the baseline value.
Overrides:
baseline in class simple_text_renderer

leading

public int leading()
The amount of spacing to be placed between lines of text rendered with this renderer.
Returns:
int the leading (vertical spacing) value.
Overrides:
leading in class simple_text_renderer