sub_arctic.new_lib
Class whiteboard_obj

java.lang.Object
  |
  +--sub_arctic.new_lib.whiteboard_obj
Direct Known Subclasses:
line_wb_obj, rect_wb_obj, text_wb_obj

public abstract class whiteboard_obj
extends java.lang.Object

This abstract class provides the API and base implementation for an object displayed on a historical_whiteboard object.


Field Summary
protected  long _end_time
          Time this object was destroyed (or Long.MAX_VALUE) if the object is still alive.
protected  int _h
          height of bounding box
protected  int _mod_id
          Numerical id of the last modifier of this object
protected  int _owner_id
          Numerical id of the owner of this object
protected  long _start_time
          Time this object was created
protected  java.util.Vector _state_history
          Vector where we place state record objects in time order.
protected  int _w
          width of bounding box
protected  int _x
          x position
protected  int _y
          y position
 
Constructor Summary
whiteboard_obj(int xv, int yv, int wv, int hv, int own_id)
          Full constructor.
 
Method Summary
abstract  boolean drag_end(event evt, int x, int y, int start_x, int start_y, int grab_x, int grab_y, java.lang.Object user_info)
          Dispatch input corresponding to the end of a drag.
abstract  boolean drag_end(event evt, java.lang.Object user_info)
          Dispatch event corresponding to the end of a simple drag.
abstract  boolean drag_feedback(event evt, int x, int y, int start_x, int start_y, int grab_x, int grab_y, java.lang.Object user_info)
          Dispatch a movement during a drag.
abstract  boolean drag_feedback(event evt, java.lang.Object user_info)
          Dispatch a movement event during a simple drag.
abstract  boolean drag_start(event evt, int x, int y, int grab_x, int grab_y, java.lang.Object user_info)
          Dispatch the start of a drag to the object.
abstract  boolean drag_start(event evt, java.lang.Object user_info)
          Dispatch the start event of a simple drag.
 void draw_self(drawable d)
          Draw the object as it appears at present.
abstract  void draw_self(drawable d, long at_time, boolean select_by_owner, java.awt.Color[] map)
          Draw the object as it would appear at the given time.
 long end_time()
          Time this object was destroyed (or Long.MAX_VALUE) if the object is still alive.
 int h()
          height of bounding box
abstract  whiteboard_obj interactive_make(event evt, historical_whiteboard wb)
          Begin to make a new object like this one interactively.
 void make_state_record()
          Make a record of the object state at the current time (for later playback) of this object as it appeared at various times
 int mod_id()
          Numerical id of the last modifier of this object
 int owner_id()
          Numerical id of the owner of this object
abstract  boolean pick(int xpt, int ypt)
          Indicate whether the given point should pick this object
 void set_end_time()
          Set the time this object was destroyed to the current time.
 void set_h(int hv)
          set the height of this object
 void set_mod_id(int id)
          Set the numerical id of the last modifier of this object
 void set_owner_id(int id)
          Set the numerical id of the owner of this object
 void set_w(int wv)
          set the width of this object
 void set_x(int xv)
          set the x position
 void set_y(int yv)
          set the y position
protected abstract  wb_obj_state snapshot()
          Build a record of the object's current state which is marked with the current time.
 long start_time()
          Time this object was created
protected  wb_obj_state state_at(long timestamp)
          Extract the state corresponding to the given time
 void update_current_state()
          Replace the current state record with a new one.
 int w()
          width of bounding box
 boolean was_alive(long at_time)
          Indicate whether the given object would have been alive at the given time.
 int x()
          x position
 int y()
          y position
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_x

protected int _x
x position

_y

protected int _y
y position

_w

protected int _w
width of bounding box

_h

protected int _h
height of bounding box

_owner_id

protected int _owner_id
Numerical id of the owner of this object

_mod_id

protected int _mod_id
Numerical id of the last modifier of this object

_start_time

protected long _start_time
Time this object was created

_end_time

protected long _end_time
Time this object was destroyed (or Long.MAX_VALUE) if the object is still alive.

_state_history

