ControlBar(MainWindow creator) {
    parent = creator;

    super.setPreferredSize(new Dimension(720, 172));
    setLayout(new BorderLayout());

    // add timer, save, and heatmap controls to the bar

    tc = new TimerControls(this);
    sc = new SaveControls(parent.getGrid(), this);
    hc = new HeatMapControls(this);
    add(tc, BorderLayout.WEST);
    add(hc, BorderLayout.CENTER);
    add(sc, BorderLayout.EAST);

    super.repaint();
    super.setVisible(true);
    System.out.println("Done Constucting");
  }
Beispiel #2
0
  public static void main(String[] argv) {
    MainWindow win;

    DbgOutput.toStdout();
    win = new MainWindow();
    // process cmd line arguments
    int i;
    for (i = 0; i < argv.length; i++) {
      if (argv[i].equals("-D")) {
        i++;
        // try to interpret the next argument as the debug level
        int dbgLvl = 1; // basic debug level
        if (i >= argv.length) {
          // no more arguments, we stick with debug level 1
          break;
        }
        try {
          dbgLvl = Integer.parseInt(argv[i]);
        } catch (NumberFormatException e) {
          dbgLvl = 1; // didn't work, this is probably a filename
          win.open(argv[i]);
        }
        DbgOutput.setDbgLevel(dbgLvl);
        Libgist.setDbgLevel(dbgLvl);

      } else if (argv[i].equals("-h")) {
        // print help message and exit
        System.out.println("Usage: amdb [-D <dbglevel> | -h] [index]");
        System.exit(0);

      } else {
        // this is a name of an index, open it
        // System.out.println("open " + argv[i]);
        win.open(argv[i]);
      }
    }
    win.setTitle("amdb");
    win.setSize(800, 600);
    win.setLocation(50, 50);
    win.setVisible(true);
  }