From c79e9a4581d781d71d93176cc7856263d712ed1e Mon Sep 17 00:00:00 2001 From: Marc Beyer Date: Mon, 24 Jan 2022 12:45:08 +0100 Subject: [PATCH] Fixed special Chars --- .../main/java/main/EditEventController.java | 17 +++ .../java/main/MainApplication_structure.puml | 109 ++++++++++++++++++ client/config.json | 2 +- client/data/src/main/java/res/Event.java | 29 +---- 4 files changed, 130 insertions(+), 27 deletions(-) create mode 100644 client/app/src/main/java/main/MainApplication_structure.puml diff --git a/client/app/src/main/java/main/EditEventController.java b/client/app/src/main/java/main/EditEventController.java index 3e34d04..58d1ea6 100644 --- a/client/app/src/main/java/main/EditEventController.java +++ b/client/app/src/main/java/main/EditEventController.java @@ -1,9 +1,17 @@ package main; +import customUI.Converter; import helper.HttpRequestException; +import javafx.fxml.FXML; +import javafx.util.StringConverter; +import javafx.util.converter.LocalTimeStringConverter; import res.DataController; import res.Event; +import java.time.LocalTime; +import java.time.format.FormatStyle; +import java.util.Locale; + public class EditEventController extends CreateEventController{ private Event currentEvent; @@ -14,8 +22,17 @@ public class EditEventController extends CreateEventController{ public void setCurrentEvent(Event currentEvent) { this.currentEvent = currentEvent; + + textName.setText(Converter.convertString(currentEvent.getName())); + datePickerDate.setValue(currentEvent.getDate().toLocalDate()); + ComboBoxPriotity.getSelectionModel().select(currentEvent.getPriority()); + + //timeEnd.setValue(currentEvent.getEnd()); } + + + @Override protected void sendHttpRequest(Event event) throws HttpRequestException { DataController dataController = new DataController(); diff --git a/client/app/src/main/java/main/MainApplication_structure.puml b/client/app/src/main/java/main/MainApplication_structure.puml new file mode 100644 index 0000000..65371cd --- /dev/null +++ b/client/app/src/main/java/main/MainApplication_structure.puml @@ -0,0 +1,109 @@ +@startuml + +/' diagram meta data start +config=StructureConfiguration; +{ + "projectClassification": { + "searchMode": "OpenProject", // OpenProject, AllProjects + "includedProjects": "", + "pathEndKeywords": "*.impl", + "isClientPath": "", + "isClientName": "", + "isTestPath": "", + "isTestName": "", + "isMappingPath": "", + "isMappingName": "", + "isDataAccessPath": "", + "isDataAccessName": "", + "isDataStructurePath": "", + "isDataStructureName": "", + "isInterfaceStructuresPath": "", + "isInterfaceStructuresName": "", + "isEntryPointPath": "", + "isEntryPointName": "" + }, + "graphRestriction": { + "classPackageExcludeFilter": "", + "classPackageIncludeFilter": "", + "classNameExcludeFilter": "", + "classNameIncludeFilter": "", + "methodNameExcludeFilter": "", + "methodNameIncludeFilter": "", + "removeByInheritance": "", // inheritance/annotation based filtering is done in a second step + "removeByAnnotation": "", + "removeByClassPackage": "", // cleanup the graph after inheritance/annotation based filtering is done + "removeByClassName": "", + "cutMappings": false, + "cutEnum": true, + "cutTests": true, + "cutClient": true, + "cutDataAccess": false, + "cutInterfaceStructures": false, + "cutDataStructures": false, + "cutGetterAndSetter": true, + "cutConstructors": true + }, + "graphTraversal": { + "forwardDepth": 3, + "backwardDepth": 3, + "classPackageExcludeFilter": "", + "classPackageIncludeFilter": "", + "classNameExcludeFilter": "", + "classNameIncludeFilter": "", + "methodNameExcludeFilter": "", + "methodNameIncludeFilter": "", + "hideMappings": false, + "hideDataStructures": false, + "hidePrivateMethods": true, + "hideInterfaceCalls": true, // indirection: implementation -> interface (is hidden) -> implementation + "onlyShowApplicationEntryPoints": false // root node is included + }, + "details": { + "aggregation": "GroupByClass", // ByClass, GroupByClass, None + "showClassGenericTypes": true, + "showMethods": true, + "showMethodParameterNames": true, + "showMethodParameterTypes": true, + "showMethodReturnType": true, + "showPackageLevels": 2, + "showDetailedClassStructure": true + }, + "rootClass": "main.MainApplication" +} +diagram meta data end '/ + + + +digraph g { + rankdir="TB" + splines=polyline + + +'nodes +subgraph cluster_3343801 { + label=main + labeljust=l + fillcolor="#ececec" + style=filled + + MainApplication3343801[ + label=< + +
+ + + + +
(C)MainApplication
- loadLoginScene()
- loadMainScene(stage: Stage)
+ main(args: String[])
+ start(stage: Stage)
> + style=filled + margin=0 + shape=plaintext + fillcolor="#FFFFFF" +]; +} + +'edges + + +} +@enduml \ No newline at end of file diff --git a/client/config.json b/client/config.json index e80bf9d..65c46cc 100644 --- a/client/config.json +++ b/client/config.json @@ -1 +1 @@ -{"saveLogin":true,"id":1,"token":"eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJtYXJjIn0.NdOMxKKgH4ZNZ84uA81L57vJtR9OhTVyKwtNsOuZhFQ"} \ No newline at end of file +{"saveLogin":true,"id":1,"token":"eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJtYXJjIn0.c7OHtcVGdTTVI2VmuY3qSlSscAM2t-aP2piRvf4R9jo"} \ No newline at end of file diff --git a/client/data/src/main/java/res/Event.java b/client/data/src/main/java/res/Event.java index 022aeea..efabe57 100644 --- a/client/data/src/main/java/res/Event.java +++ b/client/data/src/main/java/res/Event.java @@ -110,26 +110,6 @@ public class Event { Pattern pattern = Pattern.compile("[A-Za-z\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df0-9 =!?+*/$.:,;_<>()-]*"); Matcher matcher = pattern.matcher(name); if (!matcher.matches()) { - System.out.println(name); - - byte[] bytes = name.getBytes(StandardCharsets.UTF_16); - - String utf8EncodedString = new String(bytes, StandardCharsets.UTF_16); - System.out.println(utf8EncodedString); - - for (char c : (name).toCharArray()) { - System.out.print(c + " " + (int) c + ", "); - } - System.out.println(); - for (char c : (name).toCharArray()) { - System.out.print(c + " " + (int) c + ", "); - } - System.out.println(); - for (char c : ("TäöüÄÖÜ").toCharArray()) { - System.out.print(c + " " + (int) c + ", "); - } - System.out.println(); - throw new IllegalArgumentException("Der Name darf nur aus Zahlen, Buchstaben und folgenden Sonderzeichen bestehen: \u00e4\u00f6\u00fc \u00c4\u00d6\u00dc \u00df =!?+*/$.:,;_ <>()-"); } if (priority < 0) { @@ -163,7 +143,9 @@ public class Event { } public void setName(String name) { - this.name = convertToASCII(name); + System.out.println(name); + this.name = name; + System.out.println(this.name); } public int getPriority() { @@ -250,9 +232,4 @@ public class Event { "&isFullDay=" + isFullDay() + "&isPrivate=" + isPrivate(); } - - private String convertToASCII(String s) { - byte[] germanBytes = s.getBytes(); - return new String(germanBytes, StandardCharsets.US_ASCII); - } }