protected java.util.Vector _state_history
Vector where we place state record objects in time order. Objects in this vector will be a subclass of wb_obj_state cooresponding to the actual class of this object. In particular, they will be objects returned by snapshot().
Constructor Detail

whiteboard_obj

public whiteboard_obj(int xv,
                      int yv,
                      int wv,
                      int hv,
                      int own_id)
Full constructor.
Parameters:
int - xv x position of this object
int - yv y position of this object
int - wv w position of this object
int - hv h position of this object
int - own_id id of owner of this object
Method Detail

x

public int x()
x position
Returns:
int the x position of this object within the whiteboard

set_x

public void set_x(int xv)
set the x position
Parameters:
int - xv the new x position of this object within the whiteboard

y

public int y()
y position
Returns:
int the y position of this object within the whiteboard

set_y

public void set_y(int yv)
set the y position
Parameters:
int - yv the new y position of this object within the whiteboard

w

public int w()
width of bounding box
Returns:
int the width of this object's bounding box

set_w

public void set_w(int wv)
set the width of this object
Parameters:
int - wv the new width of this object

h

public int h()
height of bounding box
Returns:
int the height of this object's bounding box

set_h

public void set_h(int hv)
set the height of this object
Parameters:
int - wv the new height of this object

owner_id

public int owner_id()
Numerical id of the owner of this object

set_owner_id

public void set_owner_id(int id)
Set the numerical id of the owner of this object

mod_id

public int mod_id()
Numerical id of the last modifier of this object

set_mod_id

public void set_mod_id(int id)
Set the numerical id of the last modifier of this object

start_time

public long start_time()
Time this object was created

end_time

public long end_time()
Time this object was destroyed (or Long.MAX_VALUE) if the object is still alive.

set_end_time

public void set_end_time()
Set the time this object was destroyed to the current time.

make_state_record

public void make_state_record()
Make a record of the object state at the current time (for later playback) of this object as it appeared at various times

update_current_state

public void update_current_state()
Replace the current state record with a new one. This is used only for transitent state changes that don't go in the log, but represent the current state of the object. This always operates on the last record in the log (by simply replacing it).

state_at

protected wb_obj_state state_at(long timestamp)
Extract the state corresponding to the given time

snapshot

protected abstract wb_obj_state snapshot()
Build a record of the object's current state which is marked with the current time.

pick

public abstract boolean pick(int xpt,
                             int ypt)
Indicate whether the given point should pick this object
Parameters:
int - xpt x coordinate of query point
int - ypt y coordinate of query point
Returns:
boolean whether that point is considered to pick this object

was_alive

public boolean was_alive(long at_time)
Indicate whether the given object would have been alive at the given time.
Parameters:
long - at_time the time in question
Returns:
boolean the status of the object at that time.

draw_self

public abstract void draw_self(drawable d,
                               long at_time,
                               boolean select_by_owner,
                               java.awt.Color[] map)
Draw the object as it would appear at the given time.

draw_self

public void draw_self(drawable d)
Draw the object as it appears at present.

interactive_make

public abstract whiteboard_obj interactive_make(event evt,
                                                historical_whiteboard wb)
Begin to make a new object like this one interactively. Interaction will have started with the given event (which will be mouse button press) and will be occuring within the given whiteboard object. This routine will fill in some state from this object and some from the event. It will then typically make the owning whiteboard the simple_drag focus in order to provide information for completing the initial creation of the object. In that case calls to the drag_start(), drag_feedback() and drag_end() routines of the returned object will be forwarded to the returned object.

drag_start

public abstract boolean drag_start(event evt,
                                   java.lang.Object user_info)
Dispatch the start event of a simple drag.
Parameters:
event - evt the event "causing" the start of the drag (normally a mouse button press).
Object - user_info the uninterpreted user info that was associated with this object when it became the drag focus.
Returns:
boolean indicating whether the input was consumed.

drag_feedback

public abstract boolean drag_feedback(event evt,
                                      java.lang.Object user_info)
