Multivalent API

multivalent.std
Class SpeedRead

java.lang.Object
  extended by multivalent.VObject
      extended by multivalent.Behavior
          extended by multivalent.std.SpeedRead

public class SpeedRead
extends Behavior

Starting at cursor/selection, flash words up at some rate, after and superior to Vortex. Not sure if this is a good way to do it, but it only took two hours to implement, and makes a great example of Multivalent's advantages over that applet: don't need three copies of text, can start at any point in document, works on any page vs ones prepared with applet.

Version:
$Revision: 1.4 $ $Date: 2002/02/01 03:01:42 $

Field Summary
static java.lang.String ATTR_DELAY
           
static java.lang.String MSG_DELAY
          Sets the delay between words, in milliseconds.
static java.lang.String MSG_FASTER
          Show words faster by decreasing the delay.
static java.lang.String MSG_PAUSE
          Another semantic command, which should be given more descriptive name.
static java.lang.String MSG_SLOWER
          Another semantic command, which should be given more descriptive name.
 
Fields inherited from class multivalent.Behavior
ATTR_BEHAVIOR, name_
 
Fields inherited from class multivalent.VObject
attr_
 
Constructor Summary
SpeedRead()
           
 
Method Summary
 void destroy()
          Protocol.
 boolean eventAfter(java.awt.AWTEvent e, java.awt.Point rel, Node n)
          Arrow keys adjust speed (actually delay).
 boolean eventBefore(java.awt.AWTEvent e, java.awt.Point rel, Node n)
          Click in content area to pause.
 boolean paintAfter(Context cx, Node node)
          Draw in frame, rather than change content node, format, paint cycle -- probably wrong choice as doesn't compose.
 boolean paintBefore(Context cx, Node node)
          A tree walk protocol, called before observed node has been painted.
 void restore(ESISNode n, java.util.Map<java.lang.String,java.lang.Object> attr, Layer layer)
          Create VFrame.
 boolean semanticEventAfter(SemanticEvent se, java.lang.String msg)
          Take action: windowClosed, pause, faster, ....
 boolean semanticEventBefore(SemanticEvent se, java.lang.String msg)
          Entries in frame popup: pause, faster, slower, ....
 
Methods inherited from class multivalent.Behavior
buildAfter, buildBefore, checkRep, clipboardAfter, clipboardBefore, createUI, formatAfter, formatBefore, getBrowser, getDocument, getInstance, getInstance, getLayer, getLogger, getName, getPreference, getRoot, isEditable, putPreference, redo, restoreChildren, save, 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

MSG_PAUSE

public static final java.lang.String MSG_PAUSE
Another semantic command, which should be given more descriptive name.

"togglePause".

See Also:
Constant Field Values

MSG_DELAY

public static final java.lang.String MSG_DELAY
Sets the delay between words, in milliseconds.

"speedreadDelay": arg= Number delay.

See Also:
Constant Field Values

MSG_FASTER

public static final java.lang.String MSG_FASTER
Show words faster by decreasing the delay.

"speedreadFaster".

See Also:
Constant Field Values

MSG_SLOWER

public static final java.lang.String MSG_SLOWER
Another semantic command, which should be given more descriptive name.

"speedreadSlower".

See Also:
Constant Field Values

ATTR_DELAY

public static final java.lang.String ATTR_DELAY
See Also:
Constant Field Values
Constructor Detail

SpeedRead

public SpeedRead()
Method Detail

semanticEventBefore

public boolean semanticEventBefore(SemanticEvent se,
                                   java.lang.String msg)
Entries in frame popup: pause, faster, slower, ....

Overrides:
semanticEventBefore in class Behavior

semanticEventAfter

public boolean semanticEventAfter(SemanticEvent se,
                                  java.lang.String msg)
Take action: windowClosed, pause, faster, ....

Overrides:
semanticEventAfter in class Behavior

destroy

public void destroy()
Description copied from class: Behavior
Protocol. Cleans up state before being decommissioned: remove from Layer, observed nodes, .... Clients shouldn't hold a pointer/handle to object after destroy() as it is in an invalid state. This protocol cannot be short-circuited.

Overrides:
destroy in class Behavior

paintBefore

public boolean paintBefore(Context cx,
                           Node node)
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 node)
Draw in frame, rather than change content node, format, paint cycle -- probably wrong choice as doesn't compose.

Overrides:
paintAfter in class Behavior

eventBefore

public boolean eventBefore(java.awt.AWTEvent e,
                           java.awt.Point rel,
                           Node n)
Click in content area to pause.

Overrides:
eventBefore in class Behavior
See Also:
SemanticEvent, AWTEvent, Browser, LensMan

eventAfter

public boolean eventAfter(java.awt.AWTEvent e,
                          java.awt.Point rel,
                          Node n)
Arrow keys adjust speed (actually delay).

Overrides:
eventAfter in class Behavior

restore

public void restore(ESISNode n,
                    java.util.Map<java.lang.String,java.lang.Object> attr,
                    Layer layer)
Create VFrame.

Overrides:
restore in class Behavior

Multivalent API