Skip to content

Commit 404321e

Browse files
committed
v0.4.2
Rozwiązanie problemów pojawiających się w wersji 0.4.1.
1 parent 44fa959 commit 404321e

File tree

5 files changed

+59
-56
lines changed

5 files changed

+59
-56
lines changed

eMetrykant.iml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
4+
<output url="file://$MODULE_DIR$/target/classes" />
5+
<output-test url="file://$MODULE_DIR$/target/test-classes" />
6+
<content url="file://$MODULE_DIR$">
7+
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
8+
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
9+
<excludeFolder url="file://$MODULE_DIR$/target" />
10+
</content>
11+
<orderEntry type="inheritedJdk" />
12+
<orderEntry type="sourceFolder" forTests="false" />
13+
<orderEntry type="library" name="Maven: org.controlsfx:controlsfx:8.40.18" level="project" />
14+
<orderEntry type="library" name="Maven: org.kohsuke:github-api:1.135" level="project" />
15+
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.9" level="project" />
16+
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.13.0" level="project" />
17+
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.13.0" level="project" />
18+
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.13.0" level="project" />
19+
<orderEntry type="library" name="Maven: commons-io:commons-io:2.8.0" level="project" />
20+
</component>
21+
</module>

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<url>https://github.com/koder95/eMetrykant</url>
1010
<groupId>pl.koder95</groupId>
1111
<artifactId>eMetrykant</artifactId>
12-
<version>0.4.1</version>
12+
<version>0.4.2</version>
1313
<scm>
1414
<url>https://github.com/koder95/eMetrykant</url>
1515
<tag>search, metric, church</tag>
@@ -38,12 +38,12 @@
3838
<dependency>
3939
<groupId>org.controlsfx</groupId>
4040
<artifactId>controlsfx</artifactId>
41-
<version>8.40.16</version>
41+
<version>8.40.18</version>
4242
</dependency>
4343
<dependency>
4444
<groupId>org.kohsuke</groupId>
4545
<artifactId>github-api</artifactId>
46-
<version>1.133</version>
46+
<version>1.135</version>
4747
</dependency>
4848
</dependencies>
4949

