/*
* Copyright (C) 2011-2014 GeoForge Project
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.geoforge.worldwind.render;
import gov.nasa.worldwind.geom.Position;
import java.awt.geom.Point2D;
import java.beans.PropertyChangeListener;
import java.util.Observable;
import java.util.logging.Logger;
import org.geoforge.java.util.logging.filehandler.FileHandlerLogger;
import org.geoforge.mdl.event.GfrEvtMdlIdAbs;
import org.geoforge.mdldat.event.GfrEvtMdlIdDatChangedGeometry;
/**
*
* @author Amadeus.Sowerby
*
* email: Amadeus.Sowerby_AT_gmail.com
* ... please remove "_AT_" from the above string to get the right email address
*/
abstract public class GfrRndPointPlacemarkCircleTloAbs extends GfrRndPointPlacemarkCircleAbs
{
// ----
// begin: instantiate logger for this class
final private static Logger _LOGGER_ = Logger.getLogger(GfrRndPointPlacemarkCircleTloAbs.class.getName());
static
{
GfrRndPointPlacemarkCircleTloAbs._LOGGER_.addHandler(FileHandlerLogger.s_getInstance());
}
// end: instantiate logger for this class
// ----
protected GfrRndPointPlacemarkCircleTloAbs(
PropertyChangeListener lstShouldRedraw,
String strId,
String strName,
Position pos,
java.lang.Double dblScale)
throws Exception
{
super(lstShouldRedraw, strId, strName, pos, dblScale);
}
@Override
public void update(Observable obs, Object objEvt)
{
// beg data
//Events send here are not necessarly instanceof GfrEvtMdlIdAbs
if (objEvt instanceof GfrEvtMdlIdAbs)//!!!!
{
GfrEvtMdlIdAbs objId = (GfrEvtMdlIdAbs) objEvt;
String strIdEvt = objId.getId();
if (strIdEvt.compareTo(this._strId) != 0)
return;
if (objId instanceof GfrEvtMdlIdDatChangedGeometry)
{
GfrEvtMdlIdDatChangedGeometry evt = (GfrEvtMdlIdDatChangedGeometry) objEvt;
Point2D.Double p2d = (Point2D.Double) evt.getGeometry();
super.position = Position.fromDegrees(p2d.y, p2d.x);
this.firePropertyChange(GfrShouldRedrawRnd.STR, null, null);
return;
}
// end data
}
super.update(obs, objEvt);
}
}