java: Bump java library versions for next release
[fw/altos] / altosuilib / AltosUIMapMark.java
1 /*
2  * Copyright © 2014 Keith Packard <keithp@keithp.com>
3  *
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.
7  *
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.
12  *
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.
16  */
17
18 package org.altusmetrum.altosuilib_3;
19
20 import java.awt.*;
21 import java.awt.event.*;
22 import javax.swing.*;
23 import java.io.*;
24 import java.lang.Math;
25 import java.awt.geom.*;
26 import java.util.*;
27 import java.util.concurrent.*;
28 import org.altusmetrum.altoslib_5.*;
29
30 public class AltosUIMapMark {
31
32         AltosUILatLon   lat_lon;
33         int             state;
34
35         static public int stroke_width = 6;
36
37         public void paint(Graphics2D g, AltosUIMapTransform t) {
38
39                 Point2D.Double pt = t.screen(lat_lon);
40
41                 g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
42                                    RenderingHints.VALUE_ANTIALIAS_ON);
43                 g.setStroke(new BasicStroke(stroke_width, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
44
45                 if (0 <= state && state < AltosUIMap.stateColors.length)
46                         g.setColor(AltosUIMap.stateColors[state]);
47                 else
48                         g.setColor(AltosUIMap.stateColors[AltosLib.ao_flight_invalid]);
49
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);
53         }
54
55         public AltosUIMapMark (double lat, double lon, int state) {
56                 lat_lon = new AltosUILatLon(lat, lon);
57                 this.state = state;
58         }
59 }