sub_arctic.style
Class text_comp_part

java.lang.Object
  |
  +--sub_arctic.style.composition_part_base
        |
        +--sub_arctic.style.text_comp_part

public class text_comp_part
extends composition_part_base

This class provides composition_part based on a text_renderer and string to be drawn with that object.

See Also:
composer

Field Summary
protected  text_renderer _the_renderer
          The renderer for this part.
protected  java.lang.String _the_string
          The string for this part.
 
Fields inherited from class sub_arctic.style.composition_part_base
_feature_points, _x, _y
 
Constructor Summary
text_comp_part(int x_pos, int y_pos, text_renderer rnd, java.lang.String str)
          Full constructor.
text_comp_part(text_renderer rnd, java.lang.String str)
          Constructor with default position of 0,0.
 
Method Summary
 void draw_self(drawable on_surf, int at_x, int at_y)
          Draw the object on the given drawing surface at the given location.
 int h()
          Current height of the object.
 void set_the_renderer(text_renderer rnd)
          Set the renderer for this part.
 void set_the_string(java.lang.String str)
          Set the string for this part.
 text_renderer the_renderer()
          The renderer for this part.
 java.lang.String the_string()
          The string for this part.
 int w()
          Current width of the object.
 
Methods inherited from class sub_arctic.style.composition_part_base
can_set_h, can_set_w, feature_point, num_feature_points, set_feature_points, set_h, set_w, set_x, set_y, toString, x, y
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_the_string

protected java.lang.String _the_string
The string for this part.

_the_renderer

protected text_renderer _the_renderer
The renderer for this part.
Constructor Detail

text_comp_part

public text_comp_part(int x_pos,
                      int y_pos,
                      text_renderer rnd,
                      java.lang.String str)
Full constructor.
Parameters:
int - x_pos x position of this part.
int - y_pos y position of this part.
text_renderer - rnd the renderer to draw this part with.
String - str the string to build this part from.

text_comp_part

public text_comp_part(text_renderer rnd,
                      java.lang.String str)
Constructor with default position of 0,0.
Parameters:
text_renderer - rnd the renderer to draw this part with.
String - str the string to build this part from. (or null to indicate none).
Method Detail

the_string

public java.lang.String the_string()
The string for this part.
Returns:
String the string for this part.

set_the_string

public void set_the_string(java.lang.String str)
Set the string for this part.

the_renderer

public text_renderer the_renderer()
The renderer for this part.
Returns:
text_renderer the renderer for this part.

set_the_renderer

public void set_the_renderer(text_renderer rnd)
Set the renderer for this part.

w

public int w()
Current width of the object. This is determined from the string and text.
Returns:
int the width of the object
Overrides:
w in class composition_part_base

h

public int h()
Current height of the object. This is determined from the string and text.
Returns:
int the height of the object
Overrides:
h in class composition_part_base

draw_self

public void draw_self(drawable on_surf,
                      int at_x,
                      int at_y)
Draw the object on the given drawing surface at the given location.
Parameters:
drawable - on_surf the drawing surface to draw on.
int - at_x the x location to draw at.
int - at_y the y location to draw at.
Overrides:
draw_self in class composition_part_base