Revision 20100 branches/v10/libraries/libFMap/src/com/iver/cit/gvsig/fmap/tools/Behavior/DraggerBehavior.java
DraggerBehavior.java | ||
---|---|---|
53 | 53 |
|
54 | 54 |
|
55 | 55 |
/** |
56 |
* Behaviour que espera un listener de tipo PanListener. |
|
56 |
* <p>Behavior that permits user to drag the image of the associated |
|
57 |
* <code>MapControl</code> using a {@link PanListener PanListener}.</p> |
|
57 | 58 |
* |
58 | 59 |
* @author Vicente Caballero Navarro |
59 | 60 |
*/ |
60 | 61 |
public class DraggerBehavior extends Behavior { |
62 |
/** |
|
63 |
* First point of the path in image coordinates. |
|
64 |
*/ |
|
61 | 65 |
private Point2D m_FirstPoint; |
62 | 66 |
private Point2D m_LastPoint; |
67 |
|
|
68 |
/** |
|
69 |
* Auxiliary point that represents a corner selected in image coordinates. |
|
70 |
*/ |
|
63 | 71 |
private Point2D m_PointAnt; |
72 |
|
|
73 |
/** |
|
74 |
* Tool listener used to work with the <code>MapControl</code> object. |
|
75 |
* |
|
76 |
* @see #getListener() |
|
77 |
* @see #setListener(ToolListener) |
|
78 |
*/ |
|
64 | 79 |
private PanListener listener; |
65 | 80 |
|
66 | 81 |
/** |
67 |
* Crea un nuevo MoveBehavior.
|
|
68 |
* |
|
69 |
* @param pli listener.
|
|
82 |
* <p>Creates a new behavior for dragging the mouse.</p>
|
|
83 |
*
|
|
84 |
* @param pli listener used to permit this object to work with the associated <code>MapControl</code>
|
|
70 | 85 |
*/ |
71 | 86 |
public DraggerBehavior(PanListener pli) { |
72 | 87 |
listener = pli; |
73 | 88 |
} |
74 | 89 |
|
75 |
/** |
|
90 |
/* |
|
91 |
* (non-Javadoc) |
|
76 | 92 |
* @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#paintComponent(java.awt.Graphics) |
77 | 93 |
*/ |
78 | 94 |
public void paintComponent(Graphics g) { |
79 | 95 |
} |
80 | 96 |
|
81 |
|
|
82 |
/**
|
|
83 |
* @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
|
|
97 |
/* |
|
98 |
* (non-Javadoc)
|
|
99 |
* @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#mousePressed(java.awt.event.MouseEvent)
|
|
84 | 100 |
*/ |
85 | 101 |
public void mousePressed(MouseEvent e) { |
86 | 102 |
Point pScreen = e.getPoint(); |
... | ... | |
98 | 114 |
} |
99 | 115 |
} |
100 | 116 |
|
101 |
/** |
|
102 |
* Reimplementaci?n del m?todo mouseReleased de Behavior. |
|
103 |
* |
|
104 |
* @param e MouseEvent |
|
105 |
* |
|
106 |
* @throws BehaviorException Excepci?n lanzada cuando el Behavior. |
|
117 |
/* |
|
118 |
* (non-Javadoc) |
|
119 |
* @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#mouseReleased(java.awt.event.MouseEvent) |
|
107 | 120 |
*/ |
108 | 121 |
public void mouseReleased(MouseEvent e) throws BehaviorException { |
109 | 122 |
m_FirstPoint = null; |
110 | 123 |
} |
111 | 124 |
|
112 |
/** |
|
113 |
* Reimplementaci?n del m?todo mouseDragged de Behavior. |
|
114 |
* |
|
115 |
* @param e MouseEvent |
|
116 |
* @throws BehaviorException |
|
125 |
/* |
|
126 |
* (non-Javadoc) |
|
127 |
* @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#mouseDragged(java.awt.event.MouseEvent) |
|
117 | 128 |
*/ |
118 | 129 |
public void mouseDragged(MouseEvent e) throws BehaviorException { |
119 | 130 |
m_LastPoint = e.getPoint(); |
... | ... | |
123 | 134 |
} |
124 | 135 |
|
125 | 136 |
/** |
126 |
* @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#setListener(com.iver.cit.gvsig.fmap.tools.ToolListener) |
|
137 |
* <p>Sets a tool listener to work with the <code>MapControl</code> using this behavior.</p> |
|
138 |
* |
|
139 |
* @param listener a <code>PanListener</code> object for this behavior |
|
127 | 140 |
*/ |
128 | 141 |
public void setListener(ToolListener listener) { |
129 | 142 |
this.listener = (PanListener) listener; |
130 | 143 |
} |
131 | 144 |
|
132 |
/** |
|
145 |
/* |
|
146 |
* (non-Javadoc) |
|
133 | 147 |
* @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#getListener() |
134 | 148 |
*/ |
135 | 149 |
public ToolListener getListener() { |
Also available in: Unified diff