Logo
Distributed Genetic Programming Framework
print print

File org.dgpf.gui.InfoPanel.java

Here you can find all the information about the file org.dgpf.gui.InfoPanel.java. You may explore it here or download it onto your local disk.
/**
 * 
 */

package org.dgpf.gui;

import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.sql.Timestamp;
import java.util.Hashtable;

import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.border.TitledBorder;

import org.dgpf.gui.components.DGPFTitledBorder;
import org.dgpf.gui.utils.LanguageSwitcher;
import org.dgpf.gui.utils.Layout;

/**
 * Info Panle to show some infos.
 * 
 * @author Lado Kumsiashvili
 */

public class InfoPanel extends JPanel
  {

  /**
   * Indicates by colors the status of the search engine.
   */

  private JTextField            m_status;

  /**
   * status
   */

  boolean                       m_st             = false;

  /**
   * 
   */

  private JTextField            m_lastUpdate;

  /**
   * 
   */

  private JTextField            m_runningSince;

  /**
   * 
   */

  private JTextField            m_connectedSince;

  /**
   * Current running jar file name.
   */

  private JTextField            m_currentJarName;

  /**
   * Fields 
   */

  Hashtable<String, JTextField> m_fields;

  /**
   * serialVersionUID.
   */

  private static final long     serialVersionUID = 9189426082267261313L;

  /**
   * Default contructor
   */

  public InfoPanel()
    {
    setLayout(new GridBagLayout());
    this.m_fields = new Hashtable<String, JTextField>();
    Font titleFont = new Font("Verdana", Font.PLAIN, 10);

    this.m_status = new JTextField();
    DGPFTitledBorder l_border = new DGPFTitledBorder("Status",
        TitledBorder.LEFT, titleFont);
    this.m_status.setBorder(l_border);
    this.m_fields.put("status"this.m_status);

    this.m_currentJarName = new JTextField();
    l_border = new DGPFTitledBorder("Jar", TitledBorder.LEFT, titleFont);
    this.m_currentJarName.setBorder(l_border);
    this.m_fields.put("currentjar"this.m_currentJarName);

    this.m_connectedSince = new JTextField();
    l_border = new DGPFTitledBorder(LanguageSwitcher
        .getString("infopanel.connected_since"), TitledBorder.LEFT,
        titleFont);
    this.m_connectedSince.setBorder(l_border);
    this.m_fields.put("connectedSince"this.m_connectedSince);

    this.m_runningSince = new JTextField();
    this.m_runningSince
        .setBorder(new DGPFTitledBorder(LanguageSwitcher
            .getString("performance.start_time"), TitledBorder.LEFT,
            titleFont));
    this.m_fields.put("runningSince"this.m_runningSince);

    this.m_lastUpdate = new JTextField();
    this.m_lastUpdate.setBorder(new DGPFTitledBorder(LanguageSwitcher
        .getString("performance.last_update_time"), TitledBorder.LEFT,
        titleFont));
    this.m_fields.put("lastUpdate"this.m_lastUpdate);

    for(JTextField field : this.m_fields.values())
      {
      field.setEditable(false);
      field.setFont(new Font("Verdana", Font.BOLD, 10));
      Layout.set_constraints(this, field, 1.0, 1.0,
          GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTH,
          GridBagConstraints.REMAINDER, new Insets(1, 1, 1, 1));

      }

    }

  /**
   * Getter for status.
   * 
   * @return status
   */

  public JTextField getStatus()
    {
    return this.m_status;
    }

  /**
   * Getter for status.
   * 
   * @param p_status
   *          Status color to set.
   */

  public void setStatus(JTextField p_status)
    {
    this.m_status = p_status;
    }

  /**
   * Getter for connectedSince.
   * 
   * @return connectedSince.
   */

  public JTextField getConnectedSince()
    {
    return this.m_connectedSince;
    }

  /**
   * @param p_connectedSince
   */

  public void setConnectedSince(JTextField p_connectedSince)
    {
    this.m_connectedSince = p_connectedSince;
    }

  /**
   *  Getter lastUpdate
   * @return lastUpdate.
   */

  public JTextField getLastUpdate()
    {
    return this.m_lastUpdate;
    }

  /**
   * Setter for lastUpdate.
   * 
   * @param p_lastUpdate
   *          lastUpdate String to set.
   */

  public void setLastUpdate(JTextField p_lastUpdate)
    {
    this.m_lastUpdate = p_lastUpdate;
    }

  /**
   * Getter for runningSince.
   * 
   * @return runningSince.
   */

  public JTextField getRunningSince()
    {
    return this.m_runningSince;
    }

  /**
   * Setter for runningSince.
   * 
   * @param p_runningSince
   *          String to set.
   */

  public void setRunningSince(JTextField p_runningSince)
    {
    this.m_runningSince = p_runningSince;
    }

  /**
   *  Adjusts last update timestamp.
   */

  public void adjustLastUpdate()
    {
    this.m_lastUpdate.setText(SEInfoHolder.FORMATTER.format(new Timestamp(
        System.currentTimeMillis())));
    }

  /**
   * Getter for currentTimeMillis.
   * 
   * @return currentTimeMillis.
   */

  public JTextField getCurrentJarName()
    {
    return this.m_currentJarName;
    }

  /**
   * Setter for currentJarName.
   * 
   * @param p_currentJarName
   *          currentJarName.
   */

  public void setCurrentJarName(JTextField p_currentJarName)
    {
    this.m_currentJarName = p_currentJarName;
    }

  /**
   * Clears the fields.
   */

  public void clearInfo()
    {
    this.getStatus().setText("");
    this.getConnectedSince().setText("");
    this.getLastUpdate().setText("");
    this.getRunningSince().setText("");
    this.getCurrentJarName().setText("");
    }
  }

File Information:

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