Skip to content

Commit 03c7a9b

Browse files
committed
renamed some variables. added missing license. added underline if project is work in report
1 parent 70eeb07 commit 03c7a9b

File tree

3 files changed

+28
-15
lines changed

3 files changed

+28
-15
lines changed

src/main/java/de/doubleslash/keeptime/view/ColorTimeLine.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
// Copyright 2019 doubleSlash Net Business GmbH
2+
//
3+
// This file is part of KeepTime.
4+
// KeepTime is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
117
package de.doubleslash.keeptime.view;
218

319
import java.time.Duration;

src/main/java/de/doubleslash/keeptime/view/ReportController.java

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import com.sun.javafx.scene.control.skin.DatePickerSkin;
3030

3131
import de.doubleslash.keeptime.common.DateFormatter;
32-
import de.doubleslash.keeptime.common.DateProvider;
3332
import de.doubleslash.keeptime.common.FontProvider;
3433
import de.doubleslash.keeptime.controller.Controller;
3534
import de.doubleslash.keeptime.model.Model;
@@ -79,16 +78,14 @@ public class ReportController {
7978
private ScrollPane scrollPane;
8079

8180
@FXML
82-
private Canvas canvas;
81+
private Canvas colorTimeLineCanvas;
8382

8483
private static final Logger LOG = LoggerFactory.getLogger(ReportController.class);
8584

8685
private DatePicker datePicker; // for calendar element
8786

8887
private Model model;
8988

90-
private DateProvider dateProvider;
91-
9289
private Controller controller;
9390

9491
private ColorTimeLine colorTimeLine;
@@ -103,7 +100,7 @@ private void initialize() {
103100
updateReport(newvalue);
104101
});
105102

106-
colorTimeLine = new ColorTimeLine(canvas);
103+
colorTimeLine = new ColorTimeLine(colorTimeLineCanvas);
107104
}
108105

109106
private void updateReport(final LocalDate newvalue) {
@@ -126,23 +123,23 @@ private void updateReport(final LocalDate newvalue) {
126123
for (final Project project : workedProjectsSet) {
127124
final Label projectName = new Label(project.getName());
128125
projectName.setFont(FontProvider.getBoldFont());
126+
projectName.setUnderline(project.isWork());
129127
final Circle circle = new Circle(5, project.getColor());
130128

131-
final HBox nameHBox = new HBox();
132-
nameHBox.setAlignment(Pos.CENTER_LEFT);
133-
nameHBox.setPadding(new Insets(0, 0, 0, 5));
134-
nameHBox.setSpacing(5);
129+
final HBox projectNameHBox = new HBox();
130+
projectNameHBox.setAlignment(Pos.CENTER_LEFT);
131+
projectNameHBox.setPadding(new Insets(0, 0, 0, 5));
132+
projectNameHBox.setSpacing(5);
135133

136-
nameHBox.getChildren().add(circle);
137-
nameHBox.getChildren().add(projectName);
134+
projectNameHBox.getChildren().add(circle);
135+
projectNameHBox.getChildren().add(projectName);
138136

139-
this.gridPane.add(nameHBox, 0, rowIndex);
137+
this.gridPane.add(projectNameHBox, 0, rowIndex);
140138

141139
final List<Work> onlyCurrentProjectWork = currentWorkItems.stream().filter(w -> w.getProject() == project)
142140
.collect(Collectors.toList());
143141

144-
final long todaysWorkSeconds = onlyCurrentProjectWork.stream()
145-
.mapToLong(work -> DateFormatter.getSecondsBewtween(work.getStartTime(), work.getEndTime())).sum();
142+
final long todaysWorkSeconds = controller.calcSeconds(onlyCurrentProjectWork);
146143

147144
currentSeconds += todaysWorkSeconds;
148145
if (project.isWork()) {

src/main/resources/layouts/report.fxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
9393
</VBox.margin>
9494
</BorderPane>
95-
<Canvas fx:id="canvas" height="5.0" width="480.0">
95+
<Canvas fx:id="colorTimeLineCanvas" height="5.0" width="480.0">
9696
<VBox.margin>
9797
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
9898
</VBox.margin>

0 commit comments

Comments
 (0)