Revision 20100 branches/v10/libraries/libFMap/src/com/iver/cit/gvsig/fmap/tools/SaveRasterListenerImpl.java
SaveRasterListenerImpl.java | ||
---|---|---|
56 | 56 |
|
57 | 57 |
|
58 | 58 |
/** |
59 |
* Implementaci?n de la interfaz RectangleListener como herramienta para
|
|
60 |
* realizar un Salvado a Raster.
|
|
61 |
* |
|
62 |
* @author Nacho Brodin <brodin_ign@gva.es> |
|
63 |
*/ |
|
59 |
* <p>Generic listener for saving a rectangular area of raster layers in the associated {@link MapControl MapControl}
|
|
60 |
* object. This version only stores the rectangle defined, in pixel and real coordinates, without saving any image.</p>
|
|
61 |
*
|
|
62 |
* @author Nacho Brodin <brodin_ign@gva.es>
|
|
63 |
*/
|
|
64 | 64 |
public class SaveRasterListenerImpl implements RectangleListener { |
65 |
/** |
|
66 |
* The image to display when the cursor is active. |
|
67 |
*/ |
|
65 | 68 |
private final Image isaveraster = new ImageIcon(MapControl.class.getResource( |
66 | 69 |
"images/RectSelectCursor.gif")).getImage(); |
70 |
|
|
71 |
/** |
|
72 |
* The cursor used to work with this tool listener. |
|
73 |
* |
|
74 |
* @see #getCursor() |
|
75 |
*/ |
|
67 | 76 |
private Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(isaveraster, |
68 | 77 |
new Point(16, 16), ""); |
78 |
|
|
79 |
/** |
|
80 |
* Reference to the <code>MapControl</code> object that uses. |
|
81 |
*/ |
|
69 | 82 |
protected MapControl mapCtrl; |
70 |
|
|
83 |
|
|
84 |
/** |
|
85 |
* @see RectangleEvent#getWorldCoordRect() |
|
86 |
*/ |
|
71 | 87 |
protected Rectangle2D pixelRect = null; |
88 |
|
|
89 |
/** |
|
90 |
* @see RectangleEvent#getWorldCoordRect() |
|
91 |
*/ |
|
72 | 92 |
protected Rectangle2D rect = null; |
73 |
|
|
93 |
|
|
74 | 94 |
/** |
75 |
* Crea un nuevo RectangleListenerImpl.
|
|
76 |
* |
|
77 |
* @param mapCtrl MapControl.
|
|
95 |
* <p>Creates a new <code>SaveRasterListenerImpl</code> object.</p>
|
|
96 |
*
|
|
97 |
* @param mapCtrl the <code>MapControl</code> where is defined the rectangle
|
|
78 | 98 |
*/ |
79 | 99 |
public SaveRasterListenerImpl(MapControl mapCtrl) { |
80 | 100 |
this.mapCtrl = mapCtrl; |
81 | 101 |
} |
82 | 102 |
|
83 |
/** |
|
103 |
/* |
|
104 |
* (non-Javadoc) |
|
84 | 105 |
* @see com.iver.cit.gvsig.fmap.tools.Listeners.RectangleListener#rectangle(com.iver.cit.gvsig.fmap.tools.Events.RectangleEvent) |
85 | 106 |
*/ |
86 | 107 |
public void rectangle(RectangleEvent event) { |
... | ... | |
93 | 114 |
// mapCtrl.drawMap(false); |
94 | 115 |
} |
95 | 116 |
|
96 |
/** |
|
117 |
/* |
|
118 |
* (non-Javadoc) |
|
97 | 119 |
* @see com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener#getCursor() |
98 | 120 |
*/ |
99 | 121 |
public Cursor getCursor() { |
100 | 122 |
return cur; |
101 | 123 |
} |
102 | 124 |
|
103 |
/** |
|
125 |
/* |
|
126 |
* (non-Javadoc) |
|
104 | 127 |
* @see com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener#cancelDrawing() |
105 | 128 |
*/ |
106 | 129 |
public boolean cancelDrawing() { |
Also available in: Unified diff