Exemplo n.º 1
0
 @Override
 public void actionPerformed(ActionEvent e) {
   if (e.getSource() == showBut) {
     parentFrame.tellServer("showbutton");
   } else if (e.getSource() == hideBut) {
     parentFrame.tellServer("hidebutton");
   } else if (e.getSource() == killBut) {
     if (checkKillButton() == JOptionPane.OK_OPTION) {
       parentFrame.tellServer("killserver");
     }
   }
 }
Exemplo n.º 2
0
  /**
   * Changes the current displayed status of the button.
   *
   * @param status the status of the button.
   */
  public void updateStatusLabel(String status) {
    switch (status) {
      case "visible":
        statusLab.setText("Button is currently VISIBLE");
        break;

      case "hidden":
        statusLab.setText("Button is currently NOT VISIBLE");
        break;

      case "kill":
        statusLab.setText("Button has been shutdown");
        parentFrame.closeAll();
        setServerDeadState();
        break;

      case "ringbell":
        playBell();
        break;

      default:
        statusLab.setText("Anomalous state: " + status + ". This should not happen");
        break;
    }
  }
Exemplo n.º 3
0
  public AdminPane(MainClientHub mainClientFrame) {
    super();
    parentFrame = mainClientFrame;

    setLayout(new BorderLayout());

    initComponents();
    addHandlers();
    addComponents();

    // Asks for the current state of the button so that the status label is
    // updated correctly.
    parentFrame.tellServer("requestcurrentstate");
  }