Package org.geoforge.guillcogcecl.panel

Source Code of org.geoforge.guillcogcecl.panel.GfrPnlCntWinViewerAppSerTabsOneChkWwdEarthOgcEclAbs

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

import java.awt.event.ActionEvent;
import java.util.logging.Logger;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreeNode;
import org.geoforge.guillc.handler.IGfrHandlerToggableNode;
import org.geoforge.guillc.menuitem.GfrMimTrsAlrCheckAllAbs;
import org.geoforge.guillc.optionpane.GfrOptionPaneAbs;
import org.geoforge.guillc.treenode.GfrNodCtrAbs;
import org.geoforge.guillcogc.panel.GfrPnlCntWinViewerAppSerTabsOneChkWwdEarthOgcAbs;
import org.geoforge.guillcogcecl.enumeration.GfrEnuValuesKindObjectTloSpcPrjOgcEcl;
import org.geoforge.guillcogcecl.handler.IGfrHandlerControlUpdateButtonsCheckTlosPrjEcl;
import org.geoforge.guillcogcecl.treenode.GfrNodCtrFixFolderRootChkSecEcl;
import org.geoforge.lang.enumeration.GfrEnuApplicationPropertiesImmutableKeys;
import org.geoforge.java.util.logging.filehandler.FileHandlerLogger;

/**
*
* @author bantchao
*/
abstract public class GfrPnlCntWinViewerAppSerTabsOneChkWwdEarthOgcEclAbs extends GfrPnlCntWinViewerAppSerTabsOneChkWwdEarthOgcAbs
{
   // ----
   // begin: instantiate logger for this class

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

   static
   {
      GfrPnlCntWinViewerAppSerTabsOneChkWwdEarthOgcEclAbs._LOGGER_.addHandler(FileHandlerLogger.s_getInstance());
   }

   // end: instantiate logger for this class
   // ----
  
   protected GfrPnlCntWinViewerAppSerTabsOneChkWwdEarthOgcEclAbs(String strNameSuffixThreadOpenDisplay,
           String strWhatViewer)
   {
      super(strNameSuffixThreadOpenDisplay, strWhatViewer);
   }

   @Override
   public void actionPerformed(ActionEvent evt)
   {
      try
      {
         if (evt.getSource() instanceof GfrMimTrsAlrCheckAllAbs)
         {
            GfrMimTrsAlrCheckAllAbs mim = (GfrMimTrsAlrCheckAllAbs) evt.getSource();

            String strValueObjectKind = mim.getPropertyImmutable(
                    GfrEnuApplicationPropertiesImmutableKeys.KEY_KIND_OBJECT.name());


            //--
            if (strValueObjectKind == null || strValueObjectKind.length() < 1)
               return;

            //--
           
            //-- checking object kind, no matters if CheckAllYes or CheckAllNo
            if (strValueObjectKind.compareTo(
                    GfrEnuValuesKindObjectTloSpcPrjOgcEcl.VALUE_TLO_ECL_SCT.name()) == 0
                    || strValueObjectKind.compareTo(
                    GfrEnuValuesKindObjectTloSpcPrjOgcEcl.VALUE_TLO_ECL_ARE.name()) == 0
                    || strValueObjectKind.compareTo(
                    GfrEnuValuesKindObjectTloSpcPrjOgcEcl.VALUE_TLO_ECL_PTH.name()) == 0
                    || strValueObjectKind.compareTo(
                    GfrEnuValuesKindObjectTloSpcPrjOgcEcl.VALUE_TLO_ECL_PNT.name()) == 0
                    || strValueObjectKind.compareTo(
                    GfrEnuValuesKindObjectTloSpcPrjOgcEcl.VALUE_TLO_ECL_PLC.name()) == 0
                    || strValueObjectKind.compareTo(
                    GfrEnuValuesKindObjectTloSpcPrjOgcEcl.VALUE_TLO_ECL_SPN.name()) == 0
                    || strValueObjectKind.compareTo(
                    GfrEnuValuesKindObjectTloSpcPrjOgcEcl.VALUE_TLO_ECL_SEG_WISE_YES.name()) == 0)
            {
               javax.swing.SwingUtilities.invokeLater(new Runnable()
               {

                  @Override
                  public void run()
                  {
                     _invokedLaterUpdateCheckUncheckTloEcl();
                  }

               });

               return;
            }
         }
      }
      catch (Exception exc)
      {
         exc.printStackTrace();
         GfrPnlCntWinViewerAppSerTabsOneChkWwdEarthOgcEclAbs._LOGGER_.warning(exc.getMessage());
         GfrOptionPaneAbs.s_showDialogError(null, exc.getMessage());
         return;
      }


      super.actionPerformed(evt);
   }

   protected void _invokedLaterUpdateCheckUncheckTloEcl(IGfrHandlerToggableNode nodCheck)
   {
      GfrNodCtrAbs nod = (GfrNodCtrAbs) nodCheck;
      // updating buttons in control toolbar
      ((IGfrHandlerControlUpdateButtonsCheckTlosPrjEcl) super._pnlControls).updateButtonsCheckUncheckAllTlosProjectEcl(
              (GfrNodCtrAbs) nod.getRoot());
   }

   protected void _invokedLaterUpdateCheckUncheckTloEcl()
   {
      boolean blnAllowedAllCheck = ((IGfrHandlerControlUpdateButtonsCheckTlosPrjEcl) super._pnlControls).isAllowedEnableButtonCheckAllTlosProjectEcl();
      boolean blnAllowedAllUncheck = ((IGfrHandlerControlUpdateButtonsCheckTlosPrjEcl) super._pnlControls).isAllowedEnableButtonUncheckAllTlosProjectEcl();

      ((IGfrHandlerControlUpdateButtonsCheckTlosPrjEcl) super._pnlControls).updateButtonsCheckUncheckAllTlosProjectEcl(blnAllowedAllCheck, blnAllowedAllUncheck);
   }

   @Override
   protected void _invokedLaterUpdateCheckUncheckTlo(IGfrHandlerToggableNode nodCheck)
   {
      TreeNode nodRoot = ((DefaultMutableTreeNode) nodCheck).getRoot();

      if (nodRoot instanceof GfrNodCtrFixFolderRootChkSecEcl)
      {
         this._invokedLaterUpdateCheckUncheckTloEcl(nodCheck);

         return;
      }

      super._invokedLaterUpdateCheckUncheckTlo(nodCheck);

   }

}
TOP

Related Classes of org.geoforge.guillcogcecl.panel.GfrPnlCntWinViewerAppSerTabsOneChkWwdEarthOgcEclAbs

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.