Logo
Distributed Genetic Programming Framework
print print

File org.dgpf.gui.Client.java

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

import javax.swing.ImageIcon;

import org.dgpf.gui.utils.Host;
import org.dgpf.gui.utils.LanguageSwitcher;
import org.dgpf.gui.utils.PrefUtils;

/**
 * @author Lado Kumsiashvili
 */

public class Client
  {

  /**
   * The size of the buffer used for network communication. This should be
   * a relative large value for the following reason: When the user chooses
   * to have a chart initially the events have to be buffered while he
   * interacts with the chart chooser wizard.
   */

  public static final int NETWORK_BUFFER_SIZE = 1024;

  /**
   * The DGPF frame
   */

  private Frame           m_frame;

  /**
   * The user's current host list.
   */

  private Vector<Host>    m_hostlist          = new Vector<Host>();

  /**
   * The user's current host list filename.
   */

  private String          m_hostlist_filename = null;

  /**
   * Current <code>Locale</code>.
   */

  private Locale          m_locale;

  /**
   * @param p_args
   *          command line arguments
   */

  public static void main(String[] p_args)
    {
    Locale l_locale = null;
    /* Ensure that ResourceBundle is loaded properly. */
    try
      {
      String l_lang = PrefUtils.getString("lang", Locale.getDefault()
          .toString());
      // load user defined rb
      l_locale = new Locale(l_lang);
      LanguageSwitcher.loadBundle(l_locale);
      // test rb
      LanguageSwitcher.getString("hello");
      }
    catch(ExceptionInInitializerError eiie)
      {
      System.err
          .println("Error: ResourceBundle not found! Here's something seriously wrong!");
      System.exit(1);
      }

    /* Start main frame */
    Client l_client = new Client();
    l_client.m_frame = new Frame(l_client, "DGPF");
    l_client.m_frame
        .setIconImage(new ImageIcon(
            ClassLoader
                .getSystemResource("org/dgpf/gui/resources/bitmaps/dgpf_icon.png"))
            .getImage());
    l_client.m_frame.setVisible(true);
    l_client.m_locale = l_locale;

    }

  /**
   * @return Returns the hostlist.
   */

  public final Vector<Host> getHostlist()
    {
    return this.m_hostlist;
    }

  /**
   * Informs this class about a new host list.
   * 
   * @param p_hostlist_filename
   *          is the host list's filename.
   * @param p_hostlist
   *          is the host list to set.
   */

  public final void setHostlist(String p_hostlist_filename,
      Vector<Host> p_hostlist)
    {
    this.m_hostlist_filename = p_hostlist_filename;
    this.m_hostlist = p_hostlist;
    this.m_frame.updateHostlistText();
    }

  /**
   * @return Returns the hostlist_filename.
   */

  public final String getHostlistFilename()
    {
    return this.m_hostlist_filename;
    }

  /**
   * @return Returns the frame.
   */

  public final Frame getFrame()
    {
    return this.m_frame;
    }

  /**
   * Return current <code>Locale</code>.
   * 
   * @return the current <code>Locale</code>.
   */

  public Locale getLocale()
    {
    return this.m_locale;
    }

  /**
   * Sets current <code>Locale</code>.
   * 
   * @param p_locale
   *          the current <code>Locale</code>.
   */

  public void setLocale(Locale p_locale)
    {
    this.m_locale = p_locale;
    }
  }

File Information:

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