/[schmitzm]/trunk/src/skrueger/geotools/XMapPaneAction_Zoom.java
ViewVC logotype

Annotation of /trunk/src/skrueger/geotools/XMapPaneAction_Zoom.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 640 - (hide annotations)
Thu Jan 28 16:12:04 2010 UTC (15 years, 1 month ago) by alfonx
Original Path: branches/2.0-RC2/src/skrueger/geotools/XMapPaneAction_ZoomIn.java
File MIME type: text/plain
File size: 1255 byte(s)


1 alfonx 639 package skrueger.geotools;
2    
3     import java.awt.Point;
4     import java.awt.event.MouseEvent;
5     import java.awt.event.MouseWheelEvent;
6    
7     import org.opengis.geometry.DirectPosition;
8    
9     public class XMapPaneAction_ZoomIn implements XMapPaneAction {
10    
11     @Override
12     public void performClick(XMapPane mapPane, MouseEvent ev,
13     DirectPosition coord) {
14    
15     mapPane.zoomTo(ev.getPoint(), 1 / 2.);
16     }
17    
18     @Override
19     public void performDragging(XMapPane mapPane, MouseEvent ev,
20 alfonx 640 Point dragStartPos, Point dragLastPos, DirectPosition startCoord,
21 alfonx 639 DirectPosition endCoord) {
22    
23 alfonx 640 if (dragLastPos != null)
24     mapPane.drawRectangle(mapPane.getGraphics(), dragLastPos, ev.getPoint());
25    
26 alfonx 639 mapPane.drawRectangle(mapPane.getGraphics(), dragStartPos, ev.getPoint());
27     }
28    
29     @Override
30     public void performWheel(XMapPane mapPane, MouseWheelEvent wheelEvt,
31     DirectPosition coord) {
32    
33     final int units = wheelEvt.getUnitsToScroll();
34     if (units > 0)
35     mapPane.zoomTo(wheelEvt.getPoint(), 1. + .11 * units);
36     else
37     mapPane.zoomTo(wheelEvt.getPoint(), 2. / -units);
38     }
39    
40     @Override
41     public void performDragged(XMapPane mapPane, MouseEvent ev,
42 alfonx 640 Point dragStartPos, Point dragLastPos, DirectPosition startCoord,
43 alfonx 639 DirectPosition endCoord) {
44     // TODO Auto-generated method stub
45    
46     }
47    
48     }

Properties

Name Value
svn:eol-style native
svn:keywords Id URL
svn:mime-type text/plain

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26