mirror of
https://github.com/robertvokac/time-calc.git
synced 2025-03-25 07:27:49 +01:00
Added new improvements
This commit is contained in:
parent
f456d2195b
commit
1305038e0f
@ -359,7 +359,7 @@ public class TimeCalcManager {
|
|||||||
// } );
|
// } );
|
||||||
window.setSize(520 + 20 + 100, exitButton.getY() + 3 * exitButton.getHeight() + MARGIN);
|
window.setSize(520 + 20 + 100, exitButton.getY() + 3 * exitButton.getHeight() + MARGIN);
|
||||||
while (true) {
|
while (true) {
|
||||||
time.writeString();
|
//time.writeString();
|
||||||
if(Math.random() > 0.95) {
|
if(Math.random() > 0.95) {
|
||||||
window.requestFocus();
|
window.requestFocus();
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,8 @@ import java.util.GregorianCalendar;
|
|||||||
//https://kodejava.org/how-do-i-write-a-simple-analog-clock-using-java-2d/
|
//https://kodejava.org/how-do-i-write-a-simple-analog-clock-using-java-2d/
|
||||||
public class AnalogClock extends Widget {
|
public class AnalogClock extends Widget {
|
||||||
|
|
||||||
|
public static final Color COLOR_FOR_MILLISECOND_HAND_STRONGLY_COLORED = new Color(246,
|
||||||
|
152, 51);
|
||||||
private TimeHM startTime;
|
private TimeHM startTime;
|
||||||
private TimeHM endTime;
|
private TimeHM endTime;
|
||||||
private int startAngle;
|
private int startAngle;
|
||||||
@ -86,6 +88,7 @@ public class AnalogClock extends Widget {
|
|||||||
int centerY = getHeight() / 2;
|
int centerY = getHeight() / 2;
|
||||||
|
|
||||||
GregorianCalendar time = new GregorianCalendar();
|
GregorianCalendar time = new GregorianCalendar();
|
||||||
|
int millisecond = time.get(Calendar.MILLISECOND);
|
||||||
int second = time.get(Calendar.SECOND);
|
int second = time.get(Calendar.SECOND);
|
||||||
int minute = time.get(Calendar.MINUTE);
|
int minute = time.get(Calendar.MINUTE);
|
||||||
int hour = time.get(Calendar.HOUR_OF_DAY);
|
int hour = time.get(Calendar.HOUR_OF_DAY);
|
||||||
@ -107,6 +110,17 @@ public class AnalogClock extends Widget {
|
|||||||
// Draw clock numbers and circle
|
// Draw clock numbers and circle
|
||||||
drawClockFace(g2d, centerX, centerY, side / 2 - 40, visibility);
|
drawClockFace(g2d, centerX, centerY, side / 2 - 40, visibility);
|
||||||
|
|
||||||
|
System.out.println("millisecond=" + millisecond);
|
||||||
|
//
|
||||||
|
drawHand(g2d, side / 2 - 10, millisecond / 1000.0, 1.0f,
|
||||||
|
COLOR_FOR_MILLISECOND_HAND_STRONGLY_COLORED, visibility);
|
||||||
|
|
||||||
|
if (TimeCalcConf.getInstance().areClockHandsLong()) {
|
||||||
|
drawHand(g2d, (side / 2 - 10) / 4,
|
||||||
|
(millisecond > 500 ? millisecond - 500 : millisecond + 500) / 1000.0, 1.0f,
|
||||||
|
COLOR_FOR_MILLISECOND_HAND_STRONGLY_COLORED, visibility);
|
||||||
|
}
|
||||||
|
//
|
||||||
drawHand(g2d, side / 2 - 10, second / 60.0, 0.5f, Color.RED, visibility);
|
drawHand(g2d, side / 2 - 10, second / 60.0, 0.5f, Color.RED, visibility);
|
||||||
|
|
||||||
if (TimeCalcConf.getInstance().areClockHandsLong()) {
|
if (TimeCalcConf.getInstance().areClockHandsLong()) {
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
clock.colorful=false
|
|
||||||
clock.hands.long=true
|
clock.hands.long=true
|
||||||
|
clock.hands.second.enabled=true
|
||||||
|
clock.hands.millisecond.enabled=false
|
||||||
jokes.visible=true
|
jokes.visible=true
|
||||||
battery.waves.enabled=true
|
battery.waves.enabled=true
|
||||||
everything-hidden=false
|
default-visibility=STRONGLY_COLORED
|
||||||
default-visibility=STRONGLY_COLORED
|
visibility.only-grey-or-none.enabled=false
|
||||||
|
jokes.enabled=true
|
||||||
|
commands.enabled=true
|
Loading…
x
Reference in New Issue
Block a user