Fixed special Chars

This commit is contained in:
Marc Beyer 2022-01-24 12:45:08 +01:00
parent 4ce4445d50
commit c79e9a4581
4 changed files with 130 additions and 27 deletions

View File

@ -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();

View File

@ -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=<<TABLE BORDER="1" CELLBORDER="0" CELLPADDING="4" CELLSPACING="0">
<TR><TD ALIGN="LEFT" >(C)MainApplication</TD></TR>
<HR/>
<TR><TD ALIGN="LEFT" >- loadLoginScene()</TD></TR>
<TR><TD ALIGN="LEFT" >- loadMainScene(stage: Stage)</TD></TR>
<TR><TD ALIGN="LEFT" >+ main(args: String[])</TD></TR>
<TR><TD ALIGN="LEFT" >+ start(stage: Stage)</TD></TR>
</TABLE>>
style=filled
margin=0
shape=plaintext
fillcolor="#FFFFFF"
];
}
'edges
}
@enduml

View File

@ -1 +1 @@
{"saveLogin":true,"id":1,"token":"eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJtYXJjIn0.NdOMxKKgH4ZNZ84uA81L57vJtR9OhTVyKwtNsOuZhFQ"}
{"saveLogin":true,"id":1,"token":"eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJtYXJjIn0.c7OHtcVGdTTVI2VmuY3qSlSscAM2t-aP2piRvf4R9jo"}

View File

@ -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);
}
}