Added ProgressRotation II

This commit is contained in:
Robert Vokac 2024-04-18 17:32:42 +02:00
parent e74f63b6b5
commit 39ee336b4e
No known key found for this signature in database
GPG Key ID: 693D30BEE3329055
6 changed files with 27 additions and 5 deletions

View File

@ -199,6 +199,12 @@ public class TimeCalcConfiguration {
= new StringProperty(TimeCalcProperty.FUEL_TYPE.getKey());
public final BooleanProperty fuelIconVisibleProperty
= new BooleanProperty(TimeCalcProperty.FUEL_ICON_VISIBLE.getKey());
public final BooleanProperty rotationVisibleProperty
= new BooleanProperty(TimeCalcProperty.ROTATION_VISIBLE.getKey());
public final BooleanProperty rotationHiddenProperty
= new BooleanProperty(TimeCalcProperty.ROTATION_HIDDEN.getKey());
public final StringProperty rotationTypeProperty
= new StringProperty(TimeCalcProperty.ROTATION_TYPE.getKey());
public final BooleanProperty circleVisibleProperty
= new BooleanProperty(TimeCalcProperty.CIRCLE_VISIBLE.getKey());
public final BooleanProperty circleHiddenProperty
@ -333,6 +339,7 @@ public class TimeCalcConfiguration {
dotVisibleProperty,dotTypeProperty,
fuelVisibleProperty, fuelTypeProperty, fuelHiddenProperty,
fuelIconVisibleProperty,
rotationVisibleProperty, rotationTypeProperty, rotationHiddenProperty,
swingVisibleProperty,
swingTypeProperty,
swingQuarterIconVisibleProperty,

View File

@ -95,6 +95,9 @@ public enum TimeCalcProperty {
FUEL_VISIBLE("fuel.visible", "Fuel"),
FUEL_TYPE("fuel.type", "Fuel : Type"),
FUEL_HIDDEN("fuel.hidden", "Fuel : Hidden"),
ROTATION_VISIBLE("rotation.visible", "Rotation"),
ROTATION_TYPE("rotation.type", "Rotation : Type"),
ROTATION_HIDDEN("rotation.hidden", "Rotation : Hidden"),
FUEL_ICON_VISIBLE("fuel.icon.visible", "Fuel : Icon"),
CIRCLE_VISIBLE("circle.visible", "Circle"),
CIRCLE_TYPE("circle.type", "Circle : Type"),

View File

@ -113,7 +113,7 @@ public class ProgressRotation extends Widget {
//
angle = angle + 0.001d * donePercent() * 50d;
if(angle > 1.0d) {
angle = 0.0d;
angle = angle - 1.0d;
}
drawHand(brush, side / 2 - 10, angle, 1.0f,

View File

@ -244,6 +244,13 @@ public class ConfigWindow extends TWindow {
private final JCheckBox fuelIconVisibleProperty
= new JCheckBox(TimeCalcProperty.FUEL_ICON_VISIBLE.getKey());
//
private final JCheckBox rotationVisibleProperty
= new JCheckBox(TimeCalcProperty.ROTATION_VISIBLE.getKey());
private final JTextField rotationTypeProperty =
new JTextField(TimeCalcProperty.ROTATION_TYPE.getKey());
private final JCheckBox rotationHiddenProperty
= new JCheckBox(TimeCalcProperty.ROTATION_HIDDEN.getKey());
//
public final JCheckBox clockHiddenProperty
= new JCheckBox(TimeCalcProperty.CLOCK_HIDDEN.getKey());
public final JCheckBox batteryMinuteHiddenProperty
@ -467,6 +474,7 @@ public class ConfigWindow extends TWindow {
walkingHumanVisibleProperty.setSelected(enable);
fuelVisibleProperty.setSelected(enable);
fuelIconVisibleProperty.setSelected(enable);
rotationVisibleProperty.setSelected(enable);
typeVisibleProperty.setSelected(enable);
// clockHiddenProperty.setSelected(!enable);
// batteryMinuteHiddenProperty.setSelected(!enable);
@ -554,6 +562,7 @@ public class ConfigWindow extends TWindow {
circleVisibleProperty,circleHiddenProperty,circleTypeProperty,
dotVisibleProperty,dotHiddenProperty,dotTypeProperty,
fuelVisibleProperty,fuelTypeProperty,fuelHiddenProperty,fuelIconVisibleProperty,
rotationVisibleProperty, rotationTypeProperty, rotationHiddenProperty,
swingVisibleProperty,swingHiddenProperty,swingTypeProperty,swingQuarterIconVisibleProperty,
walkingHumanVisibleProperty,walkingHumanHiddenProperty,walkingHumanTypeProperty,
lifeVisibleProperty,lifeHiddenProperty,lifeTypeProperty,lifeBirthDateProperty,
@ -970,7 +979,7 @@ public class ConfigWindow extends TWindow {
index = 5;
}
if (key.startsWith("square.")||key.startsWith("circle.")||key.startsWith("dot.")||key.startsWith("swing.")||key.startsWith("walking-human.") || key.startsWith("fuel.")) {
if (key.startsWith("square.")||key.startsWith("circle.")||key.startsWith("dot.")||key.startsWith("swing.")||key.startsWith("walking-human.") || key.startsWith("fuel.") || key.startsWith("rotation.")) {
index = 6;
}

View File

@ -443,11 +443,11 @@ public class MainWindow extends TWindow {
100, 100);
progressRotation.visibleProperty
.bindTo(timeCalcConfiguration.fuelVisibleProperty);
.bindTo(timeCalcConfiguration.rotationVisibleProperty);
progressRotation.typeProperty
.bindTo(timeCalcConfiguration.fuelTypeProperty);
.bindTo(timeCalcConfiguration.rotationTypeProperty);
progressRotation.hiddenProperty
.bindTo(timeCalcConfiguration.fuelHiddenProperty);
.bindTo(timeCalcConfiguration.rotationHiddenProperty);
add(progressRotation);
//

View File

@ -65,6 +65,9 @@ fuel.visible=true
fuel.type=day
fuel.hidden=false
fuel.icon.visible=true
rotation.visible=true
rotation.type=day
rotation.hidden=false
swing.visible=true
swing.type=day
swing.hidden=false