fix
This commit is contained in:
commit
148713635f
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="azul-17 (2)" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="azul-17 (2)" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
@ -27,6 +27,7 @@ public abstract class Graphic_ATTR_Elem
|
||||
protected String par2;
|
||||
protected String par1_label;
|
||||
protected String par2_label;
|
||||
boolean derived = false;
|
||||
|
||||
public Graphic_ATTR_Elem(GraphicsContext gc, double x, double y, String name, long elementID) {
|
||||
super(gc, name, elementID);
|
||||
@ -254,6 +255,29 @@ public abstract class Graphic_ATTR_Elem
|
||||
public void setPar2_label(String par2_label) {
|
||||
this.par2_label = par2_label;
|
||||
}
|
||||
|
||||
public void dsfdsfds6787686(Color c) {
|
||||
if (!this.isVisible) {
|
||||
return;
|
||||
}
|
||||
this.gc.beginPath();
|
||||
this.gc.setStroke(c);
|
||||
if (this.derived) {
|
||||
this.gc.setLineWidth(1.0D);
|
||||
this.gc.setLineDashes(3.0D);
|
||||
}
|
||||
this.gc.strokeOval(this.xPos - this.textWidth / 2.0D, this.yPos - this.textHeight / 2.0D, this.textWidth, this.textHeight);
|
||||
this.gc.setLineDashes();
|
||||
|
||||
|
||||
this.gc.setFill(C2.ERMTextColor);
|
||||
this.gc.fillText(this.name, this.xPos - this.textWidth / 2.0D + 10.0D, this.yPos + this.textHeight / 2.0D - 15.0D);
|
||||
this.gc.closePath();
|
||||
}
|
||||
|
||||
public void setDerived(boolean derived) {
|
||||
this.derived = derived;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -16,17 +16,16 @@ public class Graphic_ATTR_Key_Elem
|
||||
}
|
||||
|
||||
|
||||
protected void dsfdsfds6787686(Color c) {
|
||||
public void dsfdsfds6787686(Color c) {
|
||||
if (!this.isVisible)
|
||||
return;
|
||||
this.gc.beginPath();
|
||||
this.gc.setStroke(c);
|
||||
this.gc.strokeOval(this.xPos - this.textWidth / 2.0D, this.yPos - this.textHeight / 2.0D, this.textWidth, this.textHeight);
|
||||
|
||||
this.gc.setFill(C2.ERMTextColor);
|
||||
|
||||
this.gc.setStroke(Color.BLACK);
|
||||
this.gc.setStroke(Color.WHITE);
|
||||
this.gc.fillText(this.name, this.xPos - this.textWidth / 2.0D + 10.0D, this.yPos + this.textHeight / 2.0D - 15.0D);
|
||||
|
||||
this.gc.strokeLine(this.xPos - this.textWidth / 2.0D + 10.0D,
|
||||
this.yPos + this.textHeight / 2.0D - 13.0D, this.xPos + this.textWidth / 2.0D - 10.0D, this.yPos + this.textHeight / 2.0D - 13.0D);
|
||||
this.gc.closePath();
|
||||
|
@ -10,21 +10,19 @@ public class Graphic_ATTR_Multi_Elem
|
||||
extends Graphic_ATTR_Elem {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
private final boolean derived;
|
||||
|
||||
public Graphic_ATTR_Multi_Elem(GraphicsContext gc, double x, double y, String name, boolean derived, long elementID) {
|
||||
super(gc, x, y, name, elementID);
|
||||
this.derived = derived;
|
||||
super.setDerived(derived);
|
||||
}
|
||||
|
||||
|
||||
protected void dsfdsfds6787686(Color c) {
|
||||
public void dsfdsfds6787686(Color c) {
|
||||
if (!this.isVisible)
|
||||
return;
|
||||
this.gc.beginPath();
|
||||
|
||||
this.gc.setStroke(c);
|
||||
if (this.derived) {
|
||||
if (super.derived) {
|
||||
this.gc.setLineWidth(1.0D);
|
||||
this.gc.setLineDashes(3.0D);
|
||||
}
|
||||
@ -38,7 +36,6 @@ public class Graphic_ATTR_Multi_Elem
|
||||
this.gc.closePath();
|
||||
}
|
||||
|
||||
|
||||
public String safsafdsa456456456() {
|
||||
return "A-M";
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package at.fos.ermodel.gui;
|
||||
|
||||
import javafx.scene.canvas.GraphicsContext;
|
||||
import javafx.scene.paint.Color;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
@ -10,34 +9,12 @@ public class Graphic_ATTR_One_Elem
|
||||
extends Graphic_ATTR_Elem {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
private final boolean derived;
|
||||
|
||||
public Graphic_ATTR_One_Elem(GraphicsContext gc, double x, double y, String name, boolean derived, long elementID) {
|
||||
super(gc, x, y, name, elementID);
|
||||
this.derived = derived;
|
||||
super.setDerived(derived);
|
||||
}
|
||||
|
||||
|
||||
protected void dsfdsfds6787686(Color c) {
|
||||
if (!this.isVisible) {
|
||||
return;
|
||||
}
|
||||
this.gc.beginPath();
|
||||
this.gc.setStroke(c);
|
||||
if (this.derived) {
|
||||
this.gc.setLineWidth(1.0D);
|
||||
this.gc.setLineDashes(3.0D);
|
||||
}
|
||||
this.gc.strokeOval(this.xPos - this.textWidth / 2.0D, this.yPos - this.textHeight / 2.0D, this.textWidth, this.textHeight);
|
||||
this.gc.setLineDashes();
|
||||
|
||||
|
||||
this.gc.setFill(C2.ERMTextColor);
|
||||
this.gc.fillText(this.name, this.xPos - this.textWidth / 2.0D + 10.0D, this.yPos + this.textHeight / 2.0D - 15.0D);
|
||||
this.gc.closePath();
|
||||
}
|
||||
|
||||
|
||||
public String safsafdsa456456456() {
|
||||
return "A";
|
||||
}
|
||||
|
@ -16,18 +16,16 @@ public class Graphic_ATTR_Weak_Key_Elem
|
||||
}
|
||||
|
||||
|
||||
protected void dsfdsfds6787686(Color c) {
|
||||
public void dsfdsfds6787686(Color c) {
|
||||
if (!this.isVisible)
|
||||
return;
|
||||
this.gc.beginPath();
|
||||
|
||||
this.gc.setStroke(c);
|
||||
this.gc.strokeOval(this.xPos - this.textWidth / 2.0D, this.yPos - this.textHeight / 2.0D, this.textWidth, this.textHeight);
|
||||
|
||||
this.gc.setFill(C2.ERMTextColor);
|
||||
|
||||
this.gc.setStroke(Color.BLACK);
|
||||
this.gc.setStroke(Color.WHITE);
|
||||
this.gc.fillText(this.name, this.xPos - this.textWidth / 2.0D + 10.0D, this.yPos + this.textHeight / 2.0D - 15.0D);
|
||||
|
||||
this.gc.setLineWidth(1.0D);
|
||||
this.gc.setLineDashes(3.0D);
|
||||
this.gc.strokeLine(this.xPos - this.textWidth / 2.0D + 10.0D,
|
||||
|
@ -516,21 +516,7 @@ public class ZZ30 {
|
||||
|
||||
if (oneToOne) {
|
||||
|
||||
boolean keyCorrect = true;
|
||||
ArrayList<Graphic_Main_Elem> keys = getKeyAttributes(grsem);
|
||||
if (keys.size() > 0) keyCorrect = false;
|
||||
if (keyCorrect) {
|
||||
keys = getWeakKeyAttributes(grsem);
|
||||
if (keys.size() > 0) keyCorrect = false;
|
||||
|
||||
}
|
||||
if (!keyCorrect) {
|
||||
|
||||
|
||||
this.view.verticalBox.getChildren().clear();
|
||||
this.view.generateRelationalModelCB.setSelected(false);
|
||||
return false;
|
||||
}
|
||||
if (handleKey(grsem)) return false;
|
||||
|
||||
|
||||
Graphic_ES_Main_Elem es_min_1_side;
|
||||
@ -554,52 +540,9 @@ public class ZZ30 {
|
||||
|
||||
T1 tableRS = this.relationalModel.getTableGivenNumber(grsem.sdfsdfsdfd());
|
||||
|
||||
T1 tableES = this.relationalModel.getTableGivenNumber(es_min_0_side.sdfsdfsdfd());
|
||||
ArrayList<C3> keyColumns = this.relationalModel.getKeyColumnsGivenRelation(es_min_0_side.sdfsdfsdfd());
|
||||
T1 table_1_side = this.relationalModel.getTableGivenNumber(es_min_1_side.sdfsdfsdfd());
|
||||
|
||||
for (C3 refcolumn : keyColumns) {
|
||||
C3 column = new C3(table_1_side.getTablenamePraefix() + (
|
||||
(tableRS.getTablename().length() > 0) ? (tableRS.getTablename() + "_") : "") +
|
||||
refcolumn.getColumnName(),
|
||||
refcolumn.getDatatype(),
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
refcolumn.getAutoincrementStartAt(),
|
||||
new T2(tableES.getTablename(), refcolumn.getColumnName()),
|
||||
table_1_side.getReferstoGraphicalElement(),
|
||||
|
||||
null,
|
||||
null,
|
||||
null);
|
||||
table_1_side.addColumn(column);
|
||||
}
|
||||
addTableC3(es_min_1_side, es_min_0_side, tableRS);
|
||||
if (bothSides_min_1) {
|
||||
|
||||
T1 tableES_1 = this.relationalModel.getTableGivenNumber(es_min_1_side.sdfsdfsdfd());
|
||||
ArrayList<C3> keyColumns_1 = this.relationalModel.getKeyColumnsGivenRelation(es_min_1_side.sdfsdfsdfd());
|
||||
T1 table_0_side = this.relationalModel.getTableGivenNumber(es_min_0_side.sdfsdfsdfd());
|
||||
|
||||
for (C3 refcolumn : keyColumns_1) {
|
||||
C3 column = new C3(table_0_side.getTablenamePraefix() + (
|
||||
(tableRS.getTablename().length() > 0) ? (tableRS.getTablename() + "_") : "") +
|
||||
refcolumn.getColumnName(),
|
||||
refcolumn.getDatatype(),
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
refcolumn.getAutoincrementStartAt(),
|
||||
new T2(tableES_1.getTablename(), refcolumn.getColumnName()),
|
||||
table_0_side.getReferstoGraphicalElement(),
|
||||
|
||||
null,
|
||||
null,
|
||||
null);
|
||||
table_0_side.addColumn(column);
|
||||
}
|
||||
addTableC3(es_min_0_side, es_min_1_side, tableRS);
|
||||
}
|
||||
|
||||
|
||||
@ -609,21 +552,7 @@ public class ZZ30 {
|
||||
|
||||
if (oneToMany) {
|
||||
|
||||
boolean keyCorrect = true;
|
||||
ArrayList<Graphic_Main_Elem> keys = getKeyAttributes(grsem);
|
||||
if (keys.size() > 0) keyCorrect = false;
|
||||
if (keyCorrect) {
|
||||
keys = getWeakKeyAttributes(grsem);
|
||||
if (keys.size() > 0) keyCorrect = false;
|
||||
|
||||
}
|
||||
if (!keyCorrect) {
|
||||
|
||||
|
||||
this.view.verticalBox.getChildren().clear();
|
||||
this.view.generateRelationalModelCB.setSelected(false);
|
||||
return false;
|
||||
}
|
||||
if (handleKey(grsem)) return false;
|
||||
|
||||
|
||||
T1 tableRS = this.relationalModel.getTableGivenNumber(grsem.sdfsdfsdfd());
|
||||
@ -784,6 +713,50 @@ public class ZZ30 {
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean handleKey(Graphic_RS_Main_Elem grsem) {
|
||||
boolean keyCorrect = true;
|
||||
ArrayList<Graphic_Main_Elem> keys = getKeyAttributes(grsem);
|
||||
if (keys.size() > 0) keyCorrect = false;
|
||||
if (keyCorrect) {
|
||||
keys = getWeakKeyAttributes(grsem);
|
||||
if (keys.size() > 0) keyCorrect = false;
|
||||
|
||||
}
|
||||
if (!keyCorrect) {
|
||||
|
||||
|
||||
this.view.verticalBox.getChildren().clear();
|
||||
this.view.generateRelationalModelCB.setSelected(false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void addTableC3(Graphic_ES_Main_Elem es_min_1_side, Graphic_ES_Main_Elem es_min_0_side, T1 tableRS) {
|
||||
T1 tableES = this.relationalModel.getTableGivenNumber(es_min_0_side.sdfsdfsdfd());
|
||||
ArrayList<C3> keyColumns = this.relationalModel.getKeyColumnsGivenRelation(es_min_0_side.sdfsdfsdfd());
|
||||
T1 table_1_side = this.relationalModel.getTableGivenNumber(es_min_1_side.sdfsdfsdfd());
|
||||
|
||||
for (C3 refcolumn : keyColumns) {
|
||||
C3 column = new C3(table_1_side.getTablenamePraefix() + (
|
||||
(tableRS.getTablename().length() > 0) ? (tableRS.getTablename() + "_") : "") +
|
||||
refcolumn.getColumnName(),
|
||||
refcolumn.getDatatype(),
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
refcolumn.getAutoincrementStartAt(),
|
||||
new T2(tableES.getTablename(), refcolumn.getColumnName()),
|
||||
table_1_side.getReferstoGraphicalElement(),
|
||||
|
||||
null,
|
||||
null,
|
||||
null);
|
||||
table_1_side.addColumn(column);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private ArrayList<Graphic_Main_Elem> getAttributes(Graphic_Main_Elem gme) {
|
||||
ArrayList<Graphic_Main_Elem> attributes = new ArrayList<>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user