public synchronized void handleOpenApplication(com.apple.eawt.ApplicationEvent ev) {
    Application.debug("handleOpenApplication event, filename: " + ev.getFilename());

    // open file
    String fileName = ev.getFilename();
    if (fileName != null) {
      handleOpenFile(ev);
    } else {
      GeoGebraFrame wnd = getGGBInstance();
      if (!wnd.isShowing()) wnd.setVisible(true);
    }
  }
Example #2
0
 @Override
 public void handlePreferences(ApplicationEvent ae) {
   if (mainApp != null) {
     mainApp.mPreferencesActionPerformedMac();
     ae.setHandled(true);
   } else {
     throw new IllegalStateException(
         "handlePreferences: GMGenSystem instance detached from listener");
   }
 }
  public synchronized void handleOpenFile(com.apple.eawt.ApplicationEvent ev) {
    Application.debug("handleOpenFile event, filename: " + ev.getFilename());

    // open file
    String fileName = ev.getFilename();

    if (fileName != null) {
      File openFile = new File(fileName);
      if (openFile.exists()) {
        // get application instance
        GeoGebraFrame ggb = getGGBInstance();
        Application app = ggb.getApplication();

        // open file
        File[] files = {openFile};
        boolean openInThisWindow = app.getCurrentFile() == null;
        app.getGuiManager().doOpenFiles(files, openInThisWindow);

        // make sure window is visible
        if (openInThisWindow) ggb.setVisible(true);
      }
    }
  }
Example #4
0
 @Override
 public void handleQuit(ApplicationEvent ae) {
   if (mainApp != null) {
     /*
       /    You MUST setHandled(false) if you want to delay or cancel the quit.
       /    This is important for cross-platform development -- have a universal quit
       /    routine that chooses whether or not to quit, so the functionality is identical
       /    on all platforms.  This example simply cancels the AppleEvent-based quit and
       /    defers to that universal method.
     */
     ae.setHandled(false);
     mainApp.exitFormMac();
   } else {
     throw new IllegalStateException("handleQuit: GMGenSystem instance detached from listener");
   }
 }
 public synchronized void handleReOpenApplication(com.apple.eawt.ApplicationEvent arg0) {
   Application.debug("handleReOpenApplication event, filename: " + arg0.getFilename());
 }
 public synchronized void handlePreferences(com.apple.eawt.ApplicationEvent arg0) {
   Application.debug("handlePreferences event, filename: " + arg0.getFilename());
 }
  public synchronized void handlePrintFile(com.apple.eawt.ApplicationEvent event) {
    Application.debug("handlePrintFile event, filename: " + event.getFilename());

    handleOpenFile(event);
    getGGBInstance().getApplication().getGuiManager().showPrintPreview();
  }
 public synchronized void handleAbout(com.apple.eawt.ApplicationEvent event) {
   event.setHandled(true);
   Application app = getGGBInstance().getApplication();
   app.getGuiManager().showAboutDialog();
 }
 public void handleAbout(ApplicationEvent event) {
   event.setHandled(true);
   new AboutUsDialog(null).setVisible(true);
 }