root/trunk/BackgroundMap.java

Revision 3, 1.2 kB (checked in by dpaola2, 1 month ago)

old pathways project added

Line 
1 /**
2  * BackgroundMap.java
3  *
4  * This abstract class represents a map, which is essentially a background image
5  * drawn behind Nodes and Edges on the JGraphViewer.  It knows how to paint
6  * itself onto a Graphics2D, and that's about it.
7  *
8  */
9
10 import java.awt.*;
11 import java.awt.geom.*;
12 import java.awt.image.*;
13 import java.io.*;
14
15 public abstract class BackgroundMap implements Serializable {
16         static final long serialVersionUID = -687681269250506246L;
17
18         /**
19          * Paints the map onto the given Graphics2D object, using realToScreen
20          * to transform the real coordinates the map knows about to screen
21          * coordinates it uses to draw on the Graphics2D.  observer should be
22          * the component being painted on, in which case that component will
23          * be repainted as more of the images load.
24          */
25         public abstract void paint(Graphics2D g, AffineTransform realToScreen, ImageObserver observer);
26
27         public abstract Rectangle2D getRealBoundingRectangle();
28
29         /// Returns the "ideal" scale in pixels per meter
30         public abstract double getPixelForPixelScale();
31
32         public void setDescription(String desc) { description = desc; }
33         public String getDescription() { return description; }
34         private String description = "";
35 }
Note: See TracBrowser for help on using the browser.