Changeset 635 in josm for trunk/src/org
- Timestamp:
- 2008-05-12T16:53:28+02:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapView.java
r627 r635 7 7 import java.awt.Color; 8 8 import java.awt.Graphics; 9 import java.awt.Graphics2D; 9 10 import java.awt.Point; 11 import java.awt.Transparency; 10 12 import java.awt.event.ComponentAdapter; 11 13 import java.awt.event.ComponentEvent; 12 14 import java.awt.event.KeyEvent; 15 import java.awt.image.BufferedImage; 13 16 import java.util.ArrayList; 14 17 import java.util.Collection; … … 199 202 if (center == null) 200 203 return; // no data loaded yet. 201 g.setColor(Preferences.getPreferencesColor("background", Color.BLACK)); 202 g.fillRect(0, 0, getWidth(), getHeight()); 204 205 BufferedImage bim = new BufferedImage(getWidth(), getHeight(), Transparency.OPAQUE); 206 Graphics2D tempG = bim.createGraphics(); 207 tempG.setColor(Preferences.getPreferencesColor("background", Color.BLACK)); 208 tempG.fillRect(0, 0, getWidth(), getHeight()); 203 209 204 210 for (int i = layers.size()-1; i >= 0; --i) { 205 211 Layer l = layers.get(i); 206 212 if (l.visible && l != getActiveLayer()) 207 l.paint( g, this);213 l.paint(tempG, this); 208 214 } 209 215 210 216 if (getActiveLayer() != null && getActiveLayer().visible) 211 getActiveLayer().paint( g, this);217 getActiveLayer().paint(tempG, this); 212 218 213 219 for (MapViewPaintable mvp : temporaryLayers) { 214 mvp.paint( g, this);220 mvp.paint(tempG, this); 215 221 } 216 222 217 223 // draw world borders 218 g.setColor(Color.WHITE);224 tempG.setColor(Color.WHITE); 219 225 Bounds b = new Bounds(); 220 226 Point min = getPoint(getProjection().latlon2eastNorth(b.min)); … … 225 231 int y2 = Math.max(min.y, max.y); 226 232 if (x1 > 0 || y1 > 0 || x2 < getWidth() || y2 < getHeight()) 227 g.drawRect(x1, y1, x2-x1+1, y2-y1+1);233 tempG.drawRect(x1, y1, x2-x1+1, y2-y1+1); 228 234 229 235 if (playHeadMarker != null) 230 playHeadMarker.paint(g, this); 231 236 playHeadMarker.paint(tempG, this); 237 238 g.drawImage(bim, 0, 0, null); 232 239 super.paint(g); 233 240 }
Note:
See TracChangeset
for help on using the changeset viewer.