sub_arctic.output
Class shadow_lin_grad_text

java.lang.Object
  |
  +--sub_arctic.output.simple_text_renderer
        |
        +--sub_arctic.output.gradient_text_renderer
              |
              +--sub_arctic.output.linear_gradient_text
                    |
                    +--sub_arctic.output.shadow_lin_grad_text

public class shadow_lin_grad_text
extends linear_gradient_text

Object for drawing of shadowed text with a linear gradient pattern in one of several standard styles. 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 using a linear gradient. highlight and shadow are done in two specified colors: hilight_color and shadow_color. For raised text values of white and black might be used, whereas inset text might be done with black and white.


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.linear_gradient_text
_draw_style, BL_DIAG_GRAD, HORIZ_GRAD, LAST_GRAD_STYLE, TL_DIAG_GRAD, VERT_GRAD
 
Fields inherited from class sub_arctic.output.gradient_text_renderer
_draw_gradient
 
Fields inherited from class sub_arctic.output.simple_text_renderer
_draw_color, _draw_font, _metrics
 
Constructor Summary
shadow_lin_grad_text(java.awt.Font in_font, gradient in_grad, int in_style, java.awt.Color hi_color, java.awt.Color shad_color)
          Construct a renderer given a Font, a gradient, a style code, and two colors.
 
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.linear_gradient_text
draw_style, set_draw_gradient, set_draw_gradient, set_draw_style
 
Methods inherited from class sub_arctic.output.gradient_text_renderer
draw_gradient
 
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

shadow_lin_grad_text

public shadow_lin_grad_text(java.awt.Font in_font,
                            gradient in_grad,
                            int in_style,
                            java.awt.Color hi_color,
                            java.awt.Color shad_color)
Construct a renderer given a Font, a gradient, a style code, and two colors. A clone of the gradient will be adjusted to match the style and set to span the size of the text. The highlight above, shadow below, and main text will then be drawn.
Parameters:
Font - in_font font that this renderer uses.
linear_gradient - in_grad gradient that the actual text is drawn with.
int - in_style style code indicating direction of gradient. Must be one of: TL_DIAG_GRAD, BL_DIAG_GRAD, HORIZ_GRAD, or VERT_GRAD.
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 linear_gradient_text

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