10 |
import com.vividsolutions.jts.geom.Coordinate; |
import com.vividsolutions.jts.geom.Coordinate; |
11 |
import com.vividsolutions.jts.geom.Envelope; |
import com.vividsolutions.jts.geom.Envelope; |
12 |
|
|
13 |
public class XMapPaneAction_ZoomIn implements XMapPaneAction { |
public abstract class XMapPaneAction_Zoom implements XMapPaneAction { |
14 |
|
|
15 |
|
public static class In extends XMapPaneAction_Zoom { |
16 |
|
|
17 |
@Override |
@Override |
18 |
public void performClick(XMapPane mapPane, MouseEvent ev, |
public void performClick(XMapPane mapPane, MouseEvent ev, |
38 |
DirectPosition endCoord) { |
DirectPosition endCoord) { |
39 |
|
|
40 |
if (dragLastPos != null) |
if (dragLastPos != null) |
41 |
mapPane.drawRectangle(mapPane.getGraphics(), dragLastPos, ev |
mapPane.drawRectangle(mapPane.getGraphics(), dragStartPos, dragLastPos); |
|
.getPoint()); |
|
42 |
|
|
43 |
mapPane.drawRectangle(mapPane.getGraphics(), dragStartPos, ev |
mapPane.drawRectangle(mapPane.getGraphics(), dragStartPos, ev |
44 |
.getPoint()); |
.getPoint()); |
50 |
DirectPosition endCoord) { |
DirectPosition endCoord) { |
51 |
|
|
52 |
if (dragLastPos != null) |
if (dragLastPos != null) |
53 |
mapPane.drawRectangle(mapPane.getGraphics(), dragLastPos, ev |
mapPane.drawRectangle(mapPane.getGraphics(), dragStartPos, dragLastPos ); |
|
.getPoint()); |
|
54 |
|
|
55 |
// If this is similar to a click, let mouseClicked handle it! |
// If this is similar to a click, let mouseClicked handle it! |
56 |
if ((Math.abs(dragStartPos.x - ev.getPoint().x) * Math.abs(ev |
if ((Math.abs(dragStartPos.x - ev.getPoint().x) * Math.abs(ev |
89 |
} |
} |
90 |
|
|
91 |
} |
} |
92 |
|
|
93 |
|
} |