Added several improvements XXVII
This commit is contained in:
parent
dc81835b94
commit
b21e90fca1
@ -62,7 +62,7 @@ public class AnalogClock extends JPanel {
|
||||
int endX = (int) (getWidth() / 2 + length * Math.cos(angle));
|
||||
int endY = (int) (getHeight() / 2 + length * Math.sin(angle));
|
||||
|
||||
g2d.setColor(highlight ? Color.BLUE : FOREGROUND_COLOR);
|
||||
g2d.setColor(highlight ? color : FOREGROUND_COLOR);
|
||||
g2d.setStroke(new BasicStroke(stroke));
|
||||
g2d.drawLine(getWidth() / 2, getHeight() / 2, endX, endY);
|
||||
}
|
||||
@ -70,7 +70,7 @@ public class AnalogClock extends JPanel {
|
||||
private void drawClockFace(Graphics2D g2d, int centerX, int centerY,
|
||||
int radius) {
|
||||
g2d.setStroke(new BasicStroke(2.0f));
|
||||
g2d.setColor(highlight ? Color.BLUE : FOREGROUND_COLOR);
|
||||
g2d.setColor(highlight ? Color.BLACK : FOREGROUND_COLOR);
|
||||
// System.out.println("centerX=" + centerX);
|
||||
// System.out.println("centerY=" + centerY);
|
||||
// System.out.println("radius=" + radius);
|
||||
|
@ -43,15 +43,14 @@ public class ProgressSquare extends JPanel {
|
||||
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
|
||||
RenderingHints.VALUE_ANTIALIAS_ON);
|
||||
|
||||
|
||||
System.out.println("square=" + square);
|
||||
// System.out.println("square=" + square);
|
||||
int dotNumber = (int)(donePercent * square);
|
||||
int y = dotNumber / side;
|
||||
int x = dotNumber - y * side;
|
||||
|
||||
System.out.println("dotNumber=" + dotNumber);
|
||||
System.out.println("x=" + x);
|
||||
System.out.println("y=" + y);
|
||||
// System.out.println("dotNumber=" + dotNumber);
|
||||
// System.out.println("x=" + x);
|
||||
// System.out.println("y=" + y);
|
||||
if(y > 1) {
|
||||
g2d.fillRect(side - 4, side - 4, 4, 4);
|
||||
g2d.fillRect(1, side - 4, 4, 4);
|
||||
|
Loading…
x
Reference in New Issue
Block a user