/*
* 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 java.util.Observable;
import java.util.logging.Logger;
import org.geoforge.guillc.frame.GfrFrmAbs;
import org.geoforge.guillc.optionpane.GfrOptionPaneAbs;
import org.geoforge.guillc.panel.GfrPnlStatusBarMain;
import org.geoforge.java.util.logging.filehandler.FileHandlerLogger;
import org.geoforge.mdl.event.GfrEvtMdlIdAbs;
import org.geoforge.mdldat.event.GfrEvtMdlIdDatAddedTlo;
import org.geoforge.mdldat.event.GfrEvtMdlIdDatClonedTlo;
/**
*
* @author bantchao
*/
abstract public class GfrSetRlrTopMainAbs extends GfrSetRlrTopAbs
{
// ----
// begin: instantiate logger for this class
final private static Logger _LOGGER_ = Logger.getLogger(GfrSetRlrTopMainAbs.class.getName());
static
{
GfrSetRlrTopMainAbs._LOGGER_.addHandler(FileHandlerLogger.s_getInstance());
}
// end: instantiate logger for this class
// ----
protected GfrSetRlrTopMainAbs(WorldWindowGLCanvas cnv)
{
super(cnv);
}
@Override
public void update(Observable obs, Object objEvt)
{
try
{
if (objEvt instanceof GfrEvtMdlIdDatAddedTlo ||
objEvt instanceof GfrEvtMdlIdDatClonedTlo)
{
GfrEvtMdlIdAbs evt = (GfrEvtMdlIdAbs) objEvt;
String strId = evt.getId();
addObjectVariable(strId);
// ending
return;
}
}
catch (Exception exc)
{
exc.printStackTrace();
String str = exc.getMessage();
GfrSetRlrTopMainAbs._LOGGER_.severe(str);
GfrOptionPaneAbs.s_showDialogError(GfrFrmAbs.s_getFrameOwner(GfrPnlStatusBarMain.s_getInstance()), str);
return;
}
super.update(obs, objEvt);
}
}