sub_arctic.lib
Class sem_draw_context

java.lang.Object
  |
  +--sub_arctic.lib.sem_draw_context
Direct Known Subclasses:
bounds_sem_draw_context

public class sem_draw_context
extends java.lang.Object

This class provides a traversal "parameters" object that encapsulates the context of a draw done from inside a semantic lens. A semantic lens does a re-rendering of the interactor tree rooted at its parent in a way that changes the display in some significant way. For example, the nametag_sem_draw redraw pass draws all objects as a small tag displaying the name of the class of the object, along with a bounding box. These objects are used by the sem_draw_cont predicate, various specialized drawing actions, and the sem_draw_to_child transformer.

See Also:
sem_draw_to_child, sub_arctic.lib.sem_draw_cont, base_interactor.traverse_and_collect(int, int, sub_arctic.lib.interactor_pred, sub_arctic.lib.interactor_pred, sub_arctic.lib.traversal_xform, java.lang.Object, sub_arctic.input.pick_collector)

Field Summary
protected  semantic_lens _lens
          The lens whose draw context we are.
protected  drawable _surface
          The drawable we can draw on.
 int draw_kind
          A unique identifier that indicates what type of drawing is being done.
 
Constructor Summary
sem_draw_context(int drw_knd, drawable surf)
          Constructor.
sem_draw_context(int drw_knd, drawable surf, semantic_lens sem_lens)
          Full constructor.
sem_draw_context(sem_draw_context other)
          Construct from another object.
 
Method Summary
 semantic_lens lens()
          Returns the semantic lens whose draw context we are.
 void set_lens(semantic_lens lens)
          Sets the semantic lens whose draw context we are.
 void set_surface(drawable surface)
          Sets the drawable we can draw on.
 drawable surface()
          Returns the drawable we can draw on.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

draw_kind

public int draw_kind
A unique identifier that indicates what type of drawing is being done. This value should be allocated by manager.unique_int() to ensure uniqueness, and stored in a static variable that is accessible to any interactor that needs to specialize itself on that basis.

_surface

protected drawable _surface
The drawable we can draw on.

_lens

protected semantic_lens _lens
The lens whose draw context we are.
Constructor Detail

sem_draw_context

public sem_draw_context(int drw_knd,
                        drawable surf)
Constructor.
Parameters:
ind - drw_kind a value for draw_kind.
drawable - surf a value for surface.

sem_draw_context

public sem_draw_context(int drw_knd,
                        drawable surf,
                        semantic_lens sem_lens)
Full constructor.
Parameters:
int - drw_kind a value for draw_kind.
drawable - surf a value for surface.
semantic_lens - lens the lens whose draw context we are.

sem_draw_context

public sem_draw_context(sem_draw_context other)
Construct from another object.
Parameters:
sem_draw_context - other the object we make a copy of.
Method Detail

surface

public drawable surface()
Returns the drawable we can draw on.
Returns:
int The drawable we can draw on.

set_surface

public void set_surface(drawable surface)
Sets the drawable we can draw on.
Returns:
int The drawable we can draw on.

lens

public semantic_lens lens()
Returns the semantic lens whose draw context we are.
Returns:
int The semantic lens whose draw context we are.

set_lens

public void set_lens(semantic_lens lens)
Sets the semantic lens whose draw context we are.
Returns:
int The semantic lens whose draw context we are.