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

Field Summary
static StringATTR_HEIGHT
static StringATTR_TITLE
static StringATTR_WIDTH
static StringATTR_X
static StringATTR_Y
static StringVAR_SHARED_LAYER
protected VFramewin_
Method Summary
booleanappearance(Context cx, boolean all)
Effect: Context attributes and signals.
voidclose()
Removes from LensMan.
voiddestroy()
RectanglegetContentBounds()
Bounds of corresponding VFrame's content area, exclusive of title bar.
protected LensMangetLensMan()
Return lens manager behavior that coordinates lens intersections.
intgetPriority()
final because lens priority given by window stacking order.
booleanpaintAfter(Context cx, Node node)
Effect: arbitrary drawing on top.
booleanpaintBefore(Context cx, Node node)
Effect: Graphics2D transformation matrix.
voidrestore(ESISNode n, Map<String,Object> attr, Layer layer)
Creates corresponding VFrame, and sets title and bounds, which are available for subclasses to tweak,
ESISNodesave()
booleansemanticEventAfter(SemanticEvent se, String msg)
Catch corresponding VFrame's windowClosed, windowRaised, ....
voidshow()
Adds to LensMan.

Field Detail

ATTR_HEIGHT

public static final String ATTR_HEIGHT

ATTR_TITLE

public static final String ATTR_TITLE

ATTR_WIDTH

public static final String ATTR_WIDTH

ATTR_X

public static final String ATTR_X

ATTR_Y

public static final String ATTR_Y

VAR_SHARED_LAYER

public static final String VAR_SHARED_LAYER

win_

protected VFrame win_

Method Detail

appearance

public boolean appearance(Context cx, boolean all)
Effect: Context attributes and signals.

Returns: false so it composes with other lenses

See Also: ContextListener SignalLens

close

public void close()
Removes from LensMan.

destroy

public void destroy()

getContentBounds

public Rectangle getContentBounds()
Bounds of corresponding VFrame's content area, exclusive of title bar.

getLensMan

protected LensMan getLensMan()
Return lens manager behavior that coordinates lens intersections. Dynamically creates if doesn't already exist.

See Also: LensMan

getPriority

public final int getPriority()
final because lens priority given by window stacking order.

paintAfter

public boolean paintAfter(Context cx, Node node)
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

paintBefore

public boolean paintBefore(Context cx, Node node)
Effect: Graphics2D transformation matrix.

See Also: Magnify

restore

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,

save

public ESISNode save()

semanticEventAfter

public boolean semanticEventAfter(SemanticEvent se, String msg)
Catch corresponding VFrame's windowClosed, windowRaised, ....

show

public void show()
Adds to LensMan.