Added new improvements
This commit is contained in:
parent
2a597ceee5
commit
a573a2799c
@ -57,7 +57,7 @@ public class Battery extends Widget {
|
||||
this.totalHeight = (int) (this.getHeight() / 10d * 7d);
|
||||
this.totalWidth = this.getWidth();
|
||||
}
|
||||
if(donePercent > 0 && donePercent < CRITICAL_LOW_ENERGY && (System.nanoTime() - tmpNanoTime) > (500000000l) / 2l) {
|
||||
if(donePercent > 0 && donePercent < CRITICAL_LOW_ENERGY && (System.nanoTime() - tmpNanoTime) > (1000000000l) / 2l) {
|
||||
blinking.flip();
|
||||
tmpNanoTime = System.nanoTime();
|
||||
}
|
||||
@ -172,11 +172,14 @@ public class Battery extends Widget {
|
||||
g2d.setColor(Utils.highlighted.get() || mouseOver ? Color.BLACK :
|
||||
Color.LIGHT_GRAY);
|
||||
|
||||
Font currentFont = g2d.getFont();
|
||||
g2d.setFont(bigFont);
|
||||
g2d.drawString("⚡", ((int) (totalWidth * 0.45)),(donePercent < 0.5 ? totalHeight / 4 * 3 :
|
||||
totalHeight / 4 * 1) + 10);
|
||||
g2d.setFont(currentFont);
|
||||
if(donePercent <1) {
|
||||
Font currentFont = g2d.getFont();
|
||||
g2d.setFont(bigFont);
|
||||
g2d.drawString("⚡", ((int) (totalWidth * 0.45)),
|
||||
(donePercent < 0.5 ? totalHeight / 4 * 3 :
|
||||
totalHeight / 4 * 1) + 10);
|
||||
g2d.setFont(currentFont);
|
||||
}
|
||||
|
||||
g2d.drawString(
|
||||
NumberFormats.FORMATTER_THREE_DECIMAL_PLACES.format(donePercent * 100) + "%",
|
||||
|
@ -1,6 +1,7 @@
|
||||
package org.nanoboot.utils.timecalc.gui.progress;
|
||||
|
||||
import org.nanoboot.utils.timecalc.gui.common.Widget;
|
||||
import org.nanoboot.utils.timecalc.utils.NumberFormats;
|
||||
import org.nanoboot.utils.timecalc.utils.Utils;
|
||||
|
||||
import java.awt.Color;
|
||||
@ -72,6 +73,9 @@ public class ProgressSquare extends Widget {
|
||||
}
|
||||
g2d.setColor(FOREGROUND_COLOR);
|
||||
}
|
||||
g2d.setColor(Utils.highlighted.get() || mouseOver ? Color.BLACK : BACKGROUND_COLOR);
|
||||
|
||||
g2d.drawString(NumberFormats.FORMATTER_FIVE_DECIMAL_PLACES.format(donePercent * 100) + "%", (int)(side/8d*3d),(int)(side/8d*(donePercent > 0.5 ? 3d : 5d)));
|
||||
|
||||
}
|
||||
|
||||
|
@ -92,15 +92,35 @@ public class TimeCalcManager {
|
||||
}
|
||||
|
||||
if (e.getKeyCode() == KeyEvent.VK_G) {
|
||||
if(!Utils.ultraLight.get() && Utils.highlighted.isEnabled()) {
|
||||
Utils.highlighted.disable();
|
||||
}
|
||||
Utils.ultraLight.flip();
|
||||
}
|
||||
|
||||
if (e.getKeyCode() == KeyEvent.VK_C) {
|
||||
if(Utils.ultraLight.get() && !Utils.highlighted.isEnabled()) {
|
||||
Utils.ultraLight.disable();
|
||||
}
|
||||
Utils.highlighted.flip();
|
||||
}
|
||||
if (e.getKeyCode() == KeyEvent.VK_V || e.getKeyCode() == KeyEvent.VK_SPACE) {
|
||||
if (e.getKeyCode() == KeyEvent.VK_V) {
|
||||
Utils.everythingHidden.flip();
|
||||
}
|
||||
if (e.getKeyCode() == KeyEvent.VK_SPACE) {
|
||||
if(Utils.everythingHidden.isEnabled()) {
|
||||
Utils.everythingHidden.disable();
|
||||
Utils.highlighted.enable();
|
||||
Utils.ultraLight.disable();
|
||||
} else {
|
||||
if(Utils.highlighted.isEnabled()) {
|
||||
Utils.ultraLight.enable();
|
||||
Utils.highlighted.disable();
|
||||
} else {
|
||||
Utils.everythingHidden.enable();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e.getKeyCode() == KeyEvent.VK_R) {
|
||||
commandButton.doClick();
|
||||
}
|
||||
@ -300,10 +320,6 @@ public class TimeCalcManager {
|
||||
break;
|
||||
}
|
||||
|
||||
if (Utils.highlighted.get()) {
|
||||
Utils.ultraLight.set(false);
|
||||
}
|
||||
|
||||
componentRegistry.setVisible(!Utils.everythingHidden.get());
|
||||
if (!Utils.highlighted.get() || Utils.ultraLight.get()) {
|
||||
jokeButton.setBackground(BG);
|
||||
|
@ -19,6 +19,12 @@ public class BooleanHolder {
|
||||
this.b = b;
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return get();
|
||||
}
|
||||
public boolean isDisabled() {
|
||||
return !get();
|
||||
}
|
||||
public boolean get() {
|
||||
return b;
|
||||
}
|
||||
@ -26,4 +32,10 @@ public class BooleanHolder {
|
||||
public void flip() {
|
||||
this.b = !b;
|
||||
}
|
||||
public void enable() {
|
||||
set(true);
|
||||
}
|
||||
public void disable() {
|
||||
set(false);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user