geht
This commit is contained in:
parent
60ae3894f6
commit
46dfeeb83b
@ -1,21 +1,40 @@
|
|||||||
package net.altimate.app;
|
package net.altimate.app;
|
||||||
|
|
||||||
|
|
||||||
|
import static net.altimate.app.App.filesDirectory;
|
||||||
|
|
||||||
public class Filter {
|
public class Filter {
|
||||||
|
|
||||||
ListFilesInDir listFilesInDir = new ListFilesInDir();
|
ListFilesInDir listFilesInDir = new ListFilesInDir();
|
||||||
|
|
||||||
|
|
||||||
public String[] filterRemoveWithRegex(String filterRegex, String filesDirectory) {
|
public String[] filterRemoveWithRegexOld(String filterRegex, String filesDirectory) {
|
||||||
|
|
||||||
String process[] = listFilesInDir.listFilesInDir(filesDirectory);
|
String process[] = listFilesInDir.listFilesInDir(filesDirectory);
|
||||||
|
|
||||||
for (int i = 0; i < process.length; ++i) {
|
for (int i = 0; i < process.length; ++i) {
|
||||||
|
System.out.println("process withRegex: " + process[i]);
|
||||||
process[i] = process[i].replaceAll(filterRegex, "");
|
process[i] = process[i].replaceAll(filterRegex, "");
|
||||||
}
|
}
|
||||||
return process;
|
return process;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String[] filterListSMartName(String filterRegex, String filesDirectory) {
|
||||||
|
|
||||||
|
String process[] = listFilesInDir.listFilesInDir(filesDirectory);
|
||||||
|
|
||||||
|
for (int i = 0; i < process.length; ++i) {
|
||||||
|
|
||||||
|
//System.out.println("process RegexTest: " + process[i]);
|
||||||
|
//System.out.println(filterSplitValues( i, filesDirectory));
|
||||||
|
String[] bak = (filterSplitValues( i, filesDirectory));
|
||||||
|
process[i] = bak[0];
|
||||||
|
process[i] = process[i].replaceAll(filterRegex, "");
|
||||||
|
}
|
||||||
|
return process;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public String[] filterSplitValues(int choosenFileNumber, String filesDirectory) {
|
public String[] filterSplitValues(int choosenFileNumber, String filesDirectory) {
|
||||||
|
|
||||||
String process[] = listFilesInDir.listFilesInDir(filesDirectory);
|
String process[] = listFilesInDir.listFilesInDir(filesDirectory);
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package net.altimate.app;
|
package net.altimate.app;
|
||||||
|
|
||||||
|
import javafx.beans.value.ChangeListener;
|
||||||
|
import javafx.beans.value.ObservableValue;
|
||||||
import javafx.event.ActionEvent;
|
import javafx.event.ActionEvent;
|
||||||
import javafx.event.EventHandler;
|
import javafx.event.EventHandler;
|
||||||
import javafx.geometry.Insets;
|
import javafx.geometry.Insets;
|
||||||
@ -19,6 +21,8 @@ import javafx.stage.Stage;
|
|||||||
|
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
|
|
||||||
|
import static net.altimate.app.App.filesDirectory;
|
||||||
|
|
||||||
public class SceneCreate {
|
public class SceneCreate {
|
||||||
|
|
||||||
Scene scene;
|
Scene scene;
|
||||||
@ -57,6 +61,13 @@ public class SceneCreate {
|
|||||||
vbox.getChildren().add(title);
|
vbox.getChildren().add(title);
|
||||||
|
|
||||||
nameSmartZiel = new TextField();
|
nameSmartZiel = new TextField();
|
||||||
|
nameSmartZiel.textProperty().addListener(new ChangeListener<String>() {
|
||||||
|
@Override
|
||||||
|
public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
|
||||||
|
System.out.println("Changed!!!");
|
||||||
|
// object properties oder update methode beim scene bauen in App
|
||||||
|
}
|
||||||
|
});
|
||||||
nameSmartZiel.setPromptText("Gib dm Smart Ziel einen Namen");
|
nameSmartZiel.setPromptText("Gib dm Smart Ziel einen Namen");
|
||||||
nameSmartZiel.setPrefColumnCount(1);
|
nameSmartZiel.setPrefColumnCount(1);
|
||||||
nameSmartZiel.setPrefSize(100, 20);
|
nameSmartZiel.setPrefSize(100, 20);
|
||||||
@ -125,7 +136,7 @@ public class SceneCreate {
|
|||||||
+ "thanks" + checkInDatePicker.getValue());
|
+ "thanks" + checkInDatePicker.getValue());
|
||||||
String date = checkInDatePicker.getValue().format(DateTimeFormatter.ofPattern("dd.MM.yyyy"));
|
String date = checkInDatePicker.getValue().format(DateTimeFormatter.ofPattern("dd.MM.yyyy"));
|
||||||
long seconds = System.currentTimeMillis() / 1000l;
|
long seconds = System.currentTimeMillis() / 1000l;
|
||||||
String state = "open";
|
String smartState = "open";
|
||||||
|
|
||||||
String[] createSmart = {
|
String[] createSmart = {
|
||||||
nameSmartZiel.getText() + "|" +
|
nameSmartZiel.getText() + "|" +
|
||||||
@ -133,12 +144,12 @@ public class SceneCreate {
|
|||||||
messBar.getText() + "|" +
|
messBar.getText() + "|" +
|
||||||
attraktiv.getText() + "|" +
|
attraktiv.getText() + "|" +
|
||||||
realistisch.getText() + "|" +
|
realistisch.getText() + "|" +
|
||||||
state + "|" +
|
smartState + "|" +
|
||||||
seconds + "|" +
|
seconds + "|" +
|
||||||
date
|
date
|
||||||
};
|
};
|
||||||
// Achtung rausnehmen
|
// Achtung rausnehmen
|
||||||
String filesDirectory = "/home/mic/files";
|
//String filesDirectory = "/home/mic/files";
|
||||||
CreateFile.writeFile(filesDirectory + "/" + seconds + ".smart", createSmart);
|
CreateFile.writeFile(filesDirectory + "/" + seconds + ".smart", createSmart);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -6,10 +6,7 @@ import javafx.event.ActionEvent;
|
|||||||
import javafx.event.EventHandler;
|
import javafx.event.EventHandler;
|
||||||
import javafx.geometry.Insets;
|
import javafx.geometry.Insets;
|
||||||
import javafx.scene.Scene;
|
import javafx.scene.Scene;
|
||||||
import javafx.scene.control.Button;
|
import javafx.scene.control.*;
|
||||||
import javafx.scene.control.Label;
|
|
||||||
import javafx.scene.control.ListView;
|
|
||||||
import javafx.scene.control.TextField;
|
|
||||||
import javafx.scene.layout.BorderPane;
|
import javafx.scene.layout.BorderPane;
|
||||||
import javafx.scene.layout.GridPane;
|
import javafx.scene.layout.GridPane;
|
||||||
import javafx.scene.layout.HBox;
|
import javafx.scene.layout.HBox;
|
||||||
@ -40,7 +37,7 @@ public class SceneList {
|
|||||||
border.setLeft(addList(label, list1));
|
border.setLeft(addList(label, list1));
|
||||||
border.setRight(addEdit(label,list1));
|
border.setRight(addEdit(label,list1));
|
||||||
//border.setBottom(addCreateBottom(label));
|
//border.setBottom(addCreateBottom(label));
|
||||||
scene = new Scene(border, 600, 300);
|
scene = new Scene(border, 600, 400);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Scene getScene() {
|
public Scene getScene() {
|
||||||
@ -73,7 +70,7 @@ public class SceneList {
|
|||||||
|
|
||||||
|
|
||||||
//ListView<String> list1 = new ListView();
|
//ListView<String> list1 = new ListView();
|
||||||
ObservableList<String> items = FXCollections.observableArrayList(filter.filterRemoveWithRegex(".smart", filesDirectory));
|
ObservableList<String> items = FXCollections.observableArrayList(filter.filterListSMartName(".smart", filesDirectory));
|
||||||
//ObservableList<String> items = FXCollections.observableArrayList(filter.getSmartTargetName(filesDirectory));
|
//ObservableList<String> items = FXCollections.observableArrayList(filter.getSmartTargetName(filesDirectory));
|
||||||
//list1.getItems().addAll(items);
|
//list1.getItems().addAll(items);
|
||||||
//list1.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
|
//list1.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
|
||||||
@ -100,9 +97,9 @@ public class SceneList {
|
|||||||
reload.setOnAction(new EventHandler<ActionEvent>() {
|
reload.setOnAction(new EventHandler<ActionEvent>() {
|
||||||
@Override
|
@Override
|
||||||
public void handle(ActionEvent e) {
|
public void handle(ActionEvent e) {
|
||||||
ObservableList<String> items = FXCollections.observableArrayList(filter.filterRemoveWithRegex(".smart", filesDirectory));
|
//ObservableList<String> items = FXCollections.observableArrayList(filter.filterRemoveWithRegex(".smart", filesDirectory));
|
||||||
System.out.println("theoretischer reload des Inhaltes");
|
//System.out.println("theoretischer reload des Inhaltes");
|
||||||
System.out.println(filter.filterRemoveWithRegex(".smart", filesDirectory));
|
System.out.println(filter.filterListSMartName(".smart", filesDirectory));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -133,35 +130,74 @@ public class SceneList {
|
|||||||
|
|
||||||
String[] ar = filter.filterSplitValues((int) o, filesDirectory);
|
String[] ar = filter.filterSplitValues((int) o, filesDirectory);
|
||||||
|
|
||||||
final TextField max = new TextField(ar[0]);
|
final TextField nameSmartZiel = new TextField(ar[0]);
|
||||||
max.setPrefColumnCount(20);
|
nameSmartZiel.setPrefColumnCount(20);
|
||||||
max.setPromptText("max");
|
nameSmartZiel.setPromptText("max");
|
||||||
|
|
||||||
//final TextField max2 = new TextField(filesContent[(int) o]);
|
//final TextField max2 = new TextField(filesContent[(int) o]);
|
||||||
final TextField max2 = new TextField(ar[1]);
|
final TextField sinnesSpezifisch = new TextField(ar[1]);
|
||||||
max.setPrefColumnCount(20);
|
sinnesSpezifisch .setPrefColumnCount(20);
|
||||||
max.setPromptText("max2");
|
sinnesSpezifisch .setPromptText("max2");
|
||||||
|
|
||||||
final TextField max3 = new TextField(ar[2]);
|
final TextField messBar = new TextField(ar[2]);
|
||||||
max.setPrefColumnCount(20);
|
messBar.setPrefColumnCount(20);
|
||||||
max.setPromptText("max3");
|
messBar .setPromptText("max3");
|
||||||
|
|
||||||
//final TextField max2 = new TextField(filesContent[(int) o]);
|
//final TextField max2 = new TextField(filesContent[(int) o]);
|
||||||
final TextField max4 = new TextField(ar[3]);
|
final TextField attraktiv = new TextField(ar[3]);
|
||||||
max.setPrefColumnCount(20);
|
attraktiv.setPrefColumnCount(20);
|
||||||
max.setPromptText("max4");
|
attraktiv.setPromptText("max4");
|
||||||
|
|
||||||
|
final TextField realistisch = new TextField(ar[4]);
|
||||||
|
realistisch.setPrefColumnCount(20);
|
||||||
|
realistisch.setPromptText("max5");
|
||||||
|
|
||||||
|
ObservableList<String> smartStateObj = FXCollections.observableArrayList(
|
||||||
|
"open",
|
||||||
|
"succes",
|
||||||
|
"penalty",
|
||||||
|
"closed, penalty done",
|
||||||
|
"closed, bonus done"
|
||||||
|
);
|
||||||
|
final ComboBox smartState = new ComboBox(smartStateObj);
|
||||||
|
smartState.setValue(ar[5]);
|
||||||
|
|
||||||
|
//final TextField smartState = new TextField(ar[5]);
|
||||||
|
//smartState.setPrefColumnCount(20);
|
||||||
|
//smartState.setPromptText("max6");
|
||||||
|
|
||||||
final TextField max5 = new TextField(ar[4]);
|
|
||||||
max.setPrefColumnCount(20);
|
|
||||||
max.setPromptText("max5");
|
|
||||||
|
|
||||||
//final TextField max2 = new TextField(filesContent[(int) o]);
|
//final TextField max2 = new TextField(filesContent[(int) o]);
|
||||||
final TextField max6 = new TextField(ar[5]);
|
final TextField smartDate = new TextField(ar[7]);
|
||||||
max.setPrefColumnCount(20);
|
smartDate.setPrefColumnCount(20);
|
||||||
max.setPromptText("max6");
|
smartDate.setPromptText("max7");
|
||||||
|
|
||||||
vbox.getChildren().addAll(max, max2, max3, max4, max5, max6);
|
Button edit = new Button("Edit");
|
||||||
|
|
||||||
|
vbox.getChildren().addAll(nameSmartZiel, sinnesSpezifisch, messBar, attraktiv, realistisch, smartDate, smartState, edit);
|
||||||
//System.out.println(Arrays.toString(list1));
|
//System.out.println(Arrays.toString(list1));
|
||||||
|
edit.setOnAction(new EventHandler<ActionEvent>() {
|
||||||
|
@Override
|
||||||
|
public void handle(ActionEvent e) {
|
||||||
|
System.out.println("edited: " + " nameofsmart: " + ar[0] + " file: " + ar[6] + " inhalt zelle1: " + nameSmartZiel.getText() );
|
||||||
|
String[] createSmart = {
|
||||||
|
nameSmartZiel.getText() + "|" +
|
||||||
|
sinnesSpezifisch.getText() + "|" +
|
||||||
|
messBar.getText() + "|" +
|
||||||
|
attraktiv.getText() + "|" +
|
||||||
|
realistisch.getText() + "|" +
|
||||||
|
smartState.getValue() + "|" +
|
||||||
|
ar[6] + "|" +
|
||||||
|
ar[7]
|
||||||
|
};
|
||||||
|
//String filesDirectory = "/home/mic/files";
|
||||||
|
CreateFile.writeFile(filesDirectory + "/" + ar[6] + ".smart", createSmart);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
target/classes/net/altimate/app/SceneCreate$3.class
Normal file
BIN
target/classes/net/altimate/app/SceneCreate$3.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
target/classes/net/altimate/app/SceneList$2.class
Normal file
BIN
target/classes/net/altimate/app/SceneList$2.class
Normal file
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user