/*
* 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.popupmenu;
import java.awt.event.ActionListener;
import org.geoforge.guillc.menu.GfrMenIcnAbs;
import org.geoforge.guillc.menu.GfrMenIcnNewObjectEdit;
import org.geoforge.guillc.popupmenu.GfrPmuBtnCtlAbs;
import org.geoforge.guillcogc.enumeration.GfrEnuValuesKindObjectTloSpcPrjOgc;
/**
*
* @author bantchao
*/
public class GfrPmuBtnCtlNewOgc extends GfrPmuBtnCtlAbs
{
transient private GfrMenIcnAbs _menWms = null;
public GfrPmuBtnCtlNewOgc()
{
super();
}
@Override
public void destroy()
{
super.destroy();
if (this._menWms != null)
{
this._menWms.destroy();
this._menWms = null;
}
}
@Override
public void open(ActionListener alrController) throws Exception
{
this._menWms = new GfrMenIcnNewObjectEdit(alrController,
false, // blnUseDefaultTextAndIcon
GfrEnuValuesKindObjectTloSpcPrjOgc.VALUE_TLO_WMS);
if (! this._menWms.init())
throw new Exception("! this._menWms.init()");
super.add(this._menWms);
}
@Override
public void close() throws Exception
{
if (this._menWms != null)
{
super.remove(this._menWms);
this._menWms.destroy();
this._menWms = null;
}
}
@Override
public void releaseTransient() throws Exception
{
if (this._menWms != null)
{
super.remove(this._menWms);
this._menWms.destroy();
this._menWms = null;
}
}
}