mirror of
https://github.com/robertvokac/time-calc.git
synced 2025-03-25 07:27:49 +01:00
Added several improvements XXXVI
This commit is contained in:
parent
54cdb97757
commit
0d3f06854c
@ -17,8 +17,13 @@ public class ProgressSquare extends JPanel {
|
|||||||
private int side = 0;
|
private int side = 0;
|
||||||
private int square;
|
private int square;
|
||||||
private double donePercent = 0;
|
private double donePercent = 0;
|
||||||
|
|
||||||
private boolean highlight = false;
|
private boolean highlight = false;
|
||||||
|
|
||||||
|
public void setHighlight(boolean highlight) {
|
||||||
|
this.highlight = highlight;
|
||||||
|
}
|
||||||
|
|
||||||
public ProgressSquare() {
|
public ProgressSquare() {
|
||||||
setPreferredSize(new Dimension(400, 400));
|
setPreferredSize(new Dimension(400, 400));
|
||||||
setBackground(BACKGROUND_COLOR);
|
setBackground(BACKGROUND_COLOR);
|
||||||
@ -57,10 +62,6 @@ public class ProgressSquare extends JPanel {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void paintComponent(Graphics g) {
|
public void paintComponent(Graphics g) {
|
||||||
|
|
||||||
if(donePercent >= 0.99) {
|
|
||||||
highlight = true;
|
|
||||||
}
|
|
||||||
if (side == 0) {
|
if (side == 0) {
|
||||||
this.side = Math.min(getWidth(), getHeight());
|
this.side = Math.min(getWidth(), getHeight());
|
||||||
this.square = side * side;
|
this.square = side * side;
|
||||||
|
@ -188,6 +188,7 @@ public class TimeCalcWindow {
|
|||||||
}
|
}
|
||||||
if (hourRemains == 0 && minuteRemains <= 3) {
|
if (hourRemains == 0 && minuteRemains <= 3) {
|
||||||
analogClock.setHighlight(true);
|
analogClock.setHighlight(true);
|
||||||
|
progressSquare.setHighlight(true);
|
||||||
text.setForeground(Color.BLUE);
|
text.setForeground(Color.BLUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user