mirror of
https://github.com/robertvokac/time-calc.git
synced 2025-03-25 07:27:49 +01:00
Added new improvements
This commit is contained in:
parent
da901e30e1
commit
d3dcab759c
File diff suppressed because it is too large
Load Diff
@ -115,7 +115,7 @@ public class Battery extends JPanel {
|
|||||||
intX + width_ / pointCount * 4,
|
intX + width_ / pointCount * 4,
|
||||||
intX + width_ / pointCount * 5,
|
intX + width_ / pointCount * 5,
|
||||||
intX + width_ / pointCount * 6,
|
intX + width_ / pointCount * 6,
|
||||||
(int) (intX + width_ / pointCount * 7.9),
|
(int) (intX + width_ / pointCount * 7),
|
||||||
intX + width_ / pointCount * 8},
|
intX + width_ / pointCount * 8},
|
||||||
new int[]{(int) (todoHeight + (waterSurfaceHeight * 1)),
|
new int[]{(int) (todoHeight + (waterSurfaceHeight * 1)),
|
||||||
todoHeight + (int) (waterSurfaceHeight * getRandom(0)),
|
todoHeight + (int) (waterSurfaceHeight * getRandom(0)),
|
||||||
|
@ -7,6 +7,8 @@ import javax.swing.JFrame;
|
|||||||
import javax.swing.JTextPane;
|
import javax.swing.JTextPane;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
|
import java.awt.event.MouseEvent;
|
||||||
|
import java.awt.event.MouseListener;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
@ -89,6 +91,36 @@ public class TimeCalcWindow {
|
|||||||
text.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 12));
|
text.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 12));
|
||||||
text.setForeground(Color.GRAY);
|
text.setForeground(Color.GRAY);
|
||||||
text.setBackground(new Color(238, 238, 238));
|
text.setBackground(new Color(238, 238, 238));
|
||||||
|
text.putClientProperty("mouseEntered", "false");
|
||||||
|
|
||||||
|
|
||||||
|
text.addMouseListener(new MouseListener() {
|
||||||
|
@Override
|
||||||
|
public void mouseClicked(MouseEvent e) {
|
||||||
|
Utils.highlighted.flip();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mousePressed(MouseEvent e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mouseReleased(MouseEvent e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mouseEntered(MouseEvent e) {
|
||||||
|
text.putClientProperty("mouseEntered", "true");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mouseExited(MouseEvent e) {
|
||||||
|
text.putClientProperty("mouseEntered", "false");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
window.add(text);
|
window.add(text);
|
||||||
weatherButton
|
weatherButton
|
||||||
.setBounds(20, text.getY() + text.getHeight() + 10, 100, 30);
|
.setBounds(20, text.getY() + text.getHeight() + 10, 100, 30);
|
||||||
@ -275,7 +307,7 @@ public class TimeCalcWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
text.setForeground(
|
text.setForeground(
|
||||||
Utils.highlighted.get() ? Color.BLACK : Color.LIGHT_GRAY);
|
Utils.highlighted.get() || text.getClientProperty("mouseEntered").equals("true") ? Color.BLACK : Color.LIGHT_GRAY);
|
||||||
}
|
}
|
||||||
window.setVisible(false);
|
window.setVisible(false);
|
||||||
window.dispose();
|
window.dispose();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user