diff --git a/.idea/artifacts/noEasyDB.xml b/.idea/artifacts/noEasyDB.xml deleted file mode 100644 index f4b725a..0000000 --- a/.idea/artifacts/noEasyDB.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - $PROJECT_DIR$/out/artifacts/noEasyDB - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 604d27e..0ec6b57 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/at/fos/ermodel/gui/A3.java b/at/fos/ermodel/gui/A3.java index 9405f36..82d59a8 100644 --- a/at/fos/ermodel/gui/A3.java +++ b/at/fos/ermodel/gui/A3.java @@ -19,7 +19,7 @@ import java.util.*; public class A3 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_O = new KeyCodeCombination(KeyCode.O, 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); private final A3 thisERMDrawCanvas; private final U1 u1; - private final double canvasWidth = 2000.0D; + private final double canvasWidth = 4000.0D; private final double canvasHeight = 2000.0D; private final B3 view; private final GraphicsContext gc; @@ -1310,7 +1310,7 @@ public class A3 return; } - if (this.sdfsdfds4564556.match(event)) { + if (this.resetZoomCombination.match(event)) { Collections.reverse(this.zooming); for (Double d : this.zooming) { this.thisERMDrawCanvas.getTransforms().add(new Scale(this.thisERMDrawCanvas.getScaleX() * d, diff --git a/at/fos/ermodel/gui/B3.java b/at/fos/ermodel/gui/B3.java index 3f38bf8..28e49f2 100644 --- a/at/fos/ermodel/gui/B3.java +++ b/at/fos/ermodel/gui/B3.java @@ -160,6 +160,7 @@ public class B3 this.showAttributeCB.setTooltip(new Tooltip("Check data generation")); this.showAttributeCB.setPrefWidth(40.0D); this.showAttributeCB.setMinWidth(40.0D); + this.showAttributeCB.setStyle("-fx-text-fill: white"); this.showAttributeCB.setOnAction(new EventHandler<>() { 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.treeBorderPane.setBackground(new Background(new BackgroundFill(Color.LIGHTGRAY, CornerRadii.EMPTY, Insets.EMPTY))); + this.treeBorderPane.setBackground(C2.AppBackground); this.treeBorderPane.setPrefWidth(10.0D); @@ -822,6 +823,16 @@ public class B3 fp.setAlignment(Pos.CENTER); 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); HBox hbox0 = new HBox(10.0D); @@ -831,6 +842,8 @@ public class B3 Accordion accorTextelement = new Accordion(); accorTextelement.getPanes().add(textElement); this.buttonPane.add(accorTextelement, 0, ri++, 2, 1); + vbox0.setStyle(style); + hbox0.setStyle(style); vbox0 = new VBox(10.0D); hbox0 = new HBox(10.0D); @@ -839,8 +852,11 @@ public class B3 hbox1.getChildren().addAll(this.esAssociativeBTN); vbox0.getChildren().addAll(hbox0, hbox1); 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); - entitysetType.setBackground(C2.AppForeground); vbox0 = new VBox(10.0D); hbox0 = new HBox(10.0D); @@ -848,6 +864,11 @@ public class B3 hbox1 = new HBox(10.0D); hbox1.getChildren().addAll(this.rsISABTN); vbox0.getChildren().addAll(hbox0, hbox1); + vbox0.setStyle(style); + hbox0.setStyle(style); + hbox1.setStyle(style); + + TitledPane relationshipType = new TitledPane("Relationship type", vbox0); this.buttonPane.add(relationshipType, 0, ri++, 2, 1); relationshipType.setBackground(C2.AppForeground); @@ -861,6 +882,11 @@ public class B3 hbox2.getChildren().addAll(this.rsisaGeToESBTN, this.rsisaSpToESBTN); vbox0.getChildren().addAll(hbox0, hbox1, hbox2); 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); connectESRS.setBackground(C2.AppForeground); @@ -877,6 +903,10 @@ public class B3 attributeTypes.setExpanded(false); this.buttonPane.add(attributeTypes, 0, ri++, 2, 1); attributeTypes.setBackground(C2.AppForeground); + vbox0.setStyle(style); + hbox0.setStyle(style); + hbox1.setStyle(style); + hbox2.setStyle(style); vbox0 = new VBox(10.0D); hbox0 = new HBox(10.0D); @@ -889,7 +919,10 @@ public class B3 this.buttonPane.add(connectAttribute, 0, ri++, 2, 1); connectAttribute.setBackground(C2.AppForeground); 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); box.getChildren().addAll(this.addCurrentDateToDatabaseNameCB, this.generateInsertsCB, this.singleInsertStatementCB, this.saveSQLScriptBTN); diff --git a/at/fos/ermodel/gui/C4.java b/at/fos/ermodel/gui/C4.java index 69f5af3..d0a09db 100644 --- a/at/fos/ermodel/gui/C4.java +++ b/at/fos/ermodel/gui/C4.java @@ -521,22 +521,34 @@ public class C4 { .append(column.isUnique()?"[Index(\""+column.getColumnName()+"Index\", IsUnique = true)]\n"+addChars():"") .append(column.isAutoincrement()?"[DatabaseGenerated(DatabaseGeneratedOption.Identity)]\n"+addChars():""); 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")] //[InverseProperty("De_Courses")] } - sqlScript.append("public ").append(sqltoCSType(column.getDatatype())) + sqlScript.append("public ") + .append(sqltoCSType(column.getDatatype())) .append(" ") + .append(column.getReferencesTo()!=null?shortname(column.getReferencesTo().tablename()):"") .append(shortcolumnname) .append(" { get; ") .append(column.isKey()?"private ": "") .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; - constructorbuilder.append(sqltoCSType(column.getDatatype())) + constructorbuilder.append(column.getReferencesTo()==null?sqltoCSType(column.getDatatype()):shortname(column.getReferencesTo().tablename())) .append(" ").append(shortcolumnname).append(", "); innerconstructorbuilder.append(addChars()).append(addChars()).append("this.").append(shortcolumnname).append("=").append(shortcolumnname).append(";\n"); diff --git a/noEasyDB.iml b/noEasyDB.iml index f97c59d..d030291 100644 --- a/noEasyDB.iml +++ b/noEasyDB.iml @@ -4,9 +4,9 @@ - +