Browse Source

Update color for BasicDrawing.

Holt59 6 years ago
parent
commit
ca9a00ea97

+ 1
- 1
src/main/org/insa/graphics/drawing/BasicGraphPalette.java View File

@@ -10,7 +10,7 @@ public class BasicGraphPalette implements GraphPalette {
10 10
     // Color types for arc.
11 11
     private static final Color MOTORWAY_COLOR = Color.RED;
12 12
     private static final Color BIG_ROAD_COLOR = new Color(255, 105, 0);
13
-    private static final Color SMALL_ROAD_COLOR = new Color(255, 234, 0);
13
+    private static final Color SMALL_ROAD_COLOR = new Color(255, 200, 0);
14 14
     private static final Color COASTLINE_COLOR = Color.BLUE;
15 15
 
16 16
     @Override

+ 4
- 2
src/main/org/insa/graphics/drawing/components/BasicDrawing.java View File

@@ -321,6 +321,7 @@ public class BasicDrawing extends JPanel implements Drawing {
321 321
      */
322 322
     public BasicDrawing() {
323 323
         setLayout(null);
324
+        this.setBackground(new Color(240, 240, 240));
324 325
         this.zoomAndPanListener = new ZoomAndPanListener(this,
325 326
                 ZoomAndPanListener.DEFAULT_MIN_ZOOM_LEVEL, 20, 1.2);
326 327
 
@@ -370,7 +371,8 @@ public class BasicDrawing extends JPanel implements Drawing {
370 371
         super.paintComponent(g1);
371 372
         Graphics2D g = (Graphics2D) g1;
372 373
         AffineTransform sTransform = g.getTransform();
373
-        g.clearRect(0, 0, getWidth(), getHeight());
374
+        g.setColor(this.getBackground());
375
+        g.fillRect(0, 0, getWidth(), getHeight());
374 376
         g.setTransform(zoomAndPanListener.getCoordTransform());
375 377
 
376 378
         if (graphImage != null) {
@@ -573,7 +575,7 @@ public class BasicDrawing extends JPanel implements Drawing {
573 575
                 BufferedImage.TYPE_3BYTE_BGR);
574 576
         this.graphImage = img;
575 577
         this.graphGraphics = img.createGraphics();
576
-        this.graphGraphics.setBackground(Color.WHITE);
578
+        this.graphGraphics.setBackground(this.getBackground());
577 579
         this.graphGraphics.clearRect(0, 0, this.width, this.height);
578 580
 
579 581
         // Set the zoom and pan listener

Loading…
Cancel
Save