java: Bump java library versions for next release
[fw/altos] / altosuilib / AltosUIFrame.java
index ce86ad83fbab32aa4e0aac012cff79d807ef3f5d..689ea7f312676cc46c451918bfe5b6e69b3a20cd 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_2;
+package org.altusmetrum.altosuilib_3;
 
 import java.awt.*;
 import java.awt.event.*;
@@ -73,6 +73,9 @@ public class AltosUIFrame extends JFrame implements AltosUIListener, AltosPositi
                super.setLocationByPlatform(lbp);
        }
 
+       public void scan_device_selected(AltosDevice device) {
+       }
+
        public void setSize() {
                /* Smash sizes around so that the window comes up in the right shape */
                Insets i = getInsets();
@@ -154,11 +157,28 @@ public class AltosUIFrame extends JFrame implements AltosUIListener, AltosPositi
                }
        }
 
+       static boolean global_settings_done;
+
+       public String getName() {
+               return "Altus Metrum";
+       }
+
        void init() {
                AltosUIPreferences.register_ui_listener(this);
                AltosUIPreferences.register_position_listener(this);
                position = AltosUIPreferences.position();
                addWindowListener(new AltosUIFrameListener());
+
+               /* Try to make menus live in the menu bar like regular Mac apps */
+               if (!global_settings_done) {
+                       try {
+                               global_settings_done = true;
+                               System.setProperty("com.apple.mrj.application.apple.menu.about.name", getName());
+                               System.setProperty("com.apple.macos.useScreenMenuBar", "true");
+                               System.setProperty( "apple.laf.useScreenMenuBar", "true" ); // for older versions of Java
+                       } catch (Exception e) {
+                       }
+               }
                set_icon();
        }