src/main/java/pl/koder95/eme/Main.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
* Klasa uruchamiająca i inicjująca podstawowe elementy aplikacji.
4545
*
4646
* @author Kamil Jan Mularski [@koder95]
47-
* @version 0.4.1, 2021-11-07
47+
* @version 0.4.2, 2021-11-18
4848
* @since 0.0.201
4949
*/
5050
public class Main extends Application {
@@ -70,8 +70,7 @@ public class Main extends Application {
7070
/**
7171
* Wzór identyfikujący liczby w stringu.
7272
*/
73-
public static final Pattern DIGITS_STRING_PATTERN
74-
= Pattern.compile("([0-9]*)");
73+
public static final Pattern DIGITS_STRING_PATTERN = Pattern.compile("([0-9]*)");
7574
/**
7675
* Sprawdzenie, czy system operacyjny należy do rodziny "Windows".
7776
*/
@@ -117,7 +116,7 @@ public void init() throws Exception {
117116
CabinetWorkers.register(CabinetAnalyzer.class, worker);
118117
worker.load();
119118

120-
root = FXMLLoader.load(ClassLoader.getSystemResource("pl/koder95/eme/fx/PersonalDataView.fxml"));
119+
root = FXMLLoader.load(ClassLoader.getSystemResource("pl/koder95/eme/fx/PersonalDataView.fxml"), BUNDLE);
121120
task = new SelfUpdateTask();
122121
}
123122

@@ -126,7 +125,8 @@ public void start(Stage primaryStage) {
126125
primaryStage.getIcons().add(new Image(FAVICON_PATH));
127126
primaryStage.setTitle("eMetrykant " + Version.get());
128127
Version latestRelease = RepositoryInfo.get().getLatestReleaseVersion();
129-
if (latestRelease.compareTo(Version.get()) > 0 || !getParameters().getUnnamed().isEmpty()) {
128+
if (latestRelease != null &&
129+
(latestRelease.compareTo(Version.get()) > 0 || !getParameters().getUnnamed().isEmpty())) {
130130
ProgressBar updating = new ProgressBar();
131131
Label title = new Label();
132132
Label message = new Label();

src/main/java/pl/koder95/eme/fx/PersonalDataView.java

Lines changed: 23 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package pl.koder95.eme.fx;
22

33
import javafx.fxml.FXML;
4+
import javafx.fxml.FXMLLoader;
45
import javafx.fxml.Initializable;
56
import javafx.scene.control.Label;
67
import javafx.scene.control.TextField;
@@ -12,19 +13,18 @@
1213

1314
import java.net.URL;
1415
import java.util.ListResourceBundle;
16+
import java.util.Properties;
1517
import java.util.ResourceBundle;
1618

1719
/**
1820
* Kontroler dla widoku modelu danych osobowych.
1921
*
2022
* @author Kamil Jan Mularski [@koder95]
21-
* @version 0.4.0, 2020-08-26
23+
* @version 0.4.2, 2020-11-18
2224
* @since 0.1.11
2325
*/
2426
public class PersonalDataView implements Initializable {
2527

26-
public static final String ANALYZER_KEY = "analyzer";
27-
2828
@FXML
2929
private Label personalData;
3030

@@ -45,42 +45,27 @@ public class PersonalDataView implements Initializable {
4545

4646
@Override
4747
public void initialize(URL location, ResourceBundle resources) {
48-
if (resources == null) {
49-
resources = new ListResourceBundle() {
50-
@Override
51-
protected Object[][] getContents() {
52-
return new Object[][] {
53-
{ ANALYZER_KEY, CabinetWorkers.get(CabinetAnalyzer.class) }
54-
};
55-
}
56-
};
57-
}
58-
if (resources.containsKey(ANALYZER_KEY)) {
59-
Object obj = resources.getObject(ANALYZER_KEY);
60-
if (obj instanceof CabinetAnalyzer) {
61-
CabinetAnalyzer analyzer = (CabinetAnalyzer) obj;
62-
if (searching instanceof TextField) {
63-
TextField field = (TextField) searching;
64-
AutoCompletionBinding<PersonalDataModel> autoCompletionBinding = TextFields.bindAutoCompletion(
65-
field,
66-
analyzer.getSuggestionProvider(),
67-
analyzer.getPersonalDataConverter()
68-
);
69-
autoCompletionBinding.setOnAutoCompleted(event -> setPersonalDataModel(event.getCompletion()));
70-
field.setOnAction(event -> setPersonalDataModel(
71-
analyzer.getPersonalDataConverter().fromString(field.getText())
72-
));
73-
field.textProperty().addListener(
74-
(observable, oldValue, newValue) -> {
75-
if (oldValue.length() < newValue.length()) {
76-
field.setText(newValue.toUpperCase());
77-
}
78-
}
79-
);
80-
}
81-
numberOfActs.setText(analyzer.getNumberOfActs() + "");
82-
}
48+
CabinetAnalyzer analyzer = CabinetWorkers.get(CabinetAnalyzer.class);
49+
if (searching instanceof TextField) {
50+
TextField field = (TextField) searching;
51+
AutoCompletionBinding<PersonalDataModel> autoCompletionBinding = TextFields.bindAutoCompletion(
52+
field,
53+
analyzer.getSuggestionProvider(),
54+
analyzer.getPersonalDataConverter()
55+
);
56+
autoCompletionBinding.setOnAutoCompleted(event -> setPersonalDataModel(event.getCompletion()));
57+
field.setOnAction(event -> setPersonalDataModel(
58+
analyzer.getPersonalDataConverter().fromString(field.getText())
59+
));
60+
field.textProperty().addListener(
61+
(observable, oldValue, newValue) -> {
62+
if (oldValue.length() < newValue.length()) {
63+
field.setText(newValue.toUpperCase());
64+
}
65+
}
66+
);
8367
}
68+
numberOfActs.setText(analyzer.getNumberOfActs() + "");
8469
}
8570

8671
private void setPersonalDataModel(PersonalDataModel model) {
Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
# Komunikaty uwag i błędów, które nie są wyświetlane w okienku
2-
THR_ARG_TAG_IS_WRONG=Podany węzeł nie jest znacznikiem lub nie posiada atrybutów.
3-
THR_UPDATE_FILES_NOT_FOUND=Nie znaleziono odpowiednich plików do aktualizacji.
4-
THR_USER_NOT_SELECTED=Użytkownik nie został wybrany.
5-
# Kontrolki JavaFX
6-
FX_LABEL_PERSONAL_DATA=NAZWISKO Imię
7-
FX_LABEL_NUMBER_OF_ACTS=Liczba wczytanych aktów:
1+
THR_ARG_TAG_IS_WRONG=Podany w\u0119ze\u0142 nie jest znacznikiem lub nie posiada atrybut\u00f3w.
2+
THR_UPDATE_FILES_NOT_FOUND=Nie znaleziono odpowiednich plik\u00f3w do aktualizacji.
3+
THR_USER_NOT_SELECTED=U\u017cytkownik nie zosta\u0142 wybrany.
4+
FX_LABEL_PERSONAL_DATA=NAZWISKO Imi\u0119
5+
FX_LABEL_NUMBER_OF_ACTS=Liczba wczytanych akt\u00f3w:
86
FX_TITLED_PANE_BAPTISM=Chrzest
97
FX_TITLED_PANE_CONFIRMATION=Bierzmowanie
10-
FX_TITLED_PANE_MARRIAGE=Ślub
11-
FX_TITLED_PANE_DECEASE=Pogrzeb
12-
8+
FX_TITLED_PANE_MARRIAGE=\u015Alub
9+
FX_TITLED_PANE_DECEASE=Pogrzeb

0 commit comments

Comments
 (0)