/*
* 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.beans.PropertyChangeListener;
import java.util.Observable;
import org.geoforge.mdl.event.GfrEvtMdlIdAbs;
import org.geoforge.mdldat.event.GfrEvtMdlIdDatRenamedMlo;
/**
*
* @author bantchao
*
* email: bantchao_AT_gmail.com
* ... please remove "_AT_" from the above string to get the right email address
*/
abstract public class GfrRndPointPlacemarkWisedMloAbs extends GfrRndPointPlacemarkWisedAbs
{
private String _strIdParentTlo_ = null;
private String _strSuffixTollTipText_ = null;
public String getIdParentTop() { return this._strIdParentTlo_; }
public String getSuffixToolTipText() { return this._strSuffixTollTipText_; } // TO DO: TO BE USED BY ALL GfrRnd*, in shared interface
@Override
public void update(Observable obs, Object objEvt)
{
// beg data
if (! (objEvt instanceof GfrEvtMdlIdAbs))
return;
GfrEvtMdlIdAbs objId = (GfrEvtMdlIdAbs) objEvt;
String strIdEvt = objId.getId();
if (strIdEvt.compareTo(this._strId) != 0)
return;
if (objId instanceof GfrEvtMdlIdDatRenamedMlo)
{
GfrEvtMdlIdDatRenamedMlo objRename = (GfrEvtMdlIdDatRenamedMlo) objId;
super.setValue(gov.nasa.worldwind.avlist.AVKey.DISPLAY_NAME, objRename.getValueNew());
// memo: no need to redraw, coz of just handling toolTip
return;
}
// end data
// !!! TBRL !!!
}
protected GfrRndPointPlacemarkWisedMloAbs(
PropertyChangeListener lstShouldRedraw,
String strIdParentMlo,
String strIdParentTlo,
String strNameParentMlo,
Position pos,
String strSuffixToolTipText
)
throws Exception
{
super(lstShouldRedraw, strIdParentMlo, strNameParentMlo, pos);
this._strIdParentTlo_ = strIdParentTlo;
this._strSuffixTollTipText_ = strSuffixToolTipText;
setAttributesThis();
setEnabledTooltipThis();
}
}