Insets il = new Insets(4,4,4,4);
Insets ir = new Insets(4,4,4,4);
- pane = getContentPane();
+ pane = getScrollablePane();
+
pane.setLayout(new GridBagLayout());
/* Product */
GridBagConstraints c;
- pane = getContentPane();
+ pane = getScrollablePane();
pane.setLayout(new GridBagLayout());
int nrow = 0;
Insets il = new Insets(4,4,4,4);
Insets ir = new Insets(4,4,4,4);
- pane = getContentPane();
+ pane = getScrollablePane();
pane.setLayout(new GridBagLayout());
/* Product */
voice = in_voice;
reader = in_reader;
- bag = getContentPane();
+ bag = getScrollablePane();
bag.setLayout(new GridBagLayout());
setTitle(String.format("AltOS %s", reader.name));
/* We let the user set the freq/callsign, so don't bother with the cancel dialog */
link.set_cancel_enable(false);
- bag = getContentPane();
+ bag = getScrollablePane();
bag.setLayout(new GridBagLayout());
setTitle(String.format("AltOS %s", device.toShortString()));
}
Igniter(AltosIgniteUI ui, String label, String name, int y) {
- Container pane = getContentPane();
+ Container pane = getScrollablePane();
GridBagConstraints c = new GridBagConstraints();
Insets i = new Insets(4,4,4,4);
private void make_ui() {
group = new ButtonGroup();
- Container pane = getContentPane();
+ Container pane = getScrollablePane();
GridBagConstraints c = new GridBagConstraints();
Insets i = new Insets(4,4,4,4);
if (!open())
return;
- Container pane = getContentPane();
+ Container pane = getScrollablePane();
GridBagConstraints c = new GridBagConstraints();
Insets i = new Insets(4,4,4,4);
setVisible(true);
}
-}
\ No newline at end of file
+}
-#!/bin/sh
+#!/bin/bash
+
+case `id -u` in
+ 0)
+ ;;
+ *)
+ # Check for java
+ if [ ! -d /Library/Java/JavaVirtualMachines/ -o `ls /Library/Java/JavaVirtualMachine` == '' ]; then
+ open https://adoptopenjdk.net/
+ osascript -e 'display dialog "Install Java from https://adoptopenjdk.net then click OK" buttons {"Continue"}'
+ fi
+ sudo "$0" "$@"
+ ;;
+esac
+
dir=`dirname "$0"`
cd "$dir"
-mkdir -p ~/Applications/AltOS
-find ~/Applications/AltOS -type d -print0 | xargs -0 chmod +w
-cp -f -a * ~/Applications/AltOS
-cd ~/Applications/AltOS
-chmod +w *
-xattr -c *
+APP=`echo *.app`
+LIBRARY=/Library/AltusMetrum
+APPLICATIONS=/Applications/
+for file in *; do
+ case "$i" in
+ *.app)
+ mkdir -p "$(APPLICATIONS)"
+ if [ -d "$(APPLICATIONS)/$(APP)/." ]; then
+ rm -rf "$(APPLICATIONS)/$(APP)"
+ fi
+ cp -a "$i" "$(APPLICATIONS)/$(APP)"
+ chmod +w "$(APPLICATIONS)/$(APP)"/*
+ xattr -c "$(APPLICATIONS)/$(APP)"/*
+ ;;
+ *)
+ mkdir -p "$(LIBRARY)"
+ cp -a "$i" "$(LIBRARY)"
+ ;;
+ esac
+done
found_devices = new LinkedBlockingQueue<AltosBTDevice>();
- Container pane = getContentPane();
+ Container pane = getScrollablePane();
pane.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
got_ok = false;
frame = in_frame;
- Container pane = getContentPane();
+ Container pane = getScrollablePane();
pane.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
frequencies = new FrequencyList(in_frequencies);
- Container pane = getContentPane();
+ Container pane = getScrollablePane();
pane.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
Insets il = new Insets(4,4,4,4);
Insets ir = new Insets(4,4,4,4);
- pane = getContentPane();
+ pane = getScrollablePane();
pane.setLayout(new GridBagLayout());
c = new GridBagConstraints();
Insets il = new Insets(4,4,4,4);
Insets ir = new Insets(4,4,4,4);
- pane = getContentPane();
+ pane = getScrollablePane();
pane.setLayout(new GridBagLayout());
c = new GridBagConstraints();
super(in_owner, "Open Flash Target Device", true);
owner = in_owner;
- Container pane = getContentPane();
+ Container pane = getScrollablePane();
GridBagConstraints c = new GridBagConstraints();
Insets i = new Insets(4,4,4,4);
Insets il = new Insets(4,4,4,4);
Insets ir = new Insets(4,4,4,4);
- pane = getContentPane();
+ pane = getScrollablePane();
pane.setLayout(new GridBagLayout());
int y = 0;
if (!open())
return;
- Container pane = getContentPane();
+ Container pane = getScrollablePane();
GridBagConstraints c = new GridBagConstraints();
Insets i = new Insets(4,4,4,4);
this.link = link;
this.config_values = config_values;
- pane = getContentPane();
+ pane = getScrollablePane();
pane.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
super(in_owner, name, false);
owner = in_owner;
- pane = getContentPane();
+ pane = getScrollablePane();
pane.setLayout(new GridBagLayout());
row = 0;
public class AltosUIDialog extends JDialog implements AltosUIListener {
+ private Container scrollPane;
+
+ public Container getScrollablePane() {
+ if (scrollPane == null) {
+ Container content = super.getContentPane();
+ /* Create a container to hold the dialog contents */
+ scrollPane = new Container();
+
+ /* Make an opaque box to use the right color */
+ Box box = new Box(BoxLayout.X_AXIS);
+ box.add(scrollPane);
+ box.setOpaque(true);
+
+ /* Create a scrollpane to hold the box */
+ JScrollPane scroll = new JScrollPane();
+ JViewport view = scroll.getViewport();
+ view.add(box);
+
+ /* Add the scroll pane to the top level */
+ content.add(scroll);
+ }
+ return (Container) scrollPane;
+ }
+
public void ui_changed(String look_and_feel) {
SwingUtilities.updateComponentTreeUI(this);
this.pack();
this.pack();
}
+ private Container scrollPane;
+
+ public Container getScrollablePane() {
+ if (scrollPane == null) {
+ Container content = super.getContentPane();
+ /* Create a container to hold the dialog contents */
+ scrollPane = new Container();
+
+ /* Make an opaque box to use the right color */
+ Box box = new Box(BoxLayout.X_AXIS);
+ box.add(scrollPane);
+ box.setOpaque(true);
+
+ /* Create a scrollpane to hold the box */
+ JScrollPane scroll = new JScrollPane();
+ JViewport view = scroll.getViewport();
+ view.add(box);
+
+ /* Add the scroll pane to the top level */
+ content.add(scroll);
+ }
+ return (Container) scrollPane;
+ }
+
static String[] altos_icon_names = {
"/altusmetrum-altosui-16.png",
"/altusmetrum-altosui-32.png",
public AltosUIMapPreload(AltosUIFrame in_owner) {
owner = in_owner;
- Container pane = getContentPane();
+ Container pane = getScrollablePane();
GridBagConstraints c = new GridBagConstraints();
Insets i = new Insets(4,4,4,4);
backend.putInt(fontSizePreference, font_size);
flush_preferences();
AltosUILib.set_fonts(font_size);
- for (AltosFontListener l : font_listeners)
+ for (AltosFontListener l : font_listeners) {
+ System.out.printf("notifying %s of font size change\n", l);
l.font_size_changed(font_size);
+ }
+ System.out.printf("all fonts changed\n");
}
}
public static void register_font_listener(AltosFontListener l) {
+ System.out.printf("register font listener\n");
synchronized (backend) {
font_listeners.add(l);
}
}
public static void unregister_font_listener(AltosFontListener l) {
+ System.out.printf("unregister font listener\n");
synchronized (backend) {
font_listeners.remove(l);
}
public String toString() {
String name = getName();
- if (name == null)
+ if (name == null || "".equals(name))
name = "Altus Metrum";
return String.format("%-20.20s %4d %s",
name, getSerial(), getPath());
public String toShortString() {
String name = getName();
- if (name == null)
+ if (name == null || "".equals(name))
name = "Altus Metrum";
return String.format("%s %d %s",
name, getSerial(), getPath());
this.owner = owner;
this.device = device;
- pane = getContentPane();
+ pane = getScrollablePane();
pane.setLayout(new GridBagLayout());
c = new GridBagConstraints();
Insets il = new Insets(4,4,4,4);
Insets ir = new Insets(4,4,4,4);
- pane = getContentPane();
+ pane = getScrollablePane();
pane.setLayout(new GridBagLayout());
/* Product */