sub_arctic.text
Class text_rect

java.lang.Object
  |
  +--sub_arctic.text.screen_rect
        |
        +--sub_arctic.text.text_rect

public class text_rect
extends screen_rect

This is the class that represents a displayed bunch of text on the screen. It is constructed from a word object. Note that this the screen manifestation of a word (or part of a word) after the layout. The text_bounding_rect class is used to figure out how big words are before the layout.


Field Summary
protected  int _baseline
          This holds the baseline position for this text rectangle.
protected  int _length
          This is the length of the text in text run.
protected  text_run _represented_run
          What text run does this represent?
protected  int _start
          This is the start position in the text run.
 
Fields inherited from class sub_arctic.text.screen_rect
_h, _w, _x, _y
 
Constructor Summary
text_rect(int x, int y, int w, int h, text_run tr, int start, int length)
          Construct a text_rect given its size, position, and string representation.
 
Method Summary
 int baseline()
          Return the baseline of this rectangle.
 boolean can_overlap()
          This object may not overlap its neighbor.
 int length()
          Return the length of the text we are representing.
 text_run represented_run()
          Return the text_run that this text_rect represents.
 void set_baseline(int b)
          Set the baseline of this object.
 int start_position()
          Return the start position in the text run we are representing.
 java.lang.String toString()
          Display this sucker.
 
Methods inherited from class sub_arctic.text.screen_rect
h, set_h, w, x, y
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_represented_run

protected text_run _represented_run
What text run does this represent?

_start

protected int _start
This is the start position in the text run.

_length

protected int _length
This is the length of the text in text run.

_baseline

protected int _baseline
This holds the baseline position for this text rectangle.
Constructor Detail

text_rect

public text_rect(int x,
                 int y,
                 int w,
                 int h,
                 text_run tr,
                 int start,
                 int length)
Construct a text_rect given its size, position, and string representation.
Method Detail

can_overlap

public boolean can_overlap()
This object may not overlap its neighbor.
Returns:
boolean always returns false for this subclass
Overrides:
can_overlap in class screen_rect

represented_run

public text_run represented_run()
Return the text_run that this text_rect represents.

start_position

public int start_position()
Return the start position in the text run we are representing.

length

public int length()
Return the length of the text we are representing.

toString

public java.lang.String toString()
Display this sucker.
Overrides:
toString in class screen_rect

baseline

public int baseline()
Return the baseline of this rectangle.

set_baseline

public void set_baseline(int b)
Set the baseline of this object. We have to set this so we can align the baseline of objects on this row. Be aware that the height of the font of this object is not necessarily the baseline of this object, since it might be on a line with some rect with a larger font.