root / tags / Root_FMap_piloto_CAD_Layout_version / libraries / libFMap / src / com / iver / cit / gvsig / fmap / tools / Behavior / Behavior.java @ 1664
History | View | Annotate | Download (3.88 KB)
1 |
/*
|
---|---|
2 |
* Created on 28-oct-2004
|
3 |
*/
|
4 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
5 |
*
|
6 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
7 |
*
|
8 |
* This program is free software; you can redistribute it and/or
|
9 |
* modify it under the terms of the GNU General Public License
|
10 |
* as published by the Free Software Foundation; either version 2
|
11 |
* of the License, or (at your option) any later version.
|
12 |
*
|
13 |
* This program is distributed in the hope that it will be useful,
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16 |
* GNU General Public License for more details.
|
17 |
*
|
18 |
* You should have received a copy of the GNU General Public License
|
19 |
* along with this program; if not, write to the Free Software
|
20 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
21 |
*
|
22 |
* For more information, contact:
|
23 |
*
|
24 |
* Generalitat Valenciana
|
25 |
* Conselleria d'Infraestructures i Transport
|
26 |
* Av. Blasco Ib??ez, 50
|
27 |
* 46010 VALENCIA
|
28 |
* SPAIN
|
29 |
*
|
30 |
* +34 963862235
|
31 |
* gvsig@gva.es
|
32 |
* www.gvsig.gva.es
|
33 |
*
|
34 |
* or
|
35 |
*
|
36 |
* IVER T.I. S.A
|
37 |
* Salamanca 50
|
38 |
* 46005 Valencia
|
39 |
* Spain
|
40 |
*
|
41 |
* +34 963163400
|
42 |
* dac@iver.es
|
43 |
*/
|
44 |
package com.iver.cit.gvsig.fmap.tools.Behavior; |
45 |
|
46 |
import com.iver.cit.gvsig.fmap.MapControl; |
47 |
import com.iver.cit.gvsig.fmap.tools.BehaviorException; |
48 |
import com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener; |
49 |
|
50 |
import java.awt.Cursor; |
51 |
import java.awt.Graphics; |
52 |
import java.awt.event.MouseEvent; |
53 |
import java.awt.event.MouseWheelEvent; |
54 |
import java.awt.image.BufferedImage; |
55 |
|
56 |
|
57 |
/**
|
58 |
* Herramienta del MapControl. Ejecuta acciones respondiendo a eventos, por
|
59 |
* delegaci?n desde MapControl.
|
60 |
*
|
61 |
* @author Luis W. Sevilla
|
62 |
*/
|
63 |
public abstract class Behavior { |
64 |
private MapControl mapControl;
|
65 |
/**
|
66 |
* Devuelve el ToolListener que est? seleccionado.
|
67 |
*
|
68 |
* @return ToolListener seleccionado.
|
69 |
*/
|
70 |
public abstract ToolListener getListener(); |
71 |
|
72 |
/**
|
73 |
* @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#paintComponent(java.awt.Graphics)
|
74 |
*/
|
75 |
public void paintComponent(Graphics g) { |
76 |
BufferedImage img = getMapControl().getImage();
|
77 |
|
78 |
if (img != null) { |
79 |
g.drawImage(img, 0, 0, null); |
80 |
} |
81 |
} |
82 |
|
83 |
/**
|
84 |
* Inserta el MapControl.
|
85 |
*
|
86 |
* @param mc MapControl a insertar.
|
87 |
*/
|
88 |
public void setMapControl(MapControl mc) { |
89 |
mapControl = mc; |
90 |
} |
91 |
|
92 |
/**
|
93 |
* Devuelve el cursor de la herrameinta.
|
94 |
*
|
95 |
* @return Cursor de la herramienta.
|
96 |
*/
|
97 |
public Cursor getCursor() { |
98 |
return getListener().getCursor();
|
99 |
} |
100 |
|
101 |
/**
|
102 |
* Devuelve MapControl.
|
103 |
*
|
104 |
* @return MapControl.
|
105 |
*/
|
106 |
public MapControl getMapControl() {
|
107 |
return mapControl;
|
108 |
} |
109 |
|
110 |
/**
|
111 |
* @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
|
112 |
*/
|
113 |
public void mouseClicked(MouseEvent e) throws BehaviorException { |
114 |
} |
115 |
|
116 |
/**
|
117 |
* @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent)
|
118 |
*/
|
119 |
public void mouseEntered(MouseEvent e) throws BehaviorException { |
120 |
} |
121 |
|
122 |
/**
|
123 |
* @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent)
|
124 |
*/
|
125 |
public void mouseExited(MouseEvent e) throws BehaviorException { |
126 |
} |
127 |
|
128 |
/**
|
129 |
* @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
|
130 |
*/
|
131 |
public void mousePressed(MouseEvent e) throws BehaviorException { |
132 |
} |
133 |
|
134 |
/**
|
135 |
* @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent)
|
136 |
*/
|
137 |
public void mouseReleased(MouseEvent e) throws BehaviorException { |
138 |
} |
139 |
|
140 |
/**
|
141 |
* @see java.awt.event.MouseMotionListener#mouseDragged(java.awt.event.MouseEvent)
|
142 |
*/
|
143 |
public void mouseDragged(MouseEvent e) throws BehaviorException { |
144 |
} |
145 |
|
146 |
/**
|
147 |
* @see java.awt.event.MouseMotionListener#mouseMoved(java.awt.event.MouseEvent)
|
148 |
*/
|
149 |
public void mouseMoved(MouseEvent e) throws BehaviorException { |
150 |
} |
151 |
|
152 |
/**
|
153 |
* @see java.awt.event.MouseWheelListener#mouseWheelMoved(java.awt.event.MouseWheelEvent)
|
154 |
*/
|
155 |
public void mouseWheelMoved(MouseWheelEvent e) throws BehaviorException { |
156 |
} |
157 |
} |