optimize some stuff
This commit is contained in:
parent
148713635f
commit
4b23560a46
@ -183,7 +183,6 @@ public abstract class Graphic_LINE_Elem
|
|||||||
if (this instanceof Graphic_LINE_Attr_RS_Elem) {
|
if (this instanceof Graphic_LINE_Attr_RS_Elem) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
double helpXStart = this.xPos;
|
double helpXStart = this.xPos;
|
||||||
double helpXEnd = this.xEnd;
|
double helpXEnd = this.xEnd;
|
||||||
double helpYStart = this.yPos;
|
double helpYStart = this.yPos;
|
||||||
|
@ -316,43 +316,7 @@ public class ZZ30 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
doneWeakElements.add(gw_es);
|
if (handleWeakElements(doneWeakElements, gw_es, ges)) return false;
|
||||||
|
|
||||||
|
|
||||||
boolean partPrimary = true;
|
|
||||||
|
|
||||||
ArrayList<Graphic_Main_Elem> keys = getKeyAttributes(gw_es);
|
|
||||||
if (keys.size() > 0) partPrimary = false;
|
|
||||||
keys = getWeakKeyAttributes(gw_es);
|
|
||||||
if (!partPrimary && keys.size() > 0) {
|
|
||||||
|
|
||||||
|
|
||||||
this.view.verticalBox.getChildren().clear();
|
|
||||||
this.view.generateRelationalModelCB.setSelected(false);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
assert ges != null;
|
|
||||||
T1 tableForges = this.relationalModel.getTableGivenNumber(ges.sdfsdfsdfd());
|
|
||||||
ArrayList<C3> keyColumns = this.relationalModel.getKeyColumnsGivenRelation(ges.sdfsdfsdfd());
|
|
||||||
T1 tableForgwes = this.relationalModel.getTableGivenNumber(gw_es.sdfsdfsdfd());
|
|
||||||
for (C3 refcolumn : keyColumns) {
|
|
||||||
C3 column = new C3(tableForgwes.getTablenamePraefix() + refcolumn.getColumnName(),
|
|
||||||
refcolumn.getDatatype(),
|
|
||||||
partPrimary,
|
|
||||||
!partPrimary,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
refcolumn.getAutoincrementStartAt(),
|
|
||||||
new T2(tableForges.getTablename(), refcolumn.getColumnName()),
|
|
||||||
tableForgwes.getReferstoGraphicalElement(),
|
|
||||||
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null);
|
|
||||||
tableForgwes.addColumn(column);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -417,42 +381,7 @@ public class ZZ30 {
|
|||||||
|
|
||||||
countNotTransformedWeakES--;
|
countNotTransformedWeakES--;
|
||||||
|
|
||||||
doneWeakElements.add(gw_es);
|
if (handleWeakElements(doneWeakElements, gw_es, ges)) return false;
|
||||||
|
|
||||||
boolean partPrimary = true;
|
|
||||||
|
|
||||||
ArrayList<Graphic_Main_Elem> keys = getKeyAttributes(gw_es);
|
|
||||||
if (keys.size() > 0) partPrimary = false;
|
|
||||||
keys = getWeakKeyAttributes(gw_es);
|
|
||||||
if (!partPrimary && keys.size() > 0) {
|
|
||||||
|
|
||||||
|
|
||||||
this.view.verticalBox.getChildren().clear();
|
|
||||||
this.view.generateRelationalModelCB.setSelected(false);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
assert ges != null;
|
|
||||||
T1 tableForges = this.relationalModel.getTableGivenNumber(ges.sdfsdfsdfd());
|
|
||||||
ArrayList<C3> keyColumns = this.relationalModel.getKeyColumnsGivenRelation(ges.sdfsdfsdfd());
|
|
||||||
T1 tableForgwes = this.relationalModel.getTableGivenNumber(gw_es.sdfsdfsdfd());
|
|
||||||
for (C3 refcolumn : keyColumns) {
|
|
||||||
C3 column = new C3(tableForgwes.getTablenamePraefix() + refcolumn.getColumnName(),
|
|
||||||
refcolumn.getDatatype(),
|
|
||||||
partPrimary,
|
|
||||||
!partPrimary,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
refcolumn.getAutoincrementStartAt(),
|
|
||||||
new T2(tableForges.getTablename(), refcolumn.getColumnName()),
|
|
||||||
tableForgwes.getReferstoGraphicalElement(),
|
|
||||||
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null);
|
|
||||||
tableForgwes.addColumn(column);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -713,6 +642,47 @@ public class ZZ30 {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean handleWeakElements(ArrayList<Graphic_Main_Elem> doneWeakElements, Graphic_ES_Main_Elem gw_es, Graphic_ES_Main_Elem ges) {
|
||||||
|
doneWeakElements.add(gw_es);
|
||||||
|
|
||||||
|
|
||||||
|
boolean partPrimary = true;
|
||||||
|
|
||||||
|
ArrayList<Graphic_Main_Elem> keys = getKeyAttributes(gw_es);
|
||||||
|
if (keys.size() > 0) partPrimary = false;
|
||||||
|
keys = getWeakKeyAttributes(gw_es);
|
||||||
|
if (!partPrimary && keys.size() > 0) {
|
||||||
|
|
||||||
|
|
||||||
|
this.view.verticalBox.getChildren().clear();
|
||||||
|
this.view.generateRelationalModelCB.setSelected(false);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
assert ges != null;
|
||||||
|
T1 tableForges = this.relationalModel.getTableGivenNumber(ges.sdfsdfsdfd());
|
||||||
|
ArrayList<C3> keyColumns = this.relationalModel.getKeyColumnsGivenRelation(ges.sdfsdfsdfd());
|
||||||
|
T1 tableForgwes = this.relationalModel.getTableGivenNumber(gw_es.sdfsdfsdfd());
|
||||||
|
for (C3 refcolumn : keyColumns) {
|
||||||
|
C3 column = new C3(tableForgwes.getTablenamePraefix() + refcolumn.getColumnName(),
|
||||||
|
refcolumn.getDatatype(),
|
||||||
|
partPrimary,
|
||||||
|
!partPrimary,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
refcolumn.getAutoincrementStartAt(),
|
||||||
|
new T2(tableForges.getTablename(), refcolumn.getColumnName()),
|
||||||
|
tableForgwes.getReferstoGraphicalElement(),
|
||||||
|
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null);
|
||||||
|
tableForgwes.addColumn(column);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private boolean handleKey(Graphic_RS_Main_Elem grsem) {
|
private boolean handleKey(Graphic_RS_Main_Elem grsem) {
|
||||||
boolean keyCorrect = true;
|
boolean keyCorrect = true;
|
||||||
ArrayList<Graphic_Main_Elem> keys = getKeyAttributes(grsem);
|
ArrayList<Graphic_Main_Elem> keys = getKeyAttributes(grsem);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user