Dispatch a movement event during a simple drag.
Parameters:
event - evt the event "causing" the the drag (normally a mouse move).
Object - user_info the uninterpreted user info that was associated with this object when it became the drag focus.
Returns:
boolean indicating whether the input was consumed.

drag_end

public abstract boolean drag_end(event evt,
                                 java.lang.Object user_info)
Dispatch event corresponding to the end of a simple drag.
Parameters:
event - evt the event "causing" the end of the drag (normally a mouse button release).
Object - user_info the uninterpreted user info that was associated with this object when it became the drag focus.
Returns:
boolean indicating whether the input was consumed.

drag_start

public abstract boolean drag_start(event evt,
                                   int x,
                                   int y,
                                   int grab_x,
                                   int grab_y,
                                   java.lang.Object user_info)
Dispatch the start of a drag to the object. Returns true if the drag is accepted (and hence the event consumed). The x,y values give the position of the start of drag in the parent's coordinate system as filtered by the move_drag_filter object established with the move_drag agent (if any). The event retains the original raw coordinate values. grab_x, grab_y indicate the offset of the drag start point from the origin of the object (this indicates the "grab point" within the object). The user_info object passed here will be the one that was given to the agent when focus was established.
Parameters:
event - evt The event which "caused" the drag.
int - x x position where object should be placed at start of drag (in parent's coordinates).
int - y y position where object should be placed at start of drag (in parent's coordinates).
int - grab_x x position where drag started (in local coords).
int - grab_y y position where drag started (in local coords).
Object - user_info uninterpreted information provided when the object was made the move-drag focus.
Returns:
boolean indicating whether the input was consumed.

drag_feedback

public abstract boolean drag_feedback(event evt,
                                      int x,
                                      int y,
                                      int start_x,
                                      int start_y,
                                      int grab_x,
                                      int grab_y,
                                      java.lang.Object user_info)
Dispatch a movement during a drag. Returns true if the event should be considered to have been consumed. The x,y values give the current position of the of drag in the parent's coordinate system as filtered by the move_drag_filter object established with the move_drag agent (if any). start_x, start_y give the start position of the drag (again, filtered by the established move_drag_filter object, if any). The event retains the original raw coordinate values. grab_x, grab_y indicate the offset of the drag start point from the origin of the object at the start of dragging (this indicates the "grab point" within the object). The user_info object passed here will be the one that was given to the agent when focus was established.
Parameters:
event - evt The event which "caused" the drag.
int - x x position where object should be placed at start of drag (in parent's coordinates).
int - y y position where object should be placed at start of drag (in parent's coordinates).
int - start_x x position where drag started (in parent's coords).
int - start_y y position where drag started (in parent's coords).
int - grab_x x position where drag started (in local coords).
int - grab_y y position where drag started (in local coords).
Object - user_info uninterpreted information provided when the object was made the move-drag focus.
Returns:
boolean indicating whether the input was consumed.

drag_end

public abstract boolean drag_end(event evt,
                                 int x,
                                 int y,
                                 int start_x,
                                 int start_y,
                                 int grab_x,
                                 int grab_y,
                                 java.lang.Object user_info)
Dispatch input corresponding to the end of a drag. Returns true if the even should be considered to have been consumed. The x,y values give the current position of the of drag in the parent's coordinate system as filtered by the move_drag_filter object established with the move_drag agent (if any). start_x, start_y give the start position of the drag (again, filtered by the established move_drag_filter object, if any). The event retains the original raw coordinate values. start_off_x, start_off_y indicate the offset of the drag start point from the origin of the object at the start of dragging (this indicates the "grab point" within the object). The user_info object passed here will be the one that was given to the agent when focus was established.
Parameters:
event - evt The event which "caused" the drag.
int - x x position where object should be placed at start of drag (in parent's coordinates).
int - y y position where object should be placed at start of drag (in parent's coordinates).
int - start_x x position where drag started (in parent's coords).
int - start_y y position where drag started (in parent's coords).
int - grab_x x position where drag started (in local coords).
int - grab_y y position where drag started (in local coords).
Object - user_info uninterpreted information provided when the object was made the move-drag focus.
Returns:
boolean indicating whether the input was consumed.