Skip to content

Commit 88dba8b

Browse files
committed
small changes
* some formatting * exchanged license with cc by 4.0 text * adapted clipboard icon
1 parent 179b4fc commit 88dba8b

File tree

10 files changed

+448
-218
lines changed

10 files changed

+448
-218
lines changed

pom.xml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,6 @@
3131
<relativePath /> <!-- lookup parent from repository -->
3232
</parent>
3333

34-
<repositories>
35-
36-
<!-- needed to resolve against central first-->
37-
<repository>
38-
<id>central</id>
39-
<name>Maven Central</name>
40-
<layout>default</layout>
41-
<url>https://repo1.maven.org/maven2</url>
42-
</repository>
43-
</repositories>
44-
4534
<properties>
4635
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
4736
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

src/main/java/de/doubleslash/keeptime/common/Licenses.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,9 @@ public enum Licenses {
3131
"./licenses/GNU Lesser General Public License (LGPL), Version 3.0.txt",
3232
"GNU Lesser General Public License Version 3.0",
3333
"https://www.gnu.org/licenses/lgpl-3.0.de.html"),
34-
MIT("./licenses/The MIT License.txt",
35-
"The MIT License",
36-
"https://opensource.org/licenses/MIT"),
37-
38-
FONTAWESOME("./licenses/Fontawesome Icons — CC BY 4.0 License.txt",
39-
"Fontawesome Icons — CC BY 4.0 License ",
40-
"http://creativecommons.org/licenses/by/4.0/");
34+
MIT("./licenses/The MIT License.txt", "The MIT License", "https://opensource.org/licenses/MIT"),
4135

36+
CC_4_0("./licenses/CC BY 4.0 License.txt", "CC BY 4.0 License", "https://creativecommons.org/licenses/by/4.0/");
4237

4338
private final String path;
4439
private final String name;

