Logo
Distributed Genetic Programming Framework
print print

File org.sfc.gui.windows.SfcFrame.java

Here you can find all the information about the file org.sfc.gui.windows.SfcFrame.java. You may explore it here or download it onto your local disk.
/*
 * Copyright (c) 2005 Thomas Weise
 *
 * E-Mail           : tweise@gmx.de
 * Creation Date    : 2005-06-17 20:01:54
 * Original Filename: org.sfc.gui.windows.SfcFrame.java
 * Version          : 2.0.1
 * Last modification: 2006-03-07
 *                by: Thomas Weise
 *
 * License          : GNU LESSER GENERAL PUBLIC LICENSE
 *                    Version 2.1, February 1999
 *                    You should have received a copy of this license along
 *                    with this library; if not, write to the Free Software
 *                    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *                    MA 02111-1307, USA or download the license under
 *                    http://www.gnu.org/copyleft/lesser.html.
 *
 * Warranty         : This software is provided "as is" 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.
 */


package org.sfc.gui.windows;

import java.awt.Frame;
import java.awt.Image;
import java.awt.Window;

import javax.swing.JFrame;

import org.sfc.scoped.AlreadyDisposedException;

/**
 * This is the stk implementation of <code>JFrame</code>, incorporating
 * the <code>IWindow</code> interface.
 *
 * @author Thomas Weise
 */

public class SfcFrame extends JFrame  implements  IWindow
  {
/**
 * The serial version uid.
 */

  private static final long serialVersionUID = 1;
/**
 * <code>true</code> only as long as this window was not closed.
 */

  private boolean m_living  ;



/**
 * Create a new <code>SfcFrame</code>.
 */

  public  SfcFrame ()
    {
    super();
    this.m_living = true;

    Windows.add_window(this);

    this.addWindowListener(Windows.WINDOW_LISTENER);
    }

/**
 * Returns the icon associated to the window.
 *
 * @return  The icon of the window or null if no icon is assigned.
 */

  public   final  Image         get_icon          ()
    {
    return this.getIconImage();
    }

/**
 * Sets the icon of the window.
 *
 * @param p_icon  The icon of the window.
 */

  public   final  void          set_icon          (Image  p_icon)
    {
    this.setIconImage(p_icon);
    }

/**
 * Returns the underlying os-window of the <code>IWindow</code>.
 * @return  The window-instance of this <code>IWindow</code>.
 */

  public   final  Window        get_window        ()
    {
    return this;
    }

/**
 * Returns the underlying frame of the <code>IWindow</code>.
 * @return  The frame-instance of this <code>IWindow</code>.
 */

  public   final  Frame         get_frame         ()
    {
    return this;
    }

/**
 * Close the object. You must not perform any operations with the object
 * afterwards nor should you allow any reference to point on this object.
 * Also you must not access any member variables of the object.
 * Call this method when you don't need an object anymore, allowing it to
 * perform some cleanup.
 */

  public  final void  close ()
    {
    synchronized(this)
      {
      if(this.m_living)
        {
        Windows.remove_window(this);
        this.m_living = false;
        this.dispose();
        }
      else
        {
        throw new AlreadyDisposedException();
        }
      }
    }

/**
 * This method will be called when the user decided to close the window
 * via some input like hitting the "close"-button in the system menu.
 * You can emulate a user-close action by calling this method.
 * This method closes the window and exists the system. You might override
 * it to alter behavior.
 */

  public  void          close_by_user     ()
    {
    this.close();
    System.exit(0);
    }

  }

File Information:

file name:SfcFrame.java
package:org.sfc.gui.windows
qualified name:org.sfc.gui.windows.SfcFrame.java
file type:Java Source File
download location:download http://dgpf.sourceforge.net/source/org/sfc/gui/windows/SfcFrame.java
size:3.775 KB (3866 B)
uploaded: 2015-07-22 04:11:11 GMT+0000
last update: 2006-03-07 04:19:29 GMT+0000
last access: 2018-01-22 03:58:05 GMT+0000

statistics online since 2006-01-02.   RSS Feed
Contact us by sending an email to tweise@gmx.de to receive further information, to report errors, or to join our project.
All content on this site (http://dgpf.sourceforge.net/) is LGPL-licensed.
http://dgpf.sourceforge.net/scripts/source/source.php last modified at 2015-07-22 04:10:53 GMT+0000 served at 2018-01-22 03:58:05 GMT+0000.
Valid CSS Valid XHTML 1.1
Valid RSS SourceForge.net Logo