multivalent.std.lens
Class Magnify
java.lang.Object
multivalent.VObject
multivalent.Behavior
multivalent.std.lens.Lens
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
- Transform coordinates within lens, so can select within.
- Separate scaling on x and y axes?
- Version:
- $Revision: 1.2 $ $Date: 2002/02/08 14:39:12 $
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 |
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_
Magnify
public Magnify()
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