Multivalent API

multivalent.devel
Class NodeActivity

java.lang.Object
  extended by multivalent.VObject
      extended by multivalent.Behavior
          extended by multivalent.devel.NodeActivity

public class NodeActivity
extends Behavior

Attach to node to report protocol activity on that node, filterable by protocol. Of course, this applies to tree protocols only: format, paint, low-level event, clipboard. LATER: animated on doc tree?

Version:
$Revision: 1.3 $ $Date: 2002/02/02 12:34:04 $

Field Summary
static int BUILDAFTER_MASK
           
static int BUILDBEFORE_MASK
           
static int CLIPBOARDAFTER_MASK
           
static int CLIPBOARDBEFORE_MASK
           
static int EVENTAFTER_MASK
           
static int EVENTBEFORE_MASK
           
static int FORMATAFTER_MASK
           
static int FORMATBEFORE_MASK
           
static int PAINTAFTER_MASK
           
static int PAINTBEFORE_MASK
           
static int SEMANTICEVENTAFTER_MASK
           
static int SEMANTICEVENTBEFORE_MASK
           
 
Fields inherited from class multivalent.Behavior
ATTR_BEHAVIOR, name_
 
Fields inherited from class multivalent.VObject
attr_
 
Constructor Summary
NodeActivity()
           
 
Method Summary
 boolean clipboardAfter(java.lang.StringBuffer sb, Node node)
          A tree walk protocol, called after observed node has been given a chance to contribute to the growing selection content in the passed StringBuffer.
 boolean clipboardBefore(java.lang.StringBuffer sb, Node node)
          A tree walk protocol, called before observed node has been given a chance to contribute to the growing selection content in the passed StringBuffer.
 boolean eventAfter(java.awt.AWTEvent e, java.awt.Point rel, Node obsn)
          During Behavior.eventBefore(AWTEvent, Point, Node), the behaviors that take primary action to that event should do so, after having given other behaviors the opportunity to filter it during eventBefore.
 boolean eventBefore(java.awt.AWTEvent e, java.awt.Point rel, Node obsn)
           
 boolean formatAfter(Node node)
          A tree walk protocol, called after observed node has been formatted.
 boolean formatBefore(Node node)
          A tree walk protocol, called before observed node has been formatted.
 int getMask()
           
 Node getNode()
           
 void msgOut(java.lang.String proto)
          Show protocol and limited, unusual state.
 boolean paintAfter(Context cx, Node n)
          A tree walk protocol, called before observed node has been painted.
 boolean paintBefore(Context cx, Node n)
          A tree walk protocol, called before observed node has been painted.
 void setMask(int mask)
          OR if protocol masks from the class Behavior.
 void setNode(Node node)
           
 
Methods inherited from class multivalent.Behavior
buildAfter, buildBefore, checkRep, createUI, destroy, getBrowser, getDocument, getInstance, getInstance, getLayer, getLogger, getName, getPreference, getRoot, isEditable, putPreference, redo, restore, restoreChildren, save, semanticEventAfter, semanticEventBefore, setName, toString, undo
 
Methods inherited from class multivalent.VObject
attrEntrySetIterator, attrKeysIterator, clearAttributes, getAttr, getAttr, getAttributes, getGlobal, getValue, hasAttributes, putAttr, removeAttr, setAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BUILDBEFORE_MASK

public static final int BUILDBEFORE_MASK
See Also:
Constant Field Values

BUILDAFTER_MASK

public static final int BUILDAFTER_MASK
See Also:
Constant Field Values

FORMATBEFORE_MASK

public static final int FORMATBEFORE_MASK
See Also:
Constant Field Values

FORMATAFTER_MASK

public static final int FORMATAFTER_MASK
See Also:
Constant Field Values

PAINTBEFORE_MASK

public static final int PAINTBEFORE_MASK
See Also:
Constant Field Values

PAINTAFTER_MASK

public static final int PAINTAFTER_MASK
See Also:
Constant Field Values

EVENTBEFORE_MASK

public static final int EVENTBEFORE_MASK
See Also:
Constant Field Values

EVENTAFTER_MASK

public static final int EVENTAFTER_MASK
See Also:
Constant Field Values

