2 * Copyright © 2010 Anthony Towns <aj@erisian.com.au>
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.
21 import java.awt.image.*;
22 import java.awt.event.*;
24 import javax.imageio.ImageIO;
25 import javax.swing.table.*;
29 import java.util.prefs.*;
30 import java.lang.Math;
31 import java.awt.geom.Point2D;
32 import java.awt.geom.Line2D;
34 public class AltosSiteMap extends JComponent implements AltosFlightDisplay {
38 public void show(AltosState state, int crc_errors) {
39 for (int x = 0; x < mapTiles.length; x++) {
40 mapTiles[x].show(state, crc_errors);
44 AltosSiteMapTile [] mapTiles = new AltosSiteMapTile[9];
46 public AltosSiteMap() {
48 GridBagLayout layout = new GridBagLayout();
51 GridBagConstraints c = new GridBagConstraints();
52 c.anchor = GridBagConstraints.CENTER;
53 c.fill = GridBagConstraints.BOTH;
55 for (int x = 0; x < 9; x++) {
56 c.gridx = x % 3; c.gridy = x / 3;
57 mapTiles[x] = new AltosSiteMapTile((x%3)-1, (x/3)-1);
58 layout.setConstraints(mapTiles[x], c);