Revision 20098 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/tools/PanListenerImpl.java
PanListenerImpl.java | ||
---|---|---|
56 | 56 |
|
57 | 57 |
|
58 | 58 |
/** |
59 |
* Implementaci?n de la interfaz MoveListener como herramienta para realizar el |
|
60 |
* Pan. |
|
59 |
* <p>Listener for moving the extent of the associated {@link MapControl MapControl} object |
|
60 |
* according the movement between the initial and final points of line determined by the movement |
|
61 |
* dragging with the third button of the mouse.</p> |
|
62 |
* |
|
63 |
* <p>Updates the extent of its <code>ViewPort</code> with the new position.</p> |
|
61 | 64 |
* |
62 | 65 |
* @author Vicente Caballero Navarro |
63 | 66 |
*/ |
64 | 67 |
public class PanListenerImpl implements PanListener { |
68 |
/** |
|
69 |
* The image to display when the cursor is active. |
|
70 |
*/ |
|
65 | 71 |
private final Image ipan = new ImageIcon(MapControl.class.getResource( |
66 | 72 |
"images/Hand.gif")).getImage(); |
73 |
|
|
74 |
/** |
|
75 |
* The cursor used to work with this tool listener. |
|
76 |
* |
|
77 |
* @see #getCursor() |
|
78 |
*/ |
|
67 | 79 |
private Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(ipan, |
68 | 80 |
new Point(16, 16), ""); |
81 |
|
|
82 |
/** |
|
83 |
* Reference to the <code>MapControl</code> object that uses. |
|
84 |
*/ |
|
69 | 85 |
private MapControl mapControl; |
70 | 86 |
|
71 | 87 |
/** |
72 |
* Crea un nuevo RectangleListenerImpl.
|
|
73 |
* |
|
74 |
* @param mapControl MapControl.
|
|
88 |
* <p>Creates a new listener for changing the position of the extent of the associated {@link MapControl MapControl} object.</p>
|
|
89 |
*
|
|
90 |
* @param mapControl the <code>MapControl</code> where will be applied the changes
|
|
75 | 91 |
*/ |
76 | 92 |
public PanListenerImpl(MapControl mapControl) { |
77 | 93 |
this.mapControl = mapControl; |
78 | 94 |
} |
79 | 95 |
|
80 |
/**
|
|
81 |
* @see com.iver.cit.gvsig.fmap.tools.Listeners.PanListener#move(java.awt.geom.Point2D,
|
|
82 |
* java.awt.geom.Point2D)
|
|
96 |
/* |
|
97 |
* (non-Javadoc)
|
|
98 |
* @see com.iver.cit.gvsig.fmap.tools.Listeners.PanListener#move(com.iver.cit.gvsig.fmap.tools.Events.MoveEvent)
|
|
83 | 99 |
*/ |
84 | 100 |
public void move(MoveEvent event) { |
85 | 101 |
ViewPort vp = mapControl.getMapContext().getViewPort(); |
... | ... | |
99 | 115 |
// mapControl.drawMap(); |
100 | 116 |
} |
101 | 117 |
|
102 |
/** |
|
118 |
/* |
|
119 |
* (non-Javadoc) |
|
103 | 120 |
* @see com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener#getCursor() |
104 | 121 |
*/ |
105 | 122 |
public Cursor getCursor() { |
106 | 123 |
return cur; |
107 | 124 |
} |
108 | 125 |
|
109 |
/** |
|
126 |
/* |
|
127 |
* (non-Javadoc) |
|
110 | 128 |
* @see com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener#cancelDrawing() |
111 | 129 |
*/ |
112 | 130 |
public boolean cancelDrawing() { |
Also available in: Unified diff