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