statuspanel.java

来自「Differential Evolution(JAVA)」· Java 代码 · 共 96 行

JAVA
96
字号
package DeApp1.panel;

import java.awt.*;         // Import all classes from the java.awt package
                           // AWT is the Abstract Window Toolkit. The AWT
import java.io.*;
import DeApp1.screen.*;     // Import screens


public class StatusPanel extends Label
/***********************************************************
**                                                        **
** The little status panel at the bottom of the           **
** application.                                           **
**                                                        **
** Authors:            Mikal Keenan                       **
**                     Rainer Storn                       **
**                                                        **
***********************************************************/ 
{
  public final static String runningString   = "Running...";
  public final static String pausedString    = "Paused...";
  public final static String completedString = "Completed...";
  public final static String nullString      = "";

  public final static Font labelFont = new Font ("Dialog", Font.PLAIN, 10);

  public DEScreen deScreen;


  public StatusPanel (DEScreen app)
  /***************************************
  ** Constructor.                       **
  ***************************************/
  {
	deScreen = app;
	setFont (labelFont);
  }


  public void idle ()
  /***************************************
  ** Show nothing                       **
  ***************************************/
  {
	setText (nullString);  
  }


  public void running ()
  /***************************************
  ** Show "Running"                     **
  ***************************************/
  {
	setText (runningString); 
  }


  public void pause ()
  /***************************************
  ** Show "Paused"                      **
  ***************************************/
  {
  	setText (pausedString);   
  }


  public void resume ()
  /***************************************
  ** Show "Running"                     **
  ***************************************/
  {
	setText (runningString); 
  }

  public void stop ()
  /***************************************
  ** Show nothing                       **
  ***************************************/
  {
    setText (nullString);
  }

  public void done ()
  /***************************************
  ** Show "Completed"                   **
  ***************************************/
  {
    setText (completedString);
  }
}// StatusPanel





⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?