Logo
Distributed Genetic Programming Framework
print print

File org.sfc.gui.windows.Windows.java

Here you can find all the information about the file org.sfc.gui.windows.Windows.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-09-01 07:52:52
 * Original Filename: org.sfc.gui.windows.Windows.java
 * Version          : 2.0.2
 * Last modification: 2006-07-24
 *                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.Component;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;

import org.sfc.collections.ProtectedCollection;

/**
 * The static class with some special functions for windows.
 *
 * @author Thomas Weise
 */

public final  class Windows extends ProtectedCollection<IWindow>
  {  
/**
 * The serial version uid.
 */

  private static final long serialVersionUID = 1;
  
/**
 * The globally shared singleton window list.
 * Warning: you must always synchronize access to this list.
 */

  public  static  final Windows INSTANCE = new Windows();
  
/**
 * The internal window listener for closing.
 */

  static  final WindowListener  WINDOW_LISTENER = new WindowAdapter()
    {
/**
 * Invoked when a window is in the process of being closed.
 * The close operation can be overridden at this point.
 */

    @Override
    public final  void windowClosing(final  WindowEvent p_e)
      {
      Component l_c;
      
      l_c = p_e.getComponent();
      while(l_c != null)
        {
        if(l_c instanceof IWindow)
          {
          ((IWindow)l_c).close_by_user();
          return;
          }
        
        l_c = l_c.getParent();
        }
      }
    };
  
/**
 * The invisible constructor.
 */

  private Windows()
    {
    super(IWindow.class, -1);
    }

/**
 * Add a new window to the top-level list of windows.
 * @param p_window The window to be added.
 */

  static  final void  add_window  (final IWindow p_window)
    {
    synchronized(INSTANCE)
      {
      INSTANCE.do_add(p_window);
      }
    }
  
/**
 * Remove an window from the top-level list of windows.
 * @param p_window The window to be removed.
 */

  static  final void  remove_window  (final IWindow p_window)
    {
    synchronized(INSTANCE)
      {
      INSTANCE.do_remove(p_window);
      }
    }
  
/**
 * Perform a write replace of this object.
 * @return  The object to store.
 */

  private final Object writeReplace()
    {
    return INSTANCE;
    }

/**
 * Deserialize to the proper instance.
 * @return  The globally shared instance.
 */

  private final Object readResolve()
    {
    return INSTANCE;
    }  
  }

File Information:

file name:Windows.java
package:org.sfc.gui.windows
qualified name:org.sfc.gui.windows.Windows.java
file type:Java Source File
download location:download http://dgpf.sourceforge.net/source/org/sfc/gui/windows/Windows.java
size:3.344 KB (3425 B)
uploaded: 2018-01-07 12:03:36 GMT+0000
last update: 2006-07-24 08:45:14 GMT+0000
last access: 2018-04-21 09:52:04 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 2018-01-07 12:03:34 GMT+0000 served at 2018-04-21 09:52:04 GMT+0000.
Valid CSS Valid XHTML 1.1
Valid RSS SourceForge.net Logo