mirror of
https://github.com/robertvokac/time-calc.git
synced 2025-03-25 07:27:49 +01:00
patch13
This commit is contained in:
parent
bde480f222
commit
888e4b2cbc
@ -156,6 +156,10 @@ public class TimeCalcConfiguration {
|
|||||||
|
|
||||||
public final BooleanProperty squareVisibleProperty
|
public final BooleanProperty squareVisibleProperty
|
||||||
= new BooleanProperty(TimeCalcProperty.SQUARE_VISIBLE.getKey());
|
= new BooleanProperty(TimeCalcProperty.SQUARE_VISIBLE.getKey());
|
||||||
|
public final BooleanProperty swingVisibleProperty
|
||||||
|
= new BooleanProperty(TimeCalcProperty.SWING_VISIBLE.getKey());
|
||||||
|
public final BooleanProperty swingQuarterIconVisibleProperty
|
||||||
|
= new BooleanProperty(TimeCalcProperty.SWING_QUARTER_ICON_VISIBLE.getKey());
|
||||||
public final BooleanProperty circleVisibleProperty
|
public final BooleanProperty circleVisibleProperty
|
||||||
= new BooleanProperty(TimeCalcProperty.CIRCLE_VISIBLE.getKey());
|
= new BooleanProperty(TimeCalcProperty.CIRCLE_VISIBLE.getKey());
|
||||||
public final BooleanProperty walkingHumanVisibleProperty
|
public final BooleanProperty walkingHumanVisibleProperty
|
||||||
@ -239,6 +243,8 @@ public class TimeCalcConfiguration {
|
|||||||
smileysColoredProperty,
|
smileysColoredProperty,
|
||||||
squareVisibleProperty,
|
squareVisibleProperty,
|
||||||
circleVisibleProperty,
|
circleVisibleProperty,
|
||||||
|
swingVisibleProperty,
|
||||||
|
swingQuarterIconVisibleProperty,
|
||||||
walkingHumanVisibleProperty,
|
walkingHumanVisibleProperty,
|
||||||
mainWindowCustomTitleProperty,
|
mainWindowCustomTitleProperty,
|
||||||
profileNameProperty,
|
profileNameProperty,
|
||||||
|
@ -76,6 +76,8 @@ public enum TimeCalcProperty {
|
|||||||
"Smileys : Visible only, if mouse moving over"),
|
"Smileys : Visible only, if mouse moving over"),
|
||||||
SMILEYS_COLORED("smileys.colored", "Smileys : Colored"),
|
SMILEYS_COLORED("smileys.colored", "Smileys : Colored"),
|
||||||
SQUARE_VISIBLE("square.visible", "Square"),
|
SQUARE_VISIBLE("square.visible", "Square"),
|
||||||
|
SWING_VISIBLE("swing.visible", "Swing"),
|
||||||
|
SWING_QUARTER_ICON_VISIBLE("swing.quarter-icon.visible", "Swing: Quarter icon"),
|
||||||
CIRCLE_VISIBLE("circle.visible", "Circle"),
|
CIRCLE_VISIBLE("circle.visible", "Circle"),
|
||||||
WALKING_HUMAN_VISIBLE("walking-human.visible", "Walking Human"),
|
WALKING_HUMAN_VISIBLE("walking-human.visible", "Walking Human"),
|
||||||
MAIN_WINDOW_CUSTOM_TITLE("main-window.custom-title",
|
MAIN_WINDOW_CUSTOM_TITLE("main-window.custom-title",
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
package org.nanoboot.utils.timecalc.swing.common;
|
package org.nanoboot.utils.timecalc.swing.common;
|
||||||
|
|
||||||
import java.awt.BasicStroke;
|
|
||||||
import org.nanoboot.utils.timecalc.app.GetProperty;
|
import org.nanoboot.utils.timecalc.app.GetProperty;
|
||||||
import org.nanoboot.utils.timecalc.app.TimeCalcProperty;
|
import org.nanoboot.utils.timecalc.app.TimeCalcProperty;
|
||||||
import org.nanoboot.utils.timecalc.entity.Visibility;
|
import org.nanoboot.utils.timecalc.entity.Visibility;
|
||||||
|
import org.nanoboot.utils.timecalc.swing.progress.Battery;
|
||||||
import org.nanoboot.utils.timecalc.swing.progress.ProgressSmileyIcon;
|
import org.nanoboot.utils.timecalc.swing.progress.ProgressSmileyIcon;
|
||||||
|
import org.nanoboot.utils.timecalc.swing.progress.ProgressSwing;
|
||||||
import org.nanoboot.utils.timecalc.utils.common.ProgressSmiley;
|
import org.nanoboot.utils.timecalc.utils.common.ProgressSmiley;
|
||||||
import org.nanoboot.utils.timecalc.utils.property.BooleanProperty;
|
import org.nanoboot.utils.timecalc.utils.property.BooleanProperty;
|
||||||
import org.nanoboot.utils.timecalc.utils.property.Property;
|
import org.nanoboot.utils.timecalc.utils.property.Property;
|
||||||
@ -14,6 +15,7 @@ import javax.swing.ImageIcon;
|
|||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.Timer;
|
import javax.swing.Timer;
|
||||||
|
import java.awt.BasicStroke;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.Graphics;
|
import java.awt.Graphics;
|
||||||
@ -62,7 +64,10 @@ public class Widget extends JPanel implements
|
|||||||
protected boolean mouseOver = false;
|
protected boolean mouseOver = false;
|
||||||
private boolean mouseOverCloseButton = false;
|
private boolean mouseOverCloseButton = false;
|
||||||
protected JLabel smileyIcon;
|
protected JLabel smileyIcon;
|
||||||
|
protected JLabel smileyIcon2;
|
||||||
private long lastUpdate = System.nanoTime();
|
private long lastUpdate = System.nanoTime();
|
||||||
|
private static final Color PURPLE_STRONGLY_COLORED = new Color(153,51,255);
|
||||||
|
private static final Color PURPLE_WEAKLY_COLORED = new Color(204,153,255);
|
||||||
|
|
||||||
public Widget() {
|
public Widget() {
|
||||||
setBackground(BACKGROUND_COLOR);
|
setBackground(BACKGROUND_COLOR);
|
||||||
@ -237,11 +242,19 @@ public class Widget extends JPanel implements
|
|||||||
}
|
}
|
||||||
protected void paintSmiley(Visibility visibility, Graphics2D brush, int x,
|
protected void paintSmiley(Visibility visibility, Graphics2D brush, int x,
|
||||||
int y, boolean paintBody) {
|
int y, boolean paintBody) {
|
||||||
|
paintSmiley(visibility, brush, x, y, paintBody, -1, 1);
|
||||||
|
}
|
||||||
|
protected void paintSmiley(Visibility visibility, Graphics2D brush, int x,
|
||||||
|
int y, boolean paintBody, double customDonePercent, int smileyNumber) {
|
||||||
if (!shouldBeSmileyPainted()) {
|
if (!shouldBeSmileyPainted()) {
|
||||||
if (this.smileyIcon != null) {
|
if (this.smileyIcon != null) {
|
||||||
this.remove(smileyIcon);
|
this.remove(smileyIcon);
|
||||||
this.smileyIcon = null;
|
this.smileyIcon = null;
|
||||||
}
|
}
|
||||||
|
if (this.smileyIcon2 != null) {
|
||||||
|
this.remove(smileyIcon2);
|
||||||
|
this.smileyIcon2 = null;
|
||||||
|
}
|
||||||
|
|
||||||
//nothing more to do
|
//nothing more to do
|
||||||
return;
|
return;
|
||||||
@ -251,13 +264,16 @@ public class Widget extends JPanel implements
|
|||||||
colored = false;
|
colored = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!colored) {
|
if (!colored) {
|
||||||
y = y - 2;
|
y = y - 2;
|
||||||
if (this.smileyIcon != null) {
|
if (this.smileyIcon != null) {
|
||||||
this.remove(smileyIcon);
|
this.remove(smileyIcon);
|
||||||
this.smileyIcon = null;
|
this.smileyIcon = null;
|
||||||
}
|
}
|
||||||
|
if (this.smileyIcon2 != null) {
|
||||||
|
this.remove(smileyIcon2);
|
||||||
|
this.smileyIcon2 = null;
|
||||||
|
}
|
||||||
Color originalColor = brush.getColor();
|
Color originalColor = brush.getColor();
|
||||||
if (!visibility.isStronglyColored()) {
|
if (!visibility.isStronglyColored()) {
|
||||||
brush.setColor(Color.GRAY);
|
brush.setColor(Color.GRAY);
|
||||||
@ -280,8 +296,8 @@ public class Widget extends JPanel implements
|
|||||||
brush.setColor(currentColor);
|
brush.setColor(currentColor);
|
||||||
brush.setFont(MEDIUM_FONT);
|
brush.setFont(MEDIUM_FONT);
|
||||||
brush.drawString(
|
brush.drawString(
|
||||||
ProgressSmiley.forProgress(donePercent).getCharacter(),
|
ProgressSmiley.forProgress(customDonePercent >= 0 ? customDonePercent : donePercent).getCharacter(),
|
||||||
x + 1, y + 16
|
x + 1 + (getClass() == ProgressSwing.class ? -8 : 0), y + 16
|
||||||
);
|
);
|
||||||
brush.setFont(currentFont);
|
brush.setFont(currentFont);
|
||||||
brush.setColor(originalColor);
|
brush.setColor(originalColor);
|
||||||
@ -289,15 +305,25 @@ public class Widget extends JPanel implements
|
|||||||
if (colored) {
|
if (colored) {
|
||||||
x = x + 2;
|
x = x + 2;
|
||||||
ImageIcon imageIcon = ProgressSmileyIcon
|
ImageIcon imageIcon = ProgressSmileyIcon
|
||||||
.forSmiley(ProgressSmiley.forProgress(donePercent))
|
.forSmiley(ProgressSmiley.forProgress(customDonePercent >= 0 ? customDonePercent : donePercent))
|
||||||
.getIcon();
|
.getIcon();
|
||||||
if (this.smileyIcon != null) {
|
if(smileyNumber < 2) {
|
||||||
this.remove(smileyIcon);
|
if (this.smileyIcon != null) {
|
||||||
this.smileyIcon = null;
|
this.remove(smileyIcon);
|
||||||
|
this.smileyIcon = null;
|
||||||
|
}
|
||||||
|
this.smileyIcon = new JLabel(imageIcon);
|
||||||
|
smileyIcon.setBounds(x + (getClass() == ProgressSwing.class ? - 8 : 0), y, 15, 15);
|
||||||
|
this.add(smileyIcon);
|
||||||
|
} else {
|
||||||
|
if (this.smileyIcon2 != null) {
|
||||||
|
this.remove(smileyIcon2);
|
||||||
|
this.smileyIcon2 = null;
|
||||||
|
}
|
||||||
|
this.smileyIcon2 = new JLabel(imageIcon);
|
||||||
|
smileyIcon2.setBounds(x + (getClass() == ProgressSwing.class ? - 8 : 0), y, 15, 15);
|
||||||
|
this.add(smileyIcon2);
|
||||||
}
|
}
|
||||||
this.smileyIcon = new JLabel(imageIcon);
|
|
||||||
smileyIcon.setBounds(x, y, 15, 15);
|
|
||||||
this.add(smileyIcon);
|
|
||||||
}
|
}
|
||||||
if(colored) {
|
if(colored) {
|
||||||
x = x - 2;
|
x = x - 2;
|
||||||
@ -318,4 +344,75 @@ public class Widget extends JPanel implements
|
|||||||
protected boolean changedInTheLastXMilliseconds(int milliseconds) {
|
protected boolean changedInTheLastXMilliseconds(int milliseconds) {
|
||||||
return (System.nanoTime() - lastUpdate) < milliseconds * 1000000;
|
return (System.nanoTime() - lastUpdate) < milliseconds * 1000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void paintQuarterIcon(Graphics2D brush,
|
||||||
|
Visibility visibility, int totalWidth, int totalHeight) {
|
||||||
|
paintQuarterIcon(brush, visibility, totalWidth, totalHeight, -1, -1);
|
||||||
|
}
|
||||||
|
protected void paintQuarterIcon(Graphics2D brush,
|
||||||
|
Visibility visibility, int totalWidth, int totalHeight, int x, int y) {
|
||||||
|
Color currentColor = brush.getColor();
|
||||||
|
//Color currentBackgroundColor = brush.getBackground();
|
||||||
|
Font currentFont = brush.getFont();
|
||||||
|
brush.setFont(BIG_FONT);
|
||||||
|
int q = donePercent < 0.25 ? 0 : (donePercent < 0.5 ? 1 :
|
||||||
|
(donePercent < 0.75 ? 2 : (donePercent < 1.0 ? 3 : 4)));
|
||||||
|
Color color;
|
||||||
|
Color backgroundColor;
|
||||||
|
switch (visibility) {
|
||||||
|
case STRONGLY_COLORED:
|
||||||
|
backgroundColor = Color.WHITE;
|
||||||
|
break;
|
||||||
|
case WEAKLY_COLORED:
|
||||||
|
backgroundColor = Color.LIGHT_GRAY;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
backgroundColor = Color.LIGHT_GRAY;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (q) {
|
||||||
|
case 0:
|
||||||
|
color = Battery.getColourForProgress(0.05, visibility,
|
||||||
|
mouseOver);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
color = Battery.getColourForProgress(0.25, visibility,
|
||||||
|
mouseOver);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
color = Battery.getColourForProgress(0.85, visibility,
|
||||||
|
mouseOver);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
color = Battery.getColourForProgress(0.95, visibility,
|
||||||
|
mouseOver);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
color = visibility.isStronglyColored() ? PURPLE_STRONGLY_COLORED : (visibility.isWeaklyColored() ? PURPLE_WEAKLY_COLORED : Color.GRAY);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
color = Color.LIGHT_GRAY;
|
||||||
|
}
|
||||||
|
brush.setColor(backgroundColor);
|
||||||
|
if(x< 0 || y < 0) {
|
||||||
|
brush.fillRect(((int) (totalWidth * 0.08)),
|
||||||
|
(donePercent < 0.5 ? totalHeight / 4 * 3
|
||||||
|
: (totalHeight / 4 * 1) + 10) + -8, 20, 20);
|
||||||
|
} else {
|
||||||
|
brush.fillRect(x, y, 20, 20);
|
||||||
|
}
|
||||||
|
brush.setColor(color);
|
||||||
|
if(x< 0 || y < 0) {
|
||||||
|
brush.drawString(
|
||||||
|
String.valueOf(q), ((int) (totalWidth * 0.13)),
|
||||||
|
(donePercent < 0.5 ? totalHeight / 4 * 3
|
||||||
|
: (totalHeight / 4 * 1) + 10) + 10
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
brush.drawString(String.valueOf(q), x + 4, y + 18);
|
||||||
|
}
|
||||||
|
brush.setColor(currentColor);
|
||||||
|
//brush.setBackground(currentBackgroundColor);
|
||||||
|
brush.setFont(currentFont);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -317,7 +317,7 @@ public class Battery extends Widget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (quarterIconVisibleProperty.isEnabled()) {
|
if (quarterIconVisibleProperty.isEnabled()) {
|
||||||
paintQuarterIcon(brush, visibility);
|
paintQuarterIcon(brush, visibility, totalWidth, totalHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (circleProgressVisibleProperty.isEnabled()) {
|
if (circleProgressVisibleProperty.isEnabled()) {
|
||||||
@ -364,68 +364,6 @@ public class Battery extends Widget {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Color PURPLE_STRONGLY_COLORED = new Color(153,51,255);
|
|
||||||
private static final Color PURPLE_WEAKLY_COLORED = new Color(204,153,255);
|
|
||||||
|
|
||||||
private void paintQuarterIcon(Graphics2D brush,
|
|
||||||
Visibility visibility) {
|
|
||||||
Color currentColor = brush.getColor();
|
|
||||||
//Color currentBackgroundColor = brush.getBackground();
|
|
||||||
Font currentFont = brush.getFont();
|
|
||||||
brush.setFont(BIG_FONT);
|
|
||||||
int q = donePercent < 0.25 ? 0 : (donePercent < 0.5 ? 1 :
|
|
||||||
(donePercent < 0.75 ? 2 : (donePercent < 1.0 ? 3 : 4)));
|
|
||||||
Color color;
|
|
||||||
Color backgroundColor;
|
|
||||||
switch (visibility) {
|
|
||||||
case STRONGLY_COLORED:
|
|
||||||
backgroundColor = Color.WHITE;
|
|
||||||
break;
|
|
||||||
case WEAKLY_COLORED:
|
|
||||||
backgroundColor = Color.LIGHT_GRAY;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
backgroundColor = Color.LIGHT_GRAY;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (q) {
|
|
||||||
case 0:
|
|
||||||
color = Battery.getColourForProgress(0.05, visibility,
|
|
||||||
mouseOver);
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
color = Battery.getColourForProgress(0.25, visibility,
|
|
||||||
mouseOver);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
color = Battery.getColourForProgress(0.85, visibility,
|
|
||||||
mouseOver);
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
color = Battery.getColourForProgress(0.95, visibility,
|
|
||||||
mouseOver);
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
color = visibility.isStronglyColored() ? PURPLE_STRONGLY_COLORED : (visibility.isWeaklyColored() ? PURPLE_WEAKLY_COLORED : Color.GRAY);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
color = Color.LIGHT_GRAY;
|
|
||||||
}
|
|
||||||
brush.setColor(backgroundColor);
|
|
||||||
brush.fillRect( ((int) (totalWidth * 0.08)),
|
|
||||||
(donePercent < 0.5 ? totalHeight / 4 * 3
|
|
||||||
: (totalHeight / 4 * 1) + 10) + -8, 20, 20);
|
|
||||||
brush.setColor(color);
|
|
||||||
brush.drawString(
|
|
||||||
String.valueOf(q), ((int) (totalWidth * 0.13)),
|
|
||||||
(donePercent < 0.5 ? totalHeight / 4 * 3
|
|
||||||
: (totalHeight / 4 * 1) + 10) + 10
|
|
||||||
);
|
|
||||||
brush.setColor(currentColor);
|
|
||||||
//brush.setBackground(currentBackgroundColor);
|
|
||||||
brush.setFont(currentFont);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void paintChargingCharacter(Graphics2D brush) {
|
public void paintChargingCharacter(Graphics2D brush) {
|
||||||
brush.drawString(
|
brush.drawString(
|
||||||
CHARCHING, ((int) (totalWidth * 0.45)),
|
CHARCHING, ((int) (totalWidth * 0.45)),
|
||||||
|
@ -0,0 +1,73 @@
|
|||||||
|
package org.nanoboot.utils.timecalc.swing.progress;
|
||||||
|
|
||||||
|
import org.nanoboot.utils.timecalc.app.TimeCalcProperty;
|
||||||
|
import org.nanoboot.utils.timecalc.entity.Visibility;
|
||||||
|
import org.nanoboot.utils.timecalc.swing.common.Widget;
|
||||||
|
import org.nanoboot.utils.timecalc.utils.common.NumberFormats;
|
||||||
|
import org.nanoboot.utils.timecalc.utils.property.BooleanProperty;
|
||||||
|
|
||||||
|
import java.awt.BasicStroke;
|
||||||
|
import java.awt.Color;
|
||||||
|
import java.awt.Dimension;
|
||||||
|
import java.awt.Graphics;
|
||||||
|
import java.awt.Graphics2D;
|
||||||
|
import java.awt.RenderingHints;
|
||||||
|
|
||||||
|
public class ProgressSwing extends Widget {
|
||||||
|
|
||||||
|
public final BooleanProperty quarterIconVisibleProperty
|
||||||
|
= new BooleanProperty(
|
||||||
|
TimeCalcProperty.SWING_QUARTER_ICON_VISIBLE
|
||||||
|
.getKey(), true);
|
||||||
|
|
||||||
|
public ProgressSwing() {
|
||||||
|
setPreferredSize(new Dimension(200, 100));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void paintWidget(Graphics g) {
|
||||||
|
Visibility visibility
|
||||||
|
= Visibility.valueOf(visibilityProperty.getValue());
|
||||||
|
Graphics2D brush = (Graphics2D) g;
|
||||||
|
brush.setColor(
|
||||||
|
visibility.isStronglyColored() || mouseOver ? Color.darkGray
|
||||||
|
: FOREGROUND_COLOR);
|
||||||
|
brush.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
|
||||||
|
RenderingHints.VALUE_ANTIALIAS_ON);
|
||||||
|
|
||||||
|
brush.setStroke(new BasicStroke(0.5f));
|
||||||
|
|
||||||
|
//brush.drawRect(1,1, getWidth() - 2, getHeight() - 2);
|
||||||
|
brush.setStroke(new BasicStroke(1.5f));
|
||||||
|
brush.drawLine(getWidth() /2, getHeight(), getWidth()/2,
|
||||||
|
(int) (getHeight() * 0.66) - 10);
|
||||||
|
brush.fillOval(getWidth()/2 - 3,
|
||||||
|
(int) (getHeight() * 0.66) - 10 - 3, 6, 6);
|
||||||
|
brush.drawLine(1, getHeight() - 2, getWidth(), getHeight() - 2);
|
||||||
|
int startX = (int) (getWidth() * 0.10);
|
||||||
|
int startY = (int) (getHeight() - getHeight() * 0.66 * (1 - donePercent)) - 10;
|
||||||
|
int endX = (int) (getWidth() * 0.90);
|
||||||
|
int endY = (int) (getHeight() - getHeight() * 0.66 * donePercent) - 10;
|
||||||
|
|
||||||
|
brush.drawLine(startX, startY, endX, endY);
|
||||||
|
// brush.drawLine(startX, startY, getWidth()/2,
|
||||||
|
// (int) (getHeight() * 0.6));
|
||||||
|
// brush.drawLine(endX, endY, getWidth()/2,
|
||||||
|
// (int) (getHeight() * 0.6));
|
||||||
|
|
||||||
|
|
||||||
|
paintSmiley(visibility, brush, startX, startY - 25, true);
|
||||||
|
paintSmiley(visibility, brush, endX, endY - 25, true, 1.0 - donePercent, 2);
|
||||||
|
|
||||||
|
brush.drawString(
|
||||||
|
NumberFormats.FORMATTER_ZERO_DECIMAL_PLACES
|
||||||
|
.format(donePercent * 100) + "%",
|
||||||
|
(int) (getWidth() * 0.45), (int) (getHeight() * 0.9));
|
||||||
|
if (quarterIconVisibleProperty.isEnabled()) {
|
||||||
|
paintQuarterIcon(brush, visibility, getWidth(), getHeight(),
|
||||||
|
(int) (getWidth() * 0.45), (int) (getHeight() * 0.25));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -175,6 +175,10 @@ public class ConfigWindow extends TWindow {
|
|||||||
= new JCheckBox(TimeCalcProperty.SQUARE_VISIBLE.getKey());
|
= new JCheckBox(TimeCalcProperty.SQUARE_VISIBLE.getKey());
|
||||||
private final JCheckBox circleVisibleProperty
|
private final JCheckBox circleVisibleProperty
|
||||||
= new JCheckBox(TimeCalcProperty.CIRCLE_VISIBLE.getKey());
|
= new JCheckBox(TimeCalcProperty.CIRCLE_VISIBLE.getKey());
|
||||||
|
private final JCheckBox swingVisibleProperty
|
||||||
|
= new JCheckBox(TimeCalcProperty.SWING_VISIBLE.getKey());
|
||||||
|
private final JCheckBox swingQuarterIconVisibleProperty
|
||||||
|
= new JCheckBox(TimeCalcProperty.SWING_QUARTER_ICON_VISIBLE.getKey());
|
||||||
private final JCheckBox walkingHumanVisibleProperty
|
private final JCheckBox walkingHumanVisibleProperty
|
||||||
= new JCheckBox(TimeCalcProperty.WALKING_HUMAN_VISIBLE.getKey());
|
= new JCheckBox(TimeCalcProperty.WALKING_HUMAN_VISIBLE.getKey());
|
||||||
private final JTextField mainWindowCustomTitleProperty
|
private final JTextField mainWindowCustomTitleProperty
|
||||||
@ -342,6 +346,8 @@ public class ConfigWindow extends TWindow {
|
|||||||
.setSelected(!enable);
|
.setSelected(!enable);
|
||||||
squareVisibleProperty.setSelected(enable);
|
squareVisibleProperty.setSelected(enable);
|
||||||
circleVisibleProperty.setSelected(enable);
|
circleVisibleProperty.setSelected(enable);
|
||||||
|
swingVisibleProperty.setSelected(enable);
|
||||||
|
swingQuarterIconVisibleProperty.setSelected(enable);
|
||||||
walkingHumanVisibleProperty.setSelected(enable);
|
walkingHumanVisibleProperty.setSelected(enable);
|
||||||
MainWindow.hideShowFormsCheckBox.setSelected(enable);
|
MainWindow.hideShowFormsCheckBox.setSelected(enable);
|
||||||
});
|
});
|
||||||
@ -399,6 +405,8 @@ public class ConfigWindow extends TWindow {
|
|||||||
notificationsVisibleProperty,
|
notificationsVisibleProperty,
|
||||||
squareVisibleProperty,
|
squareVisibleProperty,
|
||||||
circleVisibleProperty,
|
circleVisibleProperty,
|
||||||
|
swingVisibleProperty,
|
||||||
|
swingQuarterIconVisibleProperty,
|
||||||
walkingHumanVisibleProperty,
|
walkingHumanVisibleProperty,
|
||||||
mainWindowCustomTitleProperty,
|
mainWindowCustomTitleProperty,
|
||||||
profileNameProperty,
|
profileNameProperty,
|
||||||
|
@ -32,6 +32,7 @@ import org.nanoboot.utils.timecalc.swing.progress.MinuteBattery;
|
|||||||
import org.nanoboot.utils.timecalc.swing.progress.MonthBattery;
|
import org.nanoboot.utils.timecalc.swing.progress.MonthBattery;
|
||||||
import org.nanoboot.utils.timecalc.swing.progress.ProgressCircle;
|
import org.nanoboot.utils.timecalc.swing.progress.ProgressCircle;
|
||||||
import org.nanoboot.utils.timecalc.swing.progress.ProgressSquare;
|
import org.nanoboot.utils.timecalc.swing.progress.ProgressSquare;
|
||||||
|
import org.nanoboot.utils.timecalc.swing.progress.ProgressSwing;
|
||||||
import org.nanoboot.utils.timecalc.swing.progress.Time;
|
import org.nanoboot.utils.timecalc.swing.progress.Time;
|
||||||
import org.nanoboot.utils.timecalc.swing.progress.WalkingHumanProgress;
|
import org.nanoboot.utils.timecalc.swing.progress.WalkingHumanProgress;
|
||||||
import org.nanoboot.utils.timecalc.swing.progress.WeekBattery;
|
import org.nanoboot.utils.timecalc.swing.progress.WeekBattery;
|
||||||
@ -203,6 +204,7 @@ public class MainWindow extends TWindow {
|
|||||||
|
|
||||||
AnalogClock clock = new AnalogClock();
|
AnalogClock clock = new AnalogClock();
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
arrivalTextField.valueProperty.addListener(e -> {
|
arrivalTextField.valueProperty.addListener(e -> {
|
||||||
if (!arrivalTextField.valueProperty.getValue().isEmpty()) {
|
if (!arrivalTextField.valueProperty.getValue().isEmpty()) {
|
||||||
@ -301,9 +303,16 @@ public class MainWindow extends TWindow {
|
|||||||
// add(placeHolderWidget);
|
// add(placeHolderWidget);
|
||||||
// placeHolderWidget.setBounds(progressSquare.getX() + progressSquare.getWidth() + SwingUtils.MARGIN, SwingUtils.MARGIN, 50, 50);
|
// placeHolderWidget.setBounds(progressSquare.getX() + progressSquare.getWidth() + SwingUtils.MARGIN, SwingUtils.MARGIN, 50, 50);
|
||||||
|
|
||||||
|
ProgressSwing progressSwing = new ProgressSwing();
|
||||||
|
progressSwing.setBounds(clock.getX(), clock.getY() + clock.getHeight() + SwingUtils.MARGIN,
|
||||||
|
200, 100);
|
||||||
|
add(progressSwing);
|
||||||
|
progressSwing.visibleProperty
|
||||||
|
.bindTo(timeCalcConfiguration.swingVisibleProperty);
|
||||||
|
progressSwing.quarterIconVisibleProperty.bindTo(timeCalcConfiguration.swingQuarterIconVisibleProperty);
|
||||||
|
|
||||||
TLabel arrivalTextFieldLabel = new TLabel("Arrival:", 70);
|
TLabel arrivalTextFieldLabel = new TLabel("Arrival:", 70);
|
||||||
arrivalTextFieldLabel.setBoundsFromTop(clock, 3);
|
arrivalTextFieldLabel.setBoundsFromTop(progressSwing, 3);
|
||||||
|
|
||||||
arrivalTextField.setBoundsFromLeft(arrivalTextFieldLabel);
|
arrivalTextField.setBoundsFromLeft(arrivalTextFieldLabel);
|
||||||
TButton arrivalIncreaseButton = new SmallTButton('+');
|
TButton arrivalIncreaseButton = new SmallTButton('+');
|
||||||
@ -781,7 +790,7 @@ public class MainWindow extends TWindow {
|
|||||||
dayBattery,
|
dayBattery,
|
||||||
weekBattery, monthBattery, yearBattery,
|
weekBattery, monthBattery, yearBattery,
|
||||||
walkingHumanProgress,
|
walkingHumanProgress,
|
||||||
progressSquare, progressCircle, componentRegistry, arrivalTextFieldLabel)) {
|
progressSquare, progressCircle, progressSwing, componentRegistry, arrivalTextFieldLabel)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -812,7 +821,9 @@ public class MainWindow extends TWindow {
|
|||||||
Battery dayBattery, Battery weekBattery, Battery monthBattery,
|
Battery dayBattery, Battery weekBattery, Battery monthBattery,
|
||||||
Battery yearBattery, WalkingHumanProgress walkingHumanProgress,
|
Battery yearBattery, WalkingHumanProgress walkingHumanProgress,
|
||||||
ProgressSquare progressSquare, ProgressCircle progressCircle,
|
ProgressSquare progressSquare, ProgressCircle progressCircle,
|
||||||
ComponentRegistry<Component> componentRegistry, TLabel arrivalTextFieldLabel) {
|
ProgressSwing progressSwing,
|
||||||
|
ComponentRegistry<Component> componentRegistry,
|
||||||
|
TLabel arrivalTextFieldLabel) {
|
||||||
//System.out.println("timeCalcConfiguration.handsLongProperty=" + timeCalcConfiguration.clockHandLongProperty.isEnabled());
|
//System.out.println("timeCalcConfiguration.handsLongProperty=" + timeCalcConfiguration.clockHandLongProperty.isEnabled());
|
||||||
|
|
||||||
if (!departureTextField.valueProperty.getValue().isEmpty() && !arrivalTextField.valueProperty.getValue().isEmpty()) {
|
if (!departureTextField.valueProperty.getValue().isEmpty() && !arrivalTextField.valueProperty.getValue().isEmpty()) {
|
||||||
@ -943,6 +954,7 @@ public class MainWindow extends TWindow {
|
|||||||
}
|
}
|
||||||
progressSquare.setDonePercent(done);
|
progressSquare.setDonePercent(done);
|
||||||
progressCircle.setDonePercent(done);
|
progressCircle.setDonePercent(done);
|
||||||
|
progressSwing.setDonePercent(done);
|
||||||
dayBattery.setDonePercent(done);
|
dayBattery.setDonePercent(done);
|
||||||
|
|
||||||
WeekStatistics weekStatistics = new WeekStatistics(clock, time);
|
WeekStatistics weekStatistics = new WeekStatistics(clock, time);
|
||||||
|
@ -46,6 +46,8 @@ smileys.visible-only-if-mouse-moving-over=true
|
|||||||
smileys.colored=true
|
smileys.colored=true
|
||||||
square.visible=true
|
square.visible=true
|
||||||
circle.visible=true
|
circle.visible=true
|
||||||
|
swing.visible=true
|
||||||
|
swing.quarter-icon.visible=true
|
||||||
walking-human.visible=true
|
walking-human.visible=true
|
||||||
main-window.custom-title=---
|
main-window.custom-title=---
|
||||||
profile.name=
|
profile.name=
|
||||||
|
Loading…
x
Reference in New Issue
Block a user