Package org.geoforge.guillcogcecl.menu

Source Code of org.geoforge.guillcogcecl.menu.GfrMenIcnImpObjsTloEclSpn

/*
*  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.guillcogcecl.menu;

import java.awt.event.ActionListener;
import org.geoforge.guillc.menu.GfrMenIcnImpObjsTloAbs;
import org.geoforge.guillc.menuitem.GfrMimTrsAlrAbs;
import org.geoforge.guillcogcecl.util.GfrResBundleGuiLlcOgcEcl;
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 GfrMenIcnImpObjsTloEclSpn extends GfrMenIcnImpObjsTloAbs
{

   private GfrMimTrsAlrAbs _mimImportFromShape_ = null;

   private GfrMimTrsAlrAbs _mimImportFromSheetExc_ = null;

   private GfrMimTrsAlrAbs _mimImportFromSheetCsv_ = null;

   @Override
   public String getCustomText()
   {
      return GfrResBundleGuiLlcOgcEcl.s_getInstance().getValue("sentence.importPointsets");
   }

   public GfrMenIcnImpObjsTloEclSpn(
         ActionListener alrController,
         boolean blnUseDefault)
   {
      super(blnUseDefault,
            GfrEnuValuesKindObjectTloSpcPrjOgcEcl.VALUE_TLO_ECL_SPN);

      this._mimImportFromShape_ = new GfrMimTrsAlrImpAbs(
            alrController,
            GfrEnuValuesKindFileFormat.VALUE_SHAPE_FILE,
            GfrEnuValuesKindObjectTloSpcPrjOgcEcl.VALUE_TLO_ECL_SPN.name());

      this._mimImportFromSheetExc_ = new GfrMimTrsAlrImpAbs(
            alrController,
            GfrEnuValuesKindFileFormat.VALUE_EXCEL,
            GfrEnuValuesKindObjectTloSpcPrjOgcEcl.VALUE_TLO_ECL_SPN.name());

      this._mimImportFromSheetCsv_ = new GfrMimTrsAlrImpAbs(
            alrController,
            GfrEnuValuesKindFileFormat.VALUE_CSV,
            GfrEnuValuesKindObjectTloSpcPrjOgcEcl.VALUE_TLO_ECL_SPN.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;


      super.add(this._mimImportFromShape_);
      super.add(this._mimImportFromSheetExc_);
      super.add(this._mimImportFromSheetCsv_);

      this._mimImportFromShape_.setText(this._mimImportFromShape_.getText() + " (pending)");
      this._mimImportFromShape_.setEnabled(false);

      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();
   }
}
TOP

Related Classes of org.geoforge.guillcogcecl.menu.GfrMenIcnImpObjsTloEclSpn

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.