コード例 #1
0
 /**
  * Gets the instance of the SlowButton
  *
  * @return The instance of the SlowButton
  */
 public static JButton getSlowButton() {
   if (slowButton == null) {
     slowButton = new JButton();
     slowButton.setText(Constants.STOP);
     slowButton.setHorizontalAlignment(SwingConstants.CENTER);
     slowButton.setFont(Constants.DEFAULT_BUTTON_FONT);
     slowButton.setAlignmentX(Component.CENTER_ALIGNMENT);
     slowButton.setActionCommand(Constants.SLOW);
     slowButton.addActionListener(ButtonListener.getInstance());
   }
   return slowButton;
 }
コード例 #2
0
 /**
  * Gets the instance of the ConnectButton
  *
  * @return The instance of the ConnectButton
  */
 public static JButton getConnectButton() {
   if (connectButton == null) {
     connectButton = new JButton();
     connectButton.setText(Constants.CONNECT);
     connectButton.setHorizontalAlignment(SwingConstants.CENTER);
     connectButton.setFont(Constants.DEFAULT_BUTTON_FONT);
     connectButton.setAlignmentX(Component.CENTER_ALIGNMENT);
     connectButton.setActionCommand(Constants.CONNECT);
     connectButton.addActionListener(ButtonListener.getInstance());
   }
   return connectButton;
 }
コード例 #3
0
 /**
  * Gets the instance of the CenterButton
  *
  * @return The instance of the CenterButton
  */
 public static JButton getCenterButton() {
   if (centerButton == null) {
     centerButton = new JButton();
     centerButton.setText(Constants.CENTER);
     centerButton.setHorizontalAlignment(SwingConstants.CENTER);
     centerButton.setFont(new Font("Dialog", Font.BOLD, 14));
     centerButton.setAlignmentX(Component.CENTER_ALIGNMENT);
     centerButton.setActionCommand(Constants.CENTER);
     centerButton.addActionListener(ButtonListener.getInstance());
   }
   return centerButton;
 }
コード例 #4
0
 /**
  * Gets the instance of the ResetButton
  *
  * @return The instance of the ResetButton
  */
 public static JButton getResetButton() {
   if (resetButton == null) {
     resetButton = new JButton();
     resetButton.setText(Constants.RESET);
     resetButton.setHorizontalAlignment(SwingConstants.CENTER);
     resetButton.setFont(Constants.DEFAULT_BUTTON_FONT);
     resetButton.setAlignmentX(Component.CENTER_ALIGNMENT);
     resetButton.setActionCommand(Constants.RESET);
     resetButton.addActionListener(ButtonListener.getInstance());
     resetButton.setEnabled(false);
   }
   return resetButton;
 }