2 * Copyright © 2010 Keith Packard <keithp@keithp.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
18 package org.altusmetrum.altosuilib_1;
23 import org.altusmetrum.altoslib_1.*;
25 public class AltosUILib extends AltosLib {
27 public static final int tab_elt_pad = 5;
29 public static Font label_font;
30 public static Font value_font;
31 public static Font status_font;
32 public static Font table_label_font;
33 public static Font table_value_font;
35 final public static int font_size_small = 1;
36 final public static int font_size_medium = 2;
37 final public static int font_size_large = 3;
39 final public static int position_top_left = 0;
40 final public static int position_top = 1;
41 final public static int position_top_right = 2;
42 final public static int position_left = 3;
43 final public static int position_center = 4;
44 final public static int position_right = 5;
45 final public static int position_bottom_left = 6;
46 final public static int position_bottom = 7;
47 final public static int position_bottom_right = 8;
49 public static void set_fonts(int size) {
61 case font_size_medium:
72 label_font = new Font("Dialog", Font.PLAIN, brief_size);
73 value_font = new Font("Monospaced", Font.PLAIN, brief_size);
74 status_font = new Font("SansSerif", Font.BOLD, status_size);
75 table_label_font = new Font("SansSerif", Font.PLAIN, table_size);
76 table_value_font = new Font("Monospaced", Font.PLAIN, table_size);
79 static public final int text_width = 20;
81 static public boolean initialized = false;
82 static public boolean loaded_library = false;
84 public static boolean load_library() {
87 System.loadLibrary("altos");
88 libaltos.altos_init();
89 loaded_library = true;
90 } catch (UnsatisfiedLinkError e) {
92 System.loadLibrary("altos64");
93 libaltos.altos_init();
94 loaded_library = true;
95 } catch (UnsatisfiedLinkError e2) {
96 loaded_library = false;
101 return loaded_library;