/*
* 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.util.ArrayList;
import java.util.List;
import java.util.Observable;
import java.util.Observer;
import org.geoforge.mdldat.event.GfrEvtMdlIdDatChangedGeometry;
/**
*
* @author bill
*/
abstract public class GfrLabeledPathRndDimOnePointTloCircleAbs extends GfrLabeledPathRndDimOnePointAbs implements
Observer
{
private String _strIdTlo_ = null;
protected GfrLabeledPathRndDimOnePointTloCircleAbs(String strIdTlo) throws Exception
{
super();
this._strIdTlo_ = strIdTlo;
}
@Override
public void update(Observable obs, Object objEvt)
{
if (! (objEvt instanceof GfrEvtMdlIdDatChangedGeometry))
return;
GfrEvtMdlIdDatChangedGeometry evt = (GfrEvtMdlIdDatChangedGeometry) objEvt;
String strId = evt.getId();
if (strId.compareTo(this._strIdTlo_) != 0)
return;
Point2D.Double p2d = (Point2D.Double) evt.getGeometry();
List<Position> lstPosition = new ArrayList<Position>();
Position pos = Position.fromDegrees(p2d.y, p2d.x);
lstPosition.add(pos);
super.setLocations(lstPosition);
}
}