2 * Copyright © 2014 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_3;
21 import java.awt.event.*;
24 import java.lang.Math;
25 import java.awt.geom.*;
27 import java.util.concurrent.*;
28 import org.altusmetrum.altoslib_5.*;
30 public class AltosUIMapMark {
32 AltosUILatLon lat_lon;
35 static public int stroke_width = 6;
37 public void paint(Graphics2D g, AltosUIMapTransform t) {
39 Point2D.Double pt = t.screen(lat_lon);
41 g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
42 RenderingHints.VALUE_ANTIALIAS_ON);
43 g.setStroke(new BasicStroke(stroke_width, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
45 if (0 <= state && state < AltosUIMap.stateColors.length)
46 g.setColor(AltosUIMap.stateColors[state]);
48 g.setColor(AltosUIMap.stateColors[AltosLib.ao_flight_invalid]);
50 g.drawOval((int)pt.x-5, (int)pt.y-5, 10, 10);
51 g.drawOval((int)pt.x-20, (int)pt.y-20, 40, 40);
52 g.drawOval((int)pt.x-35, (int)pt.y-35, 70, 70);
55 public AltosUIMapMark (double lat, double lon, int state) {
56 lat_lon = new AltosUILatLon(lat, lon);