Statistics
| Revision:

root / tags / v2_0_0_Build_2038 / libraries / libFMap_controls / src / org / gvsig / fmap / mapcontrol / tools / Behavior / IBehavior.java @ 37103

History | View | Annotate | Download (5.02 KB)

1 21711 vcaballero
package org.gvsig.fmap.mapcontrol.tools.Behavior;
2 21203 vcaballero
3 23645 vcaballero
import java.awt.Image;
4 21203 vcaballero
import java.awt.event.MouseEvent;
5
import java.awt.event.MouseWheelEvent;
6
7
import org.gvsig.fmap.mapcontrol.MapControl;
8 30327 jpiera
import org.gvsig.fmap.mapcontrol.MapControlDrawer;
9 21203 vcaballero
import org.gvsig.fmap.mapcontrol.tools.BehaviorException;
10
import org.gvsig.fmap.mapcontrol.tools.Listeners.ToolListener;
11
12
13
/**
14
 * <p>When a programmer needs to add a way to permit user to interact with the current object where the graphical
15
 *  information is stored and represented, (see {@link MapControl MapControl}), must analyze and decide the basic
16
 *  <i>behavior</i> nature of the interaction.</p>
17 23645 vcaballero
 *
18 21203 vcaballero
 * <p>That <i>behavior</i> will manage mouse events and generate information and <i>tool</i> events that the
19
 *  associated {@link ToolListener ToolListener} will use to interact with the <code>MapControl</code> object ultimately.</p>
20 23645 vcaballero
 *
21 21203 vcaballero
 * <p>It will be possible also combine more than one <i>behavior</i> for a tool listener, for having a richness tool.</p>
22
 */
23
public interface IBehavior {
24
        /**
25
         * <p>Gets the <code>ToolListener</code> used by this behavior to perform actions on the
26
         *  associated <code>MapControl</code> object.</p>
27
         *
28
         * @return the <code>ToolListener</code> used by this behavior
29
         */
30
        public ToolListener getListener();
31
32
        /**
33
         * <p>Method executed in real-time, when user is working with a tool on the associated <code>MapControl</code>
34
         *  object, repainting the <code>MapControl</code>'s image.</p>
35
         *
36
         * <p>Returns immediately in all cases, even if the complete image has not yet been loaded.</p>
37 23645 vcaballero
         *
38 21203 vcaballero
         * <p>This method will be implemented according to the specific nature of each behavior, and its
39
         *  extra and particular features.</p>
40 23645 vcaballero
         *
41 21203 vcaballero
         * @see Graphics#drawImage(java.awt.Image, int, int, java.awt.image.ImageObserver)
42
         */
43 30327 jpiera
        public void paintComponent(MapControlDrawer renderer);
44 21203 vcaballero
45
        /**
46
         * <p>Associates this behavior to a <code>MapControl</code> object.</p>
47
         *
48
         * @param mc the <code>MapControl</code> object to associate
49 23645 vcaballero
         *
50 21203 vcaballero
         * @see #getMapControl()
51
         */
52
        public void setMapControl(MapControl mc);
53
54
        /**
55
         * <p>Gets the mouse cursor of the tool listener associated to this behavior.</p>
56
         *
57
         * @return the mouse cursor of the tool listener associated
58
         */
59 23645 vcaballero
        public Image getImageCursor();
60 21203 vcaballero
61
        /**
62 23645 vcaballero
         * <p>Returns the reference to the <code>MapControl</code> object that this behavior uses.</p>
63 21203 vcaballero
         *
64
         * @return the <code>MapControl</code> object used this behavior
65 23645 vcaballero
         *
66 21203 vcaballero
         * @see #setMapControl(MapControl)
67
         */
68
        public MapControl getMapControl();
69
70
        /**
71
         * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
72 23645 vcaballero
         *
73 21203 vcaballero
         * @throws BehaviorException any exception processing the action associated to a <i>mouse clicked event</i>, by the <code>IBehavior</code> object
74
         */
75
        public void mouseClicked(MouseEvent e) throws BehaviorException;
76
77
        /**
78
         * @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent)
79 23645 vcaballero
         *
80 21203 vcaballero
         * @throws BehaviorException any exception processing the action associated to a <i>mouse entered event</i>, by the <code>IBehavior</code> object
81
         */
82
        public void mouseEntered(MouseEvent e) throws BehaviorException;
83
84
        /**
85
         * @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent)
86 23645 vcaballero
         *
87 21203 vcaballero
         * @throws BehaviorException any exception processing the action associated to a <i>mouse exited event</i>, by the <code>IBehavior</code> object
88
         */
89
        public void mouseExited(MouseEvent e) throws BehaviorException;
90
91
        /**
92
         * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
93 23645 vcaballero
         *
94 21203 vcaballero
         * @throws BehaviorException any exception processing the action associated to a <i>mouse pressed event</i>, by the <code>IBehavior</code> object
95
         */
96
        public void mousePressed(MouseEvent e) throws BehaviorException;
97
98
        /**
99
         * @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent)
100 23645 vcaballero
         *
101 21203 vcaballero
         * @throws BehaviorException any exception processing the action associated to a <i>mouse released event</i>, by the <code>IBehavior</code> object
102
         */
103
        public void mouseReleased(MouseEvent e) throws BehaviorException;
104
105
        /**
106
         * @see java.awt.event.MouseMotionListener#mouseDragged(java.awt.event.MouseEvent)
107 23645 vcaballero
         *
108 21203 vcaballero
         * @throws BehaviorException any exception processing the action associated to a <i>mouse dragged event</i>, by the <code>IBehavior</code> object
109
         */
110
        public void mouseDragged(MouseEvent e) throws BehaviorException;
111
112
        /**
113
         * @see java.awt.event.MouseMotionListener#mouseMoved(java.awt.event.MouseEvent)
114 23645 vcaballero
         *
115 21203 vcaballero
         * @throws BehaviorException any exception processing the action associated to a <i>mouse moved event</i>, by the <code>IBehavior</code> object
116
         */
117
        public void mouseMoved(MouseEvent e) throws BehaviorException;
118
119
        /**
120
         * @see java.awt.event.MouseWheelListener#mouseWheelMoved(java.awt.event.MouseWheelEvent)
121 23645 vcaballero
         *
122 21203 vcaballero
         * @throws BehaviorException any exception processing the action associated to a <i>mouse wheel event</i>, by the <code>IBehavior</code> object
123
         */
124
        public void mouseWheelMoved(MouseWheelEvent e) throws BehaviorException;
125
126
}