mirror of
https://github.com/robertvokac/time-calc.git
synced 2025-03-25 07:27:49 +01:00
Added some improvements
This commit is contained in:
parent
f3a1203e99
commit
9a7db29509
@ -17,4 +17,22 @@
|
|||||||
<exec.executable>java</exec.executable>
|
<exec.executable>java</exec.executable>
|
||||||
</properties>
|
</properties>
|
||||||
</action>
|
</action>
|
||||||
|
<action>
|
||||||
|
<actionName>debug</actionName>
|
||||||
|
<packagings>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
</packagings>
|
||||||
|
<goals>
|
||||||
|
<goal>process-classes</goal>
|
||||||
|
<goal>org.codehaus.mojo:exec-maven-plugin:3.1.0:exec</goal>
|
||||||
|
</goals>
|
||||||
|
<properties>
|
||||||
|
<exec.vmArgs>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address}</exec.vmArgs>
|
||||||
|
<exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
|
||||||
|
<exec.appArgs></exec.appArgs>
|
||||||
|
<exec.mainClass>org.nanoboot.utils.timecalc.app.Main</exec.mainClass>
|
||||||
|
<exec.executable>java</exec.executable>
|
||||||
|
<jpda.listen>true</jpda.listen>
|
||||||
|
</properties>
|
||||||
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
|
@ -27,6 +27,9 @@ public class TimeCalcConfiguration {
|
|||||||
public final BooleanProperty clockVisibleProperty
|
public final BooleanProperty clockVisibleProperty
|
||||||
= new BooleanProperty(TimeCalcProperty.CLOCK_VISIBLE
|
= new BooleanProperty(TimeCalcProperty.CLOCK_VISIBLE
|
||||||
.getKey());
|
.getKey());
|
||||||
|
public final BooleanProperty clockHiddenProperty
|
||||||
|
= new BooleanProperty(TimeCalcProperty.CLOCK_HIDDEN
|
||||||
|
.getKey());
|
||||||
public final BooleanProperty clockHandsLongVisibleProperty
|
public final BooleanProperty clockHandsLongVisibleProperty
|
||||||
= new BooleanProperty(TimeCalcProperty.CLOCK_HANDS_LONG_VISIBLE
|
= new BooleanProperty(TimeCalcProperty.CLOCK_HANDS_LONG_VISIBLE
|
||||||
.getKey());
|
.getKey());
|
||||||
@ -132,6 +135,24 @@ public class TimeCalcConfiguration {
|
|||||||
public final BooleanProperty batteryYearVisibleProperty
|
public final BooleanProperty batteryYearVisibleProperty
|
||||||
= new BooleanProperty(TimeCalcProperty.BATTERY_YEAR_VISIBLE
|
= new BooleanProperty(TimeCalcProperty.BATTERY_YEAR_VISIBLE
|
||||||
.getKey());
|
.getKey());
|
||||||
|
public final BooleanProperty batteryMinuteHiddenProperty
|
||||||
|
= new BooleanProperty(TimeCalcProperty.BATTERY_MINUTE_HIDDEN
|
||||||
|
.getKey());
|
||||||
|
public final BooleanProperty batteryHourHiddenProperty
|
||||||
|
= new BooleanProperty(TimeCalcProperty.BATTERY_HOUR_HIDDEN
|
||||||
|
.getKey());
|
||||||
|
public final BooleanProperty batteryDayHiddenProperty
|
||||||
|
= new BooleanProperty(TimeCalcProperty.BATTERY_DAY_HIDDEN
|
||||||
|
.getKey());
|
||||||
|
public final BooleanProperty batteryWeekHiddenProperty
|
||||||
|
= new BooleanProperty(TimeCalcProperty.BATTERY_WEEK_HIDDEN
|
||||||
|
.getKey());
|
||||||
|
public final BooleanProperty batteryMonthHiddenProperty
|
||||||
|
= new BooleanProperty(TimeCalcProperty.BATTERY_MONTH_HIDDEN
|
||||||
|
.getKey());
|
||||||
|
public final BooleanProperty batteryYearHiddenProperty
|
||||||
|
= new BooleanProperty(TimeCalcProperty.BATTERY_YEAR_HIDDEN
|
||||||
|
.getKey());
|
||||||
public final BooleanProperty batteryBlinkingIfCriticalLowVisibleProperty
|
public final BooleanProperty batteryBlinkingIfCriticalLowVisibleProperty
|
||||||
= new BooleanProperty(
|
= new BooleanProperty(
|
||||||
TimeCalcProperty.BATTERY_BLINKING_IF_CRITICAL_LOW
|
TimeCalcProperty.BATTERY_BLINKING_IF_CRITICAL_LOW
|
||||||
@ -160,23 +181,34 @@ 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 squareHiddenProperty
|
||||||
|
= new BooleanProperty(TimeCalcProperty.SQUARE_HIDDEN.getKey());
|
||||||
public final StringProperty squareTypeProperty
|
public final StringProperty squareTypeProperty
|
||||||
= new StringProperty(TimeCalcProperty.SQUARE_TYPE.getKey());
|
= new StringProperty(TimeCalcProperty.SQUARE_TYPE.getKey());
|
||||||
public final BooleanProperty dotVisibleProperty
|
public final BooleanProperty dotVisibleProperty
|
||||||
= new BooleanProperty(TimeCalcProperty.DOT_VISIBLE.getKey());
|
= new BooleanProperty(TimeCalcProperty.DOT_VISIBLE.getKey());
|
||||||
|
public final BooleanProperty dotHiddenProperty
|
||||||
|
= new BooleanProperty(TimeCalcProperty.DOT_HIDDEN.getKey());
|
||||||
public final StringProperty dotTypeProperty
|
public final StringProperty dotTypeProperty
|
||||||
= new StringProperty(TimeCalcProperty.DOT_TYPE.getKey());
|
= new StringProperty(TimeCalcProperty.DOT_TYPE.getKey());
|
||||||
public final BooleanProperty circleVisibleProperty
|
public final BooleanProperty circleVisibleProperty
|
||||||
= new BooleanProperty(TimeCalcProperty.CIRCLE_VISIBLE.getKey());
|
= new BooleanProperty(TimeCalcProperty.CIRCLE_VISIBLE.getKey());
|
||||||
|
public final BooleanProperty circleHiddenProperty
|
||||||
|
= new BooleanProperty(TimeCalcProperty.CIRCLE_HIDDEN.getKey());
|
||||||
public final StringProperty circleTypeProperty
|
public final StringProperty circleTypeProperty
|
||||||
= new StringProperty(TimeCalcProperty.CIRCLE_TYPE.getKey());
|
= new StringProperty(TimeCalcProperty.CIRCLE_TYPE.getKey());
|
||||||
public final BooleanProperty walkingHumanVisibleProperty
|
public final BooleanProperty walkingHumanVisibleProperty
|
||||||
= new BooleanProperty(
|
= new BooleanProperty(
|
||||||
TimeCalcProperty.WALKING_HUMAN_VISIBLE.getKey());
|
TimeCalcProperty.WALKING_HUMAN_VISIBLE.getKey());
|
||||||
|
public final BooleanProperty walkingHumanHiddenProperty
|
||||||
|
= new BooleanProperty(
|
||||||
|
TimeCalcProperty.WALKING_HUMAN_HIDDEN.getKey());
|
||||||
public final StringProperty walkingHumanTypeProperty
|
public final StringProperty walkingHumanTypeProperty
|
||||||
= new StringProperty(TimeCalcProperty.WALKING_HUMAN_TYPE.getKey());
|
= new StringProperty(TimeCalcProperty.WALKING_HUMAN_TYPE.getKey());
|
||||||
public final BooleanProperty swingVisibleProperty
|
public final BooleanProperty swingVisibleProperty
|
||||||
= new BooleanProperty(TimeCalcProperty.SWING_VISIBLE.getKey());
|
= new BooleanProperty(TimeCalcProperty.SWING_VISIBLE.getKey());
|
||||||
|
public final BooleanProperty swingHiddenProperty
|
||||||
|
= new BooleanProperty(TimeCalcProperty.SWING_HIDDEN.getKey());
|
||||||
public final StringProperty swingTypeProperty
|
public final StringProperty swingTypeProperty
|
||||||
= new StringProperty(TimeCalcProperty.SWING_TYPE.getKey());
|
= new StringProperty(TimeCalcProperty.SWING_TYPE.getKey());
|
||||||
public final BooleanProperty swingQuarterIconVisibleProperty
|
public final BooleanProperty swingQuarterIconVisibleProperty
|
||||||
@ -184,12 +216,16 @@ public class TimeCalcConfiguration {
|
|||||||
|
|
||||||
public final BooleanProperty lifeVisibleProperty
|
public final BooleanProperty lifeVisibleProperty
|
||||||
= new BooleanProperty(TimeCalcProperty.LIFE_VISIBLE.getKey());
|
= new BooleanProperty(TimeCalcProperty.LIFE_VISIBLE.getKey());
|
||||||
|
public final BooleanProperty lifeHiddenProperty
|
||||||
|
= new BooleanProperty(TimeCalcProperty.LIFE_HIDDEN.getKey());
|
||||||
public final StringProperty lifeTypeProperty
|
public final StringProperty lifeTypeProperty
|
||||||
= new StringProperty(TimeCalcProperty.LIFE_TYPE.getKey());
|
= new StringProperty(TimeCalcProperty.LIFE_TYPE.getKey());
|
||||||
public final StringProperty lifeBirthDateProperty
|
public final StringProperty lifeBirthDateProperty
|
||||||
= new StringProperty(TimeCalcProperty.LIFE_BIRTH_DATE.getKey());
|
= new StringProperty(TimeCalcProperty.LIFE_BIRTH_DATE.getKey());
|
||||||
public final BooleanProperty moneyVisibleProperty
|
public final BooleanProperty moneyVisibleProperty
|
||||||
= new BooleanProperty(TimeCalcProperty.MONEY_VISIBLE.getKey());
|
= new BooleanProperty(TimeCalcProperty.MONEY_VISIBLE.getKey());
|
||||||
|
public final BooleanProperty moneyHiddenProperty
|
||||||
|
= new BooleanProperty(TimeCalcProperty.MONEY_HIDDEN.getKey());
|
||||||
public final StringProperty moneyTypeProperty
|
public final StringProperty moneyTypeProperty
|
||||||
= new StringProperty(TimeCalcProperty.MONEY_TYPE.getKey());
|
= new StringProperty(TimeCalcProperty.MONEY_TYPE.getKey());
|
||||||
public final IntegerProperty moneyPerMonthProperty
|
public final IntegerProperty moneyPerMonthProperty
|
||||||
@ -198,6 +234,8 @@ public class TimeCalcConfiguration {
|
|||||||
= new StringProperty(TimeCalcProperty.MONEY_CURRENCY.getKey());
|
= new StringProperty(TimeCalcProperty.MONEY_CURRENCY.getKey());
|
||||||
public final BooleanProperty weatherVisibleProperty
|
public final BooleanProperty weatherVisibleProperty
|
||||||
= new BooleanProperty(TimeCalcProperty.WEATHER_VISIBLE.getKey());
|
= new BooleanProperty(TimeCalcProperty.WEATHER_VISIBLE.getKey());
|
||||||
|
public final BooleanProperty weatherHiddenProperty
|
||||||
|
= new BooleanProperty(TimeCalcProperty.WEATHER_HIDDEN.getKey());
|
||||||
public final StringProperty mainWindowCustomTitleProperty
|
public final StringProperty mainWindowCustomTitleProperty
|
||||||
= new StringProperty(
|
= new StringProperty(
|
||||||
TimeCalcProperty.MAIN_WINDOW_CUSTOM_TITLE.getKey());
|
TimeCalcProperty.MAIN_WINDOW_CUSTOM_TITLE.getKey());
|
||||||
@ -299,6 +337,21 @@ public class TimeCalcConfiguration {
|
|||||||
profileNameProperty,
|
profileNameProperty,
|
||||||
activityNeededFlagsProperty,
|
activityNeededFlagsProperty,
|
||||||
speedProperty,
|
speedProperty,
|
||||||
|
clockHiddenProperty,
|
||||||
|
batteryMinuteHiddenProperty,
|
||||||
|
batteryHourHiddenProperty,
|
||||||
|
batteryDayHiddenProperty,
|
||||||
|
batteryWeekHiddenProperty,
|
||||||
|
batteryMonthHiddenProperty,
|
||||||
|
batteryYearHiddenProperty,
|
||||||
|
squareHiddenProperty,
|
||||||
|
circleHiddenProperty,
|
||||||
|
walkingHumanHiddenProperty,
|
||||||
|
swingHiddenProperty,
|
||||||
|
lifeHiddenProperty,
|
||||||
|
moneyHiddenProperty,
|
||||||
|
weatherHiddenProperty,
|
||||||
|
dotHiddenProperty,
|
||||||
testEnabledProperty,
|
testEnabledProperty,
|
||||||
testYearCustomProperty,
|
testYearCustomProperty,
|
||||||
testMonthCustomProperty,
|
testMonthCustomProperty,
|
||||||
|
@ -51,6 +51,7 @@ public enum TimeCalcProperty {
|
|||||||
CLOCK_SMILEY_VISIBLE("clock.smiley.visible","Clock : Smiley : Visible"),
|
CLOCK_SMILEY_VISIBLE("clock.smiley.visible","Clock : Smiley : Visible"),
|
||||||
CLOCK_PERCENT_PROGRESS_VISIBLE("clock.percent-progress.visible","Clock : Percent progress : Visible"),
|
CLOCK_PERCENT_PROGRESS_VISIBLE("clock.percent-progress.visible","Clock : Percent progress : Visible"),
|
||||||
CLOCK_CIRCLE_PROGRESS_VISIBLE("clock.circle-progress.visible", "Clock : Circle Progress"),
|
CLOCK_CIRCLE_PROGRESS_VISIBLE("clock.circle-progress.visible", "Clock : Circle Progress"),
|
||||||
|
CLOCK_HIDDEN("clock.hidden", "Clock : Hidden"),
|
||||||
//
|
//
|
||||||
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",
|
||||||
@ -68,6 +69,12 @@ public enum TimeCalcProperty {
|
|||||||
BATTERY_WEEK_VISIBLE("battery.week.visible", "Battery : Week"),
|
BATTERY_WEEK_VISIBLE("battery.week.visible", "Battery : Week"),
|
||||||
BATTERY_MONTH_VISIBLE("battery.month.visible", "Battery : Month"),
|
BATTERY_MONTH_VISIBLE("battery.month.visible", "Battery : Month"),
|
||||||
BATTERY_YEAR_VISIBLE("battery.year.visible", "Battery : Year"),
|
BATTERY_YEAR_VISIBLE("battery.year.visible", "Battery : Year"),
|
||||||
|
BATTERY_MINUTE_HIDDEN("battery.minute.hidden", "Battery : Minute : Hidden"),
|
||||||
|
BATTERY_HOUR_HIDDEN("battery.hour.hidden", "Battery : Hour : Hidden"),
|
||||||
|
BATTERY_DAY_HIDDEN("battery.day.hidden", "Battery : Day : Hidden"),
|
||||||
|
BATTERY_WEEK_HIDDEN("battery.week.hidden", "Battery : Week : Hidden"),
|
||||||
|
BATTERY_MONTH_HIDDEN("battery.month.hidden", "Battery : Month : Hidden"),
|
||||||
|
BATTERY_YEAR_HIDDEN("battery.year.hidden", "Battery : Year : Hidden"),
|
||||||
BATTERY_BLINKING_IF_CRITICAL_LOW("battery.blinking-if-critical-low",
|
BATTERY_BLINKING_IF_CRITICAL_LOW("battery.blinking-if-critical-low",
|
||||||
"Battery : Blinking, if critical low"),
|
"Battery : Blinking, if critical low"),
|
||||||
BATTERY_QUARTER_ICON_VISIBLE("battery.quarter-icon.visible", "Battery : Quarter icon"),
|
BATTERY_QUARTER_ICON_VISIBLE("battery.quarter-icon.visible", "Battery : Quarter icon"),
|
||||||
@ -81,23 +88,31 @@ public enum TimeCalcProperty {
|
|||||||
SMILEYS_COLORED("smileys.colored", "Smileys : Colored"),
|
SMILEYS_COLORED("smileys.colored", "Smileys : Colored"),
|
||||||
SQUARE_VISIBLE("square.visible", "Square"),
|
SQUARE_VISIBLE("square.visible", "Square"),
|
||||||
SQUARE_TYPE("square.type", "Square : Type"),
|
SQUARE_TYPE("square.type", "Square : Type"),
|
||||||
|
SQUARE_HIDDEN("square.hidden", "Square : Hidden"),
|
||||||
DOT_VISIBLE("dot.visible", "Dot"),
|
DOT_VISIBLE("dot.visible", "Dot"),
|
||||||
DOT_TYPE("dot.type", "Dot : Type"),
|
DOT_TYPE("dot.type", "Dot : Type"),
|
||||||
|
DOT_HIDDEN("dot.hidden", "Dot : Hidden"),
|
||||||
CIRCLE_VISIBLE("circle.visible", "Circle"),
|
CIRCLE_VISIBLE("circle.visible", "Circle"),
|
||||||
CIRCLE_TYPE("circle.type", "Circle : Type"),
|
CIRCLE_TYPE("circle.type", "Circle : Type"),
|
||||||
|
CIRCLE_HIDDEN("circle.hidden", "Circle : Hidden"),
|
||||||
WALKING_HUMAN_VISIBLE("walking-human.visible", "Walking Human"),
|
WALKING_HUMAN_VISIBLE("walking-human.visible", "Walking Human"),
|
||||||
WALKING_HUMAN_TYPE("walking-human.type", "Walking Human : Type"),
|
WALKING_HUMAN_TYPE("walking-human.type", "Walking Human : Type"),
|
||||||
|
WALKING_HUMAN_HIDDEN("walking-human.hidden", "Walking Human : Hidden"),
|
||||||
SWING_VISIBLE("swing.visible", "Swing"),
|
SWING_VISIBLE("swing.visible", "Swing"),
|
||||||
SWING_TYPE("swing.type", "Swing : Type"),
|
SWING_TYPE("swing.type", "Swing : Type"),
|
||||||
|
SWING_HIDDEN("swing.hidden", "Swing : Hidden"),
|
||||||
SWING_QUARTER_ICON_VISIBLE("swing.quarter-icon.visible", "Swing: Quarter icon"),
|
SWING_QUARTER_ICON_VISIBLE("swing.quarter-icon.visible", "Swing: Quarter icon"),
|
||||||
LIFE_VISIBLE("life.visible", "Life"),
|
LIFE_VISIBLE("life.visible", "Life"),
|
||||||
LIFE_TYPE("life.type", "Life : Type"),
|
LIFE_TYPE("life.type", "Life : Type"),
|
||||||
|
LIFE_HIDDEN("life.hidden", "Life : Hidden"),
|
||||||
LIFE_BIRTH_DATE("life.birth-date", "Life : Birth date"),
|
LIFE_BIRTH_DATE("life.birth-date", "Life : Birth date"),
|
||||||
MONEY_VISIBLE("money.visible", "Money"),
|
MONEY_VISIBLE("money.visible", "Money"),
|
||||||
MONEY_TYPE("money.type", "Money : Type"),
|
MONEY_TYPE("money.type", "Money : Type"),
|
||||||
|
MONEY_HIDDEN("money.hidden", "Money : Hidden"),
|
||||||
MONEY_PER_MONTH("money.per-month", "Money : Per month", Integer.class),
|
MONEY_PER_MONTH("money.per-month", "Money : Per month", Integer.class),
|
||||||
MONEY_CURRENCY("money.currency", "Money : Currency", String.class),
|
MONEY_CURRENCY("money.currency", "Money : Currency", String.class),
|
||||||
WEATHER_VISIBLE("weather.visible", "Weather"),
|
WEATHER_VISIBLE("weather.visible", "Weather"),
|
||||||
|
WEATHER_HIDDEN("weather.hidden", "Weather : Hidden"),
|
||||||
MAIN_WINDOW_CUSTOM_TITLE("main-window.custom-title","Main Window : Custom Title"),
|
MAIN_WINDOW_CUSTOM_TITLE("main-window.custom-title","Main Window : Custom Title"),
|
||||||
PROFILE_NAME("profile.name", "Profile : Name"),
|
PROFILE_NAME("profile.name", "Profile : Name"),
|
||||||
TEST_ENABLED("test.enabled", "Test : Enabled", Boolean.class),
|
TEST_ENABLED("test.enabled", "Test : Enabled", Boolean.class),
|
||||||
|
@ -16,7 +16,6 @@ import org.nanoboot.utils.timecalc.utils.property.StringProperty;
|
|||||||
|
|
||||||
import javax.swing.ImageIcon;
|
import javax.swing.ImageIcon;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JMenu;
|
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.Timer;
|
import javax.swing.Timer;
|
||||||
import java.awt.BasicStroke;
|
import java.awt.BasicStroke;
|
||||||
@ -88,8 +87,8 @@ public class Widget extends JPanel implements
|
|||||||
private static final Color PURPLE_STRONGLY_COLORED = new Color(153,51,255);
|
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 static final Color PURPLE_WEAKLY_COLORED = new Color(204,153,255);
|
||||||
|
|
||||||
@Getter
|
public final BooleanProperty hiddenProperty
|
||||||
private boolean hidden;
|
= new BooleanProperty("hiddenProperty", false);
|
||||||
|
|
||||||
private WidgetMenu widgetMenu = null;
|
private WidgetMenu widgetMenu = null;
|
||||||
public Widget() {
|
public Widget() {
|
||||||
@ -117,8 +116,8 @@ public class Widget extends JPanel implements
|
|||||||
addMouseListener(new MouseListener() {
|
addMouseListener(new MouseListener() {
|
||||||
@Override
|
@Override
|
||||||
public void mouseClicked(MouseEvent e) {
|
public void mouseClicked(MouseEvent e) {
|
||||||
if(hidden) {
|
if(hiddenProperty.isEnabled()) {
|
||||||
hidden = false;
|
hiddenProperty.disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mouseOverCloseButton) {
|
if (mouseOverCloseButton) {
|
||||||
@ -127,7 +126,7 @@ public class Widget extends JPanel implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(mouseOverMinimizeButton) {
|
if(mouseOverMinimizeButton) {
|
||||||
hidden = true;
|
hiddenProperty.enable();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,8 +244,8 @@ public class Widget extends JPanel implements
|
|||||||
Visibility visibility
|
Visibility visibility
|
||||||
= Visibility.valueOf(visibilityProperty.getValue());
|
= Visibility.valueOf(visibilityProperty.getValue());
|
||||||
|
|
||||||
if (visibleProperty.isDisabled() || hidden) {
|
if (visibleProperty.isDisabled() || hiddenProperty.isEnabled()) {
|
||||||
if(hidden) {
|
if(hiddenProperty.isEnabled()) {
|
||||||
if(this.smileyIcon != null) {
|
if(this.smileyIcon != null) {
|
||||||
this.remove(this.smileyIcon);
|
this.remove(this.smileyIcon);
|
||||||
this.smileyIcon = null;
|
this.smileyIcon = null;
|
||||||
@ -261,7 +260,22 @@ public class Widget extends JPanel implements
|
|||||||
brush.fillRect(1, 1, getWidth() - 2, getHeight() - 2);
|
brush.fillRect(1, 1, getWidth() - 2, getHeight() - 2);
|
||||||
brush.setColor(currentColor);
|
brush.setColor(currentColor);
|
||||||
}
|
}
|
||||||
brush.drawString("Show", (int) (getWidth() * 0.5 - 10), (int) (getHeight() * 0.5 - 10));
|
if(!visibility.isStronglyColored()) {
|
||||||
|
brush.setColor(Color.LIGHT_GRAY);
|
||||||
|
}
|
||||||
|
int row = 10;
|
||||||
|
int x = (int)(getWidth() > 100 ? (int) (getWidth() * 0.4) : (int) (getWidth() * 0.1));
|
||||||
|
brush.drawString("Show", x, row);
|
||||||
|
row = row + 20;
|
||||||
|
String[] nameArray = getHumanName().split(" ");
|
||||||
|
for(int i = 0; i< nameArray.length; i++) {
|
||||||
|
brush.drawString(
|
||||||
|
nameArray[i],
|
||||||
|
x
|
||||||
|
, row);
|
||||||
|
row = row + 12;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//nothing to do
|
//nothing to do
|
||||||
return;
|
return;
|
||||||
@ -563,6 +577,21 @@ public class Widget extends JPanel implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void hideWidget() {
|
public void hideWidget() {
|
||||||
this.hidden = true;
|
this.hiddenProperty.enable();
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getHumanName() {
|
||||||
|
String name = getClass().getSimpleName();
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (char ch : name.toCharArray()) {
|
||||||
|
if (Character.isUpperCase(ch)) {
|
||||||
|
sb.append(' ').append(Character.toLowerCase(ch));
|
||||||
|
} else {
|
||||||
|
sb.append(ch);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
String result = sb.toString().trim();
|
||||||
|
return result.substring(0, 1).toUpperCase() + result.substring(1, result.length());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,8 +69,8 @@ public class ConfigWindow extends TWindow {
|
|||||||
private final JPanel panelInsideScrollPaneSmileys;
|
private final JPanel panelInsideScrollPaneSmileys;
|
||||||
private final JPanel panelInsideScrollPaneTest;
|
private final JPanel panelInsideScrollPaneTest;
|
||||||
private final JPanel panelInsideScrollPaneOther;
|
private final JPanel panelInsideScrollPaneOther;
|
||||||
private final int[] currentY = new int[]{SwingUtils.MARGIN,SwingUtils.MARGIN,SwingUtils.MARGIN,SwingUtils.MARGIN,SwingUtils.MARGIN,SwingUtils.MARGIN,SwingUtils.MARGIN};
|
private final int[] currentY = new int[]{SwingUtils.MARGIN, SwingUtils.MARGIN, SwingUtils.MARGIN, SwingUtils.MARGIN, SwingUtils.MARGIN, SwingUtils.MARGIN, SwingUtils.MARGIN};
|
||||||
private final int[] currentX = new int[]{SwingUtils.MARGIN,SwingUtils.MARGIN,SwingUtils.MARGIN,SwingUtils.MARGIN,SwingUtils.MARGIN,SwingUtils.MARGIN,SwingUtils.MARGIN};
|
private final int[] currentX = new int[]{SwingUtils.MARGIN, SwingUtils.MARGIN, SwingUtils.MARGIN, SwingUtils.MARGIN, SwingUtils.MARGIN, SwingUtils.MARGIN, SwingUtils.MARGIN};
|
||||||
private final List<JComponent> propertiesList = new ArrayList<>();
|
private final List<JComponent> propertiesList = new ArrayList<>();
|
||||||
private final Map<TimeCalcProperty, JComponent> propertiesMap = new HashMap<>();
|
private final Map<TimeCalcProperty, JComponent> propertiesMap = new HashMap<>();
|
||||||
private final TButton enableAsMuchAsPossible
|
private final TButton enableAsMuchAsPossible
|
||||||
@ -122,16 +122,16 @@ public class ConfigWindow extends TWindow {
|
|||||||
.getKey());
|
.getKey());
|
||||||
private final JCheckBox clockSmileyVisibleProperty
|
private final JCheckBox clockSmileyVisibleProperty
|
||||||
= new JCheckBox(
|
= new JCheckBox(
|
||||||
TimeCalcProperty.CLOCK_SMILEY_VISIBLE
|
TimeCalcProperty.CLOCK_SMILEY_VISIBLE
|
||||||
.getKey());
|
.getKey());
|
||||||
private final JCheckBox clockPercentProgressVisibleProperty
|
private final JCheckBox clockPercentProgressVisibleProperty
|
||||||
= new JCheckBox(
|
= new JCheckBox(
|
||||||
TimeCalcProperty.CLOCK_PERCENT_PROGRESS_VISIBLE
|
TimeCalcProperty.CLOCK_PERCENT_PROGRESS_VISIBLE
|
||||||
.getKey());
|
.getKey());
|
||||||
private final JCheckBox clockCircleProgressVisibleProperty
|
private final JCheckBox clockCircleProgressVisibleProperty
|
||||||
= new JCheckBox(
|
= new JCheckBox(
|
||||||
TimeCalcProperty.CLOCK_CIRCLE_PROGRESS_VISIBLE
|
TimeCalcProperty.CLOCK_CIRCLE_PROGRESS_VISIBLE
|
||||||
.getKey());
|
.getKey());
|
||||||
//
|
//
|
||||||
private final JCheckBox batteryWavesVisibleProperty
|
private final JCheckBox batteryWavesVisibleProperty
|
||||||
= new JCheckBox(TimeCalcProperty.BATTERY_WAVES_VISIBLE.getKey());
|
= new JCheckBox(TimeCalcProperty.BATTERY_WAVES_VISIBLE.getKey());
|
||||||
@ -167,7 +167,7 @@ public class ConfigWindow extends TWindow {
|
|||||||
TimeCalcProperty.BATTERY_BLINKING_IF_CRITICAL_LOW.getKey());
|
TimeCalcProperty.BATTERY_BLINKING_IF_CRITICAL_LOW.getKey());
|
||||||
private final JCheckBox batteryQuarterIconVisibleProperty
|
private final JCheckBox batteryQuarterIconVisibleProperty
|
||||||
= new JCheckBox(
|
= new JCheckBox(
|
||||||
TimeCalcProperty.BATTERY_QUARTER_ICON_VISIBLE.getKey());
|
TimeCalcProperty.BATTERY_QUARTER_ICON_VISIBLE.getKey());
|
||||||
private final JCheckBox jokesVisibleProperty
|
private final JCheckBox jokesVisibleProperty
|
||||||
= new JCheckBox(TimeCalcProperty.JOKES_VISIBLE.getKey());
|
= new JCheckBox(TimeCalcProperty.JOKES_VISIBLE.getKey());
|
||||||
private final JCheckBox commandsVisibleProperty
|
private final JCheckBox commandsVisibleProperty
|
||||||
@ -228,6 +228,40 @@ public class ConfigWindow extends TWindow {
|
|||||||
= new JTextField(TimeCalcProperty.ACTIVITY_NEEDED_FLAGS.getKey());
|
= new JTextField(TimeCalcProperty.ACTIVITY_NEEDED_FLAGS.getKey());
|
||||||
public final JTextField speedProperty
|
public final JTextField speedProperty
|
||||||
= new JTextField(TimeCalcProperty.SPEED.getKey());
|
= new JTextField(TimeCalcProperty.SPEED.getKey());
|
||||||
|
|
||||||
|
//
|
||||||
|
public final JCheckBox clockHiddenProperty
|
||||||
|
= new JCheckBox(TimeCalcProperty.CLOCK_HIDDEN.getKey());
|
||||||
|
public final JCheckBox batteryMinuteHiddenProperty
|
||||||
|
= new JCheckBox(TimeCalcProperty.BATTERY_MINUTE_HIDDEN.getKey());
|
||||||
|
public final JCheckBox batteryHourHiddenProperty
|
||||||
|
= new JCheckBox(TimeCalcProperty.BATTERY_HOUR_HIDDEN.getKey());
|
||||||
|
public final JCheckBox batteryDayHiddenProperty
|
||||||
|
= new JCheckBox(TimeCalcProperty.BATTERY_DAY_HIDDEN.getKey());
|
||||||
|
public final JCheckBox batteryWeekHiddenProperty
|
||||||
|
= new JCheckBox(TimeCalcProperty.BATTERY_WEEK_HIDDEN.getKey());
|
||||||
|
public final JCheckBox batteryMonthHiddenProperty
|
||||||
|
= new JCheckBox(TimeCalcProperty.BATTERY_MONTH_HIDDEN.getKey());
|
||||||
|
public final JCheckBox batteryYearHiddenProperty
|
||||||
|
= new JCheckBox(TimeCalcProperty.BATTERY_YEAR_HIDDEN.getKey());
|
||||||
|
public final JCheckBox squareHiddenProperty
|
||||||
|
= new JCheckBox(TimeCalcProperty.SQUARE_HIDDEN.getKey());
|
||||||
|
public final JCheckBox circleHiddenProperty
|
||||||
|
= new JCheckBox(TimeCalcProperty.CIRCLE_HIDDEN.getKey());
|
||||||
|
public final JCheckBox walkingHumanHiddenProperty
|
||||||
|
= new JCheckBox(TimeCalcProperty.WALKING_HUMAN_HIDDEN.getKey());
|
||||||
|
public final JCheckBox swingHiddenProperty
|
||||||
|
= new JCheckBox(TimeCalcProperty.SWING_HIDDEN.getKey());
|
||||||
|
public final JCheckBox lifeHiddenProperty
|
||||||
|
= new JCheckBox(TimeCalcProperty.LIFE_HIDDEN.getKey());
|
||||||
|
public final JCheckBox moneyHiddenProperty
|
||||||
|
= new JCheckBox(TimeCalcProperty.MONEY_HIDDEN.getKey());
|
||||||
|
public final JCheckBox weatherHiddenProperty
|
||||||
|
= new JCheckBox(TimeCalcProperty.WEATHER_HIDDEN.getKey());
|
||||||
|
public final JCheckBox dotHiddenProperty
|
||||||
|
= new JCheckBox(TimeCalcProperty.DOT_HIDDEN.getKey());
|
||||||
|
|
||||||
|
//
|
||||||
private final JCheckBox testEnabledProperty
|
private final JCheckBox testEnabledProperty
|
||||||
= new JCheckBox(TimeCalcProperty.TEST_ENABLED.getKey());
|
= new JCheckBox(TimeCalcProperty.TEST_ENABLED.getKey());
|
||||||
private final JTextField testClockCustomYearProperty
|
private final JTextField testClockCustomYearProperty
|
||||||
@ -245,7 +279,7 @@ public class ConfigWindow extends TWindow {
|
|||||||
private final JTextField testClockCustomMillisecondProperty
|
private final JTextField testClockCustomMillisecondProperty
|
||||||
= new JTextField(TimeCalcProperty.TEST_CLOCK_CUSTOM_MILLISECOND.getKey());
|
= new JTextField(TimeCalcProperty.TEST_CLOCK_CUSTOM_MILLISECOND.getKey());
|
||||||
private final TTabbedPane tp;
|
private final TTabbedPane tp;
|
||||||
|
|
||||||
public ConfigWindow(TimeCalcConfiguration timeCalcConfiguration) {
|
public ConfigWindow(TimeCalcConfiguration timeCalcConfiguration) {
|
||||||
this.timeCalcConfiguration = timeCalcConfiguration;
|
this.timeCalcConfiguration = timeCalcConfiguration;
|
||||||
setTitle("Configuration");
|
setTitle("Configuration");
|
||||||
@ -263,7 +297,7 @@ public class ConfigWindow extends TWindow {
|
|||||||
this.panelInsideScrollPaneSmileys = new JPanel();
|
this.panelInsideScrollPaneSmileys = new JPanel();
|
||||||
this.panelInsideScrollPaneTest = new JPanel();
|
this.panelInsideScrollPaneTest = new JPanel();
|
||||||
this.panelInsideScrollPaneOther = new JPanel();
|
this.panelInsideScrollPaneOther = new JPanel();
|
||||||
|
|
||||||
List<JPanel> panelsInsideScrollPane = Stream.of(
|
List<JPanel> panelsInsideScrollPane = Stream.of(
|
||||||
panelInsideScrollPaneClock,
|
panelInsideScrollPaneClock,
|
||||||
panelInsideScrollPaneBattery,
|
panelInsideScrollPaneBattery,
|
||||||
@ -272,7 +306,7 @@ public class ConfigWindow extends TWindow {
|
|||||||
panelInsideScrollPaneSmileys,
|
panelInsideScrollPaneSmileys,
|
||||||
panelInsideScrollPaneTest,
|
panelInsideScrollPaneTest,
|
||||||
panelInsideScrollPaneOther).collect(Collectors.toList());
|
panelInsideScrollPaneOther).collect(Collectors.toList());
|
||||||
panelsInsideScrollPane.forEach(p-> {
|
panelsInsideScrollPane.forEach(p -> {
|
||||||
final BoxLayout boxLayout = new BoxLayout(p, BoxLayout.Y_AXIS);
|
final BoxLayout boxLayout = new BoxLayout(p, BoxLayout.Y_AXIS);
|
||||||
p.setLayout(boxLayout);
|
p.setLayout(boxLayout);
|
||||||
p.setAlignmentX(LEFT_ALIGNMENT);
|
p.setAlignmentX(LEFT_ALIGNMENT);
|
||||||
@ -284,7 +318,6 @@ public class ConfigWindow extends TWindow {
|
|||||||
//mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
|
//mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
|
||||||
mainPanel.setAlignmentX(LEFT_ALIGNMENT);
|
mainPanel.setAlignmentX(LEFT_ALIGNMENT);
|
||||||
|
|
||||||
|
|
||||||
JScrollPane scrollPaneClock = new JScrollPane(panelInsideScrollPaneClock);
|
JScrollPane scrollPaneClock = new JScrollPane(panelInsideScrollPaneClock);
|
||||||
JScrollPane scrollPaneBattery = new JScrollPane(panelInsideScrollPaneBattery);
|
JScrollPane scrollPaneBattery = new JScrollPane(panelInsideScrollPaneBattery);
|
||||||
JScrollPane scrollPaneLife = new JScrollPane(panelInsideScrollPaneLife);
|
JScrollPane scrollPaneLife = new JScrollPane(panelInsideScrollPaneLife);
|
||||||
@ -292,8 +325,8 @@ public class ConfigWindow extends TWindow {
|
|||||||
JScrollPane scrollPaneSmileys = new JScrollPane(panelInsideScrollPaneSmileys);
|
JScrollPane scrollPaneSmileys = new JScrollPane(panelInsideScrollPaneSmileys);
|
||||||
JScrollPane scrollPaneTest = new JScrollPane(panelInsideScrollPaneTest);
|
JScrollPane scrollPaneTest = new JScrollPane(panelInsideScrollPaneTest);
|
||||||
JScrollPane scrollPaneOther = new JScrollPane(panelInsideScrollPaneOther);
|
JScrollPane scrollPaneOther = new JScrollPane(panelInsideScrollPaneOther);
|
||||||
|
|
||||||
List<JScrollPane> scrollPanes = Stream.of(
|
List<JScrollPane> scrollPanes = Stream.of(
|
||||||
scrollPaneClock,
|
scrollPaneClock,
|
||||||
scrollPaneBattery,
|
scrollPaneBattery,
|
||||||
scrollPaneLife,
|
scrollPaneLife,
|
||||||
@ -301,8 +334,8 @@ public class ConfigWindow extends TWindow {
|
|||||||
scrollPaneSmileys,
|
scrollPaneSmileys,
|
||||||
scrollPaneTest,
|
scrollPaneTest,
|
||||||
scrollPaneOther
|
scrollPaneOther
|
||||||
).collect(Collectors.toList());
|
).collect(Collectors.toList());
|
||||||
|
|
||||||
tp.add("Clock", scrollPaneClock);
|
tp.add("Clock", scrollPaneClock);
|
||||||
tp.add("Battery", scrollPaneBattery);
|
tp.add("Battery", scrollPaneBattery);
|
||||||
tp.add("Life", scrollPaneLife);
|
tp.add("Life", scrollPaneLife);
|
||||||
@ -310,8 +343,8 @@ public class ConfigWindow extends TWindow {
|
|||||||
tp.add("Smileys", scrollPaneSmileys);
|
tp.add("Smileys", scrollPaneSmileys);
|
||||||
tp.add("Test", scrollPaneTest);
|
tp.add("Test", scrollPaneTest);
|
||||||
tp.add("Other", scrollPaneOther);
|
tp.add("Other", scrollPaneOther);
|
||||||
scrollPanes.forEach(s->
|
scrollPanes.forEach(s
|
||||||
{
|
-> {
|
||||||
s.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
|
s.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
|
||||||
s.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
|
s.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
|
||||||
s.setPreferredSize(
|
s.setPreferredSize(
|
||||||
@ -335,7 +368,7 @@ public class ConfigWindow extends TWindow {
|
|||||||
.getWidth() + SwingUtils.MARGIN, SwingUtils.MARGIN, 250,
|
.getWidth() + SwingUtils.MARGIN, SwingUtils.MARGIN, 250,
|
||||||
HEIGHT1);
|
HEIGHT1);
|
||||||
|
|
||||||
scrollPanes.stream().forEach(s->s.setBounds(10, 10, Integer.MAX_VALUE,Integer.MAX_VALUE));
|
scrollPanes.stream().forEach(s -> s.setBounds(10, 10, Integer.MAX_VALUE, Integer.MAX_VALUE));
|
||||||
|
|
||||||
mainPanel.add(tp);
|
mainPanel.add(tp);
|
||||||
|
|
||||||
@ -405,12 +438,28 @@ public class ConfigWindow extends TWindow {
|
|||||||
swingVisibleProperty.setSelected(enable);
|
swingVisibleProperty.setSelected(enable);
|
||||||
swingQuarterIconVisibleProperty.setSelected(enable);
|
swingQuarterIconVisibleProperty.setSelected(enable);
|
||||||
walkingHumanVisibleProperty.setSelected(enable);
|
walkingHumanVisibleProperty.setSelected(enable);
|
||||||
|
clockHiddenProperty.setSelected(!enable);
|
||||||
|
batteryMinuteHiddenProperty.setSelected(!enable);
|
||||||
|
batteryHourHiddenProperty.setSelected(!enable);
|
||||||
|
batteryDayHiddenProperty.setSelected(!enable);
|
||||||
|
batteryWeekHiddenProperty.setSelected(!enable);
|
||||||
|
batteryMonthHiddenProperty.setSelected(!enable);
|
||||||
|
batteryYearHiddenProperty.setSelected(!enable);
|
||||||
|
squareHiddenProperty.setSelected(!enable);
|
||||||
|
circleHiddenProperty.setSelected(!enable);
|
||||||
|
walkingHumanHiddenProperty.setSelected(!enable);
|
||||||
|
swingHiddenProperty.setSelected(!enable);
|
||||||
|
lifeHiddenProperty.setSelected(!enable);
|
||||||
|
moneyHiddenProperty.setSelected(!enable);
|
||||||
|
weatherHiddenProperty.setSelected(!enable);
|
||||||
|
dotHiddenProperty.setSelected(!enable);
|
||||||
MainWindow.hideShowFormsCheckBox.setSelected(enable);
|
MainWindow.hideShowFormsCheckBox.setSelected(enable);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
propertiesList.addAll(Arrays.asList(
|
propertiesList.addAll(Arrays.asList(
|
||||||
clockVisibleProperty,
|
clockVisibleProperty,
|
||||||
|
clockHiddenProperty,
|
||||||
clockHandsHourVisibleProperty,
|
clockHandsHourVisibleProperty,
|
||||||
clockHandsMinuteVisibleProperty,
|
clockHandsMinuteVisibleProperty,
|
||||||
clockHandsSecondVisibleProperty,
|
clockHandsSecondVisibleProperty,
|
||||||
@ -443,6 +492,12 @@ public class ConfigWindow extends TWindow {
|
|||||||
batteryWeekVisibleProperty,
|
batteryWeekVisibleProperty,
|
||||||
batteryMonthVisibleProperty,
|
batteryMonthVisibleProperty,
|
||||||
batteryYearVisibleProperty,
|
batteryYearVisibleProperty,
|
||||||
|
batteryMinuteHiddenProperty,
|
||||||
|
batteryHourHiddenProperty,
|
||||||
|
batteryDayHiddenProperty,
|
||||||
|
batteryWeekHiddenProperty,
|
||||||
|
batteryMonthHiddenProperty,
|
||||||
|
batteryYearHiddenProperty,
|
||||||
batteryBlinkingIfCriticalLowVisibleProperty,
|
batteryBlinkingIfCriticalLowVisibleProperty,
|
||||||
batteryQuarterIconVisibleProperty,
|
batteryQuarterIconVisibleProperty,
|
||||||
//
|
//
|
||||||
@ -461,24 +516,32 @@ public class ConfigWindow extends TWindow {
|
|||||||
commandsVisibleProperty,
|
commandsVisibleProperty,
|
||||||
notificationsVisibleProperty,
|
notificationsVisibleProperty,
|
||||||
squareVisibleProperty,
|
squareVisibleProperty,
|
||||||
|
squareHiddenProperty,
|
||||||
squareTypeProperty,
|
squareTypeProperty,
|
||||||
dotVisibleProperty,
|
dotVisibleProperty,
|
||||||
|
dotHiddenProperty,
|
||||||
dotTypeProperty,
|
dotTypeProperty,
|
||||||
circleVisibleProperty,
|
circleVisibleProperty,
|
||||||
|
circleHiddenProperty,
|
||||||
circleTypeProperty,
|
circleTypeProperty,
|
||||||
swingVisibleProperty,
|
swingVisibleProperty,
|
||||||
|
swingHiddenProperty,
|
||||||
swingTypeProperty,
|
swingTypeProperty,
|
||||||
swingQuarterIconVisibleProperty,
|
swingQuarterIconVisibleProperty,
|
||||||
walkingHumanVisibleProperty,
|
walkingHumanVisibleProperty,
|
||||||
|
walkingHumanHiddenProperty,
|
||||||
walkingHumanTypeProperty,
|
walkingHumanTypeProperty,
|
||||||
lifeVisibleProperty,
|
lifeVisibleProperty,
|
||||||
|
lifeHiddenProperty,
|
||||||
lifeTypeProperty,
|
lifeTypeProperty,
|
||||||
lifeBirthDateProperty,
|
lifeBirthDateProperty,
|
||||||
moneyVisibleProperty,
|
moneyVisibleProperty,
|
||||||
|
moneyHiddenProperty,
|
||||||
moneyTypeProperty,
|
moneyTypeProperty,
|
||||||
moneyPerMonthProperty,
|
moneyPerMonthProperty,
|
||||||
moneyCurrencyProperty,
|
moneyCurrencyProperty,
|
||||||
weatherVisibleProperty,
|
weatherVisibleProperty,
|
||||||
|
weatherHiddenProperty,
|
||||||
mainWindowCustomTitleProperty,
|
mainWindowCustomTitleProperty,
|
||||||
profileNameProperty,
|
profileNameProperty,
|
||||||
activityNeededFlagsProperty,
|
activityNeededFlagsProperty,
|
||||||
@ -704,7 +767,7 @@ public class ConfigWindow extends TWindow {
|
|||||||
String timeCalcPropertyKey
|
String timeCalcPropertyKey
|
||||||
= (String) textField.getClientProperty(
|
= (String) textField.getClientProperty(
|
||||||
CLIENT_PROPERTY_KEY);
|
CLIENT_PROPERTY_KEY);
|
||||||
if(timeCalcPropertyKey == null) {
|
if (timeCalcPropertyKey == null) {
|
||||||
timeCalcPropertyKey = textField.getText();
|
timeCalcPropertyKey = textField.getText();
|
||||||
textField.putClientProperty(CLIENT_PROPERTY_KEY, timeCalcPropertyKey);
|
textField.putClientProperty(CLIENT_PROPERTY_KEY, timeCalcPropertyKey);
|
||||||
}
|
}
|
||||||
@ -712,9 +775,6 @@ public class ConfigWindow extends TWindow {
|
|||||||
= TimeCalcProperty.forKey(timeCalcPropertyKey);
|
= TimeCalcProperty.forKey(timeCalcPropertyKey);
|
||||||
boolean isInteger = Integer.class == timeCalcProperty.getClazz();
|
boolean isInteger = Integer.class == timeCalcProperty.getClazz();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
textField.setEditable(false);
|
textField.setEditable(false);
|
||||||
textField.setBackground(Color.WHITE);
|
textField.setBackground(Color.WHITE);
|
||||||
@ -723,8 +783,8 @@ public class ConfigWindow extends TWindow {
|
|||||||
textField
|
textField
|
||||||
.addMouseListener((MouseClickedListener) f -> {
|
.addMouseListener((MouseClickedListener) f -> {
|
||||||
|
|
||||||
String result =
|
String result
|
||||||
(String) JOptionPane.showInputDialog(
|
= (String) JOptionPane.showInputDialog(
|
||||||
null,
|
null,
|
||||||
"Select new value",
|
"Select new value",
|
||||||
"New value",
|
"New value",
|
||||||
@ -735,15 +795,15 @@ public class ConfigWindow extends TWindow {
|
|||||||
.getText()
|
.getText()
|
||||||
);
|
);
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
if(timeCalcProperty.name().contains("TYPE")) {
|
if (timeCalcProperty.name().contains("TYPE")) {
|
||||||
try {
|
try {
|
||||||
WidgetType widgetType =
|
WidgetType widgetType
|
||||||
WidgetType.valueOf(result.toUpperCase(
|
= WidgetType.valueOf(result.toUpperCase(
|
||||||
Locale.ROOT));
|
Locale.ROOT));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new TimeCalcException("Invalid format. Only these values are allowed: " + Arrays
|
throw new TimeCalcException("Invalid format. Only these values are allowed: " + Arrays
|
||||||
.stream(WidgetType.values()).map(WidgetType::name).map(String::toLowerCase).collect(
|
.stream(WidgetType.values()).map(WidgetType::name).map(String::toLowerCase).collect(
|
||||||
Collectors.joining(", ")));
|
Collectors.joining(", ")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
textField.setText(result);
|
textField.setText(result);
|
||||||
@ -755,7 +815,7 @@ public class ConfigWindow extends TWindow {
|
|||||||
timeCalcConfiguration
|
timeCalcConfiguration
|
||||||
.getProperty(timeCalcProperty).addListener(e -> {
|
.getProperty(timeCalcProperty).addListener(e -> {
|
||||||
|
|
||||||
textField.setText(isInteger
|
textField.setText(isInteger
|
||||||
? String.valueOf(timeCalcConfiguration
|
? String.valueOf(timeCalcConfiguration
|
||||||
.getProperty(timeCalcProperty).getValue())
|
.getProperty(timeCalcProperty).getValue())
|
||||||
: (String) timeCalcConfiguration
|
: (String) timeCalcConfiguration
|
||||||
@ -780,7 +840,7 @@ public class ConfigWindow extends TWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void update(DocumentEvent e) {
|
private void update(DocumentEvent e) {
|
||||||
if(textField.getClientProperty(EDITABLE_ONLY_IN_DIALOG) != null) {
|
if (textField.getClientProperty(EDITABLE_ONLY_IN_DIALOG) != null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String text = textField.getText();
|
String text = textField.getText();
|
||||||
@ -858,51 +918,76 @@ public class ConfigWindow extends TWindow {
|
|||||||
private void addToNextRow(JComponent jComponent) {
|
private void addToNextRow(JComponent jComponent) {
|
||||||
addToNextRow(jComponent, true);
|
addToNextRow(jComponent, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addToNextRow(JComponent jComponent, boolean nextRow) {
|
private void addToNextRow(JComponent jComponent, boolean nextRow) {
|
||||||
int index = 6;
|
int index = 6;
|
||||||
String key = (String) jComponent.getClientProperty(CLIENT_PROPERTY_KEY);
|
String key = (String) jComponent.getClientProperty(CLIENT_PROPERTY_KEY);
|
||||||
if(key == null) {
|
if (key == null) {
|
||||||
//nothing to do
|
//nothing to do
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(key.startsWith("clock")) index = 0;
|
if (key.startsWith("clock")) {
|
||||||
if(key.startsWith("battery")) index = 1;
|
index = 0;
|
||||||
if(key.startsWith("life")) index = 2;
|
|
||||||
if(key.startsWith("money")) index = 3;
|
|
||||||
if(key.startsWith("smileys")) index = 4;
|
|
||||||
if(key.startsWith("test")) index = 5;
|
|
||||||
|
|
||||||
JPanel panel = null;
|
|
||||||
switch(index) {
|
|
||||||
case 0: panel=panelInsideScrollPaneClock;break;
|
|
||||||
case 1: panel=panelInsideScrollPaneBattery;break;
|
|
||||||
case 2: panel=panelInsideScrollPaneLife;break;
|
|
||||||
case 3: panel=panelInsideScrollPaneMoney;break;
|
|
||||||
case 4: panel=panelInsideScrollPaneSmileys;break;
|
|
||||||
case 5: panel=panelInsideScrollPaneTest;break;
|
|
||||||
default:panel= panelInsideScrollPaneOther;
|
|
||||||
}
|
}
|
||||||
if(jComponent instanceof JTextField) {
|
if (key.startsWith("battery")) {
|
||||||
|
index = 1;
|
||||||
|
}
|
||||||
|
if (key.startsWith("life")) {
|
||||||
|
index = 2;
|
||||||
|
}
|
||||||
|
if (key.startsWith("money")) {
|
||||||
|
index = 3;
|
||||||
|
}
|
||||||
|
if (key.startsWith("smileys")) {
|
||||||
|
index = 4;
|
||||||
|
}
|
||||||
|
if (key.startsWith("test")) {
|
||||||
|
index = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
JPanel panel = null;
|
||||||
|
switch (index) {
|
||||||
|
case 0:
|
||||||
|
panel = panelInsideScrollPaneClock;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
panel = panelInsideScrollPaneBattery;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
panel = panelInsideScrollPaneLife;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
panel = panelInsideScrollPaneMoney;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
panel = panelInsideScrollPaneSmileys;
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
panel = panelInsideScrollPaneTest;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
panel = panelInsideScrollPaneOther;
|
||||||
|
}
|
||||||
|
if (jComponent instanceof JTextField) {
|
||||||
JPanel p = new JPanel();
|
JPanel p = new JPanel();
|
||||||
//p.setLayout(null);
|
//p.setLayout(null);
|
||||||
|
|
||||||
JLabel label = new JLabel(TimeCalcProperty.forKey(key).getDescription() + ": ");
|
JLabel label = new JLabel(TimeCalcProperty.forKey(key).getDescription() + ": ");
|
||||||
p.add(label);
|
p.add(label);
|
||||||
p.add(jComponent);
|
p.add(jComponent);
|
||||||
label.setBounds(10,0, 200, 25);
|
label.setBounds(10, 0, 200, 25);
|
||||||
|
|
||||||
jComponent.setBounds(220, 0, 200, 25);
|
jComponent.setBounds(220, 0, 200, 25);
|
||||||
LayoutManager flowLayout = new FlowLayout(FlowLayout.LEFT);
|
LayoutManager flowLayout = new FlowLayout(FlowLayout.LEFT);
|
||||||
p.setLayout(flowLayout);
|
p.setLayout(flowLayout);
|
||||||
p.setAlignmentX(LEFT_ALIGNMENT);
|
p.setAlignmentX(LEFT_ALIGNMENT);
|
||||||
|
|
||||||
label.setPreferredSize(new Dimension(key.startsWith("test.") ? 240: 200, 25));
|
label.setPreferredSize(new Dimension(key.startsWith("test.") ? 240 : 200, 25));
|
||||||
jComponent.setPreferredSize(new Dimension(200, 25));
|
jComponent.setPreferredSize(new Dimension(200, 25));
|
||||||
|
|
||||||
p.setMaximumSize(new Dimension(600, 30));
|
p.setMaximumSize(new Dimension(600, 30));
|
||||||
panel.add(p);
|
panel.add(p);
|
||||||
|
|
||||||
|
|
||||||
//jComponent.setMinimumSize(new Dimension(60, 30));
|
//jComponent.setMinimumSize(new Dimension(60, 30));
|
||||||
//label.setBounds(0,0,100, 30);
|
//label.setBounds(0,0,100, 30);
|
||||||
} else {
|
} else {
|
||||||
@ -912,7 +997,7 @@ public class ConfigWindow extends TWindow {
|
|||||||
jComponent.setBounds(currentX[index], currentY[index], 200,
|
jComponent.setBounds(currentX[index], currentY[index], 200,
|
||||||
HEIGHT1);
|
HEIGHT1);
|
||||||
panel.add(Box.createRigidArea(new Dimension(5, 5)));
|
panel.add(Box.createRigidArea(new Dimension(5, 5)));
|
||||||
if(nextRow) {
|
if (nextRow) {
|
||||||
nextRow(index);
|
nextRow(index);
|
||||||
} else {
|
} else {
|
||||||
currentX[index] = currentX[index] + SwingUtils.MARGIN + jComponent.getWidth();
|
currentX[index] = currentX[index] + SwingUtils.MARGIN + jComponent.getWidth();
|
||||||
|
@ -70,7 +70,6 @@ import java.util.List;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import javax.swing.Timer;
|
import javax.swing.Timer;
|
||||||
import org.nanoboot.utils.timecalc.swing.progress.ProgressDot;
|
import org.nanoboot.utils.timecalc.swing.progress.ProgressDot;
|
||||||
import org.nanoboot.utils.timecalc.utils.common.NumberFormats;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Robert Vokac
|
* @author Robert Vokac
|
||||||
@ -386,6 +385,29 @@ public class MainWindow extends TWindow {
|
|||||||
.bindTo(timeCalcConfiguration.lifeVisibleProperty);
|
.bindTo(timeCalcConfiguration.lifeVisibleProperty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
clock.hiddenProperty.bindTo(timeCalcConfiguration.clockHiddenProperty);
|
||||||
|
minuteBattery.hiddenProperty.bindTo(timeCalcConfiguration.batteryMinuteHiddenProperty);
|
||||||
|
hourBattery.hiddenProperty.bindTo(timeCalcConfiguration.batteryHourHiddenProperty);
|
||||||
|
dayBattery.hiddenProperty.bindTo(timeCalcConfiguration.batteryDayHiddenProperty);
|
||||||
|
weekBattery.hiddenProperty.bindTo(timeCalcConfiguration.batteryWeekHiddenProperty);
|
||||||
|
monthBattery.hiddenProperty.bindTo(timeCalcConfiguration.batteryMonthHiddenProperty);
|
||||||
|
yearBattery.hiddenProperty.bindTo(timeCalcConfiguration.batteryYearHiddenProperty);
|
||||||
|
progressSquare.hiddenProperty
|
||||||
|
.bindTo(timeCalcConfiguration.squareHiddenProperty);
|
||||||
|
progressDot.hiddenProperty
|
||||||
|
.bindTo(timeCalcConfiguration.dotHiddenProperty);
|
||||||
|
progressCircle.hiddenProperty
|
||||||
|
.bindTo(timeCalcConfiguration.circleHiddenProperty);
|
||||||
|
walkingHumanProgress.hiddenProperty
|
||||||
|
.bindTo(timeCalcConfiguration.walkingHumanHiddenProperty);
|
||||||
|
progressSwing.hiddenProperty
|
||||||
|
.bindTo(timeCalcConfiguration.swingHiddenProperty);
|
||||||
|
progressLife.hiddenProperty
|
||||||
|
.bindTo(timeCalcConfiguration.lifeHiddenProperty);
|
||||||
|
progressMoney.hiddenProperty.bindTo(timeCalcConfiguration.moneyHiddenProperty);
|
||||||
|
progressWeather.hiddenProperty.bindTo(timeCalcConfiguration.weatherHiddenProperty);
|
||||||
|
}
|
||||||
TLabel arrivalTextFieldLabel = new TLabel("Arrival:", 70);
|
TLabel arrivalTextFieldLabel = new TLabel("Arrival:", 70);
|
||||||
arrivalTextFieldLabel.setBoundsFromTop(progressSwing, 3);
|
arrivalTextFieldLabel.setBoundsFromTop(progressSwing, 3);
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ clock.date.visible-only-if-mouse-moving-over=true
|
|||||||
clock.smiley.visible=false
|
clock.smiley.visible=false
|
||||||
clock.percent-progress.visible=false
|
clock.percent-progress.visible=false
|
||||||
clock.circle-progress.visible=true
|
clock.circle-progress.visible=true
|
||||||
|
clock.hidden=false
|
||||||
#
|
#
|
||||||
battery.waves.visible=true
|
battery.waves.visible=true
|
||||||
battery.circle-progress.visible=true
|
battery.circle-progress.visible=true
|
||||||
@ -36,6 +37,12 @@ battery.day.visible=true
|
|||||||
battery.week.visible=true
|
battery.week.visible=true
|
||||||
battery.month.visible=true
|
battery.month.visible=true
|
||||||
battery.year.visible=true
|
battery.year.visible=true
|
||||||
|
battery.minute.hidden=false
|
||||||
|
battery.hour.hidden=false
|
||||||
|
battery.day.hidden=false
|
||||||
|
battery.week.hidden=false
|
||||||
|
battery.month.hidden=false
|
||||||
|
battery.year.hidden=false
|
||||||
battery.blinking-if-critical-low=true
|
battery.blinking-if-critical-low=true
|
||||||
battery.quarter-icon.visible=true
|
battery.quarter-icon.visible=true
|
||||||
#
|
#
|
||||||
@ -47,23 +54,31 @@ smileys.visible-only-if-mouse-moving-over=true
|
|||||||
smileys.colored=true
|
smileys.colored=true
|
||||||
square.visible=true
|
square.visible=true
|
||||||
square.type=day
|
square.type=day
|
||||||
|
square.hidden=false
|
||||||
dot.visible=true
|
dot.visible=true
|
||||||
dot.type=day
|
dot.type=day
|
||||||
|
dot.hidden=false
|
||||||
circle.visible=true
|
circle.visible=true
|
||||||
circle.type=day
|
circle.type=day
|
||||||
|
circle.hidden=false
|
||||||
swing.visible=true
|
swing.visible=true
|
||||||
swing.type=day
|
swing.type=day
|
||||||
|
swing.hidden=false
|
||||||
swing.quarter-icon.visible=true
|
swing.quarter-icon.visible=true
|
||||||
life.visible=false
|
life.visible=false
|
||||||
life.type=day
|
life.type=day
|
||||||
|
life.hidden=false
|
||||||
life.birth-date=
|
life.birth-date=
|
||||||
money.visible=false
|
money.visible=false
|
||||||
money.type=day
|
money.type=day
|
||||||
|
money.hidden=false
|
||||||
money.per-month=0
|
money.per-month=0
|
||||||
money.currency=
|
money.currency=
|
||||||
weather.visible=true
|
weather.visible=true
|
||||||
|
weather.hidden=false
|
||||||
walking-human.visible=true
|
walking-human.visible=true
|
||||||
walking-human.type=day
|
walking-human.type=day
|
||||||
|
walking-human.hidden=false
|
||||||
main-window.custom-title=---
|
main-window.custom-title=---
|
||||||
profile.name=
|
profile.name=
|
||||||
test.enabled=false
|
test.enabled=false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user