I modify the mousePressed event because when i press the mouse before I
move it the OpenMap send null a exception, because thMap variable is null.
Then the new mousePressed event is:
/**
* Process a mouse pressed event. Add the mouse location to the
* segment vector. Calculate the cumulative total distance.
*
* _at_param e mouse event.
*/
public void mousePressed(MouseEvent e) {
e.getComponent().requestFocus();
if (e.getSource() instanceof MapBean) {
// mouse has now been pressed
mousePressed = true;
// erase the old circle if any
eraseCircle();
// anchor the new first point of the line
theMap = (MapBean)e.getSource();
rPoint1 = theMap.getProjection().inverse(e.getPoint());
// ensure the second point is not yet set.
rPoint2 = null;
// add the anchor point to the list of line segments
segments.addElement(rPoint1);
// add the distance to the total distance
totalDistance = totalDistance + distance;
}
}
-------------------------------------
Eliecer Osorio Verdugo
Investigación y Desarrollo
------------------------------------
Sisdef Ltda.
Fono: 56 32 810777
Fax : 56 32 811190
-------------------------------------
e-mail: eosorio_at_sisdef.cl
-------------------------------------
---------------------------------------------------------------------------
La información contenida en esta transmisión es confidencial y no puede
ser usada o difundida por personas distintas a su(s) destinatario(s). El
uso no autorizado de la información contenida en esta transmisión puede
ser sancionado criminalmente de conformidad con la ley chilena.
Si ha recibido esta transmisión por error, por favor destrúyala y
notifique al remitente. Atendido que no existe certidumbre que el presente
mensaje no será modificado como resultado de su transmisión por correo
electrónico, SISDEF no será responsable si el contenido del mismo ha sido
modificado.
--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Thu Jan 12 2006 - 13:13:43 EST