src/main/java/de/doubleslash/keeptime/common/Resources.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,9 @@ public enum RESOURCE {
5353

5454
SVG_PENCIL_ICON("/svgs/pencil.svg"),
5555

56-
SVG_FLOPPY_DISK_ICON("/svgs/floppy-disk.svg"),
57-
58-
SVG_BUG_ICON("/svgs/bug.svg")
56+
SVG_CLIPBOARD("/svgs/clipboard.svg"),
5957

58+
SVG_BUG_ICON("/svgs/bug.svg"),
6059

6160
;
6261

src/main/java/de/doubleslash/keeptime/common/SvgNodeProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import java.io.InputStream;
1414

1515
/**
16-
* class loads SvgPath from a SvgFile because Java can not load the original svg file as it is.
16+
* Class loads SvgPath from a SvgFile because Java can not load the original svg file as it is.
1717
* <p>
1818
* To load the svg the class extracts the path as string and creates a new SvgPath and returns it.
1919
*/
@@ -42,7 +42,7 @@ public static String getSvgPathWithXMl(Resources.RESOURCE resource) {
4242
return svgPath;
4343
}
4444

45-
public static Node getSvgNodeWithScale(Resources.RESOURCE resource, Double scaleX , Double scaleY) {
45+
public static Node getSvgNodeWithScale(Resources.RESOURCE resource, Double scaleX, Double scaleY) {
4646
SVGPath iconSvg = new SVGPath();
4747
iconSvg.setContent(getSvgPathWithXMl(resource));
4848
iconSvg.setScaleX(scaleX);

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

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,26 @@
1818

1919
import java.util.Comparator;
2020

21-
import de.doubleslash.keeptime.common.*;
22-
import javafx.geometry.Pos;
23-
import javafx.scene.Group;
24-
import javafx.scene.control.*;
25-
import javafx.scene.image.ImageView;
26-
import javafx.scene.layout.Background;
27-
import javafx.scene.shape.SVGPath;
28-
import javafx.scene.text.TextAlignment;
2921
import org.slf4j.Logger;
3022
import org.slf4j.LoggerFactory;
3123
import org.springframework.stereotype.Component;
3224

3325
import de.doubleslash.keeptime.ApplicationProperties;
34-
import de.doubleslash.keeptime.Main;
26+
import de.doubleslash.keeptime.common.BrowserHelper;
27+
import de.doubleslash.keeptime.common.FileOpenHelper;
28+
import de.doubleslash.keeptime.common.Licenses;
3529
import de.doubleslash.keeptime.view.license.LicenseTableRow;
3630
import javafx.collections.FXCollections;
3731
import javafx.collections.ObservableList;
3832
import javafx.fxml.FXML;
33+
import javafx.scene.control.Alert;
3934
import javafx.scene.control.Alert.AlertType;
35+
import javafx.scene.control.Button;
36+
import javafx.scene.control.Hyperlink;
37+
import javafx.scene.control.Label;
38+
import javafx.scene.control.TableCell;
39+
import javafx.scene.control.TableColumn;
40+
import javafx.scene.control.TableView;
4041
import javafx.scene.control.cell.PropertyValueFactory;
4142
import javafx.scene.input.MouseButton;
4243
import javafx.scene.layout.Region;
@@ -55,9 +56,6 @@ public class AboutController {
5556
@FXML
5657
private Button reportBugButton;
5758

58-
@FXML
59-
private SVGPath contentId;
60-
6159
@FXML
6260
private Label versionNumberLabel;
6361

@@ -71,10 +69,10 @@ public class AboutController {
7169

7270
private final ApplicationProperties applicationProperties;
7371

74-
public AboutController (ApplicationProperties applicationProperties) {
75-
this.applicationProperties = applicationProperties;
72+
public AboutController(ApplicationProperties applicationProperties) {
73+
this.applicationProperties = applicationProperties;
7674
}
77-
75+
7876
@FXML
7977
public void initialize() {
8078
LOG.debug("set version label");
@@ -90,7 +88,6 @@ public void initialize() {
9088
nameColumn.setMinWidth(160);
9189

9290
nameColumn.setCellValueFactory(new PropertyValueFactory<>("name"));
93-
//Set Bug Icon to reportBugButton
9491

9592
// licenseColumn
9693
final TableColumn<LicenseTableRow, String> licenseColumn = new TableColumn<>("License");
@@ -151,7 +148,7 @@ public ObservableList<LicenseTableRow> loadLicenseRows() {
151148
licenseRows.add(new LicenseTableRow("spring-boot-starter-data-jpa", Licenses.APACHEV2));
152149
licenseRows.add(new LicenseTableRow("mockito-core", Licenses.MIT));
153150
licenseRows.add(new LicenseTableRow("h2", Licenses.EPLV1));
154-
licenseRows.add(new LicenseTableRow("Fontawesome", Licenses.FONTAWESOME));
151+
licenseRows.add(new LicenseTableRow("Font Awesome Icons", Licenses.CC_4_0));
155152

156153
licenseRows.sort(Comparator.comparing(LicenseTableRow::getName));
157154

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

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
import java.util.TreeSet;
2626
import java.util.stream.Collectors;
2727

28-
import de.doubleslash.keeptime.common.SvgNodeProvider;
29-
import javafx.scene.control.*;
3028
import org.slf4j.Logger;
3129
import org.slf4j.LoggerFactory;
3230
import org.springframework.beans.factory.annotation.Autowired;
@@ -37,6 +35,7 @@
3735
import de.doubleslash.keeptime.common.DateFormatter;
3836
import de.doubleslash.keeptime.common.Resources;
3937
import de.doubleslash.keeptime.common.Resources.RESOURCE;
38+
import de.doubleslash.keeptime.common.SvgNodeProvider;
4039
import de.doubleslash.keeptime.controller.Controller;
4140
import de.doubleslash.keeptime.exceptions.FXMLLoaderException;
4241
import de.doubleslash.keeptime.model.Model;
@@ -52,7 +51,20 @@
5251
import javafx.fxml.FXMLLoader;
5352
import javafx.scene.Node;
5453
import javafx.scene.canvas.Canvas;
54+
import javafx.scene.control.Alert;
5555
import javafx.scene.control.Alert.AlertType;
56+
import javafx.scene.control.Button;
57+
import javafx.scene.control.ButtonType;
58+
import javafx.scene.control.ContentDisplay;
59+
import javafx.scene.control.DateCell;
60+
import javafx.scene.control.DatePicker;
61+
import javafx.scene.control.Dialog;
62+
import javafx.scene.control.Label;
63+
import javafx.scene.control.Tooltip;
64+
import javafx.scene.control.TreeItem;
65+
import javafx.scene.control.TreeTableCell;
66+
import javafx.scene.control.TreeTableColumn;
67+
import javafx.scene.control.TreeTableView;
5668
import javafx.scene.control.cell.TreeItemPropertyValueFactory;
5769
import javafx.scene.input.Clipboard;
5870
import javafx.scene.input.ClipboardContent;
@@ -63,6 +75,7 @@
6375
import javafx.scene.shape.Circle;
6476
import javafx.stage.Stage;
6577
import javafx.util.Callback;
78+
6679
@Component
6780
public class ReportController {
6881

@@ -187,19 +200,22 @@ private void updateReport(final LocalDate dateToShow) {
187200

188201
this.currentDayLabel.setText(DateFormatter.toDayDateString(this.currentReportDate));
189202
final List<Work> currentWorkItems = model.getWorkRepository()
190-
.findByStartDateOrderByStartTimeAsc(this.currentReportDate);
203+
.findByStartDateOrderByStartTimeAsc(this.currentReportDate);
191204

192205
colorTimeLine.update(currentWorkItems, controller.calcSeconds(currentWorkItems));
193206

194-
final SortedSet<Project> workedProjectsSet = currentWorkItems.stream().map(Work::getProject)
195-
.collect(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(Project::getIndex))));
207+
final SortedSet<Project> workedProjectsSet = currentWorkItems.stream()
208+
.map(Work::getProject)
209+
.collect(Collectors.toCollection(() -> new TreeSet<>(
210+
Comparator.comparing(Project::getIndex))));
196211

197212
long currentWorkSeconds = 0;
198213
long currentSeconds = 0;
199214

200215
for (final Project project : workedProjectsSet) {
201-
final List<Work> onlyCurrentProjectWork = currentWorkItems.stream().filter(w -> w.getProject() == project)
202-
.collect(Collectors.toList());
216+
final List<Work> onlyCurrentProjectWork = currentWorkItems.stream()
217+
.filter(w -> w.getProject() == project)
218+
.collect(Collectors.toList());
203219

204220
final long projectWorkSeconds = controller.calcSeconds(onlyCurrentProjectWork);
205221

@@ -269,11 +285,12 @@ public void updateItem(final LocalDate item, final boolean empty) {
269285
}
270286

271287
private Button createDeleteWorkButton(final Work w) {
272-
final Button deleteButton;
273-
deleteButton = new Button("", SvgNodeProvider.getSvgNodeWithScale(RESOURCE.SVG_TRASH_ICON,0.03,0.03));
288+
final Button deleteButton = new Button("",
289+
SvgNodeProvider.getSvgNodeWithScale(RESOURCE.SVG_TRASH_ICON, 0.03, 0.03));
274290
deleteButton.setMaxSize(20, 18);
275291
deleteButton.setMinSize(20, 18);
276292
deleteButton.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
293+
277294
deleteButton.setOnAction(e -> {
278295
LOG.info("Delete work clicked.");
279296
final Alert alert = new Alert(AlertType.CONFIRMATION);
@@ -295,10 +312,12 @@ private Button createDeleteWorkButton(final Work w) {
295312
}
296313

297314
private Button createEditWorkButton(final Work work) {
298-
final Button editButton = new Button("",SvgNodeProvider.getSvgNodeWithScale(RESOURCE.SVG_PENCIL_ICON, 0.03 ,0.03));
315+
final Button editButton = new Button("",
316+
SvgNodeProvider.getSvgNodeWithScale(RESOURCE.SVG_PENCIL_ICON, 0.03, 0.03));
299317
editButton.setMaxSize(20, 18);
300318
editButton.setMinSize(20, 18);
301319
editButton.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
320+
302321
editButton.setOnAction(e -> {
303322
LOG.info("Edit work clicked.");
304323
final Dialog<Work> dialog = setupEditWorkDialog(work);
@@ -355,10 +374,11 @@ private GridPane setUpEditWorkGridPane(final Work work, final Dialog<Work> dialo
355374
}
356375

357376
private Button createCopyProjectButton(final List<Work> projectWork) {
358-
final Button copyButton = new Button("", SvgNodeProvider.getSvgNodeWithScale(RESOURCE.SVG_FLOPPY_DISK_ICON, 0.03 ,0.03));
377+
final Button copyButton = new Button("", SvgNodeProvider.getSvgNodeWithScale(RESOURCE.SVG_CLIPBOARD, 0.03, 0.03));
359378
copyButton.setMaxSize(20, 18);
360379
copyButton.setMinSize(20, 18);
361380
copyButton.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
381+
362382
final EventHandler<ActionEvent> eventListener = actionEvent -> {
363383
LOG.debug("Copy to Clipboard clicked.");
364384
final ProjectReport pr = new ProjectReport(projectWork.size());
@@ -378,7 +398,7 @@ private Button createCopyProjectButton(final List<Work> projectWork) {
378398
}
379399

380400
private Node createCopyWorkButton(final Work w) {
381-
final Button copyButton = new Button("", SvgNodeProvider.getSvgNodeWithScale(RESOURCE.SVG_FLOPPY_DISK_ICON, 0.03 ,0.03));
401+
final Button copyButton = new Button("", SvgNodeProvider.getSvgNodeWithScale(RESOURCE.SVG_CLIPBOARD, 0.03, 0.03));
382402
copyButton.setMaxSize(20, 18);
383403
copyButton.setMinSize(20, 18);
384404
copyButton.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);

0 commit comments

Comments
 (0)