/*
* 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.guillcogcecl.menu;
import java.awt.event.ActionListener;
import org.geoforge.guillc.menu.GfrMenIcnImpObjsTloAbs;
import org.geoforge.guillc.menuitem.GfrMimTrsAlrAbs;
import org.geoforge.guillc.menuitem.GfrMimTrsAlrImpAbs;
import org.geoforge.guillcogcecl.enumeration.GfrEnuValuesKindObjectTloSpcPrjOgcEcl;
import org.geoforge.io.enumeration.GfrEnuValuesKindFileFormat;
/**
*
* @author Amadeus.Sowerby
*
* email: Amadeus.Sowerby_AT_gmail.com ... please remove "_AT_" from the above
* string to get the right email address
*/
public class GfrMenIcnImpObjsTloEclSegWiseYes extends GfrMenIcnImpObjsTloAbs
{
private GfrMimTrsAlrAbs _mimImportFromShape_ = null;
private GfrMimTrsAlrAbs _mimImportFromSheetExc_ = null;
private GfrMimTrsAlrAbs _mimImportFromSheetCsv_ = null;
@Override
public String getCustomText()
{
return "Import sectors";
}
public GfrMenIcnImpObjsTloEclSegWiseYes(
ActionListener alrController,
boolean blnUseDefault)
{
super(blnUseDefault,
GfrEnuValuesKindObjectTloSpcPrjOgcEcl.VALUE_TLO_ECL_SEG_WISE_YES);
this._mimImportFromShape_ = new GfrMimTrsAlrImpAbs(
alrController,
GfrEnuValuesKindFileFormat.VALUE_SHAPE_FILE,
GfrEnuValuesKindObjectTloSpcPrjOgcEcl.VALUE_TLO_ECL_SEG_WISE_YES.name());
this._mimImportFromSheetExc_ = new GfrMimTrsAlrImpAbs(
alrController,
GfrEnuValuesKindFileFormat.VALUE_EXCEL,
GfrEnuValuesKindObjectTloSpcPrjOgcEcl.VALUE_TLO_ECL_SEG_WISE_YES.name());
this._mimImportFromSheetCsv_ = new GfrMimTrsAlrImpAbs(
alrController,
GfrEnuValuesKindFileFormat.VALUE_CSV,
GfrEnuValuesKindObjectTloSpcPrjOgcEcl.VALUE_TLO_ECL_SEG_WISE_YES.name());
}
@Override
public boolean init()
{
if (!super.init())
return false;
if (!this._mimImportFromShape_.init())
return false;
if (!this._mimImportFromSheetExc_.init())
return false;
if (!this._mimImportFromSheetCsv_.init())
return false;
this._mimImportFromShape_.setPending(true);
this._mimImportFromSheetCsv_.setPending(true);
this._mimImportFromSheetExc_.setPending(true);
super.add(this._mimImportFromShape_);
super.add(this._mimImportFromSheetExc_);
super.add(this._mimImportFromSheetCsv_);
return true;
}
@Override
public void destroy()
{
super.destroy();
if (this._mimImportFromShape_ != null)
{
this._mimImportFromShape_.destroy();
this._mimImportFromShape_ = null;
}
if (this._mimImportFromSheetExc_ != null)
{
this._mimImportFromSheetExc_.destroy();
this._mimImportFromSheetExc_ = null;
}
if (this._mimImportFromSheetCsv_ != null)
{
this._mimImportFromSheetCsv_.destroy();
this._mimImportFromSheetCsv_ = null;
}
}
// beg transient stuff
@Override
public void loadTransient() throws Exception
{
super.loadTransient();
this._mimImportFromShape_.loadTransient();
this._mimImportFromSheetExc_.loadTransient();
this._mimImportFromSheetCsv_.loadTransient();
}
// end transient stuff // beg transient stuff
@Override
public void releaseTransient() throws Exception
{
super.releaseTransient();
this._mimImportFromShape_.releaseTransient();
this._mimImportFromSheetExc_.releaseTransient();
this._mimImportFromSheetCsv_.releaseTransient();
}
}