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

Diff of /trunk/src/skrueger/geotools/XMapPaneAction.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 650 by alfonx, Thu Jan 28 16:51:55 2010 UTC revision 651 by alfonx, Fri Jan 29 08:37:34 2010 UTC
# Line 29  Line 29 
29   ******************************************************************************/   ******************************************************************************/
30  package skrueger.geotools;  package skrueger.geotools;
31    
32    import java.awt.Cursor;
33  import java.awt.Point;  import java.awt.Point;
34  import java.awt.event.MouseEvent;  import java.awt.event.MouseEvent;
35  import java.awt.event.MouseWheelEvent;  import java.awt.event.MouseWheelEvent;
# Line 38  import org.opengis.geometry.DirectPositi Line 39  import org.opengis.geometry.DirectPositi
39  import schmitzm.swing.event.MouseInputType;  import schmitzm.swing.event.MouseInputType;
40    
41  /**  /**
42   * Defines an action (e.g. Zoom in, zoom out, drag) when a click, drag or   * Defines an action (e.g. Zoom in, zoom out, drag) when a click, drag or window
43   * window selection is performed on a {@link XMapPane}.   * selection is performed on a {@link XMapPane}.
44   * @author <a href="mailto:[email protected]">Martin Schmitz</a> (University of Bonn/Germany)   *
45     * @author <a href="mailto:[email protected]">Martin Schmitz</a>
46     *         (University of Bonn/Germany)
47   */   */
48  public interface XMapPaneAction {  public interface XMapPaneAction {
49      
50    /**          /**
51     * Defines the action in case of a single click on the map. Called by           * This action can be assigned to any {@link MouseInputType} to perform
52     * ### XMapPaneMouseAdapter ### on {@link MouseInputType#LClick} and           * zoom-in
53     * {@link MouseInputType#RClick}.           **/
54     * @param mapPane map pane the action should be performed on          public static XMapPaneAction_Zoom ZOOM_IN = new XMapPaneAction_Zoom.In();
55     * @param ev      mouse event of the action  
56     * @param coord   geo coordinate the click is performed on          /**
57     */           * This action can be assigned to any {@link MouseInputType} to perform
58    public void performClick(XMapPane mapPane, MouseEvent ev, DirectPosition coord);           * zoom-out
59               **/
60    /**          public static XMapPaneAction_Zoom ZOOM_OUT = new XMapPaneAction_Zoom.Out();
61     * Defines the action in case of a mouse drag on the map. This method          
62     * is called on every mouse motion.          /**
63     * @param mapPane      map pane the action should be performed on           * This action can be assigned to any {@link MouseInputType} to perform
64     * @param ev           mouse event of the action           * panning on a Map
65     * @param dragStartPos window position the drag was started (the current           **/
66     *                     position can be determined from the mouse event)            public static XMapPaneAction_Pan PAN = new XMapPaneAction_Pan();        
67     * @param startCoord   geo coordinate the drag was started  
68     * @param endCoord     geo coordinate the drag is currently moved over          /**
69     */           * Defines the action in case of a single click on the map. Called by ###
70    public void performDragging(XMapPane mapPane, MouseEvent ev, Point dragStartPos, Point dragLastPos, DirectPosition startCoord, DirectPosition endCoord);           * XMapPaneMouseAdapter ### on {@link MouseInputType#LClick} and
71             * {@link MouseInputType#RClick}.
72    /**           *
73     * Defines the action in case of a window selection on the map (the moment           * @param mapPane
74     * a drag ends).           *            map pane the action should be performed on
75     * @param mapPane      map pane the action should be performed on           * @param ev
76     * @param ev           mouse event of the action           *            mouse event of the action
77     * @param dragStartPos window position the window starts (the end           * @param coord
78     *                     position can be determined from the mouse event)             *            geo coordinate the click is performed on
79     * @param startCoord   geo coordinate the window starts           */
80     * @param endCoord     geo coordinate the window ends          public void performClick(XMapPane mapPane, MouseEvent ev,
81     */                          DirectPosition coord);
82    public void performDragged(XMapPane mapPane, MouseEvent ev, Point dragStartPos, Point dragLastPos, DirectPosition startCoord, DirectPosition endCoord);  
83            /**
84    /**           * Defines the action in case of a mouse drag on the map. This method is
85     * Defines the action in case of a mouse wheel action on the map (the moment           * called on every mouse motion.
86     * a drag ends).           *
87     * @param mapPane      map pane the action should be performed on           * @param mapPane
88     * @param ev           mouse event of the action           *            map pane the action should be performed on
89     * @param coord        geo coordinate the wheel is turned on           * @param ev
90     */           *            mouse event of the action
91    public void performWheel(XMapPane mapPane, MouseWheelEvent ev, DirectPosition coord);           * @param dragStartPos
92               *            window position the drag was started (the current position can
93    public static XMapPaneAction_Zoom ZOOM_IN = new XMapPaneAction_Zoom.In();           *            be determined from the mouse event)
94    public static XMapPaneAction_Zoom ZOOM_OUT = new XMapPaneAction_Zoom.Out();           * @param startCoord
95             *            geo coordinate the drag was started
96             * @param endCoord
97             *            geo coordinate the drag is currently moved over
98             */
99            public void performDragging(XMapPane mapPane, MouseEvent ev,
100                            Point dragStartPos, Point dragLastPos, DirectPosition startCoord,
101                            DirectPosition endCoord);
102    
103            /**
104             * Defines the action in case of a window selection on the map (the moment a
105             * drag ends).
106             *
107             * @param mapPane
108             *            map pane the action should be performed on
109             * @param ev
110             *            mouse event of the action
111             * @param dragStartPos
112             *            window position the window starts (the end position can be
113             *            determined from the mouse event)
114             * @param startCoord
115             *            geo coordinate the window starts
116             * @param endCoord
117             *            geo coordinate the window ends
118             */
119            public void performDragged(XMapPane mapPane, MouseEvent ev,
120                            Point dragStartPos, Point dragLastPos, DirectPosition startCoord,
121                            DirectPosition endCoord);
122    
123            /**
124             * Defines the action in case of a mouse wheel action on the map (the moment
125             * a drag ends).
126             *
127             * @param mapPane
128             *            map pane the action should be performed on
129             * @param ev
130             *            mouse event of the action
131             * @param coord
132             *            geo coordinate the wheel is turned on
133             */
134            public void performWheel(XMapPane mapPane, MouseWheelEvent ev,
135                            DirectPosition coord);
136    
137  }  }

Legend:
Removed from v.650  
changed lines
  Added in v.651

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26