mirror of
https://github.com/robertvokac/time-calc.git
synced 2025-03-25 07:27:49 +01:00
patch8
This commit is contained in:
parent
d21ec2f0e8
commit
4d6dbd3285
@ -78,6 +78,14 @@ public class TimeCalcConfiguration {
|
|||||||
= new BooleanProperty(
|
= new BooleanProperty(
|
||||||
TimeCalcProperty.CLOCK_DATE_VISIBLE_ONLY_IF_MOUSE_MOVING_OVER
|
TimeCalcProperty.CLOCK_DATE_VISIBLE_ONLY_IF_MOUSE_MOVING_OVER
|
||||||
.getKey());
|
.getKey());
|
||||||
|
public final BooleanProperty clockSmileyVisibleProperty
|
||||||
|
= new BooleanProperty(
|
||||||
|
TimeCalcProperty.CLOCK_SMILEY_VISIBLE
|
||||||
|
.getKey());
|
||||||
|
public final BooleanProperty clockPercentProgressVisibleProperty
|
||||||
|
= new BooleanProperty(
|
||||||
|
TimeCalcProperty.CLOCK_PERCENT_PROGRESS_VISIBLE
|
||||||
|
.getKey());
|
||||||
//
|
//
|
||||||
public final BooleanProperty batteryWavesVisibleProperty
|
public final BooleanProperty batteryWavesVisibleProperty
|
||||||
= new BooleanProperty(TimeCalcProperty.BATTERY_WAVES_VISIBLE
|
= new BooleanProperty(TimeCalcProperty.BATTERY_WAVES_VISIBLE
|
||||||
@ -201,6 +209,8 @@ public class TimeCalcConfiguration {
|
|||||||
clockCentreCircleBlackProperty,
|
clockCentreCircleBlackProperty,
|
||||||
clockProgressVisibleOnlyIfMouseMovingOverProperty,
|
clockProgressVisibleOnlyIfMouseMovingOverProperty,
|
||||||
clockDateVisibleOnlyIfMouseMovingOverProperty,
|
clockDateVisibleOnlyIfMouseMovingOverProperty,
|
||||||
|
clockSmileyVisibleProperty,
|
||||||
|
clockPercentProgressVisibleProperty,
|
||||||
batteryWavesVisibleProperty,
|
batteryWavesVisibleProperty,
|
||||||
batteryCircleProgressProperty,
|
batteryCircleProgressProperty,
|
||||||
batteryPercentProgressProperty,
|
batteryPercentProgressProperty,
|
||||||
|
@ -45,6 +45,8 @@ public enum TimeCalcProperty {
|
|||||||
CLOCK_DATE_VISIBLE_ONLY_IF_MOUSE_MOVING_OVER(
|
CLOCK_DATE_VISIBLE_ONLY_IF_MOUSE_MOVING_OVER(
|
||||||
"clock.date.visible-only-if-mouse-moving-over",
|
"clock.date.visible-only-if-mouse-moving-over",
|
||||||
"Clock : Date visible only, if mouse moving over"),
|
"Clock : Date visible only, if mouse moving over"),
|
||||||
|
CLOCK_SMILEY_VISIBLE("clock.smiley.visible","Clock : Smiley : Visible"),
|
||||||
|
CLOCK_PERCENT_PROGRESS_VISIBLE("clock.percent-progress.visible","Clock : Percent progress : Visible"),
|
||||||
//
|
//
|
||||||
BATTERY_WAVES_VISIBLE("battery.waves.visible", "Battery : Waves"),
|
BATTERY_WAVES_VISIBLE("battery.waves.visible", "Battery : Waves"),
|
||||||
BATTERY_CIRCLE_PROGRESS_VISIBLE("battery.circle-progress.visible",
|
BATTERY_CIRCLE_PROGRESS_VISIBLE("battery.circle-progress.visible",
|
||||||
|
@ -258,6 +258,7 @@ public class Widget extends JPanel implements
|
|||||||
this.remove(smileyIcon);
|
this.remove(smileyIcon);
|
||||||
this.smileyIcon = null;
|
this.smileyIcon = null;
|
||||||
}
|
}
|
||||||
|
Color originalColor = brush.getColor();
|
||||||
if (!visibility.isStronglyColored()) {
|
if (!visibility.isStronglyColored()) {
|
||||||
brush.setColor(Color.GRAY);
|
brush.setColor(Color.GRAY);
|
||||||
}
|
}
|
||||||
@ -283,6 +284,7 @@ public class Widget extends JPanel implements
|
|||||||
x + 1, y + 16
|
x + 1, y + 16
|
||||||
);
|
);
|
||||||
brush.setFont(currentFont);
|
brush.setFont(currentFont);
|
||||||
|
brush.setColor(originalColor);
|
||||||
}
|
}
|
||||||
if (colored) {
|
if (colored) {
|
||||||
x = x + 2;
|
x = x + 2;
|
||||||
|
@ -5,6 +5,7 @@ import org.nanoboot.utils.timecalc.entity.Visibility;
|
|||||||
import org.nanoboot.utils.timecalc.swing.common.SwingUtils;
|
import org.nanoboot.utils.timecalc.swing.common.SwingUtils;
|
||||||
import org.nanoboot.utils.timecalc.swing.common.Widget;
|
import org.nanoboot.utils.timecalc.swing.common.Widget;
|
||||||
import org.nanoboot.utils.timecalc.utils.common.DateFormats;
|
import org.nanoboot.utils.timecalc.utils.common.DateFormats;
|
||||||
|
import org.nanoboot.utils.timecalc.utils.common.NumberFormats;
|
||||||
import org.nanoboot.utils.timecalc.utils.common.TTime;
|
import org.nanoboot.utils.timecalc.utils.common.TTime;
|
||||||
import org.nanoboot.utils.timecalc.utils.property.BooleanProperty;
|
import org.nanoboot.utils.timecalc.utils.property.BooleanProperty;
|
||||||
import org.nanoboot.utils.timecalc.utils.property.IntegerProperty;
|
import org.nanoboot.utils.timecalc.utils.property.IntegerProperty;
|
||||||
@ -92,6 +93,8 @@ public class AnalogClock extends Widget {
|
|||||||
= new BooleanProperty("handsLongProperty", true);
|
= new BooleanProperty("handsLongProperty", true);
|
||||||
public BooleanProperty handsColoredProperty
|
public BooleanProperty handsColoredProperty
|
||||||
= new BooleanProperty("handsColoredProperty", true);
|
= new BooleanProperty("handsColoredProperty", true);
|
||||||
|
public final BooleanProperty smileyVisibleProperty = new BooleanProperty("smileyVisibleProperty");
|
||||||
|
public final BooleanProperty percentProgressVisibleProperty = new BooleanProperty("percentProgressVisibleProperty");
|
||||||
private Color customCircleColor = null;
|
private Color customCircleColor = null;
|
||||||
|
|
||||||
public AnalogClock() {
|
public AnalogClock() {
|
||||||
@ -178,6 +181,7 @@ public class AnalogClock extends Widget {
|
|||||||
int total = endMS - startMS;
|
int total = endMS - startMS;
|
||||||
int done = nowMS - startMS;
|
int done = nowMS - startMS;
|
||||||
double progress = ((double)done) / ((double)total);
|
double progress = ((double)done) / ((double)total);
|
||||||
|
setDonePercent(progress);
|
||||||
|
|
||||||
//System.out.println("clock.handsLongProperty=" + handsLongProperty.isEnabled());
|
//System.out.println("clock.handsLongProperty=" + handsLongProperty.isEnabled());
|
||||||
Visibility visibility
|
Visibility visibility
|
||||||
@ -374,6 +378,18 @@ public class AnalogClock extends Widget {
|
|||||||
((int) (side * 0.25) + 30),
|
((int) (side * 0.25) + 30),
|
||||||
((int) (side * 0.35)) + 60);
|
((int) (side * 0.35)) + 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(percentProgressVisibleProperty.isEnabled()) {
|
||||||
|
brush.drawString(((int) Math.floor(donePercent * 100)) + "%",
|
||||||
|
((int) (side * 0.25)),
|
||||||
|
((int) (side * 0.35)) + 35);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(smileyVisibleProperty.isEnabled()) {
|
||||||
|
paintSmiley(visibility, brush, ((int) (side * 0.25) + 90),
|
||||||
|
((int) (side * 0.35)) + 20);
|
||||||
|
}
|
||||||
|
|
||||||
if (numbersVisibleProperty.isEnabled()) {
|
if (numbersVisibleProperty.isEnabled()) {
|
||||||
for (int i = 1; i <= 12; i++) {
|
for (int i = 1; i <= 12; i++) {
|
||||||
double angle = Math.PI * 2 * (i / 12.0 - 0.25);
|
double angle = Math.PI * 2 * (i / 12.0 - 0.25);
|
||||||
|
@ -109,6 +109,14 @@ public class ConfigWindow extends TWindow {
|
|||||||
= new JCheckBox(
|
= new JCheckBox(
|
||||||
TimeCalcProperty.CLOCK_DATE_VISIBLE_ONLY_IF_MOUSE_MOVING_OVER
|
TimeCalcProperty.CLOCK_DATE_VISIBLE_ONLY_IF_MOUSE_MOVING_OVER
|
||||||
.getKey());
|
.getKey());
|
||||||
|
private final JCheckBox clockSmileyVisibleProperty
|
||||||
|
= new JCheckBox(
|
||||||
|
TimeCalcProperty.CLOCK_SMILEY_VISIBLE
|
||||||
|
.getKey());
|
||||||
|
private final JCheckBox clockPercentProgressVisibleProperty
|
||||||
|
= new JCheckBox(
|
||||||
|
TimeCalcProperty.CLOCK_PERCENT_PROGRESS_VISIBLE
|
||||||
|
.getKey());
|
||||||
//
|
//
|
||||||
private final JCheckBox batteryWavesVisibleProperty
|
private final JCheckBox batteryWavesVisibleProperty
|
||||||
= new JCheckBox(TimeCalcProperty.BATTERY_WAVES_VISIBLE.getKey());
|
= new JCheckBox(TimeCalcProperty.BATTERY_WAVES_VISIBLE.getKey());
|
||||||
@ -298,6 +306,8 @@ public class ConfigWindow extends TWindow {
|
|||||||
.setSelected(!enable);
|
.setSelected(!enable);
|
||||||
clockDateVisibleOnlyIfMouseMovingOverProperty
|
clockDateVisibleOnlyIfMouseMovingOverProperty
|
||||||
.setSelected(false);
|
.setSelected(false);
|
||||||
|
clockSmileyVisibleProperty.setSelected(enable);
|
||||||
|
clockPercentProgressVisibleProperty.setSelected(enable);
|
||||||
batteryVisibleProperty.setSelected(true);
|
batteryVisibleProperty.setSelected(true);
|
||||||
batteryWavesVisibleProperty.setSelected(enable);
|
batteryWavesVisibleProperty.setSelected(enable);
|
||||||
batteryCircleProgressVisibleProperty.setSelected(enable);
|
batteryCircleProgressVisibleProperty.setSelected(enable);
|
||||||
@ -345,6 +355,8 @@ public class ConfigWindow extends TWindow {
|
|||||||
clockCentreCircleBlackProperty,
|
clockCentreCircleBlackProperty,
|
||||||
clockProgressVisibleOnlyIfMouseMovingOverProperty,
|
clockProgressVisibleOnlyIfMouseMovingOverProperty,
|
||||||
clockDateVisibleOnlyIfMouseMovingOverProperty,
|
clockDateVisibleOnlyIfMouseMovingOverProperty,
|
||||||
|
clockSmileyVisibleProperty,
|
||||||
|
clockPercentProgressVisibleProperty,
|
||||||
batteryVisibleProperty,
|
batteryVisibleProperty,
|
||||||
batteryWavesVisibleProperty,
|
batteryWavesVisibleProperty,
|
||||||
batteryCircleProgressVisibleProperty,
|
batteryCircleProgressVisibleProperty,
|
||||||
|
@ -534,6 +534,8 @@ public class MainWindow extends TWindow {
|
|||||||
.bindTo(timeCalcConfiguration.clockDateVisibleOnlyIfMouseMovingOverProperty);
|
.bindTo(timeCalcConfiguration.clockDateVisibleOnlyIfMouseMovingOverProperty);
|
||||||
clock.visibleProperty
|
clock.visibleProperty
|
||||||
.bindTo(timeCalcConfiguration.clockVisibleProperty);
|
.bindTo(timeCalcConfiguration.clockVisibleProperty);
|
||||||
|
clock.percentProgressVisibleProperty.bindTo(timeCalcConfiguration.clockPercentProgressVisibleProperty);
|
||||||
|
clock.smileyVisibleProperty.bindTo(timeCalcConfiguration.clockSmileyVisibleProperty);
|
||||||
|
|
||||||
ComponentRegistry<Component> componentRegistry
|
ComponentRegistry<Component> componentRegistry
|
||||||
= new ComponentRegistry();
|
= new ComponentRegistry();
|
||||||
|
@ -18,6 +18,8 @@ clock.centre-circle.visible=true
|
|||||||
clock.hands.colored=true
|
clock.hands.colored=true
|
||||||
clock.progress.visible-only-if-mouse-moving-over=true
|
clock.progress.visible-only-if-mouse-moving-over=true
|
||||||
clock.date.visible-only-if-mouse-moving-over=true
|
clock.date.visible-only-if-mouse-moving-over=true
|
||||||
|
clock.smiley.visible=false
|
||||||
|
clock.percent-progress.visible=false
|
||||||
#
|
#
|
||||||
battery.waves.visible=true
|
battery.waves.visible=true
|
||||||
battery.circle-progress.visible=true
|
battery.circle-progress.visible=true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user