/*
* 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 2
* 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package org.geoforge.guillc.wwd.rlrs;
import gov.nasa.worldwind.awt.WorldWindowGLCanvas;
import gov.nasa.worldwind.layers.Layer;
import gov.nasa.worldwind.layers.LayerList;
import org.geoforge.worldwind.layer.GfrRlrObjTloAbs;
/**
*
* @author bantchao
*/
abstract public class GfrSetRlrTopMainLclAbs extends GfrSetRlrTopMainAbs
{
protected GfrSetRlrTopMainLclAbs(WorldWindowGLCanvas cnv)
{
super(cnv);
}
@Override
public boolean removeObjectVariable(String strId) throws Exception
{
LayerList llt = super._cnv.getModel().getLayers();
for (Layer lyrCur: llt)
{
if (! (lyrCur instanceof GfrRlrObjTloAbs))
continue;
GfrRlrObjTloAbs rlrCur = (GfrRlrObjTloAbs) lyrCur;
String strIdCur = rlrCur.getIdObjectGeoforgeWwdEarth();
if (strIdCur.compareTo(strId) != 0)
continue;
llt.remove(lyrCur);
rlrCur.removeAllRenderables();
rlrCur.destroy();
return true;
}
return false;
}
}