multivalent.std.lens
Class Lens
public abstract
class
Lens
extends Behavior
implements ContextListener
VWindows that transform their content and compose with one another.
Lenses are tools, such as a magnifying glass or show OCR content, that are associated with the window as a whole
(specifically, with the Root), as opposed to individual Documents.
Unlike other VWindows, Lenses are coordinated by a
Lens Manager, which composes their effects.
During paintBefore, as lenses implement ContextListener, they can add themselves to a Context's list of omnipresent
in order to modify in all Documents within its bounds.
To put lens creation in UI, add a reference to WindowUI in hub.
Can write a lens with opaque content, but then it's not really a lens, which transforms their content, so use a VWindow or Note.
Xerox PARC Magic Lenses reference
Version: $Revision: 1.5 $ $Date: 2003/06/02 05:48:56 $
See Also: LensMan Context ContextListener WindowUI
Method Summary |
boolean | appearance(Context cx, boolean all)
Effect: Context attributes and signals. |
void | close() Removes from LensMan. |
void | destroy() |
Rectangle | getContentBounds() Bounds of corresponding VFrame's content area, exclusive of title bar. |
protected LensMan | getLensMan()
Return lens manager behavior that coordinates lens intersections.
|
int | getPriority() final because lens priority given by window stacking order. |
boolean | paintAfter(Context cx, Node node)
Effect: arbitrary drawing on top.
|
boolean | paintBefore(Context cx, Node node)
Effect: Graphics2D transformation matrix. |
void | restore(ESISNode n, Map<String,Object> attr, Layer layer) Creates corresponding VFrame, and sets title and bounds, which are available for subclasses to tweak, |
ESISNode | save() |
boolean | semanticEventAfter(SemanticEvent se, String msg) Catch corresponding VFrame's windowClosed, windowRaised, .... |
void | show() Adds to LensMan. |
public static final String ATTR_HEIGHT
public static final String ATTR_TITLE
public static final String ATTR_WIDTH
public static final String ATTR_X
public static final String ATTR_Y
public static final String VAR_SHARED_LAYER
public boolean appearance(
Context cx, boolean all)
public void close()
Removes from LensMan.
public void destroy()
public Rectangle getContentBounds()
Bounds of corresponding VFrame's content area, exclusive of title bar.
Return lens manager behavior that coordinates lens intersections.
Dynamically creates if doesn't already exist.
See Also: LensMan
public final int getPriority()
final because lens priority given by window stacking order.
Effect: arbitrary drawing on top.
Can even traverse tree for special effects (that don't compose with other lenses).
Warning: this type of effects don't compose as well with other lenses.
Returns: false so it composes with other lenses
See Also: Ruler Bounds Cypher
Effect: Graphics2D transformation matrix.
See Also: Magnify
public void restore(
ESISNode n, Map<String,Object> attr,
Layer layer)
Creates corresponding VFrame, and sets title and bounds, which are available for subclasses to tweak,
Catch corresponding VFrame's windowClosed, windowRaised, ....
public void show()
Adds to LensMan.