Update color for BasicDrawing.
This commit is contained in:
parent
f3964f1958
commit
ca9a00ea97
@ -10,7 +10,7 @@ public class BasicGraphPalette implements GraphPalette {
|
|||||||
// Color types for arc.
|
// Color types for arc.
|
||||||
private static final Color MOTORWAY_COLOR = Color.RED;
|
private static final Color MOTORWAY_COLOR = Color.RED;
|
||||||
private static final Color BIG_ROAD_COLOR = new Color(255, 105, 0);
|
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;
|
private static final Color COASTLINE_COLOR = Color.BLUE;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -321,6 +321,7 @@ public class BasicDrawing extends JPanel implements Drawing {
|
|||||||
*/
|
*/
|
||||||
public BasicDrawing() {
|
public BasicDrawing() {
|
||||||
setLayout(null);
|
setLayout(null);
|
||||||
|
this.setBackground(new Color(240, 240, 240));
|
||||||
this.zoomAndPanListener = new ZoomAndPanListener(this,
|
this.zoomAndPanListener = new ZoomAndPanListener(this,
|
||||||
ZoomAndPanListener.DEFAULT_MIN_ZOOM_LEVEL, 20, 1.2);
|
ZoomAndPanListener.DEFAULT_MIN_ZOOM_LEVEL, 20, 1.2);
|
||||||
|
|
||||||
@ -370,7 +371,8 @@ public class BasicDrawing extends JPanel implements Drawing {
|
|||||||
super.paintComponent(g1);
|
super.paintComponent(g1);
|
||||||
Graphics2D g = (Graphics2D) g1;
|
Graphics2D g = (Graphics2D) g1;
|
||||||
AffineTransform sTransform = g.getTransform();
|
AffineTransform sTransform = g.getTransform();
|
||||||
g.clearRect(0, 0, getWidth(), getHeight());
|
g.setColor(this.getBackground());
|
||||||
|
g.fillRect(0, 0, getWidth(), getHeight());
|
||||||
g.setTransform(zoomAndPanListener.getCoordTransform());
|
g.setTransform(zoomAndPanListener.getCoordTransform());
|
||||||
|
|
||||||
if (graphImage != null) {
|
if (graphImage != null) {
|
||||||
@ -573,7 +575,7 @@ public class BasicDrawing extends JPanel implements Drawing {
|
|||||||
BufferedImage.TYPE_3BYTE_BGR);
|
BufferedImage.TYPE_3BYTE_BGR);
|
||||||
this.graphImage = img;
|
this.graphImage = img;
|
||||||
this.graphGraphics = img.createGraphics();
|
this.graphGraphics = img.createGraphics();
|
||||||
this.graphGraphics.setBackground(Color.WHITE);
|
this.graphGraphics.setBackground(this.getBackground());
|
||||||
this.graphGraphics.clearRect(0, 0, this.width, this.height);
|
this.graphGraphics.clearRect(0, 0, this.width, this.height);
|
||||||
|
|
||||||
// Set the zoom and pan listener
|
// Set the zoom and pan listener
|
||||||
|
Loading…
Reference in New Issue
Block a user