SEMANTICEVENTBEFORE_MASK

public static final int SEMANTICEVENTBEFORE_MASK
See Also:
Constant Field Values

SEMANTICEVENTAFTER_MASK

public static final int SEMANTICEVENTAFTER_MASK
See Also:
Constant Field Values

CLIPBOARDBEFORE_MASK

public static final int CLIPBOARDBEFORE_MASK
See Also:
Constant Field Values

CLIPBOARDAFTER_MASK

public static final int CLIPBOARDAFTER_MASK
See Also:
Constant Field Values
Constructor Detail

NodeActivity

public NodeActivity()
Method Detail

formatBefore

public boolean formatBefore(Node node)
Description copied from class: Behavior
A tree walk protocol, called before observed node has been formatted.

Overrides:
formatBefore in class Behavior
Returns:
true to short-circuit to formatAfter at that node, bypassing formatting of the subtree. Could be used on collapsed outline sections to save work formatting content that wouldn't be displayed anyhow.

formatAfter

public boolean formatAfter(Node node)
Description copied from class: Behavior
A tree walk protocol, called after observed node has been formatted. For instance, Search uses this to keep its coordinates of matches current.

Overrides:
formatAfter in class Behavior
Returns:
true to short-circuit formatting of rest of protocol, which consists exclusively of higher-priority behaviors, which almost never want to do.

paintBefore

public boolean paintBefore(Context cx,
                           Node n)
Description copied from class: Behavior
A tree walk protocol, called before observed node has been painted. Called in same coordinate space as node's painting. Can be used draw special background, but usual background setting is done by spans or style sheets.

Overrides:
paintBefore in class Behavior
Returns:
true to short-circuit to paintAfter at that node, bypassing painting of the subtree.

paintAfter

public boolean paintAfter(Context cx,
                          Node n)
Description copied from class: Behavior
A tree walk protocol, called before observed node has been painted. Called in same coordinate space as node's painting. Use to draw annotations at node's location. For instance, Search uses this to decorate the scrollbar (a type of node) with location of matches.

Overrides:
paintAfter in class Behavior

clipboardBefore

public boolean clipboardBefore(java.lang.StringBuffer sb,
                               Node node)
Description copied from class: Behavior
A tree walk protocol, called before observed node has been given a chance to contribute to the growing selection content in the passed StringBuffer. As a special case, observers on the root are always called, even if the selection is for only a part of the document. This way, a behavior could add author and title attribution to all selections. Remember that in addition to appending text to a StringBuffer, text can be inserted anywhere.

Overrides:
clipboardBefore in class Behavior
Returns:
true to short-circuit to selectAfter at that node, bypassing selection of the subtree. For instance, if you're selecting bibliographic entries, you might want to generate BibTeX or IEEE formatting rather than straight text; likewise, on math, generate Lisp, TeX, or Mathematica.

clipboardAfter

public boolean clipboardAfter(java.lang.StringBuffer sb,
                              Node node)
Description copied from class: Behavior
A tree walk protocol, called after observed node has been given a chance to contribute to the growing selection content in the passed StringBuffer. As a special case, observers on the root are always called, even if the selection is for only a part of the document.

Overrides:
clipboardAfter in class Behavior

eventBefore

public boolean eventBefore(java.awt.AWTEvent e,
                           java.awt.Point rel,
                           Node obsn)
Overrides:
eventBefore in class Behavior
See Also:
SemanticEvent, AWTEvent, Browser, LensMan

eventAfter

public boolean eventAfter(java.awt.AWTEvent e,
                          java.awt.Point rel,
                          Node obsn)
Description copied from class: Behavior
During Behavior.eventBefore(AWTEvent, Point, Node), the behaviors that take primary action to that event should do so, after having given other behaviors the opportunity to filter it during eventBefore.

Overrides:
eventAfter in class Behavior

msgOut

public void msgOut(java.lang.String proto)
Show protocol and limited, unusual state.


setMask

public void setMask(int mask)
OR if protocol masks from the class Behavior.


getMask

public int getMask()

setNode

public void setNode(Node node)

getNode

public Node getNode()

Multivalent API