+
+ if (line != null) {
+ g2d.setColor(Color.BLUE);
+ g2d.draw(line);
+
+ String message = line_dist();
+ g2d.setFont(font);
+ g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+ Rectangle2D bounds;
+ bounds = font.getStringBounds(message, g2d.getFontRenderContext());
+
+ float x = (float) line.x1;
+ float y = (float) line.y1 + (float) bounds.getHeight() / 2.0f;
+
+ if (line.x1 < line.x2) {
+ x -= (float) bounds.getWidth() + 2.0f;
+ } else {
+ x += 2.0f;
+ }
+ g2d.drawString(message, x, y);
+ }
+ }
+
+ public void paint(Graphics g) {
+ Graphics2D g2d = (Graphics2D) g;
+ Image image = null;
+ boolean queued = false;
+
+ AltosSiteMap.debug_component(this, "paint");
+
+ ++painting_serial;
+
+ if (file != null) {
+ AltosSiteMapImage aimage;
+
+ aimage = AltosSiteMapCache.get_image(this, file, px_size, px_size);
+ if (aimage != null) {
+ if (aimage.validate(painting_serial))
+ image = aimage.image;
+ else
+ queued = true;
+ }
+ }
+ if (!queued)
+ paint_graphics(g2d, image, painting_serial);