From ca9a00ea97afb0494030515b1cf8cbc34df4032b Mon Sep 17 00:00:00 2001 From: Holt59 Date: Sun, 11 Mar 2018 16:15:30 +0100 Subject: [PATCH] Update color for BasicDrawing. --- src/main/org/insa/graphics/drawing/BasicGraphPalette.java | 2 +- .../org/insa/graphics/drawing/components/BasicDrawing.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/org/insa/graphics/drawing/BasicGraphPalette.java b/src/main/org/insa/graphics/drawing/BasicGraphPalette.java index 8feb2a7..ffe47d3 100644 --- a/src/main/org/insa/graphics/drawing/BasicGraphPalette.java +++ b/src/main/org/insa/graphics/drawing/BasicGraphPalette.java @@ -10,7 +10,7 @@ public class BasicGraphPalette implements GraphPalette { // Color types for arc. private static final Color MOTORWAY_COLOR = Color.RED; private static final Color BIG_ROAD_COLOR = new Color(255, 105, 0); - private static final Color SMALL_ROAD_COLOR = new Color(255, 234, 0); + private static final Color SMALL_ROAD_COLOR = new Color(255, 200, 0); private static final Color COASTLINE_COLOR = Color.BLUE; @Override diff --git a/src/main/org/insa/graphics/drawing/components/BasicDrawing.java b/src/main/org/insa/graphics/drawing/components/BasicDrawing.java index a182bba..b572112 100644 --- a/src/main/org/insa/graphics/drawing/components/BasicDrawing.java +++ b/src/main/org/insa/graphics/drawing/components/BasicDrawing.java @@ -321,6 +321,7 @@ public class BasicDrawing extends JPanel implements Drawing { */ public BasicDrawing() { setLayout(null); + this.setBackground(new Color(240, 240, 240)); this.zoomAndPanListener = new ZoomAndPanListener(this, ZoomAndPanListener.DEFAULT_MIN_ZOOM_LEVEL, 20, 1.2); @@ -370,7 +371,8 @@ public class BasicDrawing extends JPanel implements Drawing { super.paintComponent(g1); Graphics2D g = (Graphics2D) g1; AffineTransform sTransform = g.getTransform(); - g.clearRect(0, 0, getWidth(), getHeight()); + g.setColor(this.getBackground()); + g.fillRect(0, 0, getWidth(), getHeight()); g.setTransform(zoomAndPanListener.getCoordTransform()); if (graphImage != null) { @@ -573,7 +575,7 @@ public class BasicDrawing extends JPanel implements Drawing { BufferedImage.TYPE_3BYTE_BGR); this.graphImage = img; this.graphGraphics = img.createGraphics(); - this.graphGraphics.setBackground(Color.WHITE); + this.graphGraphics.setBackground(this.getBackground()); this.graphGraphics.clearRect(0, 0, this.width, this.height); // Set the zoom and pan listener