Logo
Distributed Genetic Programming Framework
print print

File org.dgpf.gui.DesktopPane.java

Here you can find all the information about the file org.dgpf.gui.DesktopPane.java. You may explore it here or download it onto your local disk.
/*
 * Copyright (c) 2006 Universitaet Kassel
 *
 * E-Mail           : mirko.dietrich@hrz.uni-kassel.de
 * Original Filename: org.dgpf.gui.DGPFDesktopPane.java
 *
 * 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.dgpf.gui;

import java.awt.Component;
import java.beans.PropertyVetoException;
import java.util.Vector;

import javax.swing.JDesktopPane;

/**
 * Provides a desktop within the DGPF gui window. Each window in this
 * subdesktop represents a connection to a DGPF client/server/p2p-node.
 */

public class DesktopPane extends JDesktopPane
  {

  /**
   * serial version UID
   */

  private static final long serialVersionUID = 1L;

  /**
   * vector holding all the frames. The original getAllFrames returns
   * unfortunatelly a dynamicly generated vector of frames but we need
   * statcal list.
   */

  private Vector<InternalFrame> m_frames           = new Vector<InternalFrame>();

  /**
   * Addes a component.
   *  
   * @param p_c Component to add.
   *       
   * @return added Component.
   */

  @Override
  public Component add(Component p_c)
    {

    if(p_c instanceof InternalFrame) {
      
    if(!this.m_frames.contains(p_c))
      this.m_frames.add((InternalFrame) p_c);
    
    }
      return super.add(p_c);
    
    }

  /**
   * Toggles an internal frame maximize.
   * 
   * @param p_frame to toggle maximize.
   */

  public static void toggleFrameMaximized(InternalFrame p_frame)
    {
    try
      {
      if(p_frame.isMaximum() == true)
        {
        p_frame.setMaximum(false);
        }
      else
        {
        p_frame.setMaximum(true);
        }
      }
    catch(PropertyVetoException e)
      {
      e.printStackTrace();
      }
    }

  /**
   * Removes a Frame at a given position.
   * 
   * @param p_idx
   *          position of the frame to be removed.
   */

  public void removeFrame(int p_idx)
    {
    this.m_frames.remove(p_idx);
   // super.remove(idx);
    }

  /**
   * Removes a Frame
   * 
   * @param p_c
   *          position of the frame to be removed
   */

  public void removeFrame(Component p_c)
    {
    this.m_frames.remove(p_c);
    }

  /**
   * Set initial desktop properties.
   */

  public DesktopPane()
    {
    super();
    }

  /**
   * Getter for frames.
   * 
   * @return frames
   */

  public Vector<InternalFrame> getFrames()
    {
    return this.m_frames;
    }

  /**
   * Setter for frames.
   * 
   * @param p_vec
   *          InternalFrame Vector to set.
   */

  public void setFrames(Vector<InternalFrame> p_vec)
    {
    this.m_frames = p_vec;
    }

  }

File Information:

file name:DesktopPane.java
package:org.dgpf.gui
qualified name:org.dgpf.gui.DesktopPane.java
file type:Java Source File
download location:download http://dgpf.sourceforge.net/source/org/dgpf/gui/DesktopPane.java
size:3.233 KB (3311 B)
uploaded: 2015-07-22 04:10:58 GMT+0000
last update: 2006-09-24 23:47:04 GMT+0000
last access: 2017-11-23 05:30:51 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 2017-11-23 05:30:51 GMT+0000.
Valid CSS Valid XHTML 1.1
Valid RSS SourceForge.net Logo