From 68effc6e39f731a2d7bbe2963999c1e785118897 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 25 May 2015 20:33:28 -0700 Subject: [PATCH] altoslib: More frobbing with new map bits Signed-off-by: Keith Packard --- altoslib/AltosMapTile.java | 10 +++++----- altosui/AltosFlightUI.java | 4 ++-- altosuilib/AltosFlightDisplay.java | 28 ---------------------------- altosuilib/AltosFontListener.java | 22 ---------------------- altosuilib/AltosUIMapView.java | 15 --------------- altosuilib/Makefile.am | 4 ++-- configure.ac | 4 ++-- 7 files changed, 11 insertions(+), 76 deletions(-) delete mode 100644 altosuilib/AltosFlightDisplay.java delete mode 100644 altosuilib/AltosFontListener.java diff --git a/altoslib/AltosMapTile.java b/altoslib/AltosMapTile.java index 923b7c6b..92b7a985 100644 --- a/altoslib/AltosMapTile.java +++ b/altoslib/AltosMapTile.java @@ -22,13 +22,13 @@ import java.util.*; public abstract class AltosMapTile implements AltosFontListener { AltosMapTileListener listener; - AltosLatLon upper_left, center; - int px_size; + public AltosLatLon upper_left, center; + public int px_size; int zoom; int maptype; - AltosMapStore store; - AltosMapCache cache; - int status; + public AltosMapStore store; + public AltosMapCache cache; + public int status; static public final int success = 0; static public final int loading = 1; diff --git a/altosui/AltosFlightUI.java b/altosui/AltosFlightUI.java index 424c57da..6ef85a96 100644 --- a/altosui/AltosFlightUI.java +++ b/altosui/AltosFlightUI.java @@ -40,7 +40,7 @@ public class AltosFlightUI extends AltosUIFrame implements AltosFlightDisplay { AltosDescent descent; AltosLanded landed; AltosCompanionInfo companion; - AltosUIMap sitemap; + AltosUIMapNew sitemap; boolean has_map; boolean has_companion; boolean has_state; @@ -319,7 +319,7 @@ public class AltosFlightUI extends AltosUIFrame implements AltosFlightDisplay { has_companion = false; has_state = false; - sitemap = new AltosUIMap(); + sitemap = new AltosUIMapNew(); displays.add(sitemap); has_map = false; diff --git a/altosuilib/AltosFlightDisplay.java b/altosuilib/AltosFlightDisplay.java deleted file mode 100644 index ac65c49e..00000000 --- a/altosuilib/AltosFlightDisplay.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright © 2010 Keith Packard - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - */ - -package org.altusmetrum.altosuilib_6; - -import org.altusmetrum.altoslib_6.*; - -public interface AltosFlightDisplay extends AltosUnitsListener, AltosFontListener { - void reset(); - - void show(AltosState state, AltosListenerState listener_state); - - String getName(); -} diff --git a/altosuilib/AltosFontListener.java b/altosuilib/AltosFontListener.java deleted file mode 100644 index 93625278..00000000 --- a/altosuilib/AltosFontListener.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright © 2011 Keith Packard - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - */ - -package org.altusmetrum.altosuilib_6; - -public interface AltosFontListener { - void font_size_changed(int font_size); -} diff --git a/altosuilib/AltosUIMapView.java b/altosuilib/AltosUIMapView.java index c8632b99..d110f803 100644 --- a/altosuilib/AltosUIMapView.java +++ b/altosuilib/AltosUIMapView.java @@ -426,21 +426,6 @@ public class AltosUIMapView extends Component implements MouseMotionListener, Mo } public void paint(Graphics g) { - VolatileImage back_buffer = create_back_buffer(); - do { - GraphicsConfiguration gc = getGraphicsConfiguration(); - int code = back_buffer.validate(gc); - if (code == VolatileImage.IMAGE_INCOMPATIBLE) - back_buffer = create_back_buffer(); - - Graphics g_back = back_buffer.getGraphics(); - g_back.setClip(g.getClip()); - do_paint(g_back); - g_back.dispose(); - - g.drawImage(back_buffer, 0, 0, this); - } while (back_buffer.contentsLost()); - back_buffer.flush(); } public void update(Graphics g) { diff --git a/altosuilib/Makefile.am b/altosuilib/Makefile.am index d51da91d..30d003e9 100644 --- a/altosuilib/Makefile.am +++ b/altosuilib/Makefile.am @@ -12,8 +12,6 @@ altosuilib_JAVA = \ GrabNDrag.java \ AltosDevice.java \ AltosDeviceDialog.java \ - AltosFlightDisplay.java \ - AltosFontListener.java \ AltosPositionListener.java \ AltosUIConfigure.java \ AltosUIAxis.java \ @@ -61,6 +59,7 @@ altosuilib_JAVA = \ AltosBTManage.java \ AltosBTKnown.java \ AltosUIMap.java \ + AltosUIMapNew.java \ AltosUIMapView.java \ AltosUIMapLine.java \ AltosUIMapMark.java \ @@ -84,6 +83,7 @@ altosuilib_JAVA = \ AltosUIFreqList.java \ AltosUITelemetryList.java \ AltosUIRateList.java \ + AltosUIImage.java \ OSXAdapter.java JAR=altosuilib_$(ALTOSUILIB_VERSION).jar diff --git a/configure.ac b/configure.ac index 171d1410..0564f4f8 100644 --- a/configure.ac +++ b/configure.ac @@ -29,8 +29,8 @@ AC_SUBST(VERSION_DASH) dnl ========================================================================== dnl Java library versions -ALTOSUILIB_VERSION=6 -ALTOSLIB_VERSION=6 +ALTOSUILIB_VERSION=7 +ALTOSLIB_VERSION=7 AC_SUBST(ALTOSLIB_VERSION) AC_DEFINE(ALTOSLIB_VERSION,$ALTOSLIB_VERSION,[Version of the AltosLib package]) -- 2.30.2