mirror of
https://github.com/robertvokac/time-calc.git
synced 2025-03-25 07:27:49 +01:00
Added several improvements, changes and bug fixes
This commit is contained in:
parent
30d4ff30a4
commit
a95ca6a58d
@ -9,6 +9,7 @@ import javax.swing.BorderFactory;
|
|||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JTextField;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.FlowLayout;
|
import java.awt.FlowLayout;
|
||||||
@ -61,8 +62,12 @@ public class ActivityPanel extends JPanel implements Comparable<ActivityPanel> {
|
|||||||
add(totalComment);
|
add(totalComment);
|
||||||
add(today);
|
add(today);
|
||||||
add(remains);
|
add(remains);
|
||||||
|
name.setHorizontalAlignment(JTextField.LEFT);
|
||||||
|
comment.setHorizontalAlignment(JTextField.LEFT);
|
||||||
|
ticket.setHorizontalAlignment(JTextField.LEFT);
|
||||||
|
|
||||||
// JButton moveThisButton = new SmallTButton("Move ");
|
|
||||||
|
// JButton moveThisButton = new SmallTButton("Move ");
|
||||||
// JButton moveBeforeButton = new SmallTButton("Here");
|
// JButton moveBeforeButton = new SmallTButton("Here");
|
||||||
JButton copyButton = new SmallTButton("Copy");
|
JButton copyButton = new SmallTButton("Copy");
|
||||||
JButton deleteButton = new SmallTButton("Delete");
|
JButton deleteButton = new SmallTButton("Delete");
|
||||||
@ -241,6 +246,9 @@ public class ActivityPanel extends JPanel implements Comparable<ActivityPanel> {
|
|||||||
subject.setText(activity.createSubject());
|
subject.setText(activity.createSubject());
|
||||||
totalComment.setText(activity.createTotalComment());
|
totalComment.setText(activity.createTotalComment());
|
||||||
sortkey.setText(String.valueOf(activity.getSortkey()));
|
sortkey.setText(String.valueOf(activity.getSortkey()));
|
||||||
|
name.setFont(SwingUtils.VERY_SMALL_FONT);
|
||||||
|
comment.setFont(SwingUtils.VERY_SMALL_FONT);
|
||||||
|
ticket.setFont(SwingUtils.VERY_SMALL_FONT);
|
||||||
this.activityRepository = activityRepository;
|
this.activityRepository = activityRepository;
|
||||||
//this.setBorder(BorderFactory.createLineBorder(Color.ORANGE, 1));
|
//this.setBorder(BorderFactory.createLineBorder(Color.ORANGE, 1));
|
||||||
setAlignmentX(LEFT_ALIGNMENT);
|
setAlignmentX(LEFT_ALIGNMENT);
|
||||||
|
@ -214,13 +214,16 @@ public class DayPanel extends JPanel {
|
|||||||
double done = 0d;
|
double done = 0d;
|
||||||
double todo = 8d;
|
double todo = 8d;
|
||||||
for(ActivityPanel ap:list) {
|
for(ActivityPanel ap:list) {
|
||||||
panelInsideScrollPane.add(ap);
|
|
||||||
double now = ap.getActivity().getSpentHours() + ap.getActivity().getSpentMinutes() / 60d;
|
double now = ap.getActivity().getSpentHours() + ap.getActivity().getSpentMinutes() / 60d;
|
||||||
done = done + now;
|
done = done + now;
|
||||||
todo = todo - now;
|
todo = todo - now;
|
||||||
ap.today.setText(TTime.ofMilliseconds((int)(done * 60d * 60d * 1000d)).toString().substring(0,5));
|
ap.today.setText(TTime.ofMilliseconds((int)(done * 60d * 60d * 1000d)).toString().substring(0,5));
|
||||||
ap.remains.setText(TTime.ofMilliseconds((int)(todo * 60d * 60d * 1000d)).toString().substring(0,5));
|
ap.remains.setText(TTime.ofMilliseconds((int)(todo * 60d * 60d * 1000d)).toString().substring(0,5));
|
||||||
|
panelInsideScrollPane.add(ap);
|
||||||
|
ap.revalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
revalidate();
|
revalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user