Beispiel #1
0
  public MainFrame(String title, UserFrontEnd ptheApp) {
    super(title);
    theApp = ptheApp;
    // identify the OS

    if (theApp.runningOSX()) initForOSX(); // OSX specific inits
    else if (theApp.runningWindows()) { // Windows specific inits
      initForWindows();
    } else if (theApp.runningLinux()) {
      initForLinux();
    } else {
      JOptionPane.showMessageDialog(
          this,
          "Phylontal doesn't recognize your operating system (yet!)",
          "Operating System unknown",
          JOptionPane.WARNING_MESSAGE);
    }

    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    // add tabbed pane
    tabbedView = new JTabbedPane(JTabbedPane.TOP);
    tabbedView.addChangeListener(this);

    tabbedView.addTab("Project", projectTab = new ProjectTab(theApp));
    tabbedView.addTab("Matcher", matcherTab = new MatcherTab(theApp));

    int matchIndex = tabbedView.indexOfComponent(matcherTab);
    tabbedView.setToolTipTextAt(matchIndex, "Disabled until a project is specified");
    tabbedView.setEnabledAt(matchIndex, false);

    int projectIndex = tabbedView.indexOfComponent(projectTab);
    tabbedView.setToolTipTextAt(projectIndex, "Create or Load a project; specify components");

    currentTabComponent = tabbedView.getSelectedComponent();
    if (currentTabComponent instanceof TabView) {
      resetMenuBar();
      JMenuBar tmpBar = ((TabView) currentTabComponent).initializeMenus();
      if (tmpBar != null) {
        menuBar = tmpBar;
        setJMenuBar(menuBar);
      }
    }

    Container content = getContentPane(); // get content pane
    content.setLayout(new BorderLayout());
    content.add(tabbedView, BorderLayout.CENTER);

    // add icons

    // add preferences Dialog

    preferencesDialog = new PreferencesDialog(this);
  }
Beispiel #2
0
 public void cleanup() {
   theApp.cleanup(); // last thing to do
 }
Beispiel #3
0
 /**
  * Create about dialog with the menu item as parent
  *
  * @param owner owning component for the purpose of positioning the dialog
  */
 public void showAboutBox() {
   JOptionPane.showMessageDialog(
       this, theApp.getAboutString(), aboutTitle, JOptionPane.INFORMATION_MESSAGE, logoIcon);
 }