예제 #1
0
 @Override
 public void changeProp(String[] args) {
   if (args[1].equalsIgnoreCase("CLI")) {
     String[] exit = new String[] {"exit"};
     setChanged();
     notifyObservers(exit); // close all threads working from Model
     if (!startWindow.shell.isDisposed()) {
       startWindow.close();
     }
     if (!mazeWindow.shell.isDisposed()) {
       mazeWindow.close();
     }
     boot.Run.main(args);
   } else {
     startWindow.updateMessageBox("Properties file loaded");
   }
 }
예제 #2
0
 @Override
 public void error(String string) {
   if (!mazeWindow.shell.isDisposed()) {
     mazeWindow.errMessageBox(string);
   } else if (!startWindow.shell.isDisposed()) {
     startWindow.errMessageBox(string);
   }
 }
예제 #3
0
 @Override
 public void mazegenerated(String string) {
   if (!startWindow.shell.isDisposed() && play == false) {
     startWindow.updateMessageBox(string);
   }
 }
예제 #4
0
 @Override
 public void start() {
   startWindow.run();
 }
예제 #5
0
  protected void start() {

    StartWindow startWindow = new StartWindow();
    startWindow.setLocationRelativeTo(null);
    startWindow.setVisible(true);
  }
예제 #6
0
public class FoundClientPanel extends JPanel implements Serializable {

  /** Create the panel. */
  private ApplicationFacadeInterface facade = StartWindow.getBusinessLogic();

  private JLabel lblNewLabel = new JLabel("");
  private JLabel lblDeleteOk = new JLabel("");

  public FoundClientPanel(final Vector<Client> h, final int ind, final Admin ad) {

    setLayout(null);

    JLabel izena = new JLabel("");
    izena.setBounds(27, 189, 262, 14);
    add(izena);
    izena.setText(h.get(ind).getName());

    JLabel lblRural = new JLabel("Izena:");
    lblRural.setBounds(10, 11, 110, 14);
    add(lblRural);

    JLabel abizen = new JLabel("");
    abizen.setBounds(92, 11, 29, 14);
    add(abizen);
    abizen.setText(h.get(ind).getAbizena());

    JLabel label = new JLabel("Abizena:");
    label.setBounds(10, 36, 93, 14);
    add(label);

    JLabel lblPrice = new JLabel("Login:"******"");
    searchPrice.setBounds(123, 60, 68, 23);
    add(searchPrice);
    searchPrice.setBackground(Color.WHITE);
    searchPrice.setText(h.get(ind).getLogin());

    lblNewLabel.setBounds(311, 60, 46, 14);
    add(lblNewLabel);

    lblDeleteOk.setBounds(398, 11, 46, 14);
    add(lblDeleteOk);

    JButton btnDelete = new JButton("Delete");
    btnDelete.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {
            ApplicationFacadeInterface facades = StartWindow.getBusinessLogic();
            try {
              Boolean rhUpdate = facades.deleteClient(h.get(ind));
              if (rhUpdate) {
                lblDeleteOk.setForeground(Color.GREEN);
                lblDeleteOk.setText("Delete OK");
                StartWindow.setAdminPanel(ad);
              } else {
                lblDeleteOk.setForeground(Color.RED);
                lblDeleteOk.setText("gaizki");
              }
            } catch (Exception e1) {
              // TODO Auto-generated catch block
              e1.printStackTrace();
            }
          }
        });
    btnDelete.setBounds(299, 7, 89, 23);
    add(btnDelete);
  }
}