sub_arctic.text
Class screen_rect

java.lang.Object
  |
  +--sub_arctic.text.screen_rect
Direct Known Subclasses:
dead_rect, text_rect

public abstract class screen_rect
extends java.lang.Object

This object is the base class for all objects which can appear on the screen.


Field Summary
protected  int _h
          Height within the containing structure.
protected  int _w
          Width within the containing structure.
protected  int _x
          X coord within the containing structure.
protected  int _y
          Y coord within the containing structure.
 
Constructor Summary
screen_rect()
          Construct a screen rect.
 
Method Summary
abstract  boolean can_overlap()
          This function is called to see if this object may overlap its predecessor as it is layed out.
 int h()
          This returns the height of the object within its containing structure.
 void set_h(int new_h)
          Set the height of a screen object.
 java.lang.String toString()
          Display this sucker.
 int w()
          This returns the width of the object.
 int x()
          This returns the x position of the object within its containing structure.
 int y()
          This returns the y position of the object within its containing structure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_x

protected int _x
X coord within the containing structure. This is the location of the top-left corner.

_y

protected int _y
Y coord within the containing structure. This is the location of the top-left corner.

_w

protected int _w
Width within the containing structure.

_h

protected int _h
Height within the containing structure.
Constructor Detail

screen_rect

public screen_rect()
Construct a screen rect. This function does nothing except fill in the values of the fields with an "unknown" marker.
Method Detail

can_overlap

public abstract boolean can_overlap()
This function is called to see if this object may overlap its predecessor as it is layed out. Objects like text and images can not overlap, objects like markups and cursors can overlap.
Returns:
boolean true if the object can overlap its neighbor

x

public int x()
This returns the x position of the object within its containing structure. This returns -1 if the value is not yet known.
Returns:
int x coord of top left corner

y

public int y()
This returns the y position of the object within its containing structure. This returns -1 if the value is not yet known.
Returns:
int y coord of top left corner

w

public int w()
This returns the width of the object. This returns -1 if the value is not yet known.
Returns:
int width of the object in pixels

h

public int h()
This returns the height of the object within its containing structure. This returns -1 if the value is not yet known.
Returns:
int height of the object in pixels

set_h

public void set_h(int new_h)
Set the height of a screen object. This needs to happen so that we can determine the maximum height of objects on a line and then retroactively fix the height of all the objects less than the maximum.

toString

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