Package org.geoforge.guillc.panel

Source Code of org.geoforge.guillc.panel.GfrPnlPrintableSctAwtDspAbs

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

import java.awt.BorderLayout;
import java.awt.Component;
import javax.help.HelpBroker;
import javax.swing.JPanel;
import org.geoforge.guihlp.handler.IGfrHandlerSetEnabledTrueHelpOnThisSection;
import org.geoforge.guillc.border.GfrBorderHelpOnThis;

/**
*
* @author robert
*/
abstract public class GfrPnlPrintableSctAwtDspAbs extends GfrPnlPrintableSctAwt implements
        IGfrHandlerSetEnabledTrueHelpOnThisSection
{
   transient protected GfrPnlCntDspAbs _pnlTransient = null;
  
   protected GfrPnlPrintableSctAwtDspAbs()
   {
      super();
     
      GfrBorderHelpOnThis.s_set((JPanel) this);
     
      super.setLayout(new BorderLayout());
   }
  
    @Override
   public void setEnabledTrueHelpOnThisSection(HelpBroker hbr)
   {
      for (int i = 0; i < super.getComponentCount(); i++)
      {
         Component cmpCur = super.getComponent(i);

         if (cmpCur instanceof IGfrHandlerSetEnabledTrueHelpOnThisSection)
         {
            IGfrHandlerSetEnabledTrueHelpOnThisSection hot = (IGfrHandlerSetEnabledTrueHelpOnThisSection) cmpCur;
            hot.setEnabledTrueHelpOnThisSection(hbr);
         }
      }
   }
   
    @Override
   public void loadUnserializedObject() throws Exception
    {
       if (this._pnlTransient != null)
       {
          // should add the following
          // if (super.isAncestorOf(this._pnlTransient))
          this._pnlTransient.loadUnserializedObject();
       }
      
       super.loadUnserializedObject();
    }
   
    @Override
   public void releaseUnserializedObject() throws Exception
   {
      if (this._pnlTransient != null)
       {
          // should add the following
          // if (super.isAncestorOf(this._pnlTransient))
         
          this._pnlTransient.releaseUnserializedObject();
         
          if (super.isAncestorOf(this._pnlTransient))
         {
            super.remove(this._pnlTransient);

            if (super.isVisible())
               super.validate();
         }

         this._pnlTransient.destroy();
         this._pnlTransient = null;
       }
     
      super.releaseUnserializedObject();
   }
   
    @Override
   public void destroy()
   {
      super.destroy();

      if (this._pnlTransient != null)
      {
         this._pnlTransient.destroy();
         this._pnlTransient = null;
      }
   }
   
    public void close() throws Exception
   {
       if (this._pnlTransient != null)
       {
         if (super.isAncestorOf(this._pnlTransient))
         {
            super.remove(this._pnlTransient);

            if (super.isVisible())
                    super.validate();
         }

         this._pnlTransient.destroy();
         this._pnlTransient = null;
       }
   }
}
TOP

Related Classes of org.geoforge.guillc.panel.GfrPnlPrintableSctAwtDspAbs

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.