Multivalent API

multivalent.std.lens
Class Magnify

java.lang.Object
  extended by multivalent.VObject
      extended by multivalent.Behavior
          extended by multivalent.std.lens.Lens
              extended by multivalent.std.lens.Magnify
All Implemented Interfaces:
ContextListener

public class Magnify
extends Lens

Enlarge content by scaling Graphics2D. This lens composes well, as opposed to BitMagnify. To do

Version:
$Revision: 1.2 $ $Date: 2002/02/08 14:39:12 $

Field Summary
static java.lang.String ATTR_ZOOM
           
static java.lang.String ATTR_ZOOMS
           
static java.lang.String MSG_MAGNIFY
          Create a mangify lens.
protected  VRadiogroup rg_
           
 
Fields inherited from class multivalent.std.lens.Lens
ATTR_HEIGHT, ATTR_TITLE, ATTR_WIDTH, ATTR_X, ATTR_Y, VAR_SHARED_LAYER, win_
 
Fields inherited from class multivalent.Behavior
ATTR_BEHAVIOR, name_
 
Fields inherited from class multivalent.VObject
attr_
 
Fields inherited from interface multivalent.ContextListener
LITTLE, LOT, PRIORITY_LENS, PRIORITY_MAX, PRIORITY_MIN, PRIORITY_SELECTION, PRIORITY_SPAN, PRIORITY_STRUCT, SOME
 
Constructor Summary
Magnify()
           
 
Method Summary
 boolean paintBefore(Context cx, Node node)
          Effect: Graphics2D transformation matrix.
 void restore(ESISNode n, java.util.Map<java.lang.String,java.lang.Object> attr, Layer layer)
          Transform mouse coordinates to match magnified.
 boolean semanticEventAfter(SemanticEvent se, java.lang.String msg)
          Catch corresponding VFrame's windowClosed, windowRaised, ....
 boolean semanticEventBefore(SemanticEvent se, java.lang.String msg)
          Round robin distribution to all behaviors.
 
Methods inherited from class multivalent.std.lens.Lens
appearance, close, destroy, getContentBounds, getLensMan, getPriority, paintAfter, save, show
 
Methods inherited from class multivalent.Behavior
buildAfter, buildBefore, checkRep, clipboardAfter, clipboardBefore, createUI, eventAfter, eventBefore, formatAfter, formatBefore, getBrowser, getDocument, getInstance, getInstance, getLayer, getLogger, getName, getPreference, getRoot, isEditable, putPreference, redo, restoreChildren, 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_MAGNIFY

public static final java.lang.String MSG_MAGNIFY
Create a mangify lens.

"magnifyLens".

See Also:
Constant Field Values

ATTR_ZOOM

public static final java.lang.String ATTR_ZOOM
See Also:
Constant Field Values

ATTR_ZOOMS

public static final java.lang.String ATTR_ZOOMS
See Also:
Constant Field Values

rg_

protected VRadiogroup rg_
Constructor Detail

Magnify

public Magnify()
Method Detail

paintBefore

public boolean paintBefore(Context cx,
                           Node node)
Description copied from class: Lens
Effect: Graphics2D transformation matrix.

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

restore

public void restore(ESISNode n,
                    java.util.Map<java.lang.String,java.lang.Object> attr,
                    Layer layer)
Transform mouse coordinates to match magnified. public boolean eventAfter(AWTEvent e, Point rel, Node obsn) { //public boolean eventBefore(AWTEvent e, Point rel, Node obsn) { if (super.eventBefore(e, rel, obsn)) return true; // transform magnified space => unmag space rel_.setLocation(rel); //double f = zoom_/100.0; Rectangle r = getContentBounds(); //rel.setLocation(r.x + (int)((rel.x-r.x)/f), r.y + (int)((rel.y-r.y)/f)); //System.out.println(rel_+ " => "+rel); rel.x = ((rel.x - r.x)*100/zoom_) + r.x; rel.y = ((rel.y - r.y)*100/zoom_) + r.y; //return false; return super.eventAfter(e,rel, obsn); } public boolean eventAfterX(AWTEvent e, Point rel, Node obsn) { /*if (warp_) {* / rel.setLocation(rel_); //warp_=false; } return super.eventAfter(e,rel, obsn); }

Overrides:
restore in class Lens

semanticEventBefore

public boolean semanticEventBefore(SemanticEvent se,
                                   java.lang.String msg)
Description copied from class: Behavior
Round robin distribution to all behaviors. Message and clientData unpacked from SemanticEvent for convenience. Message is interned, so if you compare to a literal, you can use "==". Message can't be changed (it can be short-circuited out of), but client data can be mutated as it is passed along (so it's not passed as a parameter).

Overrides:
semanticEventBefore in class Behavior

semanticEventAfter

public boolean semanticEventAfter(SemanticEvent se,
                                  java.lang.String msg)
Description copied from class: Lens
Catch corresponding VFrame's windowClosed, windowRaised, ....

Overrides:
semanticEventAfter in class Lens

Multivalent API