use multimaint-merge to make Debian changelogs less ugly
[fw/altos] / altosui / AltosSiteMapTile.java
index 8301f42b007e7fa9907991c3920543ce033e4946..9e62bb47c751fdfa967ae358af80467cbd443409 100644 (file)
@@ -35,11 +35,20 @@ public class AltosSiteMapTile extends JLayeredPane {
        JLabel mapLabel;
        JLabel draw;
        Graphics2D g2d;
+       int px_size;
 
        public void loadMap(ImageIcon icn) {
                mapLabel.setIcon(icn);
        }
 
+       public void clearMap() {
+               fillLabel(mapLabel, Color.GRAY, px_size);
+               g2d = fillLabel(draw, new Color(127,127,127,0), px_size);
+               g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+                                    RenderingHints.VALUE_ANTIALIAS_ON);
+               g2d.setStroke(new BasicStroke(6, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
+       }
+
        static Color stateColors[] = {
                Color.WHITE,  // startup
                Color.WHITE,  // idle
@@ -80,6 +89,13 @@ public class AltosSiteMapTile extends JLayeredPane {
                repaint();
        }
 
+       public void draw_circle(Point2D.Double pt) {
+               g2d.setColor(Color.RED);
+               g2d.drawOval((int)pt.x-5, (int)pt.y-5, 10, 10);
+               g2d.drawOval((int)pt.x-20, (int)pt.y-20, 40, 40);
+               g2d.drawOval((int)pt.x-35, (int)pt.y-35, 70, 70);
+       }
+
        public static Graphics2D fillLabel(JLabel l, Color c, int px_size) {
                BufferedImage img = new BufferedImage(px_size, px_size,
                                                      BufferedImage.TYPE_INT_ARGB);
@@ -90,7 +106,8 @@ public class AltosSiteMapTile extends JLayeredPane {
                return g;
        }
 
-       public AltosSiteMapTile(int px_size) {
+       public AltosSiteMapTile(int in_px_size) {
+               px_size = in_px_size;
                setPreferredSize(new Dimension(px_size, px_size));
 
                mapLabel = new JLabel();