Merge branch 'master' of ipost.rocks:noeasydb

This commit is contained in:
Mystikfluu 2023-06-04 18:12:53 +02:00
commit f03da7ce6c
6 changed files with 57 additions and 20 deletions

View File

@ -1,8 +0,0 @@
<component name="ArtifactManager">
<artifact type="jar" build-on-make="true" name="noEasyDB">
<output-path>$PROJECT_DIR$/out/artifacts/noEasyDB</output-path>
<root id="archive" name="noEasyDB.jar">
<element id="module-output" name="noEasyDB" />
</root>
</artifact>
</component>

2
.idea/misc.xml generated
View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="azul-17 (2)" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="zulu-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" /> <output url="file://$PROJECT_DIR$/out" />
</component> </component>
</project> </project>

View File

@ -19,7 +19,7 @@ import java.util.*;
public class A3 public class A3
extends Canvas { extends Canvas {
final KeyCombination sdfsdfds4564556 = new KeyCodeCombination(KeyCode.DIGIT0, KeyCombination.CONTROL_DOWN); final KeyCombination resetZoomCombination = new KeyCodeCombination(KeyCode.DIGIT0, KeyCombination.CONTROL_DOWN);
final KeyCombination keyCombinationCTRL_R = new KeyCodeCombination(KeyCode.R, KeyCombination.CONTROL_DOWN); final KeyCombination keyCombinationCTRL_R = new KeyCodeCombination(KeyCode.R, KeyCombination.CONTROL_DOWN);
final KeyCombination keyCombinationCTRL_O = new KeyCodeCombination(KeyCode.O, KeyCombination.CONTROL_DOWN); final KeyCombination keyCombinationCTRL_O = new KeyCodeCombination(KeyCode.O, KeyCombination.CONTROL_DOWN);
final KeyCombination keyCombinationCTRL_E = new KeyCodeCombination(KeyCode.E, KeyCombination.CONTROL_DOWN); final KeyCombination keyCombinationCTRL_E = new KeyCodeCombination(KeyCode.E, KeyCombination.CONTROL_DOWN);
@ -33,7 +33,7 @@ public class A3
final KeyCombination dsfsdfds67678768 = new KeyCodeCombination(KeyCode.Y, KeyCombination.CONTROL_DOWN); final KeyCombination dsfsdfds67678768 = new KeyCodeCombination(KeyCode.Y, KeyCombination.CONTROL_DOWN);
private final A3 thisERMDrawCanvas; private final A3 thisERMDrawCanvas;
private final U1 u1; private final U1 u1;
private final double canvasWidth = 2000.0D; private final double canvasWidth = 4000.0D;
private final double canvasHeight = 2000.0D; private final double canvasHeight = 2000.0D;
private final B3 view; private final B3 view;
private final GraphicsContext gc; private final GraphicsContext gc;
@ -1310,7 +1310,7 @@ public class A3
return; return;
} }
if (this.sdfsdfds4564556.match(event)) { if (this.resetZoomCombination.match(event)) {
Collections.reverse(this.zooming); Collections.reverse(this.zooming);
for (Double d : this.zooming) { for (Double d : this.zooming) {
this.thisERMDrawCanvas.getTransforms().add(new Scale(this.thisERMDrawCanvas.getScaleX() * d, this.thisERMDrawCanvas.getTransforms().add(new Scale(this.thisERMDrawCanvas.getScaleX() * d,

View File

@ -160,6 +160,7 @@ public class B3
this.showAttributeCB.setTooltip(new Tooltip("Check data generation")); this.showAttributeCB.setTooltip(new Tooltip("Check data generation"));
this.showAttributeCB.setPrefWidth(40.0D); this.showAttributeCB.setPrefWidth(40.0D);
this.showAttributeCB.setMinWidth(40.0D); this.showAttributeCB.setMinWidth(40.0D);
this.showAttributeCB.setStyle("-fx-text-fill: white");
this.showAttributeCB.setOnAction(new EventHandler<>() { this.showAttributeCB.setOnAction(new EventHandler<>() {
public void handle(ActionEvent event) { public void handle(ActionEvent event) {
@ -264,11 +265,11 @@ public class B3
}); });
this.treeOpenBTN.setBackground(new Background(new BackgroundFill(Color.LIGHTGRAY, CornerRadii.EMPTY, Insets.EMPTY))); this.treeOpenBTN.setBackground(C2.AppBackground);
this.treeOpenBTN.setGraphic(imageView); this.treeOpenBTN.setGraphic(imageView);
this.treeBorderPane.setBackground(new Background(new BackgroundFill(Color.LIGHTGRAY, CornerRadii.EMPTY, Insets.EMPTY))); this.treeBorderPane.setBackground(C2.AppBackground);
this.treeBorderPane.setPrefWidth(10.0D); this.treeBorderPane.setPrefWidth(10.0D);
@ -822,6 +823,16 @@ public class B3
fp.setAlignment(Pos.CENTER); fp.setAlignment(Pos.CENTER);
this.buttonPane.add(labeledSeparator, 0, ri++, 2, 1); this.buttonPane.add(labeledSeparator, 0, ri++, 2, 1);
BackgroundFill fill = C2.AppForeground.getFills().get(0);
Paint paint = fill.getFill();
String style = "";
if (paint instanceof Color color) {
String hex = String.format("#%02X%02X%02X",
(int)(color.getRed() * 255),
(int)(color.getGreen() * 255),
(int)(color.getBlue() * 255));
style = "-fx-background-color: "+hex+";";
}
VBox vbox0 = new VBox(10.0D); VBox vbox0 = new VBox(10.0D);
HBox hbox0 = new HBox(10.0D); HBox hbox0 = new HBox(10.0D);
@ -831,6 +842,8 @@ public class B3
Accordion accorTextelement = new Accordion(); Accordion accorTextelement = new Accordion();
accorTextelement.getPanes().add(textElement); accorTextelement.getPanes().add(textElement);
this.buttonPane.add(accorTextelement, 0, ri++, 2, 1); this.buttonPane.add(accorTextelement, 0, ri++, 2, 1);
vbox0.setStyle(style);
hbox0.setStyle(style);
vbox0 = new VBox(10.0D); vbox0 = new VBox(10.0D);
hbox0 = new HBox(10.0D); hbox0 = new HBox(10.0D);
@ -839,8 +852,11 @@ public class B3
hbox1.getChildren().addAll(this.esAssociativeBTN); hbox1.getChildren().addAll(this.esAssociativeBTN);
vbox0.getChildren().addAll(hbox0, hbox1); vbox0.getChildren().addAll(hbox0, hbox1);
TitledPane entitysetType = new TitledPane("Entity-set type", vbox0); TitledPane entitysetType = new TitledPane("Entity-set type", vbox0);
entitysetType.setStyle(style);
vbox0.setStyle(style);
hbox0.setStyle(style);
hbox1.setStyle(style);
this.buttonPane.add(entitysetType, 0, ri++, 2, 1); this.buttonPane.add(entitysetType, 0, ri++, 2, 1);
entitysetType.setBackground(C2.AppForeground);
vbox0 = new VBox(10.0D); vbox0 = new VBox(10.0D);
hbox0 = new HBox(10.0D); hbox0 = new HBox(10.0D);
@ -848,6 +864,11 @@ public class B3
hbox1 = new HBox(10.0D); hbox1 = new HBox(10.0D);
hbox1.getChildren().addAll(this.rsISABTN); hbox1.getChildren().addAll(this.rsISABTN);
vbox0.getChildren().addAll(hbox0, hbox1); vbox0.getChildren().addAll(hbox0, hbox1);
vbox0.setStyle(style);
hbox0.setStyle(style);
hbox1.setStyle(style);
TitledPane relationshipType = new TitledPane("Relationship type", vbox0); TitledPane relationshipType = new TitledPane("Relationship type", vbox0);
this.buttonPane.add(relationshipType, 0, ri++, 2, 1); this.buttonPane.add(relationshipType, 0, ri++, 2, 1);
relationshipType.setBackground(C2.AppForeground); relationshipType.setBackground(C2.AppForeground);
@ -861,6 +882,11 @@ public class B3
hbox2.getChildren().addAll(this.rsisaGeToESBTN, this.rsisaSpToESBTN); hbox2.getChildren().addAll(this.rsisaGeToESBTN, this.rsisaSpToESBTN);
vbox0.getChildren().addAll(hbox0, hbox1, hbox2); vbox0.getChildren().addAll(hbox0, hbox1, hbox2);
TitledPane connectESRS = new TitledPane("Connect ES-RS", vbox0); TitledPane connectESRS = new TitledPane("Connect ES-RS", vbox0);
vbox0.setStyle(style);
hbox0.setStyle(style);
hbox1.setStyle(style);
hbox2.setStyle(style);
this.buttonPane.add(connectESRS, 0, ri++, 2, 1); this.buttonPane.add(connectESRS, 0, ri++, 2, 1);
connectESRS.setBackground(C2.AppForeground); connectESRS.setBackground(C2.AppForeground);
@ -877,6 +903,10 @@ public class B3
attributeTypes.setExpanded(false); attributeTypes.setExpanded(false);
this.buttonPane.add(attributeTypes, 0, ri++, 2, 1); this.buttonPane.add(attributeTypes, 0, ri++, 2, 1);
attributeTypes.setBackground(C2.AppForeground); attributeTypes.setBackground(C2.AppForeground);
vbox0.setStyle(style);
hbox0.setStyle(style);
hbox1.setStyle(style);
hbox2.setStyle(style);
vbox0 = new VBox(10.0D); vbox0 = new VBox(10.0D);
hbox0 = new HBox(10.0D); hbox0 = new HBox(10.0D);
@ -889,7 +919,10 @@ public class B3
this.buttonPane.add(connectAttribute, 0, ri++, 2, 1); this.buttonPane.add(connectAttribute, 0, ri++, 2, 1);
connectAttribute.setBackground(C2.AppForeground); connectAttribute.setBackground(C2.AppForeground);
this.buttonPane.add(this.generateRelationalModelCB, 0, ri++, 2, 1); this.buttonPane.add(this.generateRelationalModelCB, 0, ri++, 2, 1);
vbox0.setStyle(style);
hbox0.setStyle(style);
hbox1.setStyle(style);
hbox2.setStyle(style);
VBox box = new VBox(10.0D); VBox box = new VBox(10.0D);
box.getChildren().addAll(this.addCurrentDateToDatabaseNameCB, this.generateInsertsCB, this.singleInsertStatementCB, this.saveSQLScriptBTN); box.getChildren().addAll(this.addCurrentDateToDatabaseNameCB, this.generateInsertsCB, this.singleInsertStatementCB, this.saveSQLScriptBTN);

View File

@ -521,22 +521,34 @@ public class C4 {
.append(column.isUnique()?"[Index(\""+column.getColumnName()+"Index\", IsUnique = true)]\n"+addChars():"") .append(column.isUnique()?"[Index(\""+column.getColumnName()+"Index\", IsUnique = true)]\n"+addChars():"")
.append(column.isAutoincrement()?"[DatabaseGenerated(DatabaseGeneratedOption.Identity)]\n"+addChars():""); .append(column.isAutoincrement()?"[DatabaseGenerated(DatabaseGeneratedOption.Identity)]\n"+addChars():"");
if(column.getReferencesTo() != null) { if(column.getReferencesTo() != null) {
sqlScript.append("[ForeignKey(\"").append(shortname(table.getTablename())).append(shortcolumnname).append("-").append(shortname(column.getReferencesTo().tablename())).append(shortname(column.getReferencesTo().columnname())).append("\")]\n").append(addChars()); //sqlScript.append("[ForeignKey(\"").append(shortname(table.getTablename())).append(shortcolumnname).append("-").append(shortname(column.getReferencesTo().tablename())).append(shortname(column.getReferencesTo().columnname())).append("\")]\n").append(addChars());
//[ForeignKey("Co_Department")] //[ForeignKey("Co_Department")]
//[InverseProperty("De_Courses")] //[InverseProperty("De_Courses")]
} }
sqlScript.append("public ").append(sqltoCSType(column.getDatatype())) sqlScript.append("public ")
.append(sqltoCSType(column.getDatatype()))
.append(" ") .append(" ")
.append(column.getReferencesTo()!=null?shortname(column.getReferencesTo().tablename()):"")
.append(shortcolumnname) .append(shortcolumnname)
.append(" { get; ") .append(" { get; ")
.append(column.isKey()?"private ": "") .append(column.isKey()?"private ": "")
.append("set; }\n"); .append("set; }\n");
if(column.getReferencesTo() != null) {
sqlScript.append(addChars()).append("public ").append(shortname(column.getReferencesTo().tablename())).append(" ").append(shortname(column.getReferencesTo().tablename())).append(" { get; set; }\n");
constructorbuilder.append(shortname(column.getReferencesTo().tablename()))
.append(" ").append(shortname(column.getReferencesTo().tablename())).append(", ");
innerconstructorbuilder.append(addChars()).append(addChars()).append("this.").append(shortname(column.getReferencesTo().tablename())).append("=").append(shortname(column.getReferencesTo().tablename())).append(";\n");
continue;
}
if(column.isKey())continue; if(column.isKey())continue;
constructorbuilder.append(sqltoCSType(column.getDatatype())) constructorbuilder.append(column.getReferencesTo()==null?sqltoCSType(column.getDatatype()):shortname(column.getReferencesTo().tablename()))
.append(" ").append(shortcolumnname).append(", "); .append(" ").append(shortcolumnname).append(", ");
innerconstructorbuilder.append(addChars()).append(addChars()).append("this.").append(shortcolumnname).append("=").append(shortcolumnname).append(";\n"); innerconstructorbuilder.append(addChars()).append(addChars()).append("this.").append(shortcolumnname).append("=").append(shortcolumnname).append(";\n");

View File

@ -4,9 +4,9 @@
<exclude-output /> <exclude-output />
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/lib" />
<excludeFolder url="file://$MODULE_DIR$/.idea" /> <excludeFolder url="file://$MODULE_DIR$/.idea" />
<excludeFolder url="file://$MODULE_DIR$/data" /> <excludeFolder url="file://$MODULE_DIR$/data" />
<excludeFolder url="file://$MODULE_DIR$/lib" />
<excludeFolder url="file://$MODULE_DIR$/proguard" /> <excludeFolder url="file://$MODULE_DIR$/proguard" />
<excludePattern pattern=".gitignore" /> <excludePattern pattern=".gitignore" />
<excludePattern pattern="*.bat" /> <excludePattern pattern="*.bat" />