Package org.geoforge.guillcogc.panel

Source Code of org.geoforge.guillcogc.panel.GfrPnlTabsSettingsInfObjDatServerWmsGeneral

/*
*  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.guillcogc.panel;

import org.geoforge.guillc.panel.GfrPnlKeyValueTfdXXXLarge;
import org.geoforge.guillc.panel.GfrPnlTabsSettingsInfObjDatAbs;
import org.geoforge.guillc.panel.GfrPnlKeyValueAbs;
import org.geoforge.guillc.panel.GfrPnlKeyValueTfdXSmall;
import org.geoforge.guillc.panel.GfrPnlTabsSettingsInfAbs;
import org.geoforge.guillc.panel.GfrPnlKeyValueTfdMedium;
import java.awt.event.ActionListener;
import java.util.logging.Logger;
import org.geoforge.lang.util.GfrResBundleLang;
import org.geoforge.java.util.logging.filehandler.FileHandlerLogger;
import org.geoforge.wrpbasprssynogc.GfrWrpBasSynObjNameTloWms;

/**
*
* @author bantchao
*/
public class GfrPnlTabsSettingsInfObjDatServerWmsGeneral extends GfrPnlTabsSettingsInfObjDatAbs
{
   // ----
   // begin: instantiate logger for this class

   final static private Logger _LOGGER_ = Logger.getLogger(GfrPnlTabsSettingsInfObjDatServerWmsGeneral.class.getName());

   static
   {
      GfrPnlTabsSettingsInfObjDatServerWmsGeneral._LOGGER_.addHandler(FileHandlerLogger.s_getInstance());
   }
   // end: instantiate logger for this class
   // ----
   final static public String STR_TITLE_THIS = "General " + GfrPnlTabsSettingsInfAbs.STR_TITLE.toLowerCase();
  
   private GfrPnlKeyValueAbs _pnlLayerCount_ = null;
   //private GfrPnlKeyValueAbs _pnlTerrainCount_ = null;
   private GfrPnlKeyValueAbs _pnlLastUpdate = null;

   public GfrPnlTabsSettingsInfObjDatServerWmsGeneral(
           ActionListener alrParent, // not yet in use
           String strIdObject)
           throws Exception
   {
      super(GfrWrpBasSynObjNameTloWms.getInstance().getCreationDate(strIdObject));

      super._pnlWhat = new GfrPnlKeyValueTfdXXXLarge(
              GfrResBundleLang.s_getInstance().getValue("word.url") + ": ",
              GfrWrpBasSynObjNameTloWms.getInstance().getName(strIdObject));
            
     
      this._pnlLastUpdate = new GfrPnlKeyValueTfdMedium("Last update:",
              GfrWrpBasSynObjNameTloWms.getInstance().getLastUpdate(strIdObject));

      this._pnlLayerCount_ = new GfrPnlKeyValueTfdXSmall("Layers count:",
              String.valueOf(GfrWrpBasSynObjNameTloWms.getInstance().getCountLayers(strIdObject)));

      /*this._pnlTerrainCount_ = new GfrPnlKeyValueTfdXSmall("Terrains count:",
              String.valueOf(GfrWrpBasSynObjNameTloWms.getInstance().getCountTerrains(strIdObject)));*/
   }

   @Override
   protected boolean _alignLabels()
   {
      // alignment

      java.util.Set<GfrPnlKeyValueAbs> setPanels = new java.util.HashSet<GfrPnlKeyValueAbs>();

      setPanels.add(super._pnlWhat);
      setPanels.add(super._pnlCreationDate);
      setPanels.add(this._pnlLastUpdate);
      setPanels.add(this._pnlLayerCount_);
      //setPanels.add(this._pnlTerrainCount_);


      if (!GfrPnlKeyValueAbs.s_alignLabels(setPanels))
      {
         String str = "! GfrPnlKeyValueAbs.s_alignLabels(setPanels)";
         GfrPnlTabsSettingsInfObjDatServerWmsGeneral._LOGGER_.severe(str);
         return false;
      }

      setPanels.clear();
      setPanels = null;

      // ending
      return true;
   }

   @Override
   public boolean init()
   {
      if (!super.init())
         return false;

      if (!this._pnlLastUpdate.init())
         return false;

      if (!this._pnlLayerCount_.init())
         return false;

      /*if (!this._pnlTerrainCount_.init())
         return false;*/

      super.addWithVerticalStrut(this._pnlLastUpdate);
      super.addWithVerticalStrut(this._pnlLayerCount_);
      //super.addWithVerticalStrut(this._pnlTerrainCount_);

      if (!_alignLabels())
         return false;

      return true;
   }

   @Override
   public void destroy()
   {
      if (this._pnlLastUpdate != null)
      {
         this._pnlLastUpdate.destroy();
         this._pnlLastUpdate = null;
      }

      if (this._pnlLayerCount_ != null)
      {
         this._pnlLayerCount_.destroy();
         this._pnlLayerCount_ = null;
      }

      /*if (this._pnlTerrainCount_ != null)
      {
         this._pnlTerrainCount_.destroy();
         this._pnlTerrainCount_ = null;
      }*/

      super.destroy();
   }
}
TOP

Related Classes of org.geoforge.guillcogc.panel.GfrPnlTabsSettingsInfObjDatServerWmsGeneral

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.