@@ -75,12 +75,13 @@ private class GraphPanel extends JPanel {
75
75
private Rectangle bounds ;
76
76
private int xOffset , xPadding ;
77
77
private final Font font ;
78
- private final Color bgColor ;
79
- private final Color gridColor = new Color (245 , 245 , 245 , 245 );
78
+ private final Color bgColor , gridColor , boundsColor ;
80
79
81
80
public GraphPanel () {
82
81
font = Theme .getFont ("console.font" );
83
82
bgColor = Theme .getColor ("plotting.bgcolor" );
83
+ gridColor = Theme .getColor ("plotting.gridcolor" );
84
+ boundsColor = Theme .getColor ("plotting.boundscolor" );
84
85
xOffset = 20 ;
85
86
xPadding = 20 ;
86
87
}
@@ -134,7 +135,7 @@ public void paintComponent(Graphics g1) {
134
135
Rectangle2D fRect = fm .getStringBounds (String .valueOf (tick ), g );
135
136
xOffset = Math .max (xOffset , (int ) fRect .getWidth () + 15 );
136
137
137
- g .setColor (Color . BLACK );
138
+ g .setColor (boundsColor );
138
139
// draw tick
139
140
g .drawLine (xOffset - 5 , (int ) transformY (tick ), xOffset + 2 , (int ) transformY (tick ));
140
141
// draw tick label
@@ -144,8 +145,6 @@ public void paintComponent(Graphics g1) {
144
145
g .drawLine (xOffset + 3 , (int ) transformY (tick ), bounds .width - xPadding , (int ) transformY (tick ));
145
146
}
146
147
147
- //g.drawLine(bounds.x + xOffset, bounds.y + 5, bounds.x + xOffset, bounds.y + bounds.height - 10);
148
-
149
148
// handle data count
150
149
int cnt = xCount - BUFFER_CAPACITY ;
151
150
if (xCount < BUFFER_CAPACITY ) cnt = 0 ;
@@ -170,15 +169,15 @@ public void paintComponent(Graphics g1) {
170
169
sWidth = (int )fBounds .getWidth ()/2 ;
171
170
xValue = (int )((bounds .width - xOffset - xPadding ) * ((xTickRange * i ) / BUFFER_CAPACITY ) + xOffset );
172
171
}
173
- // draw graph x axis ticks and labels
174
- g .setColor (Color . BLACK );
172
+ // draw graph x axis, ticks and labels
173
+ g .setColor (boundsColor );
175
174
g .drawString (s , xValue - sWidth , (int ) bounds .y + (int ) transformY (zeroTick ) + 15 );
176
175
g .drawLine (xValue , (int )transformY (zeroTick ) - 2 , xValue , bounds .y + (int )transformY (zeroTick ) + 5 );
177
176
// draw vertical grid lines
178
177
g .setColor (gridColor );
179
178
g .drawLine (xValue , (int )transformY (zeroTick ) - 3 , xValue , bounds .y + (int )transformY (lastTick ));
180
179
}
181
- g .setColor (Color . BLACK );
180
+ g .setColor (boundsColor );
182
181
// draw major y axis
183
182
g .drawLine (bounds .x + xOffset , (int ) transformY (lastTick ) - 5 , bounds .x + xOffset , bounds .y + (int ) transformY (zeroTick ) + 5 );
184
183
// draw major x axis
0 commit comments