svn-gvsig-desktop / trunk / libraries / libCq CMS for java.old / src / org / cresques / ui / cmd / CmdZoom.java @ 91
History | View | Annotate | Download (718 Bytes)
1 |
package org.cresques.ui.cmd; |
---|---|
2 |
|
3 |
import java.awt.Component; |
4 |
import java.awt.geom.Point2D; |
5 |
|
6 |
import java.awt.event.MouseEvent; |
7 |
|
8 |
import org.cresques.ui.CQMapCanvas; |
9 |
|
10 |
public class CmdZoom extends Cmd { |
11 |
public static final int type=Cmd.ZOOM; |
12 |
public double aumenta = 2.0; |
13 |
public double reduce = .5; |
14 |
public CmdZoom(Component canvas) { |
15 |
super(canvas);
|
16 |
eventsWanted = (LEFT | RIGHT | PRESS | RELEASE | DRAG); |
17 |
} |
18 |
public void cmd(Point2D pt, int bt, int mouseEvent) { |
19 |
//System.out.println("Zoom: Evento = "+ mouseEvent);
|
20 |
if (mouseEvent == RELEASE) {
|
21 |
if (bt == MouseEvent.BUTTON1) |
22 |
((CQMapCanvas) canvas).zoom(aumenta, pt); |
23 |
else if (bt == MouseEvent.BUTTON3) |
24 |
((CQMapCanvas) canvas).zoom(reduce, pt); |
25 |
} |
26 |
} |
27 |
} |