Skip to content

Commit e419f12

Browse files
author
Martin Plieske
committed
real license names in table view; modified layout
1 parent f432d8d commit e419f12

File tree

4 files changed

+37
-19
lines changed

4 files changed

+37
-19
lines changed

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

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,27 @@
22

33
public enum Licenses {
44

5-
GPLV3("./licenses/GNU General Public License (GPL), Version 3.0.txt"),
6-
EPLV1("./licenses/EPL 1.0.txt"),
7-
APACHEV2("./licenses/Apache License, Version 2.0.txt"),
8-
LGPLV3("./licenses/GNU Lesser General Public License (LGPL), Version 3.0.txt"),
9-
MIT("./licenses/The MIT License.txt");
5+
GPLV3("./licenses/GNU General Public License (GPL), Version 3.0.txt", "GNU General Public License Version 3.0"),
6+
EPLV1("./licenses/EPL 1.0.txt", "Eclipse Public License 1.0"),
7+
APACHEV2("./licenses/Apache License, Version 2.0.txt", "Apache License Version 2.0"),
8+
LGPLV3(
9+
"./licenses/GNU Lesser General Public License (LGPL), Version 3.0.txt",
10+
"GNU Lesser General Public License Version 3.0"),
11+
MIT("./licenses/The MIT License.txt", "The MIT License");
1012

1113
private final String path;
14+
private final String name;
1215

13-
Licenses(final String licensePath) {
16+
Licenses(final String licensePath, final String licenseName) {
1417
path = licensePath;
18+
name = licenseName;
1519
}
1620

1721
public String getPath() {
1822
return path;
1923
}
24+
25+
public String getName() {
26+
return name;
27+
}
2028
}

src/main/java/de/doubleslash/keeptime/model/LicenceTableRow.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44

55
public class LicenceTableRow {
66
private String name;
7+
private String licenseName;
78
private Licenses license;
89

9-
public LicenceTableRow(final String softwareName, final Licenses licenceName) {
10-
this.license = licenceName;
11-
this.name = softwareName;
10+
public LicenceTableRow(final String name, final Licenses license) {
11+
this.license = license;
12+
this.licenseName = license.getName();
13+
this.name = name;
1214
}
1315

1416
public String getName() {
@@ -19,6 +21,14 @@ public void setName(final String name) {
1921
this.name = name;
2022
}
2123

24+
public String getLicenseName() {
25+
return licenseName;
26+
}
27+
28+
public void setLicenseName(final String licenseName) {
29+
this.licenseName = licenseName;
30+
}
31+
2232
public Licenses getLicense() {
2333
return license;
2434
}

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
public class AboutController {
2424

2525
private static final String GITHUB_PAGE = "https://www.github.com/doubleSlashde/KeepTime";
26-
private static final String GITHUB_ISSUE_PAGE = "/issues";
26+
private static final String GITHUB_ISSUE_PAGE = GITHUB_PAGE + "/issues";
2727

2828
private final FileOpenHelper fileOpen = new FileOpenHelper();
2929
private final BrowserHelper browserOpen = new BrowserHelper();
@@ -51,14 +51,14 @@ public void initialize() {
5151
// name column
5252
TableColumn<LicenceTableRow, String> nameColumn;
5353
nameColumn = new TableColumn<>("Name");
54-
nameColumn.setMinWidth(100);
54+
nameColumn.setMinWidth(160);
5555
nameColumn.setCellValueFactory(new PropertyValueFactory<>("name"));
5656

5757
// licenseColumn
58-
TableColumn<LicenceTableRow, Licenses> licenseColumn;
58+
TableColumn<LicenceTableRow, String> licenseColumn;
5959
licenseColumn = new TableColumn<>("License");
60-
licenseColumn.setMinWidth(200);
61-
licenseColumn.setCellValueFactory(new PropertyValueFactory<>("license"));
60+
licenseColumn.setMinWidth(260);
61+
licenseColumn.setCellValueFactory(new PropertyValueFactory<>("licenseName"));
6262

6363
final ObservableList<LicenceTableRow> licenses = loadRows();
6464

@@ -75,7 +75,7 @@ public void initialize() {
7575
if (!row.isEmpty() && event.getButton() == MouseButton.PRIMARY && event.getClickCount() == 2) {
7676
final LicenceTableRow clickedRow = row.getItem();
7777
final Licenses license = clickedRow.getLicense();
78-
LOG.debug("License file name: {}", license.getPath());
78+
LOG.debug("License file name: {}", license);
7979

8080
fileOpen.openFile(license.getPath());
8181
}
@@ -92,7 +92,7 @@ public void initialize() {
9292
LOG.debug("roportbugbutton setonaction");
9393
reportBugButton.setOnAction(ae -> {
9494
LOG.info("Clicked reportBugButton");
95-
browserOpen.openURL(GITHUB_PAGE + GITHUB_ISSUE_PAGE);
95+
browserOpen.openURL(GITHUB_ISSUE_PAGE);
9696
});
9797
}
9898

src/main/resources/layouts/about.fxml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<?import javafx.scene.shape.Line?>
99
<?import javafx.scene.text.Font?>
1010

11-
<Pane fx:id="mainContainer" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="460.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">
11+
<Pane fx:id="mainContainer" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="486.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">
1212
<children>
1313
<Label fx:id="keepTimeLabel" layoutX="220.0" layoutY="50.0" text="KeepTime">
1414
<font>
@@ -42,12 +42,12 @@
4242
<Font name="Open Sans Regular" size="14.0" />
4343
</font>
4444
</Label>
45-
<Button fx:id="reportBugButton" layoutX="377.0" layoutY="356.0" mnemonicParsing="false" prefWidth="120.0" text="report a bug">
45+
<Button fx:id="reportBugButton" layoutX="378.0" layoutY="288.0" mnemonicParsing="false" prefWidth="120.0" text="report a bug">
4646
<font>
4747
<Font name="Open Sans Regular" size="14.0" />
4848
</font>
4949
</Button>
50-
<TableView fx:id="licenseTableView" layoutX="62.0" layoutY="331.0" prefHeight="120.0" prefWidth="300.0" />
50+
<TableView fx:id="licenseTableView" layoutX="62.0" layoutY="331.0" prefHeight="120.0" prefWidth="437.0" />
5151
<Label fx:id="versionNumberLabel" layoutX="120.0" layoutY="131.0" text="1.0.0">
5252
<font>
5353
<Font name="Open Sans Regular" size="14.0" />

0 commit comments

Comments
 (0)