/*
* 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.guillcogc.panel;
import org.geoforge.guillc.handler.IGfrHandlerBuilderObjectWwdEarth;
import org.geoforge.guillc.wwd.util.OurToolTipControllerSecBldObjs;
import org.geoforge.guillcogc.wwd.rlrs.GfrSetRlrTopSecOgcWmss;
import org.geoforge.io.serial.GfrSerializeStateWwdSec;
import org.geoforge.worldwind.builder.GfrBldObjAbs;
import org.geoforge.worldwind.util.GfrCtrMenContextAbs;
/**
*
* @author bantchao
*/
abstract public class GfrPnlMainWwdOgcSecBldObjAbs extends GfrPnlMainWwdOgcAbs implements
IGfrHandlerBuilderObjectWwdEarth
{
protected GfrBldObjAbs _bldObject = null;
private String _strIdViewer_ = null;
protected GfrPnlMainWwdOgcSecBldObjAbs(String strIdViewerSource) throws Exception
{
super(
(GfrCtrMenContextAbs) null, // object
(GfrCtrMenContextAbs) null, // void
false // blnIsSerializableStateOrbit
);
this._strIdViewer_ = strIdViewerSource;
super._topWmss = new GfrSetRlrTopSecOgcWmss(super._cnv, strIdViewerSource);
super._ctrTooltip = new OurToolTipControllerSecBldObjs(this._cnv);
}
@Override
public Object getValueGeometryObjectEarthDrawn() { return this._bldObject.getValue(); }
@Override
public boolean init()
{
if (! super.init())
return false;
if (! this._bldObject.init())
return false;
String strState = GfrSerializeStateWwdSec.s_read(this._strIdViewer_);
if (strState != null)
{
super.restoreStateOrbitView(strState);
}
return true;
}
@Override
public void destroy()
{
super.destroy();
if (this._bldObject != null)
{
this._bldObject.destroy();
this._bldObject = null;
}
}
@Override
public void setEnabledEditorBuilderObjectWwdEarth(boolean bln)
{
this._bldObject.setReady(bln);
}
}