multivalent.std.lens

Class Magnify

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 StringATTR_ZOOM
static StringATTR_ZOOMS
static StringMSG_MAGNIFY
Create a mangify lens.
protected VRadiogrouprg_
Method Summary
booleanpaintBefore(Context cx, Node node)
voidrestore(ESISNode n, Map<String,Object> attr, Layer layer)
Transform mouse coordinates to match magnified.
booleansemanticEventAfter(SemanticEvent se, String msg)
booleansemanticEventBefore(SemanticEvent se, String msg)

Field Detail

ATTR_ZOOM

public static final String ATTR_ZOOM

ATTR_ZOOMS

public static final String ATTR_ZOOMS

MSG_MAGNIFY

public static final String MSG_MAGNIFY
Create a mangify lens.

"magnifyLens".

rg_

protected VRadiogroup rg_

Method Detail

paintBefore

public boolean paintBefore(Context cx, Node node)

restore

public void restore(ESISNode n, Map<String,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); }

semanticEventAfter

public boolean semanticEventAfter(SemanticEvent se, String msg)

semanticEventBefore

public boolean semanticEventBefore(SemanticEvent se, String msg)