sub_arctic.text
Class text_run

java.lang.Object
  |
  +--sub_arctic.text.run
        |
        +--sub_arctic.text.text_run

public class text_run
extends run

This is the class that holds the information about a contigous set of characters in the same style.


Field Summary
protected  handler _event_handler
          This is the object that gets the first look at events that occur within our area.
protected  java.lang.String _text
          This is the actual string of text that we represent.
protected  style _text_style
          The style for this text object.
 
Fields inherited from class sub_arctic.text.run
_next, _prev
 
Constructor Summary
text_run(style s, java.lang.String t, handler h)
          Construct a text run from a style, a string, and an event handler.
 
Method Summary
 void add_text(java.lang.String n)
          Add text to this object.
 handler event_handler()
          Return the object that is handling events for this area.
 style text_style()
          This returns the style in use by this text run.
 java.lang.String text()
          Return the actual string we are trying to display.
 int width()
          Return the naive value of the width of this run.
 
Methods inherited from class sub_arctic.text.run
next, prev
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_text_style

protected style _text_style
The style for this text object.

_text

protected java.lang.String _text
This is the actual string of text that we represent. This should never be empty or null.

_event_handler

protected handler _event_handler
This is the object that gets the first look at events that occur within our area.
Constructor Detail

text_run

public text_run(style s,
                java.lang.String t,
                handler h)
Construct a text run from a style, a string, and an event handler.
Method Detail

text_style

public style text_style()
This returns the style in use by this text run.

text

public java.lang.String text()
Return the actual string we are trying to display.
Returns:
String the string we represent (which may be broken onto multiple lines)

add_text

public void add_text(java.lang.String n)
Add text to this object.

event_handler

public handler event_handler()
Return the object that is handling events for this area.

width

public int width()
Return the naive value of the width of this run. This value is computed by simply considering the current string in the current font.
Returns:
int the simple width of this run in pixels
Overrides:
width in class run