Revision 20100 branches/v10/libraries/libFMap/src/com/iver/cit/gvsig/fmap/tools/MeasureListenerImpl.java
MeasureListenerImpl.java | ||
---|---|---|
54 | 54 |
|
55 | 55 |
|
56 | 56 |
/** |
57 |
* Implementaci?n de la interfaz MeasureListener como herramienta para medir la
|
|
58 |
* distancia.
|
|
57 |
* <p>Listener for calculating the length of the segments of a polyline, defined in the associated {@link MapControl MapControl}
|
|
58 |
* object.</p>
|
|
59 | 59 |
* |
60 | 60 |
* @author Vicente Caballero Navarro |
61 | 61 |
*/ |
62 | 62 |
public class MeasureListenerImpl implements PolylineListener { |
63 |
/** |
|
64 |
* The image to display when the cursor is active. |
|
65 |
*/ |
|
63 | 66 |
private final Image iruler = new ImageIcon(MapControl.class.getResource( |
64 | 67 |
"images/RulerCursor.gif")).getImage(); |
68 |
|
|
69 |
/** |
|
70 |
* The cursor used to work with this tool listener. |
|
71 |
* |
|
72 |
* @see #getCursor() |
|
73 |
*/ |
|
65 | 74 |
private Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(iruler, |
66 | 75 |
new Point(16, 16), ""); |
76 |
|
|
77 |
/** |
|
78 |
* Reference to the <code>MapControl</code> object that uses. |
|
79 |
*/ |
|
67 | 80 |
protected MapControl mapCtrl; |
68 | 81 |
|
69 | 82 |
/** |
70 |
* Crea un nuevo MeasureListenerImpl.
|
|
83 |
* <p>Creates a new listener for calculating the length of a polyline.</p>
|
|
71 | 84 |
* |
72 |
* @param mc MapControl.
|
|
85 |
* @param mc the <code>MapControl</code> where is calculated the length
|
|
73 | 86 |
*/ |
74 | 87 |
public MeasureListenerImpl(MapControl mc) { |
75 | 88 |
this.mapCtrl = mc; |
76 | 89 |
} |
77 | 90 |
|
78 |
/** |
|
91 |
/* |
|
92 |
* (non-Javadoc) |
|
79 | 93 |
* @see com.iver.cit.gvsig.fmap.tools.Listeners.PolylineListener#points(com.iver.cit.gvsig.fmap.tools.Events.MeasureEvent) |
80 | 94 |
*/ |
81 | 95 |
public void points(MeasureEvent event) { |
... | ... | |
101 | 115 |
(distAll)); |
102 | 116 |
} |
103 | 117 |
|
104 |
/** |
|
118 |
/* |
|
119 |
* (non-Javadoc) |
|
105 | 120 |
* @see com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener#getCursor() |
106 | 121 |
*/ |
107 | 122 |
public Cursor getCursor() { |
108 | 123 |
return cur; |
109 | 124 |
} |
110 | 125 |
|
111 |
/** |
|
126 |
/* |
|
127 |
* (non-Javadoc) |
|
112 | 128 |
* @see com.iver.cit.gvsig.fmap.tools.Listeners.PolylineListener#pointFixed(com.iver.cit.gvsig.fmap.tools.Events.MeasureEvent) |
113 | 129 |
*/ |
114 | 130 |
public void pointFixed(MeasureEvent event) { |
115 | 131 |
} |
116 | 132 |
|
117 |
/** |
|
133 |
/* |
|
134 |
* (non-Javadoc) |
|
118 | 135 |
* @see com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener#cancelDrawing() |
119 | 136 |
*/ |
120 | 137 |
public boolean cancelDrawing() { |
121 | 138 |
return false; |
122 | 139 |
} |
123 | 140 |
|
124 |
/** |
|
141 |
/* |
|
142 |
* (non-Javadoc) |
|
125 | 143 |
* @see com.iver.cit.gvsig.fmap.tools.Listeners.PolylineListener#polylineFinished(com.iver.cit.gvsig.fmap.tools.Events.MeasureEvent) |
126 | 144 |
*/ |
127 | 145 |
public void polylineFinished(MeasureEvent event) { |
Also available in: Unified diff