Color gray10 = new Color(25, 25, 25);
    protected void createGIFFile(int distance, int max, int[] post_dist,                                 int[] post_height) {        int box_height_buffer = 20;        int gif_height_buffer = 20;        int gif_width_buffer = 20;        int text_width = 100;        int box_height = max + (box_height_buffer * 2);        int box_width = distance;        int gif_height = box_height + (gif_height_buffer * 2);        int gif_width = box_width + (gif_width_buffer * 2) + text_width;        AcmeGifFormatter formatter = new AcmeGifFormatter();        java.awt.Graphics graphics = formatter.getGraphics(gif_width,                gif_height);        Color gray10 = new Color(25, 25, 25);        Color gray50 = new Color(128, 128, 128);        Color gray75 = new Color(191, 191, 191);        Color gray90 = new Color(230, 230, 230);        Debug.message("terrain",                "ProfileGenerator gif creation: drawing boundaries");        /* Fill in the generic colors */        graphics.setColor(gray90);        graphics.fillRect(0, 0, gif_width, gif_height);        graphics.setColor(gray50);        graphics.fillRect(gif_width_buffer,                gif_height_buffer,                box_width,                box_height);        Debug.message("terrain", "ProfileGenerator gif creation: drawing edges");        // outside edge        graphics.setColor(Color.black);        graphics.drawRect(0, 0, gif_width - 1, gif_height - 1);        // inside edge        graphics.drawRect(gif_width_buffer,                gif_height_buffer,                box_width,                box_height);        graphics.setColor(Color.yellow);        // 0 height line        graphics.drawLine(gif_width_buffer + 1,                gif_height_buffer + box_height - box_height_buffer,                gif_width_buffer + box_width - 1,                gif_height_buffer + box_height - box_height_buffer);        // These are the horizontal reference lines in the image.        graphics.setColor(Color.black);        FontMetrics f = graphics.getFontMetrics();        Debug.message("terrain",                "ProfileGenerator gif creation: drawing level lines");        for (int i = 1; i < 9; i++) {            graphics.drawLine(gif_width_buffer, gif_height_buffer + box_height                    - box_height_buffer - (max * i / 8), gif_width_buffer                    + box_width + 5, gif_height_buffer + box_height                    - box_height_buffer - (max * i / 8));            int meters = max * i / 8;            int feet = (int) (meters * 3.2);            String lineLabel = meters + "m / " + feet + "ft";            byte[] lineLabelBytes = lineLabel.getBytes();            graphics.drawString(lineLabel,                    gif_width_buffer + box_width + 10,                    gif_height_buffer + box_height - box_height_buffer                            - (max * i / 8) + (f.getAscent() / 2));        }        int last_x = gif_width_buffer + 1;        int last_height = gif_height_buffer + box_height - box_height_buffer                - post_height[0];        int total_distance = 0;        Debug.message("terrain",                "ProfileGenerator gif creation: drawing profile");        graphics.setColor(Color.red);        for (int i = 1; i < post_height.length; i++) {            graphics.drawLine(gif_width_buffer + total_distance,                    gif_height_buffer + box_height - box_height_buffer                            - post_height[i - 1],                    gif_width_buffer + post_dist[i] + total_distance,                    gif_height_buffer + box_height - box_height_buffer                            - post_height[i]);            total_distance += post_dist[i];        }        javax.swing.ImageIcon ii = new javax.swing.ImageIcon(formatter.getBufferedImage());        javax.swing.JFrame jf = com.bbn.openmap.util.PaletteHelper.getPaletteWindow(new javax.swing.JLabel(ii),                "Path Profile",                (ComponentListener) null);        jf.show();        //      byte[] imageBytes = formatter.getImageBytes();        //      String tmppath = null;        //      try {        //          String tmpDir = Environment.get(Environment.TmpDir);        //          if (tmpDir != null) {        //              tmppath = tmpDir + File.separator + "openmap-" +        //                  Environment.timestamp() + ".gif";        //              FileOutputStream fs = new FileOutputStream(tmppath);        //              fs.write(imageBytes);        //              fs.close(); // close the streams        //              String url = "file://" + tmppath;        //              layer.fireRequestURL(url);        //          } else {        //              Debug.error("ProfileGenerator: can't create image file,        // because the openmap.TempDirectory was not set.");        //          }        //      } catch (IOException e) {        //          Debug.error("ProfileGenerator: Cannot write to temp file:"        // +        //                      Environment.get("line.separator") +        //                      "\"" + tmppath + "\"");        //      }        //      String imageString = new String(imageBytes);        //      layer.fireRequestBrowserContent(imageString);    }