Exemple #1
0
  public Main(JFrame frame) {
    super(new BorderLayout());

    this.frame = frame;

    tabpane = new JTabbedPane();

    algorithm_View = new Algorithm_View();
    algorithm_View.setTabbedPane(tabpane);
    config_View = new Config_View();

    menu = new JMenuBar();
    file = new JMenu("File");
    openFile = new JMenuItem("Load Graph");
    resetView = new JMenuItem("Reset View");
    openFile.addActionListener(this);
    resetView.addActionListener(this);
    file.add(openFile);
    file.add(resetView);

    help = new JMenu("Help");
    about = new JMenuItem("About...");
    helpGeneral = new JMenuItem("Manual");

    about.addActionListener(this);
    helpGeneral.addActionListener(this);

    help.add(about);
    help.add(helpGeneral);
    algorithm_View.setPanel();
    algorithm_View.setFrame(frame);
    algorithm_View.setDrawer(drawer);
    tabpane.addTab("Algorithm", null, algorithm_View, "Algorithm view");
    tabpane.addTab("Config Algorithm", null, config_View, "Algorithm configuration");

    menu.add(file);
    menu.add(help);

    this.add(menu, BorderLayout.NORTH);
    this.add(tabpane, BorderLayout.CENTER);
  }