Skip to content

Commit 3540469

Browse files
committed
fixed spelling error. added open sans license. adapted about layout
1 parent 694e872 commit 3540469

File tree

3 files changed

+53
-45
lines changed

3 files changed

+53
-45
lines changed

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

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,16 @@
1616

1717
package de.doubleslash.keeptime.view;
1818

19+
import java.util.Comparator;
20+
1921
import org.slf4j.Logger;
2022
import org.slf4j.LoggerFactory;
2123

2224
import de.doubleslash.keeptime.Main;
2325
import de.doubleslash.keeptime.common.BrowserHelper;
2426
import de.doubleslash.keeptime.common.FileOpenHelper;
2527
import de.doubleslash.keeptime.common.Licenses;
26-
import de.doubleslash.keeptime.view.license.LicenceTableRow;
28+
import de.doubleslash.keeptime.view.license.LicenseTableRow;
2729
import javafx.collections.FXCollections;
2830
import javafx.collections.ObservableList;
2931
import javafx.fxml.FXML;
@@ -58,7 +60,7 @@ public class AboutController {
5860
private Hyperlink ourLicenseHyperLink;
5961

6062
@FXML
61-
private TableView<LicenceTableRow> licenseTableView;
63+
private TableView<LicenseTableRow> licenseTableView;
6264

6365
private static final Logger LOG = LoggerFactory.getLogger(AboutController.class);
6466

@@ -68,20 +70,20 @@ public void initialize() {
6870
versionNumberLabel.setText(Main.VERSION);
6971

7072
ourLicenseHyperLink.setFocusTraversable(false);
71-
ourLicenseHyperLink.setOnAction(ae -> FileOpenHelper.openFile(Licenses.GPLV3.getPath()));
73+
ourLicenseHyperLink.setOnAction(ae -> showLicense(Licenses.GPLV3));
7274

7375
LOG.debug("set up table");
7476
// name column
75-
TableColumn<LicenceTableRow, String> nameColumn;
77+
TableColumn<LicenseTableRow, String> nameColumn;
7678
nameColumn = new TableColumn<>("Name");
7779
nameColumn.setMinWidth(160);
7880

7981
nameColumn.setCellValueFactory(new PropertyValueFactory<>("name"));
8082

8183
// licenseColumn
82-
final TableColumn<LicenceTableRow, String> licenseColumn = new TableColumn<>("License");
84+
final TableColumn<LicenseTableRow, String> licenseColumn = new TableColumn<>("License");
8385
licenseColumn.setMinWidth(260);
84-
licenseColumn.setCellFactory(param -> new TableCell<LicenceTableRow, String>() {
86+
licenseColumn.setCellFactory(param -> new TableCell<LicenseTableRow, String>() {
8587
@Override
8688
protected void updateItem(final String item, final boolean empty) {
8789
super.updateItem(item, empty);
@@ -95,27 +97,19 @@ protected void updateItem(final String item, final boolean empty) {
9597

9698
setOnMouseClicked(eventOnMouseClicked -> {
9799
if (!empty && eventOnMouseClicked.getButton() == MouseButton.PRIMARY) {
98-
final LicenceTableRow row = (LicenceTableRow) getTableRow().getItem();
100+
final LicenseTableRow row = (LicenseTableRow) getTableRow().getItem();
99101
final Licenses license = row.getLicense();
100102
LOG.debug("License file name: {}", license);
101103

102-
if (!FileOpenHelper.openFile(license.getPath())) {
103-
final Alert alert = new Alert(AlertType.ERROR);
104-
alert.setTitle("Ooops");
105-
alert.setHeaderText("Could not find the license file");
106-
alert.setContentText(
107-
String.format("We could not find the license file at \"%s\".%nPlease visit \"%s\".",
108-
license.getPath(), license.getUrl()));
109-
110-
alert.show();
111-
}
104+
showLicense(license);
112105
}
113106
});
114107
}
108+
115109
});
116110
licenseColumn.setCellValueFactory(new PropertyValueFactory<>("licenseName"));
117111

118-
final ObservableList<LicenceTableRow> licenses = loadRows();
112+
final ObservableList<LicenseTableRow> licenses = loadLicenseRows();
119113

120114
licenseTableView.setItems(licenses);
121115

@@ -135,17 +129,31 @@ protected void updateItem(final String item, final boolean empty) {
135129
});
136130
}
137131

138-
public ObservableList<LicenceTableRow> loadRows() {
139-
final ObservableList<LicenceTableRow> rows = FXCollections.observableArrayList();
140-
rows.add(new LicenceTableRow("jnativehook", Licenses.GPLV3));
141-
rows.add(new LicenceTableRow("jnativehook", Licenses.LGPLV3));
142-
rows.add(new LicenceTableRow("commons-lang3", Licenses.APACHEV2));
143-
rows.add(new LicenceTableRow("flyway-maven-plugin", Licenses.APACHEV2));
144-
rows.add(new LicenceTableRow("spring-boot-starter-data-jpa", Licenses.APACHEV2));
145-
rows.add(new LicenceTableRow("mockito-core", Licenses.MIT));
146-
rows.add(new LicenceTableRow("h2", Licenses.EPLV1));
147-
148-
return rows;
132+
public ObservableList<LicenseTableRow> loadLicenseRows() {
133+
final ObservableList<LicenseTableRow> licenseRows = FXCollections.observableArrayList();
134+
licenseRows.add(new LicenseTableRow("Open Sans", Licenses.APACHEV2));
135+
licenseRows.add(new LicenseTableRow("jnativehook", Licenses.GPLV3));
136+
licenseRows.add(new LicenseTableRow("jnativehook", Licenses.LGPLV3));
137+
licenseRows.add(new LicenseTableRow("commons-lang3", Licenses.APACHEV2));
138+
licenseRows.add(new LicenseTableRow("flyway-maven-plugin", Licenses.APACHEV2));
139+
licenseRows.add(new LicenseTableRow("spring-boot-starter-data-jpa", Licenses.APACHEV2));
140+
licenseRows.add(new LicenseTableRow("mockito-core", Licenses.MIT));
141+
licenseRows.add(new LicenseTableRow("h2", Licenses.EPLV1));
142+
143+
licenseRows.sort(Comparator.comparing(LicenseTableRow::getName));
144+
145+
return licenseRows;
149146
}
150147

148+
private void showLicense(final Licenses license) {
149+
if (!FileOpenHelper.openFile(license.getPath())) {
150+
final Alert alert = new Alert(AlertType.ERROR);
151+
alert.setTitle("Ooops");
152+
alert.setHeaderText("Could not find the license file");
153+
alert.setContentText(String.format("We could not find the license file at \"%s\".%nPlease visit \"%s\".",
154+
license.getPath(), license.getUrl()));
155+
156+
alert.show();
157+
}
158+
}
151159
}

src/main/java/de/doubleslash/keeptime/view/license/LicenceTableRow.java renamed to src/main/java/de/doubleslash/keeptime/view/license/LicenseTableRow.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818

1919
import de.doubleslash.keeptime.common.Licenses;
2020

21-
public class LicenceTableRow {
21+
public class LicenseTableRow {
2222
private String name;
2323
private String licenseName;
2424
private Licenses license;
2525

26-
public LicenceTableRow(final String name, final Licenses license) {
26+
public LicenseTableRow(final String name, final Licenses license) {
2727
this.license = license;
2828
this.licenseName = license.getName();
2929
this.name = name;

src/main/resources/layouts/about.fxml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,57 +24,57 @@
2424
<?import javafx.scene.shape.Line?>
2525
<?import javafx.scene.text.Font?>
2626

27-
<Pane fx:id="mainContainer" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="567.0" prefWidth="559.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.doubleslash.keeptime.view.AboutController">
27+
<Pane fx:id="mainContainer" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="507.0" prefWidth="509.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.doubleslash.keeptime.view.AboutController">
2828
<children>
29-
<Label fx:id="keepTimeLabel" layoutX="220.0" layoutY="50.0" text="KeepTime">
29+
<Label fx:id="keepTimeLabel" layoutX="197.0" layoutY="11.0" text="KeepTime">
3030
<font>
3131
<Font name="Open Sans Regular" size="26.0" />
3232
</font>
3333
</Label>
34-
<Line fx:id="bigLine" endX="497.0" endY="111.0" fill="BLACK" smooth="false" startX="62.0" startY="111.0" strokeWidth="2.0" />
35-
<Label fx:id="versionLabel" layoutX="62.0" layoutY="131.0" text="Version:">
34+
<Line fx:id="bigLine" endX="497.0" endY="111.0" fill="BLACK" layoutX="-23.0" layoutY="-39.0" smooth="false" startX="62.0" startY="111.0" strokeWidth="2.0" />
35+
<Label fx:id="versionLabel" layoutX="39.0" layoutY="92.0" text="Version:">
3636
<font>
3737
<Font name="Open Sans Regular" size="14.0" />
3838
</font>
3939
</Label>
40-
<Label fx:id="copyrightLabel" layoutX="62.0" layoutY="169.0" text="Copyright (c) doubleSlash Net-Business GmbH">
40+
<Label fx:id="copyrightLabel" layoutX="39.0" layoutY="130.0" text="Copyright (c) doubleSlash Net-Business GmbH">
4141
<font>
4242
<Font name="Open Sans Regular" size="14.0" />
4343
</font>
4444
</Label>
45-
<Label fx:id="openSourceLabel" layoutX="62.0" layoutY="207.0" prefHeight="20.0" prefWidth="360.0" text="KeepTime is open source software, licensed under the">
45+
<Label fx:id="openSourceLabel" layoutX="39.0" layoutY="168.0" prefHeight="20.0" prefWidth="360.0" text="KeepTime is open source software, licensed under the">
4646
<font>
4747
<Font name="Open Sans Regular" size="14.0" />
4848
</font>
4949
</Label>
50-
<Hyperlink fx:id="gitHubHyperlink" focusTraversable="false" layoutX="57.0" layoutY="262.0" text="https://www.github.com/doubleSlashde/KeepTime">
50+
<Hyperlink fx:id="gitHubHyperlink" focusTraversable="false" layoutX="34.0" layoutY="206.0" text="https://www.github.com/doubleSlashde/KeepTime" underline="true">
5151
<font>
5252
<Font name="Open Sans Regular" size="14.0" />
5353
</font>
5454
</Hyperlink>
55-
<Line fx:id="smallLine" endX="497.0" endY="273.0" layoutY="36.0" startX="62.0" startY="273.0" strokeWidth="2.0" />
56-
<Label fx:id="thirdPartyLabel" layoutX="62.0" layoutY="329.0" text="third party software">
55+
<Line fx:id="smallLine" endX="497.0" endY="273.0" layoutX="-23.0" layoutY="1.0" startX="62.0" startY="273.0" strokeWidth="2.0" />
56+
<Label fx:id="thirdPartyLabel" layoutX="39.0" layoutY="281.0" text="third party software">
5757
<font>
5858
<Font name="Open Sans Regular" size="14.0" />
5959
</font>
6060
</Label>
61-
<Button fx:id="reportBugButton" focusTraversable="false" layoutX="378.0" layoutY="324.0" mnemonicParsing="false" prefWidth="110.0" text="report a bug">
61+
<Button fx:id="reportBugButton" focusTraversable="false" layoutX="355.0" layoutY="237.0" mnemonicParsing="false" prefWidth="110.0" text="report a bug">
6262
<font>
6363
<Font name="Open Sans Regular" size="14.0" />
6464
</font>
6565
</Button>
66-
<TableView fx:id="licenseTableView" focusTraversable="false" layoutX="62.0" layoutY="378.0" prefHeight="120.0" prefWidth="437.0" />
67-
<Label fx:id="versionNumberLabel" layoutX="120.0" layoutY="131.0" text="1.0.0">
66+
<TableView fx:id="licenseTableView" focusTraversable="false" layoutX="39.0" layoutY="302.0" prefHeight="188.0" prefWidth="437.0" />
67+
<Label fx:id="versionNumberLabel" layoutX="97.0" layoutY="92.0" text="1.0.0">
6868
<font>
6969
<Font name="Open Sans Regular" size="14.0" />
7070
</font>
7171
</Label>
72-
<Hyperlink fx:id="ourLicenseHyperLink" layoutX="57.0" layoutY="221.0" text="GPL Version 3.0">
72+
<Hyperlink fx:id="ourLicenseHyperLink" layoutX="34.0" layoutY="182.0" text="GPL Version 3.0">
7373
<font>
7474
<Font name="Open Sans Regular" size="14.0" />
7575
</font>
7676
</Hyperlink>
77-
<Label layoutX="168.0" layoutY="225.0" text=", check out our Github page:">
77+
<Label layoutX="143.0" layoutY="186.0" text=". Check out our GitHub page:">
7878
<font>
7979
<Font name="Open Sans Regular" size="14.0" />
8080
</font>

0 commit comments

Comments
 (0)