Revision 1042 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/tools/Behavior/MapTool.java

View differences:

MapTool.java
3 3
 */
4 4
package com.iver.cit.gvsig.fmap.tools.Behavior;
5 5

  
6
import com.iver.cit.gvsig.fmap.NewMapControl;
7
import com.iver.cit.gvsig.fmap.tools.BehaviorException;
8
import com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener;
9

  
6 10
import java.awt.Cursor;
7 11
import java.awt.Graphics;
8 12
import java.awt.event.ComponentEvent;
......
10 14
import java.awt.event.MouseWheelEvent;
11 15
import java.awt.image.BufferedImage;
12 16

  
13
import com.iver.cit.gvsig.fmap.NewMapControl;
14
import com.iver.cit.gvsig.fmap.tools.BehaviorException;
15
import com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener;
16 17

  
17 18
/**
18
 * Herramienta del MapControl.
19
 * Ejecuta acciones respondiendo a eventos, por delegaci?n desde MapControl.
20
 * 
21
 * @author Luis W. Sevilla <sevilla_lui@gva.es>
19
 * Herramienta del MapControl. Ejecuta acciones respondiendo a eventos, por
20
 * delegaci?n desde MapControl.
21
 *
22
 * @author Luis W. Sevilla
22 23
 */
23 24
public abstract class MapTool {
24 25
	private NewMapControl mapControl;
25 26
	private Cursor cursor;
26
	
27
	public abstract void setListener(ToolListener listener);	
28 27

  
28
	/**
29
	 * Inserta el ToolListener.
30
	 *
31
	 * @param listener ToolListener a a?adir.
32
	 */
33
	public abstract void setListener(ToolListener listener);
34

  
35
	/**
36
	 * Devuelve el ToolListener que est? seleccionado.
37
	 *
38
	 * @return ToolListener seleccionado.
39
	 */
29 40
	public abstract ToolListener getListener();
30
	
31
	  /**
32
     * @see com.iver.cit.gvsig.fmap.tools.Behavior.MapTool#paintComponent(java.awt.Graphics)
33
     */
34
    public void paintComponent(Graphics g) {
41

  
42
	/**
43
	 * @see com.iver.cit.gvsig.fmap.tools.Behavior.MapTool#paintComponent(java.awt.Graphics)
44
	 */
45
	public void paintComponent(Graphics g) {
35 46
		BufferedImage img = getMapControl().getImage();
36
		
47

  
37 48
		g.drawImage(img, 0, 0, null);
38
    }
49
	}
39 50

  
40
	
41
    public void setCursor(Cursor c){
42
    	cursor = c;    	
43
    }
44
    
45
    public void setMapControl(NewMapControl mc){
46
    	mapControl = mc;    	
47
    }
48
    
49
	public Cursor getCursor(){
51
	/**
52
	 * Inserta el cursor de la herramienta.
53
	 *
54
	 * @param c Cursor.
55
	 */
56
	public void setCursor(Cursor c) {
57
		cursor = c;
58
	}
59

  
60
	/**
61
	 * Inserta el MapControl.
62
	 *
63
	 * @param mc MapControl a insertar.
64
	 */
65
	public void setMapControl(NewMapControl mc) {
66
		mapControl = mc;
67
	}
68

  
69
	/**
70
	 * Devuelve el cursor de la herrameinta.
71
	 *
72
	 * @return Cursor de la herramienta.
73
	 */
74
	public Cursor getCursor() {
50 75
		return cursor;
51 76
	}
52
	
53
	public NewMapControl getMapControl(){
54
		return mapControl;		
77

  
78
	/**
79
	 * DOCUMENT ME!
80
	 *
81
	 * @return DOCUMENT ME!
82
	 */
83
	public NewMapControl getMapControl() {
84
		return mapControl;
55 85
	}
56
	public void zoomChange(ComponentEvent e){
86

  
87
	/**
88
	 * DOCUMENT ME!
89
	 *
90
	 * @param e DOCUMENT ME!
91
	 */
92
	public void zoomChange(ComponentEvent e) {
57 93
	}
94

  
58 95
	/**
59 96
	 * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
60 97
	 */
61 98
	public void mouseClicked(MouseEvent e) throws BehaviorException {
62
		
63 99
	}
64 100

  
65 101
	/**
66 102
	 * @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent)
67 103
	 */
68 104
	public void mouseEntered(MouseEvent e) throws BehaviorException {
69
		
70 105
	}
106

  
71 107
	/**
72 108
	 * @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent)
73 109
	 */
74 110
	public void mouseExited(MouseEvent e) throws BehaviorException {
75
		
76 111
	}
77 112

  
78 113
	/**
79 114
	 * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
80 115
	 */
81 116
	public void mousePressed(MouseEvent e) throws BehaviorException {
82
		
83 117
	}
84 118

  
85 119
	/**
86
	 * @throws Exception
120
	 * DOCUMENT ME!
121
	 *
122
	 * @param e DOCUMENT ME!
123
	 *
124
	 * @throws BehaviorException
125
	 *
87 126
	 * @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent)
88 127
	 */
89 128
	public void mouseReleased(MouseEvent e) throws BehaviorException {
90
		
91 129
	}
92 130

  
93 131
	/**
94 132
	 * @see java.awt.event.MouseMotionListener#mouseDragged(java.awt.event.MouseEvent)
95 133
	 */
96 134
	public void mouseDragged(MouseEvent e) throws BehaviorException {
97
		
98 135
	}
99 136

  
100 137
	/**
101 138
	 * @see java.awt.event.MouseMotionListener#mouseMoved(java.awt.event.MouseEvent)
102 139
	 */
103 140
	public void mouseMoved(MouseEvent e) throws BehaviorException {
104
		
105 141
	}
106 142

  
107 143
	/**
108 144
	 * @see java.awt.event.MouseWheelListener#mouseWheelMoved(java.awt.event.MouseWheelEvent)
109 145
	 */
110 146
	public void mouseWheelMoved(MouseWheelEvent e) throws BehaviorException {
111
		
112 147
	}
113 148
}

Also available in: Unified diff