From: Giovanni Mascellani Subject: [PATCH] patch/no_mac Removes Mac OS X specific code. Signed-off-by: Giovanni Mascellani --- geogebra/gui/app/GeoGebraFrame.java | 10 --- geogebra/gui/app/MacApplicationListener.java | 101 -------------------------- 2 files changed, 0 insertions(+), 111 deletions(-) diff --git a/geogebra/gui/app/GeoGebraFrame.java b/geogebra/gui/app/GeoGebraFrame.java index bc5fbe0..2c8f7df 100644 --- a/geogebra/gui/app/GeoGebraFrame.java +++ b/geogebra/gui/app/GeoGebraFrame.java @@ -255,16 +255,6 @@ public class GeoGebraFrame extends JFrame implements WindowFocusListener { * MacOS X specific initing. Note: this method can only be run on a Mac! */ public static void initMacSpecifics() { - try { - // init mac application listener - MacApplicationListener.initMacApplicationListener(); - - // mac menu bar - // System.setProperty("com.apple.macos.useScreenMenuBar", "true"); - System.setProperty("apple.laf.useScreenMenuBar", "true"); - } catch (Exception e) { - Application.debug(e + ""); - } } public static synchronized GeoGebraFrame createNewWindow( diff --git a/geogebra/gui/app/MacApplicationListener.java b/geogebra/gui/app/MacApplicationListener.java deleted file mode 100644 index 0c53155..0000000 --- a/geogebra/gui/app/MacApplicationListener.java +++ /dev/null @@ -1,101 +0,0 @@ -package geogebra.gui.app; - -import geogebra.main.Application; - -import java.io.File; - -public class MacApplicationListener implements com.apple.eawt.ApplicationListener { - - public static void initMacApplicationListener() { - com.apple.eawt.Application app = new com.apple.eawt.Application(); - app.addApplicationListener(new MacApplicationListener()); - } - - /** - * Gets active instance of GeoGebra window. This method waits - * until an active instance was created by GeoGebra.main() - * @return - */ - private synchronized GeoGebraFrame getGGBInstance() { - GeoGebraFrame wnd = null; - while (wnd == null) { - try { - Thread.sleep(100); - wnd = GeoGebraFrame.getActiveInstance(); - } catch (Exception e) { - Application.debug("MacApplicationListener.getGGBInstance(): " + e.getMessage()); - wnd = null; - } - } - return wnd; - } - - public synchronized void handleQuit(com.apple.eawt.ApplicationEvent ev) { - // quit all frames - Application app = getGGBInstance().getApplication(); - app.exitAll(); - } - - public synchronized void handleAbout(com.apple.eawt.ApplicationEvent event) { - event.setHandled(true); - Application app = getGGBInstance().getApplication(); - app.getGuiManager().showAboutDialog(); - } - - 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 }; - // #1541 - boolean openInThisWindow = app.isSaved(); - app.getGuiManager().doOpenFiles(files, openInThisWindow); - - // make sure window is visible - if (openInThisWindow) - ggb.setVisible(true); - } - } - } - - 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 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); - } - } - - public synchronized void handlePreferences(com.apple.eawt.ApplicationEvent arg0) { - Application.debug("handlePreferences event, filename: " + arg0.getFilename()); - } - - public synchronized void handleReOpenApplication(com.apple.eawt.ApplicationEvent arg0) { - Application.debug("handleReOpenApplication event, filename: " + arg0.getFilename()); - } - - -} -- tg: (4896c42..) patch/no_mac (depends on: master)