Package org.geoforge.guillc.internalframe

Source Code of org.geoforge.guillc.internalframe.GfrIfrWinViewRunIdRegAbs

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.geoforge.guillc.internalframe;

import java.awt.BorderLayout;
import java.awt.event.ActionListener;
import java.util.logging.Logger;
import javax.swing.event.InternalFrameListener;
import org.geoforge.guillc.border.GfrBorderHelpOnThis;
import org.geoforge.guillc.handler.IGfrHandlerListenerPerspectiveRun;
import org.geoforge.guillc.menubar.GfrMbrAbs;
import org.geoforge.guillc.panel.GfrPnl;
import org.geoforge.guillc.panel.GfrPnlCntWinViewerAbs;
import org.geoforge.guillc.panel.GfrPnlStatusBarAbs;
import org.geoforge.guillc.toolbar.GfrTbrHlpAbs;
import org.geoforge.java.util.logging.filehandler.FileHandlerLogger;

/**
*
* @author bill
*
* "Reg":Regular (1 menuBar, 1 toolBar, 1 contentsPane, 1 statusBar) v/s for eg "Spc" (Spaces),
*
*/
abstract public class GfrIfrWinViewRunIdRegAbs extends GfrIfrWinViewRunIdAbs
{
    // ----
   // begin: instantiate logger for this class

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

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

   // end: instantiate logger for this class
   // ----

    protected GfrTbrHlpAbs _tbr = null; // optional
   protected GfrPnlStatusBarAbs _pnlStatusBar = null; // optional
   
    protected GfrPnl _pnlContentPane_ = null;
   protected GfrMbrAbs _mbr = null;
   protected GfrPnlCntWinViewerAbs _pnlContents = null;

   
    protected GfrIfrWinViewRunIdRegAbs(
            int intWidthPref,
           int intHeightPref,
           InternalFrameListener ifrListenerController,
           String strUniqueIdMe,
           String strUniqueNameMe) throws Exception
    {
        super(intWidthPref, intHeightPref, ifrListenerController, strUniqueIdMe, strUniqueNameMe);
       
     
       
        this._pnlContentPane_ = new GfrPnl(new BorderLayout());

        if (!this._pnlContentPane_.init())
        {
            String strSevere = "! this._pnlContentPane_.init()";
            GfrIfrWinViewRunIdRegAbs._LOGGER_.severe(strSevere);
            throw new Exception(strSevere);
        }

        super.setContentPane(this._pnlContentPane_);
        GfrBorderHelpOnThis.s_set(this._pnlContentPane_);
    }
   
    @Override
   public void removeActionListenerPerspectiveRun(ActionListener actListenerController)
   {
       super.removeActionListenerPerspectiveRun(actListenerController);
      
      if (this._pnlContents != null)
         ((IGfrHandlerListenerPerspectiveRun) this._pnlContents).removeActionListenerPerspectiveRun(actListenerController);

      if (this._mbr != null)
         ((IGfrHandlerListenerPerspectiveRun) this._mbr).removeActionListenerPerspectiveRun(actListenerController);

      if (this._tbr != null)
         ((IGfrHandlerListenerPerspectiveRun) this._tbr).removeActionListenerPerspectiveRun(actListenerController);
   }

   @Override
   public void addActionListenerPerspectiveRun(ActionListener actListenerController)
   {
       super.addActionListenerPerspectiveRun(actListenerController);
      
      if (this._pnlContents != null)
         ((IGfrHandlerListenerPerspectiveRun) this._pnlContents).addActionListenerPerspectiveRun(actListenerController);

      if (this._mbr != null)
         ((IGfrHandlerListenerPerspectiveRun) this._mbr).addActionListenerPerspectiveRun(actListenerController);

      if (this._tbr != null)
         ((IGfrHandlerListenerPerspectiveRun) this._tbr).addActionListenerPerspectiveRun(actListenerController);
   }
  
    @Override
   public void destroy()
   {
       super.destroy();
      
      if (this._mbr != null)
      {
         this._mbr.destroy();
         this._mbr = null;
      }

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

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

      if (this._pnlStatusBar != null)
      {
         this._pnlStatusBar.destroy();
         this._pnlStatusBar = null;
      }
   }
   
    @Override
   public void loadTransient() throws Exception
   {
      super.loadTransient();
   }

   @Override
   public void releaseTransient() throws Exception
   {
      super.releaseTransient();
   }
  
   @Override
   public boolean init()
   {
      if (! super.init())
          return false;

      if (this._pnlStatusBar != null)
      {
         if (!this._pnlStatusBar.init())
            return false;

         // ATTN: first, coz others getting JFrame owner thanks to call with this one as arg (getting parent's status bar)
         super.getContentPane().add(this._pnlStatusBar, BorderLayout.SOUTH); // first !!!!!!
      }


      // ----
      if (this._mbr != null)
         if (!this._mbr.init())
            return false;

      if (this._tbr != null)
         if (!this._tbr.init())
            return false;

      if (this._pnlContents != null)
         if (!this._pnlContents.init())
            return false;

      if (this._mbr != null)
         super.setJMenuBar(this._mbr);

      if (this._tbr != null)
         super.getContentPane().add(this._tbr, BorderLayout.NORTH);

      if (this._pnlContents != null)
         super.getContentPane().add(this._pnlContents, BorderLayout.CENTER);

      return true;
   }
}
TOP

Related Classes of org.geoforge.guillc.internalframe.GfrIfrWinViewRunIdRegAbs

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.