From a547d49565a406f72191f98bbb453c552ab28cab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Bitteur?= Date: Wed, 15 Jan 2025 12:33:03 +0100 Subject: [PATCH] MacApplication modified to point to Preferences rather than low-level Constants --- .../java/org/audiveris/omr/ui/MacApplication.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/org/audiveris/omr/ui/MacApplication.java b/app/src/main/java/org/audiveris/omr/ui/MacApplication.java index aa83f172a..8f9a6519f 100644 --- a/app/src/main/java/org/audiveris/omr/ui/MacApplication.java +++ b/app/src/main/java/org/audiveris/omr/ui/MacApplication.java @@ -96,7 +96,7 @@ public Object invoke (Object proxy, logger.debug(name); switch (name) { - case "handlePreferences" -> GuiActions.getInstance().defineConstants(null); + case "handlePreferences" -> GuiActions.getInstance().definePreferences(null); case "handleQuit" -> GuiActions.getInstance().exit(null); case "handleAbout" -> GuiActions.getInstance().showAbout(null); case "handleOpenFile" -> { @@ -127,8 +127,7 @@ private static Object getEvent (Object[] args) if ((eventClass != null) && eventClass.isAssignableFrom(arg.getClass())) { return arg; } - } catch (Exception e) { - } + } catch (Exception e) {} } } @@ -158,8 +157,7 @@ private static void setHandled (Object event) Method handled = eventClass.getMethod("setHandled", boolean.class); handled.invoke(event, true); } catch (IllegalAccessException | IllegalArgumentException | NoSuchMethodException - | SecurityException | InvocationTargetException e) { - } + | SecurityException | InvocationTargetException e) {} } /** @@ -181,8 +179,8 @@ public static boolean setupMacMenus () Object app = appClass.getDeclaredConstructor().newInstance(); //Enable the about menu item and the preferences menu item - for (String methodName : new String[] - { "setEnabledAboutMenu", "setEnabledPreferencesMenu" }) { + for (String methodName : new String[] { "setEnabledAboutMenu", + "setEnabledPreferencesMenu" }) { Method method = appClass.getMethod(methodName, boolean.class); method.invoke(app, true); } @@ -195,8 +193,7 @@ public static boolean setupMacMenus () //providing an instance of this class as a callback for any method invocation Object listenerProxy = Proxy.newProxyInstance( MacApplication.class.getClassLoader(), - new Class[] - { listenerClass }, + new Class[] { listenerClass }, new MacApplication()); //Add the generated class as a hook