2597 lines
102 KiB
Java
2597 lines
102 KiB
Java
package at.fos.ermodel.gui;
|
|
|
|
import javafx.collections.FXCollections;
|
|
import javafx.collections.ListChangeListener;
|
|
import javafx.collections.ObservableList;
|
|
import javafx.scene.canvas.Canvas;
|
|
import javafx.scene.canvas.GraphicsContext;
|
|
import javafx.scene.control.MenuItem;
|
|
import javafx.scene.control.*;
|
|
import javafx.scene.image.ImageView;
|
|
import javafx.scene.input.*;
|
|
import javafx.scene.paint.Color;
|
|
import javafx.scene.transform.Scale;
|
|
|
|
import java.awt.*;
|
|
import java.io.File;
|
|
import java.util.*;
|
|
|
|
|
|
public class A3
|
|
extends Canvas {
|
|
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);
|
|
final KeyCombination keyCombinationCTRL_N = new KeyCodeCombination(KeyCode.N, KeyCombination.CONTROL_DOWN);
|
|
final KeyCombination dsfsdfdsf56456 = new KeyCodeCombination(KeyCode.S, KeyCombination.CONTROL_DOWN);
|
|
final KeyCombination sadsdsadsad213213 = new KeyCodeCombination(KeyCode.C, KeyCombination.CONTROL_DOWN);
|
|
final KeyCombination dsfsfdsfd456456 = new KeyCodeCombination(KeyCode.X, KeyCombination.CONTROL_DOWN);
|
|
final KeyCombination dfgsdd456456 = new KeyCodeCombination(KeyCode.V, KeyCombination.CONTROL_DOWN);
|
|
final KeyCombination asdadsa324324 = new KeyCodeCombination(KeyCode.A, KeyCombination.CONTROL_DOWN);
|
|
final KeyCombination keyCombinationCTRL_Z = new KeyCodeCombination(KeyCode.Z, KeyCombination.CONTROL_DOWN);
|
|
final KeyCombination dsfsdfds67678768 = new KeyCodeCombination(KeyCode.Y, KeyCombination.CONTROL_DOWN);
|
|
private final A3 thisERMDrawCanvas;
|
|
private final U1 u1;
|
|
private final double canvasWidth = 4000.0D;
|
|
private final double canvasHeight = 2000.0D;
|
|
private final B3 view;
|
|
private final GraphicsContext gc;
|
|
private final ArrayList<Graphic_Main_Elem> graphicElements;
|
|
private final ArrayList<Graphic_Main_Elem> attributeElements;
|
|
private final ObservableList<Graphic_Main_Elem> graphicElementsObservable;
|
|
private final ArrayList<Double> zooming = new ArrayList<>();
|
|
private final ArrayList<Graphic_Main_Elem> pastActions;
|
|
private final ArrayList<Graphic_Main_Elem> futureActions;
|
|
double dockXAnyElem1 = 0.0D;
|
|
double dockYAnyElem1 = 0.0D;
|
|
double dockXAnyElem2 = 0.0D;
|
|
double dockYAnyElem2 = 0.0D;
|
|
byte dockAtPointAnyElem1 = 0;
|
|
byte asdasdsad435435etertret = 0;
|
|
private boolean elementIsSelected = false;
|
|
private Graphic_Main_Elem sdadasd34535trertertret = null;
|
|
private double xOffset;
|
|
private double yOffset;
|
|
private boolean connectionModeSet;
|
|
private Graphic_Main_Elem anyElem1;
|
|
private Graphic_Main_Elem anyElem2;
|
|
private int selectCounterConnection = 0;
|
|
private C4 relationalModel;
|
|
private long elementID;
|
|
private ContextMenu contextMenu = new ContextMenu();
|
|
private MenuItem addText;
|
|
private MenuItem addName;
|
|
private MenuItem addMinMax;
|
|
private MenuItem addISASpec;
|
|
private MenuItem sadsadas4353453retretret;
|
|
private MenuItem sdfsdfsdfsdfdsf324324;
|
|
private double dialogXPos;
|
|
private double dialogYPos;
|
|
private boolean dsasadasd345435fghgfh;
|
|
private boolean changeDockingPoint;
|
|
private MenuItem changeDockingPointAtFigure1;
|
|
private MenuItem changeDockingPointAtFigure2;
|
|
private Graphic_LINE_Elem connectionToChange;
|
|
private Graphic_Figure_Elem figureToChange1;
|
|
private Graphic_Figure_Elem figureToChange2;
|
|
private boolean rectangleSelection = false;
|
|
private double selectRecX;
|
|
private double selectRecY;
|
|
private double selectRecXEnd;
|
|
private double selectRecYEnd;
|
|
private ArrayList<Graphic_Main_Elem> selectedElements;
|
|
private File modelSavedInFile;
|
|
private String initialDirectory;
|
|
|
|
|
|
public A3(final B3 view, File modelSavedInFile, final U1 u1) {
|
|
this.thisERMDrawCanvas = this;
|
|
setWidth(this.canvasWidth);
|
|
setHeight(this.canvasHeight);
|
|
|
|
this.graphicElements = new ArrayList<>();
|
|
this.attributeElements = new ArrayList<>();
|
|
|
|
this.graphicElementsObservable = FXCollections.observableList(this.graphicElements);
|
|
this.graphicElementsObservable.addListener((ListChangeListener<Graphic_Main_Elem>) arg0 -> {
|
|
if (!u1.getText().contains("*")) u1.setText(u1.getText() + "*");
|
|
if (!arg0.next())
|
|
return;
|
|
if (arg0.wasAdded()) {
|
|
|
|
view.graphicElemLV.getItems().addAll(arg0.getAddedSubList());
|
|
|
|
|
|
for (Graphic_Main_Elem gme : arg0.getAddedSubList()) {
|
|
if (gme instanceof Graphic_ATTR_Elem ||
|
|
gme instanceof Graphic_ES_Main_Elem ||
|
|
gme instanceof Graphic_RS_Main_Elem) {
|
|
A3.this.attributeElements.add(gme);
|
|
}
|
|
}
|
|
|
|
for (Graphic_Main_Elem gme : arg0.getAddedSubList()) {
|
|
gme.sfdsfsfsddf123234435(U4.ADD);
|
|
A3.this.pastActions.add(gme);
|
|
}
|
|
|
|
A3.this.futureActions.clear();
|
|
}
|
|
arg0.wasUpdated();
|
|
|
|
|
|
if (arg0.wasRemoved()) {
|
|
|
|
view.graphicElemLV.getItems().removeAll(arg0.getRemoved());
|
|
for (Graphic_Main_Elem gme : arg0.getRemoved()) {
|
|
if (gme instanceof Graphic_ATTR_Elem ||
|
|
gme instanceof Graphic_ES_Main_Elem ||
|
|
gme instanceof Graphic_RS_Main_Elem) {
|
|
A3.this.attributeElements.remove(gme);
|
|
}
|
|
}
|
|
|
|
for (Graphic_Main_Elem gme : arg0.getAddedSubList()) {
|
|
if (gme instanceof Graphic_ATTR_Elem ||
|
|
gme instanceof Graphic_ES_Main_Elem ||
|
|
gme instanceof Graphic_RS_Main_Elem) {
|
|
A3.this.attributeElements.remove(gme);
|
|
}
|
|
}
|
|
|
|
for (Graphic_Main_Elem gme : arg0.getRemoved()) {
|
|
gme.sfdsfsfsddf123234435(U4.REMOVE);
|
|
A3.this.pastActions.add(gme);
|
|
}
|
|
|
|
A3.this.futureActions.clear();
|
|
}
|
|
A3.this.asdadsa32432rweewr();
|
|
|
|
A3.this.sortGraphicElementsByName();
|
|
if (view.generateRelationalModelCB.isSelected() &&
|
|
!A3.this.dsfdsdfssdf45645re()) {
|
|
view.verticalBox.getChildren().clear();
|
|
}
|
|
});
|
|
|
|
this.pastActions = new ArrayList<>();
|
|
this.futureActions = new ArrayList<>();
|
|
|
|
this.elementID = 0L;
|
|
this.view = view;
|
|
this.gc = getGraphicsContext2D();
|
|
setHandler();
|
|
createContextMenu();
|
|
this.modelSavedInFile = modelSavedInFile;
|
|
|
|
String dbname = "erdb";
|
|
if (modelSavedInFile != null) dbname = modelSavedInFile.getName().replace(".erm", "") + "db";
|
|
this.relationalModel = new C4(dbname.toLowerCase());
|
|
this.u1 = u1;
|
|
}
|
|
|
|
private void clearSelectionRectangle() {
|
|
if (selectRecX < selectRecXEnd) {
|
|
if (selectRecY < selectRecYEnd) {
|
|
gc.clearRect(A3.this.selectRecX - 1.0D,
|
|
A3.this.selectRecY - 1.0D,
|
|
Math.abs(A3.this.selectRecXEnd - A3.this.selectRecX) + 2.0D,
|
|
Math.abs(A3.this.selectRecYEnd - A3.this.selectRecY) + 2.0D);
|
|
} else {
|
|
gc.clearRect(A3.this.selectRecX - 1.0D,
|
|
A3.this.selectRecYEnd - 1.0D,
|
|
Math.abs(A3.this.selectRecXEnd - A3.this.selectRecX) + 2.0D,
|
|
Math.abs(A3.this.selectRecY - A3.this.selectRecYEnd) + 2.0D);
|
|
}
|
|
} else {
|
|
if (selectRecY < selectRecYEnd) {
|
|
gc.clearRect(A3.this.selectRecXEnd - 1.0D,
|
|
A3.this.selectRecY - 1.0D,
|
|
Math.abs(A3.this.selectRecX - A3.this.selectRecXEnd) + 2.0D,
|
|
Math.abs(A3.this.selectRecYEnd - A3.this.selectRecY) + 2.0D);
|
|
} else {
|
|
gc.clearRect(A3.this.selectRecXEnd - 1.0D,
|
|
A3.this.selectRecYEnd - 1.0D,
|
|
Math.abs(A3.this.selectRecX - A3.this.selectRecXEnd) + 2.0D,
|
|
Math.abs(A3.this.selectRecY - A3.this.selectRecYEnd) + 2.0D);
|
|
}
|
|
}
|
|
}
|
|
|
|
private void setHandler() {
|
|
this.thisERMDrawCanvas.setOnScroll(event -> {
|
|
if (event.isControlDown()) {
|
|
double zoomFactor = 1.05D;
|
|
double deltaY = event.getDeltaY();
|
|
if (deltaY < 0.0D) {
|
|
zoomFactor = 0.95D;
|
|
}
|
|
if (zoomFactor == 1.05D) {
|
|
|
|
A3.this.zooming.add(0.95D);
|
|
} else {
|
|
|
|
A3.this.zooming.add(1.05D);
|
|
}
|
|
|
|
A3.this.thisERMDrawCanvas.getTransforms().add(new Scale(A3.this.thisERMDrawCanvas.getScaleX() * zoomFactor,
|
|
A3.this.thisERMDrawCanvas.getScaleY() * zoomFactor));
|
|
event.consume();
|
|
}
|
|
});
|
|
|
|
setOnMouseDragged(event -> {
|
|
if (A3.this.thisERMDrawCanvas.dsasadasd345435fghgfh) {
|
|
return;
|
|
}
|
|
if (A3.this.selectedElements != null && A3.this.selectedElements.size() > 0) {
|
|
|
|
if (!A3.this.u1.getText().contains("*")) A3.this.u1.setText(A3.this.u1.getText() + "*");
|
|
|
|
|
|
for (Graphic_Main_Elem ge : A3.this.selectedElements) {
|
|
double newX = ge.xPos + event.getX() - A3.this.xOffset;
|
|
double newY = ge.yPos + event.getY() - A3.this.yOffset;
|
|
|
|
if (!A3.this.dsfsdfds435345esfsfd(newX, newY, A3.this.selectedElements)) {
|
|
event.consume();
|
|
|
|
|
|
for (Graphic_Main_Elem geh : A3.this.selectedElements) {
|
|
newX = geh.xPos;
|
|
newY = geh.yPos;
|
|
geh.sdffdsfsdf4354357656(newX, newY);
|
|
ArrayList<Graphic_LINE_Elem> gleListStart = A3.this.dsfdsfdsjhkj456456(geh);
|
|
if (gleListStart.size() > 0) {
|
|
for (Graphic_LINE_Elem gle : gleListStart) {
|
|
gle.dsfsdfsfd();
|
|
|
|
gle.setxPos(((Graphic_Figure_Elem) geh).getXYForGivenPoint(gle.getLineConnectedWithPointAtStart())[0]);
|
|
gle.setyPos(((Graphic_Figure_Elem) geh).getXYForGivenPoint(gle.getLineConnectedWithPointAtStart())[1]);
|
|
gle.safdsadasds32432456456();
|
|
}
|
|
}
|
|
ArrayList<Graphic_LINE_Elem> gleListEnd = A3.this.sdfsdfds23432rwefsd(geh);
|
|
if (gleListEnd.size() > 0) {
|
|
for (Graphic_LINE_Elem gle : gleListEnd) {
|
|
gle.dsfsdfsfd();
|
|
gle.setxEnd(((Graphic_Figure_Elem) geh).getXYForGivenPoint(gle.getLineConnectedWithPointAtEnd())[0]);
|
|
gle.setyEnd(((Graphic_Figure_Elem) geh).getXYForGivenPoint(gle.getLineConnectedWithPointAtEnd())[1]);
|
|
gle.safdsadasds32432456456();
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
return;
|
|
}
|
|
}
|
|
|
|
for (Graphic_Main_Elem ge : A3.this.selectedElements) {
|
|
double newX = ge.xPos + event.getX() - A3.this.xOffset;
|
|
double newY = ge.yPos + event.getY() - A3.this.yOffset;
|
|
ge.sdffdsfsdf4354357656(newX, newY);
|
|
|
|
ArrayList<Graphic_LINE_Elem> gleListStart = A3.this.dsfdsfdsjhkj456456(ge);
|
|
if (gleListStart.size() > 0) {
|
|
for (Graphic_LINE_Elem gle : gleListStart) {
|
|
gle.dsfsdfsfd();
|
|
|
|
gle.setxPos(((Graphic_Figure_Elem) ge).getXYForGivenPoint(gle.getLineConnectedWithPointAtStart())[0] + event.getX() - A3.this.xOffset);
|
|
gle.setyPos(((Graphic_Figure_Elem) ge).getXYForGivenPoint(gle.getLineConnectedWithPointAtStart())[1] + event.getY() - A3.this.yOffset);
|
|
gle.safdsadasds32432456456();
|
|
}
|
|
}
|
|
ArrayList<Graphic_LINE_Elem> gleListEnd = A3.this.sdfsdfds23432rwefsd(ge);
|
|
if (gleListEnd.size() > 0) {
|
|
for (Graphic_LINE_Elem gle : gleListEnd) {
|
|
gle.dsfsdfsfd();
|
|
gle.setxEnd(((Graphic_Figure_Elem) ge).getXYForGivenPoint(gle.getLineConnectedWithPointAtEnd())[0] + event.getX() - A3.this.xOffset);
|
|
gle.setyEnd(((Graphic_Figure_Elem) ge).getXYForGivenPoint(gle.getLineConnectedWithPointAtEnd())[1] + event.getY() - A3.this.yOffset);
|
|
gle.safdsadasds32432456456();
|
|
}
|
|
}
|
|
}
|
|
A3.this.xOffset = event.getX();
|
|
A3.this.yOffset = event.getY();
|
|
|
|
A3.this.dsfsdf12312456dgret(A3.this.selectedElements);
|
|
|
|
A3.this.sdfdsf456456fghgf(A3.this.selectedElements);
|
|
event.consume();
|
|
|
|
return;
|
|
}
|
|
|
|
if (A3.this.elementIsSelected) {
|
|
|
|
if (A3.this.sdadasd34535trertertret instanceof Graphic_LINE_Elem) {
|
|
event.consume();
|
|
|
|
return;
|
|
}
|
|
if (!A3.this.u1.getText().contains("*")) A3.this.u1.setText(A3.this.u1.getText() + "*");
|
|
|
|
double newX = A3.this.sdadasd34535trertertret.xPos + event.getX() - A3.this.xOffset;
|
|
double newY = A3.this.sdadasd34535trertertret.yPos + event.getY() - A3.this.yOffset;
|
|
|
|
|
|
if (A3.this.dsfdsf43534dfdfhg(newX, newY, A3.this.sdadasd34535trertertret)) {
|
|
return;
|
|
}
|
|
|
|
ArrayList<Graphic_LINE_Elem> gleListStart = A3.this.dsfdsfdsjhkj456456(A3.this.sdadasd34535trertertret);
|
|
if (gleListStart.size() > 0) {
|
|
for (Graphic_LINE_Elem gle : gleListStart) {
|
|
gle.dsfsdfsfd();
|
|
gle.setxPos(((Graphic_Figure_Elem) A3.this.sdadasd34535trertertret).getXYForGivenPoint(gle.getLineConnectedWithPointAtStart())[0] + event.getX() - A3.this.xOffset);
|
|
gle.setyPos(((Graphic_Figure_Elem) A3.this.sdadasd34535trertertret).getXYForGivenPoint(gle.getLineConnectedWithPointAtStart())[1] + event.getY() - A3.this.yOffset);
|
|
|
|
|
|
gle.safdsadasds32432456456();
|
|
}
|
|
}
|
|
ArrayList<Graphic_LINE_Elem> gleListEnd = A3.this.sdfsdfds23432rwefsd(A3.this.sdadasd34535trertertret);
|
|
if (gleListEnd.size() > 0) {
|
|
for (Graphic_LINE_Elem gle : gleListEnd) {
|
|
gle.dsfsdfsfd();
|
|
gle.setxEnd(((Graphic_Figure_Elem) A3.this.sdadasd34535trertertret).getXYForGivenPoint(gle.getLineConnectedWithPointAtEnd())[0] + event.getX() - A3.this.xOffset);
|
|
gle.setyEnd(((Graphic_Figure_Elem) A3.this.sdadasd34535trertertret).getXYForGivenPoint(gle.getLineConnectedWithPointAtEnd())[1] + event.getY() - A3.this.yOffset);
|
|
|
|
|
|
gle.safdsadasds32432456456();
|
|
}
|
|
}
|
|
|
|
A3.this.sdadasd34535trertertret.sdffdsfsdf4354357656(newX, newY);
|
|
A3.this.xOffset = event.getX();
|
|
A3.this.yOffset = event.getY();
|
|
|
|
ArrayList<Graphic_Main_Elem> elList = new ArrayList<>();
|
|
elList.add(A3.this.sdadasd34535trertertret);
|
|
A3.this.dsfsdfd456456rezrez(elList);
|
|
event.consume();
|
|
|
|
return;
|
|
}
|
|
|
|
if (rectangleSelection) {
|
|
clearSelectionRectangle();
|
|
|
|
selectRecXEnd = event.getX();
|
|
selectRecYEnd = event.getY();
|
|
|
|
gc.setLineWidth(1.0D);
|
|
gc.setLineDashes(3.0D);
|
|
gc.setStroke(Color.RED);
|
|
|
|
if (selectRecX < selectRecXEnd) {
|
|
if (selectRecY < selectRecYEnd) {
|
|
gc.strokeRect(A3.this.selectRecX,
|
|
A3.this.selectRecY,
|
|
Math.abs(A3.this.selectRecXEnd - A3.this.selectRecX),
|
|
Math.abs(A3.this.selectRecYEnd - A3.this.selectRecY));
|
|
} else {
|
|
gc.strokeRect(A3.this.selectRecX,
|
|
A3.this.selectRecYEnd,
|
|
Math.abs(A3.this.selectRecXEnd - A3.this.selectRecX),
|
|
Math.abs(A3.this.selectRecY - A3.this.selectRecYEnd));
|
|
}
|
|
} else {
|
|
if (selectRecY < selectRecYEnd) {
|
|
gc.strokeRect(A3.this.selectRecXEnd,
|
|
A3.this.selectRecY,
|
|
Math.abs(A3.this.selectRecX - A3.this.selectRecXEnd),
|
|
Math.abs(A3.this.selectRecYEnd - A3.this.selectRecY));
|
|
} else {
|
|
gc.strokeRect(A3.this.selectRecXEnd,
|
|
A3.this.selectRecYEnd,
|
|
Math.abs(A3.this.selectRecX - A3.this.selectRecXEnd),
|
|
Math.abs(A3.this.selectRecY - A3.this.selectRecYEnd));
|
|
}
|
|
}
|
|
|
|
gc.setLineDashes();
|
|
thisERMDrawCanvas.sdfsdfds3465er(false);
|
|
}
|
|
event.consume();
|
|
});
|
|
|
|
|
|
setOnMouseReleased(event -> {
|
|
if (A3.this.thisERMDrawCanvas.dsasadasd345435fghgfh) {
|
|
return;
|
|
}
|
|
if (A3.this.selectedElements != null && A3.this.selectedElements.size() > 0) {
|
|
event.consume();
|
|
|
|
return;
|
|
}
|
|
if (A3.this.rectangleSelection) {
|
|
A3.this.selectRecXEnd = event.getX();
|
|
A3.this.selectRecYEnd = event.getY();
|
|
clearSelectionRectangle();
|
|
|
|
A3.this.selectedElements = A3.this.thisERMDrawCanvas.selectElementsInRectangle(A3.this.selectRecX - 1.0D, A3.this.selectRecY - 1.0D, A3.this.selectRecXEnd + 2.0D, A3.this.selectRecYEnd + 2.0D);
|
|
|
|
if (A3.this.selectedElements.size() == 0) {
|
|
A3.this.rectangleSelection = false;
|
|
} else {
|
|
|
|
A3.this.dsfsdfd456456rezrez(A3.this.selectedElements);
|
|
}
|
|
event.consume();
|
|
}
|
|
});
|
|
|
|
setOnMouseMoved(event -> {
|
|
if (A3.this.thisERMDrawCanvas.dsasadasd345435fghgfh)
|
|
return;
|
|
A3.this.thisERMDrawCanvas.requestFocus();
|
|
|
|
if (A3.this.selectedElements != null && A3.this.selectedElements.size() > 0) {
|
|
event.consume();
|
|
return;
|
|
}
|
|
if (A3.this.rectangleSelection) {
|
|
event.consume();
|
|
|
|
return;
|
|
}
|
|
|
|
if (A3.this.selectCounterConnection == 1) {
|
|
A3.this.sdfsdfds3465er(true);
|
|
A3.this.sdfdsfdsdf34543erretwre();
|
|
A3.this.anyElem1.selectElem();
|
|
A3.this.gc.setStroke(C2.TEMPLINEColor);
|
|
A3.this.gc.strokeLine(A3.this.dockXAnyElem1, A3.this.dockYAnyElem1, event.getX(), event.getY());
|
|
|
|
for (Graphic_Main_Elem gme : A3.this.graphicElements) {
|
|
|
|
if (A3.this.anyElem1 == gme ||
|
|
!(gme instanceof Graphic_Figure_Elem))
|
|
continue;
|
|
if (gme.dsfsfds45645456(event.getX(), event.getY())) {
|
|
double[] dockablePoints = ((Graphic_Figure_Elem) gme).getDockablePoint(event.getX(), event.getY());
|
|
|
|
if (dockablePoints != null) {
|
|
if (gme.isConnectable) {
|
|
((Graphic_Figure_Elem) gme).drawDockablePoint(C2.TEMPLINEColor, (int) dockablePoints[2]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (A3.this.isConnectionModeSet() && A3.this.selectCounterConnection == 0) {
|
|
A3.this.sdfsdfds3465er(true);
|
|
A3.this.sdfdsfdsdf34543erretwre();
|
|
|
|
for (Graphic_Main_Elem gme : A3.this.graphicElements) {
|
|
if (!(gme instanceof Graphic_Figure_Elem))
|
|
continue;
|
|
if (gme.dsfsfds45645456(event.getX(), event.getY())) {
|
|
double[] dockablePoints = ((Graphic_Figure_Elem) gme).getDockablePoint(event.getX(), event.getY());
|
|
|
|
if (dockablePoints != null &&
|
|
gme.isConnectable) {
|
|
((Graphic_Figure_Elem) gme).drawDockablePoint(C2.TEMPLINEColor, (int) dockablePoints[2]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (!A3.this.view.selectModeBTN.isSelected()) {
|
|
return;
|
|
}
|
|
|
|
for (Graphic_Main_Elem gme : A3.this.graphicElements) {
|
|
|
|
if (gme.dsfsfds45645456(event.getX(), event.getY())) {
|
|
gme.dgfdsfdssfd43534456();
|
|
|
|
A3.this.view.graphicElemLV.getSelectionModel().select(gme);
|
|
A3.this.view.graphicElemLV.scrollTo(A3.this.view.graphicElemLV.getSelectionModel().getSelectedIndex());
|
|
|
|
|
|
if (A3.this.view.generateRelationalModelCB.isSelected()) {
|
|
T1 tableExists = A3.this.relationalModel.getTableGivenNumber(gme.sdfsdfsdfd());
|
|
|
|
|
|
if (tableExists == null) {
|
|
tableExists = A3.this.relationalModel.getColumnGivenNumber(gme.sdfsdfsdfd());
|
|
}
|
|
|
|
int indexOfTable;
|
|
if (tableExists != null) {
|
|
indexOfTable = 0;
|
|
for (TreeItem<T1> tableInTree : A3.this.view.rootTableNode.getChildren()) {
|
|
if (tableInTree.getValue().getTablename().equals(tableExists.getTablename())) {
|
|
break;
|
|
}
|
|
indexOfTable++;
|
|
}
|
|
|
|
A3.this.dsfsdfds7687683rew(A3.this.view.rootTableNode);
|
|
A3.this.view.rootTableNode.setExpanded(true);
|
|
A3.this.view.treeTableView.getSelectionModel().select(indexOfTable);
|
|
A3.this.view.treeTableView.scrollTo(A3.this.view.treeTableView.getSelectionModel().getSelectedIndex());
|
|
|
|
A3.this.sfdsfsfdss324243wer(tableExists);
|
|
}
|
|
} else {
|
|
|
|
A3.this.view.verticalBox.getChildren().clear();
|
|
}
|
|
|
|
|
|
if (A3.this.sdadasd34535trertertret != null && gme != A3.this.sdadasd34535trertertret)
|
|
A3.this.sdadasd34535trertertret.dfsdfssdf456456();
|
|
A3.this.sdadasd34535trertertret = gme;
|
|
A3.this.elementIsSelected = true;
|
|
A3.this.thisERMDrawCanvas.requestFocus();
|
|
event.consume();
|
|
|
|
|
|
return;
|
|
}
|
|
}
|
|
|
|
if (A3.this.sdadasd34535trertertret != null) A3.this.sdadasd34535trertertret.dfsdfssdf456456();
|
|
A3.this.elementIsSelected = false;
|
|
A3.this.sdadasd34535trertertret = null;
|
|
A3.this.sdfsdfds3465er(true);
|
|
event.consume();
|
|
});
|
|
|
|
|
|
setOnMousePressed(event -> {
|
|
A3.this.u1.stackpane.requestFocus();
|
|
|
|
|
|
if (A3.this.rectangleSelection) {
|
|
A3.this.selectRecX = event.getX();
|
|
A3.this.selectRecY = event.getY();
|
|
A3.this.xOffset = event.getX();
|
|
A3.this.yOffset = event.getY();
|
|
event.consume();
|
|
A3.this.thisERMDrawCanvas.requestFocus();
|
|
|
|
return;
|
|
}
|
|
if (event.getButton() == MouseButton.PRIMARY && A3.this.view.selectModeBTN.isSelected()) {
|
|
|
|
if (A3.this.elementIsSelected) {
|
|
A3.this.xOffset = event.getX();
|
|
A3.this.yOffset = event.getY();
|
|
event.consume();
|
|
A3.this.thisERMDrawCanvas.requestFocus();
|
|
|
|
return;
|
|
}
|
|
A3.this.selectRecX = event.getX();
|
|
A3.this.selectRecY = event.getY();
|
|
A3.this.rectangleSelection = true;
|
|
event.consume();
|
|
A3.this.thisERMDrawCanvas.requestFocus();
|
|
|
|
|
|
return;
|
|
}
|
|
|
|
if (event.getButton() == MouseButton.SECONDARY && A3.this.elementIsSelected) {
|
|
|
|
|
|
A3.this.thisERMDrawCanvas.dsasadasd345435fghgfh = true;
|
|
|
|
if (!A3.this.thisERMDrawCanvas.contextMenu.isShowing()) {
|
|
A3.this.thisERMDrawCanvas.createContextMenu();
|
|
A3.this.thisERMDrawCanvas.setContextMenuItems(event.getScreenX() + 2.0D, event.getScreenY());
|
|
|
|
A3.this.thisERMDrawCanvas.contextMenu.show(A3.this.thisERMDrawCanvas, event.getScreenX() + 2.0D, event.getScreenY());
|
|
event.consume();
|
|
A3.this.thisERMDrawCanvas.requestFocus();
|
|
}
|
|
|
|
return;
|
|
}
|
|
|
|
if (event.getButton() == MouseButton.PRIMARY) {
|
|
|
|
|
|
if (A3.this.view.attrToAttrBTN.isSelected()) {
|
|
|
|
for (Graphic_Main_Elem gme : A3.this.graphicElements) {
|
|
|
|
if (gme.dsfsfds45645456(event.getX(), event.getY()) && gme instanceof Graphic_ATTR_Elem) {
|
|
|
|
|
|
A3.this.sdfsdfsfds234324rew(gme, 0, event.getX(), event.getY(), event.getScreenX(), event.getScreenY());
|
|
A3.this.thisERMDrawCanvas.requestFocus();
|
|
|
|
return;
|
|
}
|
|
}
|
|
|
|
return;
|
|
}
|
|
|
|
if (A3.this.view.attrToESBTN.isSelected()) {
|
|
|
|
|
|
for (Graphic_Main_Elem gme : A3.this.graphicElements) {
|
|
|
|
if (gme.dsfsfds45645456(event.getX(), event.getY()) && (
|
|
gme instanceof Graphic_ATTR_Elem || gme instanceof Graphic_ES_Elem || gme instanceof Graphic_ES_Assoc_Elem || gme instanceof Graphic_ES_Weak_Elem)) {
|
|
|
|
|
|
A3.this.sdfsdfsfds234324rew(gme, 1, event.getX(), event.getY(), event.getScreenX(), event.getScreenY());
|
|
A3.this.thisERMDrawCanvas.requestFocus();
|
|
|
|
return;
|
|
}
|
|
}
|
|
|
|
return;
|
|
}
|
|
|
|
if (A3.this.view.attrToRSBTN.isSelected()) {
|
|
|
|
|
|
for (Graphic_Main_Elem gme : A3.this.graphicElements) {
|
|
|
|
if (gme.dsfsfds45645456(event.getX(), event.getY()) && (
|
|
gme instanceof Graphic_ATTR_Elem || gme instanceof Graphic_RS_Elem)) {
|
|
|
|
|
|
A3.this.sdfsdfsfds234324rew(gme, 2, event.getX(), event.getY(), event.getScreenX(), event.getScreenY());
|
|
A3.this.thisERMDrawCanvas.requestFocus();
|
|
|
|
return;
|
|
}
|
|
}
|
|
|
|
return;
|
|
}
|
|
|
|
if (A3.this.view.rsidToESWeakBTN.isSelected()) {
|
|
|
|
|
|
for (Graphic_Main_Elem gme : A3.this.graphicElements) {
|
|
|
|
if (gme.dsfsfds45645456(event.getX(), event.getY())) {
|
|
if (gme instanceof Graphic_RS_Identifying_Elem || gme instanceof Graphic_ES_Weak_Elem) {
|
|
|
|
|
|
A3.this.sdfsdfsfds234324rew(gme, 6, event.getX(), event.getY(), event.getScreenX(), event.getScreenY());
|
|
A3.this.thisERMDrawCanvas.requestFocus();
|
|
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
return;
|
|
}
|
|
if (A3.this.view.rsisaGeToESBTN.isSelected()) {
|
|
|
|
|
|
for (Graphic_Main_Elem gme : A3.this.graphicElements) {
|
|
|
|
if (gme.dsfsfds45645456(event.getX(), event.getY())) {
|
|
if (gme instanceof Graphic_ES_Weak_Elem || gme instanceof Graphic_ES_Elem || gme instanceof Graphic_RS_ISA_Elem) {
|
|
|
|
|
|
A3.this.sdfsdfsfds234324rew(gme, 4, event.getX(), event.getY(), event.getScreenX(), event.getScreenY());
|
|
A3.this.thisERMDrawCanvas.requestFocus();
|
|
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
return;
|
|
}
|
|
if (A3.this.view.rsisaSpToESBTN.isSelected()) {
|
|
|
|
|
|
for (Graphic_Main_Elem gme : A3.this.graphicElements) {
|
|
|
|
if (gme.dsfsfds45645456(event.getX(), event.getY())) {
|
|
if (gme instanceof Graphic_ES_Elem || gme instanceof Graphic_RS_ISA_Elem) {
|
|
|
|
|
|
A3.this.sdfsdfsfds234324rew(gme, 5, event.getX(), event.getY(), event.getScreenX(), event.getScreenY());
|
|
A3.this.thisERMDrawCanvas.requestFocus();
|
|
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
return;
|
|
}
|
|
if (A3.this.view.rsToESBTN.isSelected()) {
|
|
|
|
|
|
for (Graphic_Main_Elem gme : A3.this.graphicElements) {
|
|
|
|
if (gme.dsfsfds45645456(event.getX(), event.getY())) {
|
|
if (gme instanceof Graphic_Figure_Elem && !(gme instanceof Graphic_RS_ISA_Elem)) {
|
|
|
|
|
|
A3.this.sdfsdfsfds234324rew(gme, 3, event.getX(), event.getY(), event.getScreenX(), event.getScreenY());
|
|
A3.this.thisERMDrawCanvas.requestFocus();
|
|
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
return;
|
|
}
|
|
if (A3.this.view.rsidToESBTN.isSelected()) {
|
|
|
|
|
|
for (Graphic_Main_Elem gme : A3.this.graphicElements) {
|
|
|
|
if (gme.dsfsfds45645456(event.getX(), event.getY())) {
|
|
if (gme instanceof Graphic_RS_Identifying_Elem ||
|
|
gme instanceof Graphic_ES_Elem ||
|
|
gme instanceof Graphic_ES_Weak_Elem ||
|
|
gme instanceof Graphic_ES_Assoc_Elem) {
|
|
|
|
|
|
A3.this.sdfsdfsfds234324rew(gme, 7, event.getX(), event.getY(), event.getScreenX(), event.getScreenY());
|
|
A3.this.thisERMDrawCanvas.requestFocus();
|
|
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
return;
|
|
}
|
|
|
|
Graphic_Main_Elem gese = null;
|
|
String name = null;
|
|
|
|
if (!A3.this.view.selectModeBTN.isSelected() && !A3.this.view.rsISABTN.isSelected() && !A3.this.view.textElemBTN.isSelected() && !A3.this.view.textWithoutBorderElemBTN.isSelected()) {
|
|
A5 ermend = new A5(A3.this.thisERMDrawCanvas, event.getScreenX(), event.getScreenY(), null);
|
|
|
|
if (ermend.isDoNothing())
|
|
return;
|
|
name = ermend.getNameTF().getText();
|
|
}
|
|
|
|
|
|
if (A3.this.view.textElemBTN.isSelected() || A3.this.view.textWithoutBorderElemBTN.isSelected()) {
|
|
A7 ermend = new A7(A3.this.thisERMDrawCanvas, event.getScreenX(), event.getScreenY(), null);
|
|
if (ermend.isDoNothing())
|
|
return;
|
|
name = ermend.getTextTA().getText();
|
|
boolean hasBorder = !A3.this.view.textWithoutBorderElemBTN.isSelected();
|
|
gese = new Graphic_Text_Elem(A3.this.gc, event.getX(), event.getY(), name, hasBorder, A3.this.thisERMDrawCanvas.sdfsddf345ersdf());
|
|
}
|
|
if (A3.this.view.esBTN.isSelected()) {
|
|
gese = new Graphic_ES_Elem(A3.this.gc, event.getX(), event.getY(), name, A3.this.thisERMDrawCanvas.sdfsddf345ersdf());
|
|
}
|
|
if (A3.this.view.esWeakBTN.isSelected()) {
|
|
gese = new Graphic_ES_Weak_Elem(A3.this.gc, event.getX(), event.getY(), name, A3.this.thisERMDrawCanvas.sdfsddf345ersdf());
|
|
}
|
|
if (A3.this.view.esAssociativeBTN.isSelected()) {
|
|
gese = new Graphic_ES_Assoc_Elem(A3.this.gc, event.getX(), event.getY(), name, A3.this.thisERMDrawCanvas.sdfsddf345ersdf());
|
|
}
|
|
if (A3.this.view.rsBTN.isSelected()) {
|
|
gese = new Graphic_RS_Elem(A3.this.gc, event.getX(), event.getY(), name, A3.this.thisERMDrawCanvas.sdfsddf345ersdf());
|
|
}
|
|
if (A3.this.view.rsIDBTN.isSelected()) {
|
|
gese = new Graphic_RS_Identifying_Elem(A3.this.gc, event.getX(), event.getY(), name, A3.this.thisERMDrawCanvas.sdfsddf345ersdf());
|
|
}
|
|
if (A3.this.view.rsISABTN.isSelected()) {
|
|
A6 ermend = new A6(A3.this.thisERMDrawCanvas, event.getScreenX(), event.getScreenY(), null, null);
|
|
|
|
|
|
if (ermend.isDoNothing())
|
|
return;
|
|
gese = new Graphic_RS_ISA_Elem(A3.this.gc, event.getX(), event.getY(), "ISA", A3.this.thisERMDrawCanvas.sdfsddf345ersdf());
|
|
((Graphic_RS_ISA_Elem) gese).setPartial_or_total(ermend.getP_tTF().getText());
|
|
((Graphic_RS_ISA_Elem) gese).setDisjunct_or_notdisjunct(ermend.getD_ndTF().getText());
|
|
}
|
|
if (A3.this.view.attrOneBTN.isSelected()) {
|
|
gese = new Graphic_ATTR_One_Elem(A3.this.gc, event.getX(), event.getY(), name, false, A3.this.thisERMDrawCanvas.sdfsddf345ersdf());
|
|
}
|
|
if (A3.this.view.attrMultiBTN.isSelected()) {
|
|
gese = new Graphic_ATTR_Multi_Elem(A3.this.gc, event.getX(), event.getY(), name, false, A3.this.thisERMDrawCanvas.sdfsddf345ersdf());
|
|
}
|
|
if (A3.this.view.attrDerivedOneBTN.isSelected()) {
|
|
gese = new Graphic_ATTR_One_Elem(A3.this.gc, event.getX(), event.getY(), name, true, A3.this.thisERMDrawCanvas.sdfsddf345ersdf());
|
|
}
|
|
if (A3.this.view.attrDerivedMultiBTN.isSelected()) {
|
|
gese = new Graphic_ATTR_Multi_Elem(A3.this.gc, event.getX(), event.getY(), name, true, A3.this.thisERMDrawCanvas.sdfsddf345ersdf());
|
|
}
|
|
if (A3.this.view.attrKeyBTN.isSelected()) {
|
|
gese = new Graphic_ATTR_Key_Elem(A3.this.gc, event.getX(), event.getY(), name, A3.this.thisERMDrawCanvas.sdfsddf345ersdf());
|
|
}
|
|
if (A3.this.view.attrWeakKeyBTN.isSelected()) {
|
|
gese = new Graphic_ATTR_Weak_Key_Elem(A3.this.gc, event.getX(), event.getY(), name, A3.this.thisERMDrawCanvas.sdfsddf345ersdf());
|
|
}
|
|
|
|
|
|
assert gese != null;
|
|
gese.safdsadasds32432456456();
|
|
|
|
A3.this.graphicElementsObservable.add(gese);
|
|
|
|
|
|
String operatingSystem = System.getProperty("os.name");
|
|
|
|
if (!operatingSystem.toLowerCase().contains("linux")) {
|
|
|
|
try {
|
|
(new Robot()).keyPress(9);
|
|
} catch (AWTException ignored) {
|
|
}
|
|
}
|
|
|
|
|
|
if (A3.this.view.generateRelationalModelCB.isSelected() &&
|
|
!A3.this.dsfdsdfssdf45645re()) {
|
|
A3.this.view.verticalBox.getChildren().clear();
|
|
}
|
|
A3.this.thisERMDrawCanvas.requestFocus();
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
private boolean sfsdfsdf4354353(int connectionType, Graphic_Main_Elem anyElem1, Graphic_Main_Elem anyElem2) {
|
|
boolean connectionAllowed = true;
|
|
|
|
if (connectionType == 4 || connectionType == 5) {
|
|
|
|
if (anyElem1 instanceof Graphic_RS_ISA_Elem &&
|
|
!(anyElem2 instanceof Graphic_ES_Elem)) connectionAllowed = false;
|
|
|
|
|
|
if (anyElem1 instanceof Graphic_ES_Elem &&
|
|
!(anyElem2 instanceof Graphic_RS_ISA_Elem)) connectionAllowed = false;
|
|
|
|
|
|
return connectionAllowed;
|
|
}
|
|
|
|
|
|
if (connectionType == 3) {
|
|
|
|
if (anyElem1 instanceof Graphic_RS_Elem &&
|
|
!(anyElem2 instanceof Graphic_ES_Main_Elem)) connectionAllowed = false;
|
|
|
|
|
|
if (anyElem1 instanceof Graphic_ES_Main_Elem &&
|
|
!(anyElem2 instanceof Graphic_RS_Elem)) connectionAllowed = false;
|
|
|
|
|
|
if (anyElem1 instanceof Graphic_ES_Assoc_Elem &&
|
|
anyElem2 instanceof Graphic_ES_Main_Elem) connectionAllowed = true;
|
|
|
|
if (anyElem1 instanceof Graphic_ES_Main_Elem &&
|
|
anyElem2 instanceof Graphic_ES_Assoc_Elem) connectionAllowed = true;
|
|
|
|
|
|
return connectionAllowed;
|
|
}
|
|
|
|
|
|
if (connectionType == 7) {
|
|
|
|
|
|
connectionAllowed = connectionExists(anyElem1, anyElem2);
|
|
|
|
|
|
return connectionAllowed;
|
|
}
|
|
|
|
|
|
if (connectionType == 6) {
|
|
|
|
|
|
connectionAllowed = connectionExists(anyElem1, anyElem2);
|
|
|
|
|
|
return connectionAllowed;
|
|
}
|
|
|
|
|
|
if (connectionType == 2) {
|
|
|
|
if (anyElem1 instanceof Graphic_RS_Elem) {
|
|
if (!(anyElem2 instanceof Graphic_ATTR_Elem)) connectionAllowed = false;
|
|
|
|
}
|
|
if (anyElem1 instanceof Graphic_ATTR_Elem &&
|
|
!(anyElem2 instanceof Graphic_RS_Elem)) connectionAllowed = false;
|
|
|
|
|
|
return connectionAllowed;
|
|
}
|
|
|
|
|
|
if (connectionType == 1) {
|
|
if (anyElem1 instanceof Graphic_ES_Main_Elem) {
|
|
if (!(anyElem2 instanceof Graphic_ATTR_Elem)) connectionAllowed = false;
|
|
|
|
}
|
|
if (anyElem1 instanceof Graphic_ATTR_Elem &&
|
|
!(anyElem2 instanceof Graphic_ES_Main_Elem)) connectionAllowed = false;
|
|
|
|
|
|
return connectionAllowed;
|
|
}
|
|
|
|
|
|
if (connectionType == 0) {
|
|
|
|
connectionAllowed = connectionExists(anyElem1, anyElem2);
|
|
}
|
|
|
|
|
|
return connectionAllowed;
|
|
}
|
|
|
|
|
|
private boolean connectionExists(Graphic_Main_Elem anyElem1, Graphic_Main_Elem anyElem2) {
|
|
for (Graphic_Main_Elem gme : this.graphicElements) {
|
|
if (gme instanceof Graphic_LINE_Elem gmeline) {
|
|
if (gmeline.getConnectedWithEnd() == anyElem1 &&
|
|
gmeline.getConnectedWithStart() == anyElem2) return false;
|
|
if (gmeline.getConnectedWithEnd() == anyElem2 &&
|
|
gmeline.getConnectedWithStart() == anyElem1) return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
|
|
public void setConnectivityForFigures() {
|
|
Graphic_Main_Elem gme;
|
|
Iterator<Graphic_Main_Elem> var2;
|
|
for (var2 = this.graphicElements.iterator(); var2.hasNext(); gme.isConnectable = false) {
|
|
gme = var2.next();
|
|
}
|
|
|
|
var2 = this.graphicElements.iterator();
|
|
|
|
while (true) {
|
|
do {
|
|
do {
|
|
do {
|
|
if (!var2.hasNext()) {
|
|
return;
|
|
}
|
|
|
|
gme = var2.next();
|
|
} while (!(gme instanceof Graphic_Figure_Elem));
|
|
|
|
if (this.view.attrToAttrBTN.isSelected() && gme instanceof Graphic_ATTR_Elem && !((Graphic_ATTR_Elem) gme).isKey()) {
|
|
gme.isConnectable = true;
|
|
}
|
|
|
|
if (this.view.attrToESBTN.isSelected() && (gme instanceof Graphic_ATTR_Elem || gme instanceof Graphic_ES_Main_Elem)) {
|
|
gme.isConnectable = !(gme instanceof Graphic_ATTR_Elem) || this.attributeHasESRSConnection((Graphic_ATTR_Elem) gme);
|
|
}
|
|
|
|
if (this.view.attrToRSBTN.isSelected() && (gme instanceof Graphic_ATTR_Elem || gme instanceof Graphic_RS_Main_Elem) && !(gme instanceof Graphic_RS_ISA_Elem) && !(gme instanceof Graphic_RS_Identifying_Elem)) {
|
|
gme.isConnectable = !(gme instanceof Graphic_ATTR_Elem) || this.attributeHasESRSConnection((Graphic_ATTR_Elem) gme);
|
|
}
|
|
|
|
if (this.view.rsToESBTN.isSelected() && (gme instanceof Graphic_ES_Main_Elem || gme instanceof Graphic_RS_Elem)) {
|
|
gme.isConnectable = true;
|
|
}
|
|
|
|
if (this.view.rsidToESWeakBTN.isSelected() && (gme instanceof Graphic_ES_Weak_Elem || gme instanceof Graphic_RS_Identifying_Elem)) {
|
|
gme.isConnectable = true;
|
|
}
|
|
|
|
if (this.view.rsidToESBTN.isSelected() && (gme instanceof Graphic_ES_Elem || gme instanceof Graphic_ES_Assoc_Elem || gme instanceof Graphic_RS_Identifying_Elem || gme instanceof Graphic_ES_Weak_Elem)) {
|
|
gme.isConnectable = true;
|
|
}
|
|
|
|
if (this.view.rsisaGeToESBTN.isSelected() && (gme instanceof Graphic_ES_Elem || gme instanceof Graphic_RS_ISA_Elem)) {
|
|
gme.isConnectable = true;
|
|
}
|
|
} while (!this.view.rsisaSpToESBTN.isSelected());
|
|
} while (!(gme instanceof Graphic_ES_Elem) && !(gme instanceof Graphic_RS_ISA_Elem));
|
|
|
|
gme.isConnectable = true;
|
|
}
|
|
}
|
|
|
|
|
|
private boolean attributeHasESRSConnection(Graphic_ATTR_Elem gmeAttribute) {
|
|
boolean found = false;
|
|
for (Graphic_Main_Elem gme : this.graphicElements) {
|
|
if (gme instanceof Graphic_LINE_Attr_ES_Elem ||
|
|
gme instanceof Graphic_LINE_Attr_RS_Elem) {
|
|
Graphic_LINE_Elem gmeline = (Graphic_LINE_Elem) gme;
|
|
if (gmeline.getConnectedWithEnd() == gmeAttribute ||
|
|
gmeline.getConnectedWithStart() == gmeAttribute) return false;
|
|
}
|
|
}
|
|
return !found;
|
|
}
|
|
|
|
|
|
private void sdfsdfsfds234324rew(Graphic_Main_Elem gme, int connectionType, double mouseX, double mouseY, double screenX, double screenY) {
|
|
if (!gme.isConnectable) {
|
|
return;
|
|
}
|
|
|
|
double[] dockablePoints = ((Graphic_Figure_Elem) gme).getDockablePoint(mouseX, mouseY);
|
|
if (dockablePoints == null) {
|
|
return;
|
|
}
|
|
switch (this.selectCounterConnection) {
|
|
case 0 -> {
|
|
this.anyElem1 = gme;
|
|
this.selectCounterConnection++;
|
|
this.view.buttonPane.setDisable(true);
|
|
gme.dgfdsfdssfd43534456();
|
|
this.dockXAnyElem1 = dockablePoints[0];
|
|
this.dockYAnyElem1 = dockablePoints[1];
|
|
this.dockAtPointAnyElem1 = (byte) (int) dockablePoints[2];
|
|
return;
|
|
}
|
|
case 1 -> {
|
|
if (!sfsdfsdf4354353(connectionType, this.anyElem1, gme)) {
|
|
return;
|
|
}
|
|
this.anyElem2 = gme;
|
|
if (this.anyElem1 == this.anyElem2) {
|
|
return;
|
|
}
|
|
this.selectCounterConnection++;
|
|
gme.dgfdsfdssfd43534456();
|
|
this.dockXAnyElem2 = dockablePoints[0];
|
|
this.dockYAnyElem2 = dockablePoints[1];
|
|
this.asdasdsad435435etertret = (byte) (int) dockablePoints[2];
|
|
}
|
|
}
|
|
|
|
|
|
if (this.selectCounterConnection >= 2) {
|
|
String minimum, maximum;
|
|
this.view.buttonPane.setDisable(false);
|
|
|
|
|
|
Graphic_LINE_Elem gese = null;
|
|
switch (connectionType) {
|
|
case 0 -> gese = new Graphic_LINE_Attr_Attr_Elem(this.gc,
|
|
this.dockXAnyElem1, this.dockYAnyElem1,
|
|
this.dockXAnyElem2, this.dockYAnyElem2,
|
|
this.dockAtPointAnyElem1, this.asdasdsad435435etertret,
|
|
(Graphic_Figure_Elem) this.anyElem1, (Graphic_Figure_Elem) this.anyElem2,
|
|
this.thisERMDrawCanvas.sdfsddf345ersdf());
|
|
case 1 -> gese = new Graphic_LINE_Attr_ES_Elem(this.gc,
|
|
this.dockXAnyElem1, this.dockYAnyElem1,
|
|
this.dockXAnyElem2, this.dockYAnyElem2,
|
|
this.dockAtPointAnyElem1, this.asdasdsad435435etertret,
|
|
(Graphic_Figure_Elem) this.anyElem1, (Graphic_Figure_Elem) this.anyElem2,
|
|
this.thisERMDrawCanvas.sdfsddf345ersdf());
|
|
case 2 -> gese = new Graphic_LINE_Attr_RS_Elem(this.gc,
|
|
this.dockXAnyElem1, this.dockYAnyElem1,
|
|
this.dockXAnyElem2, this.dockYAnyElem2,
|
|
this.dockAtPointAnyElem1, this.asdasdsad435435etertret,
|
|
(Graphic_Figure_Elem) this.anyElem1, (Graphic_Figure_Elem) this.anyElem2,
|
|
this.thisERMDrawCanvas.sdfsddf345ersdf());
|
|
case 4 -> gese = new Graphic_LINE_RSISAG_ES_Elem(this.gc,
|
|
this.dockXAnyElem1, this.dockYAnyElem1,
|
|
this.dockXAnyElem2, this.dockYAnyElem2,
|
|
this.dockAtPointAnyElem1, this.asdasdsad435435etertret,
|
|
(Graphic_Figure_Elem) this.anyElem1, (Graphic_Figure_Elem) this.anyElem2,
|
|
this.thisERMDrawCanvas.sdfsddf345ersdf());
|
|
case 5 -> gese = new Graphic_LINE_RSISAS_ES_Elem(this.gc,
|
|
this.dockXAnyElem1, this.dockYAnyElem1,
|
|
this.dockXAnyElem2, this.dockYAnyElem2,
|
|
this.dockAtPointAnyElem1, this.asdasdsad435435etertret,
|
|
(Graphic_Figure_Elem) this.anyElem1, (Graphic_Figure_Elem) this.anyElem2,
|
|
this.thisERMDrawCanvas.sdfsddf345ersdf());
|
|
case 6 -> gese = new Graphic_LINE_RSID_ESWEAK_Elem(this.gc,
|
|
this.dockXAnyElem1, this.dockYAnyElem1,
|
|
this.dockXAnyElem2, this.dockYAnyElem2,
|
|
this.dockAtPointAnyElem1, this.asdasdsad435435etertret,
|
|
(Graphic_Figure_Elem) this.anyElem1, (Graphic_Figure_Elem) this.anyElem2,
|
|
this.thisERMDrawCanvas.sdfsddf345ersdf());
|
|
case 3, 7 -> {
|
|
if (!this.changeDockingPoint) {
|
|
A4 ermminmax = new A4(this.thisERMDrawCanvas,
|
|
screenX,
|
|
screenY,
|
|
"0", "n");
|
|
if (ermminmax.isDoNothing()) {
|
|
|
|
this.selectCounterConnection = 0;
|
|
this.anyElem1.dfsdfssdf456456();
|
|
this.anyElem2.dfsdfssdf456456();
|
|
this.anyElem1 = null;
|
|
this.anyElem2 = null;
|
|
this.dockXAnyElem1 = 0.0D;
|
|
this.dockYAnyElem1 = 0.0D;
|
|
this.dockXAnyElem2 = 0.0D;
|
|
this.dockYAnyElem2 = 0.0D;
|
|
this.dockAtPointAnyElem1 = 0;
|
|
this.asdasdsad435435etertret = 0;
|
|
|
|
sdfsdfds3465er(true);
|
|
sdfdsfdsdf34543erretwre();
|
|
return;
|
|
}
|
|
minimum = ermminmax.getMinTF().getText();
|
|
maximum = ermminmax.getMaxTF().getText();
|
|
} else {
|
|
|
|
minimum = this.connectionToChange.getMinimum();
|
|
maximum = this.connectionToChange.getMaximum();
|
|
}
|
|
if (connectionType == 3) {
|
|
gese = new Graphic_LINE_RS_ES_Elem(this.gc,
|
|
this.dockXAnyElem1, this.dockYAnyElem1,
|
|
this.dockXAnyElem2, this.dockYAnyElem2,
|
|
this.dockAtPointAnyElem1, this.asdasdsad435435etertret,
|
|
(Graphic_Figure_Elem) this.anyElem1, (Graphic_Figure_Elem) this.anyElem2,
|
|
this.thisERMDrawCanvas.sdfsddf345ersdf());
|
|
}
|
|
if (connectionType == 7)
|
|
gese = new Graphic_LINE_RSID_ES_Elem(this.gc,
|
|
this.dockXAnyElem1, this.dockYAnyElem1,
|
|
this.dockXAnyElem2, this.dockYAnyElem2,
|
|
this.dockAtPointAnyElem1, this.asdasdsad435435etertret,
|
|
(Graphic_Figure_Elem) this.anyElem1, (Graphic_Figure_Elem) this.anyElem2,
|
|
this.thisERMDrawCanvas.sdfsddf345ersdf());
|
|
gese.setMinimum(minimum);
|
|
gese.setMaximum(maximum);
|
|
}
|
|
}
|
|
|
|
|
|
this.graphicElementsObservable.add(gese);
|
|
|
|
|
|
this.selectCounterConnection = 0;
|
|
this.anyElem1.dfsdfssdf456456();
|
|
this.anyElem2.dfsdfssdf456456();
|
|
this.anyElem1 = null;
|
|
this.anyElem2 = null;
|
|
this.dockXAnyElem1 = 0.0D;
|
|
this.dockYAnyElem1 = 0.0D;
|
|
this.dockXAnyElem2 = 0.0D;
|
|
this.dockYAnyElem2 = 0.0D;
|
|
this.dockAtPointAnyElem1 = 0;
|
|
this.asdasdsad435435etertret = 0;
|
|
|
|
sdfsdfds3465er(true);
|
|
|
|
if (this.changeDockingPoint) {
|
|
this.view.selectModeBTN.setSelected(true);
|
|
this.changeDockingPoint = false;
|
|
} else {
|
|
sdfdsfdsdf34543erretwre();
|
|
}
|
|
if (this.view.generateRelationalModelCB.isSelected() &&
|
|
!dsfdsdfssdf45645re()) {
|
|
this.view.verticalBox.getChildren().clear();
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
public void clearERMDrawCanvas() {
|
|
this.gc.clearRect(0.0D, 0.0D, getWidth(), getHeight());
|
|
|
|
this.graphicElementsObservable.clear();
|
|
|
|
this.attributeElements.clear();
|
|
|
|
|
|
this.elementID = 1L;
|
|
}
|
|
|
|
|
|
public void sdfdsfdsf43645re() {
|
|
this.selectedElements = new ArrayList<>();
|
|
for (Graphic_Main_Elem gme : this.graphicElements) {
|
|
this.selectedElements.add(gme);
|
|
gme.selectElem();
|
|
}
|
|
this.rectangleSelection = true;
|
|
}
|
|
|
|
|
|
public void sdfsdfds3465er(boolean clearCanvas) {
|
|
if (clearCanvas) sfdsfsd43543();
|
|
|
|
dsfsdf12312456dgret(null);
|
|
sdfdsf456456fghgf(null);
|
|
}
|
|
|
|
|
|
public void dsfsdfd456456rezrez(ArrayList<Graphic_Main_Elem> without) {
|
|
dsfsdf12312456dgret(without);
|
|
sdfdsf456456fghgf(without);
|
|
}
|
|
|
|
|
|
private void dsfsdf12312456dgret(ArrayList<Graphic_Main_Elem> without) {
|
|
for (Graphic_Main_Elem gme : this.graphicElements) {
|
|
if ((gme instanceof Graphic_Figure_Elem || gme instanceof Graphic_Text_Elem) && (
|
|
without == null || sadsadaads435435rete(without, gme))) gme.safdsadasds32432456456();
|
|
|
|
}
|
|
}
|
|
|
|
|
|
private void sdfdsf456456fghgf(ArrayList<Graphic_Main_Elem> without) {
|
|
for (Graphic_Main_Elem gme : this.graphicElements) {
|
|
if (gme instanceof Graphic_LINE_Elem && (
|
|
without == null || sadsadaads435435rete(without, gme))) gme.safdsadasds32432456456();
|
|
|
|
}
|
|
}
|
|
|
|
|
|
private boolean sadsadaads435435rete(ArrayList<Graphic_Main_Elem> without, Graphic_Main_Elem figure) {
|
|
boolean found = true;
|
|
if (without.contains(figure)) return false;
|
|
return found;
|
|
}
|
|
|
|
|
|
public ArrayList<Graphic_LINE_Elem> dsfdsfdsjhkj456456(Graphic_Main_Elem elementSelected) {
|
|
ArrayList<Graphic_LINE_Elem> gle = new ArrayList<>();
|
|
for (Graphic_Main_Elem gme : this.graphicElements) {
|
|
if (gme instanceof Graphic_LINE_Elem && (
|
|
(Graphic_LINE_Elem) gme).getConnectedWithStart().sdfsdfsdfd() == elementSelected.sdfsdfsdfd()) {
|
|
gle.add((Graphic_LINE_Elem) gme);
|
|
}
|
|
}
|
|
|
|
return gle;
|
|
}
|
|
|
|
|
|
public ArrayList<Graphic_LINE_Elem> sdfsdfds23432rwefsd(Graphic_Main_Elem elementSelected) {
|
|
ArrayList<Graphic_LINE_Elem> gle = new ArrayList<>();
|
|
for (Graphic_Main_Elem gme : this.graphicElements) {
|
|
if (gme instanceof Graphic_LINE_Elem && (
|
|
(Graphic_LINE_Elem) gme).getConnectedWithEnd().sdfsdfsdfd() == elementSelected.sdfsdfsdfd()) {
|
|
gle.add((Graphic_LINE_Elem) gme);
|
|
}
|
|
}
|
|
|
|
return gle;
|
|
}
|
|
|
|
|
|
public void sdfdsfd567657rrt(KeyEvent event) {
|
|
if (this.thisERMDrawCanvas.contextMenu.isShowing()) {
|
|
return;
|
|
}
|
|
if (this.keyCombinationCTRL_R.match(event)) {
|
|
(this.view.getCurrentTab()).canvas.sdfsdfds3465er(true);
|
|
event.consume();
|
|
}
|
|
|
|
|
|
if (this.keyCombinationCTRL_O.match(event)) {
|
|
this.view.readModel();
|
|
event.consume();
|
|
}
|
|
|
|
|
|
if (this.keyCombinationCTRL_E.match(event)) {
|
|
this.view.close();
|
|
return;
|
|
}
|
|
|
|
if (this.keyCombinationCTRL_N.match(event)) {
|
|
this.view.setCurrentTab(this.view.addNewTab(null));
|
|
(this.view.getCurrentTab()).canvas.requestFocus();
|
|
this.view.tabPane.getSelectionModel().select(this.view.getCurrentTab());
|
|
event.consume();
|
|
|
|
return;
|
|
}
|
|
|
|
if (this.dsfsdfdsf56456.match(event)) {
|
|
this.view.saveModel();
|
|
event.consume();
|
|
|
|
return;
|
|
}
|
|
|
|
if (this.resetZoomCombination.match(event)) {
|
|
Collections.reverse(this.zooming);
|
|
for (Double d : this.zooming) {
|
|
this.thisERMDrawCanvas.getTransforms().add(new Scale(this.thisERMDrawCanvas.getScaleX() * d,
|
|
this.thisERMDrawCanvas.getScaleY() * d));
|
|
}
|
|
this.thisERMDrawCanvas
|
|
.zooming.clear();
|
|
setWidth(this.canvasWidth);
|
|
setHeight(this.canvasHeight);
|
|
event.consume();
|
|
|
|
return;
|
|
}
|
|
|
|
if (this.dsfsfdsfd456456.match(event)) {
|
|
this.thisERMDrawCanvas.requestFocus();
|
|
|
|
if (this.selectedElements != null) {
|
|
this.view.setToCopyElements(new ArrayList<>());
|
|
for (Graphic_Main_Elem gme : this.selectedElements) {
|
|
Graphic_Main_Elem gmeCopy = (Graphic_Main_Elem) T3.copyObject(gme);
|
|
this.view.getToCopyElements().add(gmeCopy);
|
|
}
|
|
|
|
for (Graphic_Main_Elem gme : this.selectedElements) {
|
|
gme.dsfsdfsfd();
|
|
sfsdfsfds4343(gme.sdfsdfsdfd());
|
|
}
|
|
}
|
|
event.consume();
|
|
|
|
return;
|
|
}
|
|
|
|
if (this.sadsdsadsad213213.match(event)) {
|
|
this.thisERMDrawCanvas.requestFocus();
|
|
|
|
if (this.selectedElements != null) {
|
|
this.view.setToCopyElements(new ArrayList<>());
|
|
for (Graphic_Main_Elem gme : this.selectedElements) {
|
|
Graphic_Main_Elem gmeCopy = (Graphic_Main_Elem) T3.copyObject(gme);
|
|
this.view.getToCopyElements().add(gmeCopy);
|
|
}
|
|
}
|
|
event.consume();
|
|
|
|
return;
|
|
}
|
|
|
|
if (this.dfgsdd456456.match(event)) {
|
|
this.thisERMDrawCanvas.requestFocus();
|
|
if (this.view.getToCopyElements() != null) {
|
|
|
|
ArrayList<Graphic_Main_Elem> elementsPrepared = new ArrayList<>();
|
|
for (Graphic_Main_Elem gme : this.view.getToCopyElements()) {
|
|
Graphic_Main_Elem gmeCopy = (Graphic_Main_Elem) T3.copyObject(gme);
|
|
elementsPrepared.add(gmeCopy);
|
|
}
|
|
|
|
|
|
for (Graphic_Main_Elem gme : elementsPrepared) {
|
|
|
|
if (gme instanceof Graphic_LINE_Elem) {
|
|
for (Graphic_Main_Elem gmeLinePoint : elementsPrepared) {
|
|
if (gmeLinePoint instanceof Graphic_Figure_Elem) {
|
|
if (((Graphic_LINE_Elem) gme).getConnectedWithEnd().sdfsdfsdfd() == gmeLinePoint.sdfsdfsdfd()) {
|
|
((Graphic_LINE_Elem) gme).setConnectedWithEnd((Graphic_Figure_Elem) gmeLinePoint);
|
|
}
|
|
if (((Graphic_LINE_Elem) gme).getConnectedWithStart().sdfsdfsdfd() == gmeLinePoint.sdfsdfsdfd()) {
|
|
((Graphic_LINE_Elem) gme).setConnectedWithStart((Graphic_Figure_Elem) gmeLinePoint);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
long nextElem = sdfsddf345ersdf();
|
|
for (Graphic_Main_Elem gme : elementsPrepared) {
|
|
|
|
gme.setGc(this.gc);
|
|
gme.dsdasadsasd32423432(nextElem);
|
|
gme.isVisible = true;
|
|
nextElem++;
|
|
}
|
|
|
|
this.graphicElementsObservable.addAll(elementsPrepared);
|
|
|
|
|
|
sdfsdfds3465er(true);
|
|
|
|
this.elementID = sdfsddf345ersdf();
|
|
this.view.setToCopyElements(null);
|
|
}
|
|
event.consume();
|
|
|
|
return;
|
|
}
|
|
|
|
if (this.asdadsa324324.match(event)) {
|
|
this.thisERMDrawCanvas.requestFocus();
|
|
this.view.selectModeBTN.setSelected(true);
|
|
sdfdsfdsf43645re();
|
|
event.consume();
|
|
|
|
return;
|
|
}
|
|
|
|
if (this.keyCombinationCTRL_Z.match(event)) {
|
|
this.thisERMDrawCanvas.requestFocus();
|
|
if (this.selectedElements != null || this.elementIsSelected) {
|
|
return;
|
|
}
|
|
if (this.pastActions != null && this.pastActions.size() > 0) {
|
|
|
|
Graphic_Main_Elem lastAction = this.pastActions.remove(this.pastActions.size() - 1);
|
|
|
|
this.futureActions.add(lastAction);
|
|
if (Objects.requireNonNull(lastAction.adsadadsa4354353()) == U4.REMOVE) {
|
|
this.graphicElements.add(lastAction);
|
|
lastAction.sfdsfsfsddf123234435(U4.ADD);
|
|
} else {
|
|
this.graphicElements.remove(lastAction);
|
|
lastAction.sfdsfsfsddf123234435(U4.REMOVE);
|
|
}
|
|
|
|
|
|
}
|
|
sdfsdfds3465er(true);
|
|
if (this.view.generateRelationalModelCB.isSelected() &&
|
|
!dsfdsdfssdf45645re()) {
|
|
this.view.verticalBox.getChildren().clear();
|
|
}
|
|
asdadsa32432rweewr();
|
|
this.view.graphicElemLV.getItems().clear();
|
|
this.view.graphicElemLV.getItems().addAll(this.graphicElements);
|
|
|
|
if (this.connectionModeSet) (this.view.getCurrentTab()).canvas.sdfdsfdsdf34543erretwre();
|
|
event.consume();
|
|
|
|
return;
|
|
}
|
|
|
|
if (this.dsfsdfds67678768.match(event)) {
|
|
if (this.futureActions.size() > 0) {
|
|
Graphic_Main_Elem redoElem = this.futureActions.remove(this.futureActions.size() - 1);
|
|
|
|
if (this.graphicElements.size() > 0)
|
|
this.pastActions.add(this.graphicElements.get(this.graphicElements.size() - 1));
|
|
if (Objects.requireNonNull(redoElem.adsadadsa4354353()) == U4.REMOVE) {
|
|
this.graphicElements.add(redoElem);
|
|
redoElem.sfdsfsfsddf123234435(U4.ADD);
|
|
} else {
|
|
this.graphicElements.remove(redoElem);
|
|
redoElem.sfdsfsfsddf123234435(U4.REMOVE);
|
|
}
|
|
|
|
|
|
}
|
|
sdfsdfds3465er(true);
|
|
if (this.view.generateRelationalModelCB.isSelected() &&
|
|
!dsfdsdfssdf45645re()) {
|
|
this.view.verticalBox.getChildren().clear();
|
|
}
|
|
asdadsa32432rweewr();
|
|
this.view.graphicElemLV.getItems().clear();
|
|
this.view.graphicElemLV.getItems().addAll(this.graphicElements);
|
|
|
|
if (this.connectionModeSet) (this.view.getCurrentTab()).canvas.sdfdsfdsdf34543erretwre();
|
|
event.consume();
|
|
|
|
|
|
return;
|
|
}
|
|
|
|
|
|
switch (event.getCode()) {
|
|
case F1, S -> {
|
|
sdfsdfds3465er(true);
|
|
if (this.view.selectModeBTN.isSelected()) {
|
|
this.selectedElements = null;
|
|
this.rectangleSelection = false;
|
|
this.elementIsSelected = false;
|
|
this.sdadasd34535trertertret = null;
|
|
this.view.lastCreationSelected.fire();
|
|
} else {
|
|
this.view.selectModeBTN.fire();
|
|
}
|
|
event.consume();
|
|
return;
|
|
}
|
|
case BACK_SPACE, DELETE -> {
|
|
if (this.rectangleSelection) {
|
|
for (Graphic_Main_Elem gme : this.selectedElements) {
|
|
gme.dsfsdfsfd();
|
|
sfsdfsfds4343(gme.sdfsdfsdfd());
|
|
}
|
|
this.selectedElements = null;
|
|
this.rectangleSelection = false;
|
|
sdfsdfds3465er(true);
|
|
return;
|
|
}
|
|
if (!this.elementIsSelected) return;
|
|
this.sdadasd34535trertertret.dsfsdfsfd();
|
|
if (this.sdadasd34535trertertret instanceof Graphic_Figure_Elem) {
|
|
ArrayList<Graphic_LINE_Elem> linesAsEnd = sdfsdfds23432rwefsd(this.sdadasd34535trertertret);
|
|
ArrayList<Graphic_LINE_Elem> linesAsStart = dsfdsfdsjhkj456456(this.sdadasd34535trertertret);
|
|
for (Graphic_LINE_Elem gle : linesAsEnd) {
|
|
|
|
gle.dsfsdfsfd();
|
|
|
|
this.graphicElementsObservable.remove(gle);
|
|
|
|
}
|
|
|
|
for (Graphic_LINE_Elem gle : linesAsStart) {
|
|
|
|
gle.dsfsdfsfd();
|
|
|
|
this.graphicElementsObservable.remove(gle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
this.graphicElementsObservable.remove(this.sdadasd34535trertertret);
|
|
|
|
|
|
this.elementIsSelected = false;
|
|
|
|
this.sdadasd34535trertertret = null;
|
|
|
|
sdfsdfds3465er(true);
|
|
}
|
|
|
|
|
|
case ESCAPE -> {
|
|
|
|
if (this.thisERMDrawCanvas.dsasadasd345435fghgfh) this.thisERMDrawCanvas.dsasadasd345435fghgfh = false;
|
|
|
|
|
|
if (this.rectangleSelection) {
|
|
|
|
this.rectangleSelection = false;
|
|
|
|
this.selectedElements = null;
|
|
|
|
sdfsdfds3465er(false);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (this.selectCounterConnection > 0) {
|
|
|
|
if (this.anyElem1 != null) this.anyElem1.dfsdfssdf456456();
|
|
|
|
this.anyElem1 = null;
|
|
|
|
if (this.anyElem2 != null) this.anyElem2.dfsdfssdf456456();
|
|
|
|
this.anyElem2 = null;
|
|
|
|
sdfsdfds3465er(true);
|
|
|
|
sdfdsfdsdf34543erretwre();
|
|
|
|
|
|
this.view.buttonPane.setDisable(false);
|
|
|
|
|
|
this.selectCounterConnection = 0;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
case UP -> {
|
|
|
|
if (dsfdsfds4354354fdhf(0.0D, -5.0D)) {
|
|
|
|
|
|
dsfsfdsd3453efs(0.0D, -5.0D);
|
|
|
|
sdfsdfds3465er(true);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
case DOWN -> {
|
|
|
|
dsfsfdsd3453efs(0.0D, 5.0D);
|
|
|
|
sdfsdfds3465er(true);
|
|
|
|
sdfdsfsfds();
|
|
}
|
|
|
|
|
|
case LEFT -> {
|
|
|
|
if (dsfdsfds4354354fdhf(-5.0D, 0.0D)) {
|
|
|
|
|
|
dsfsfdsd3453efs(-5.0D, 0.0D);
|
|
|
|
sdfsdfds3465er(true);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
case RIGHT -> {
|
|
|
|
dsfsfdsd3453efs(5.0D, 0.0D);
|
|
|
|
sdfsdfds3465er(true);
|
|
|
|
sdfdsfsfds();
|
|
}
|
|
|
|
}
|
|
|
|
|
|
event.consume();
|
|
}
|
|
|
|
|
|
public void createContextMenu() {
|
|
this.contextMenu = new ContextMenu();
|
|
|
|
|
|
this.contextMenu.setOnHiding(event -> {
|
|
if (A3.this.thisERMDrawCanvas.dsasadasd345435fghgfh)
|
|
A3.this.thisERMDrawCanvas.dsasadasd345435fghgfh = false;
|
|
|
|
});
|
|
|
|
|
|
this.addText = new MenuItem("Change Text");
|
|
this.addText.setOnAction(event -> {
|
|
event.consume();
|
|
A7 ermend = new A7(A3.this.thisERMDrawCanvas, A3.this.dialogXPos, A3.this.dialogYPos, A3.this.sdadasd34535trertertret.name);
|
|
if (A3.this.sdadasd34535trertertret instanceof Graphic_Text_Elem) {
|
|
|
|
((Graphic_Text_Elem) A3.this.sdadasd34535trertertret).changeName(ermend.getTextTA().getText());
|
|
A3.this.view.graphicElemLV.refresh();
|
|
|
|
if (A3.this.view.generateRelationalModelCB.isSelected() &&
|
|
!A3.this.dsfdsdfssdf45645re()) {
|
|
A3.this.view.verticalBox.getChildren().clear();
|
|
}
|
|
}
|
|
A3.this.thisERMDrawCanvas.dsasadasd345435fghgfh = false;
|
|
});
|
|
|
|
|
|
this.addName = new MenuItem("Change Name");
|
|
this.addName.setOnAction(event -> {
|
|
event.consume();
|
|
A5 ermend = new A5(A3.this.thisERMDrawCanvas, A3.this.dialogXPos, A3.this.dialogYPos, A3.this.sdadasd34535trertertret.name);
|
|
if (A3.this.sdadasd34535trertertret instanceof Graphic_Figure_Elem) {
|
|
ArrayList<Graphic_LINE_Elem> gleListStart = A3.this.dsfdsfdsjhkj456456(A3.this.sdadasd34535trertertret);
|
|
|
|
|
|
((Graphic_Figure_Elem) A3.this.sdadasd34535trertertret).changeName(ermend.getNameTF().getText());
|
|
A3.this.view.graphicElemLV.refresh();
|
|
|
|
|
|
if (gleListStart.size() > 0) {
|
|
for (Graphic_LINE_Elem gle : gleListStart) {
|
|
gle.dsfsdfsfd();
|
|
|
|
gle.setxPos(((Graphic_Figure_Elem) A3.this.sdadasd34535trertertret).getXYForGivenPoint(gle.getLineConnectedWithPointAtStart())[0]);
|
|
gle.setyPos(((Graphic_Figure_Elem) A3.this.sdadasd34535trertertret).getXYForGivenPoint(gle.getLineConnectedWithPointAtStart())[1]);
|
|
gle.safdsadasds32432456456();
|
|
}
|
|
}
|
|
ArrayList<Graphic_LINE_Elem> gleListEnd = A3.this.sdfsdfds23432rwefsd(A3.this.sdadasd34535trertertret);
|
|
if (gleListEnd.size() > 0) {
|
|
for (Graphic_LINE_Elem gle : gleListEnd) {
|
|
gle.dsfsdfsfd();
|
|
gle.setxEnd(((Graphic_Figure_Elem) A3.this.sdadasd34535trertertret).getXYForGivenPoint(gle.getLineConnectedWithPointAtEnd())[0]);
|
|
gle.setyEnd(((Graphic_Figure_Elem) A3.this.sdadasd34535trertertret).getXYForGivenPoint(gle.getLineConnectedWithPointAtEnd())[1]);
|
|
gle.safdsadasds32432456456();
|
|
}
|
|
}
|
|
|
|
if (A3.this.view.generateRelationalModelCB.isSelected() &&
|
|
!A3.this.dsfdsdfssdf45645re()) {
|
|
A3.this.view.verticalBox.getChildren().clear();
|
|
}
|
|
}
|
|
A3.this.thisERMDrawCanvas.dsasadasd345435fghgfh = false;
|
|
});
|
|
|
|
|
|
this.addMinMax = new MenuItem("Change Min/Max");
|
|
this.addMinMax.setOnAction(event -> {
|
|
event.consume();
|
|
Graphic_LINE_Elem gle = (Graphic_LINE_Elem) A3.this.sdadasd34535trertertret;
|
|
A4 ermend = new A4(A3.this.thisERMDrawCanvas, A3.this.dialogXPos, A3.this.dialogYPos, gle.getMinimum(), gle.getMaximum());
|
|
gle.changeMinMax(ermend.getMinTF().getText(), ermend.getMaxTF().getText());
|
|
A3.this.view.graphicElemLV.refresh();
|
|
A3.this.thisERMDrawCanvas.dsasadasd345435fghgfh = false;
|
|
|
|
if (A3.this.view.generateRelationalModelCB.isSelected() &&
|
|
!A3.this.dsfdsdfssdf45645re()) {
|
|
A3.this.view.verticalBox.getChildren().clear();
|
|
}
|
|
});
|
|
|
|
|
|
this.addISASpec = new MenuItem("Change T-P/D-ND");
|
|
this.addISASpec.setOnAction(event -> {
|
|
event.consume();
|
|
Graphic_RS_ISA_Elem gle = (Graphic_RS_ISA_Elem) A3.this.sdadasd34535trertertret;
|
|
A6 ermend = new A6(A3.this.thisERMDrawCanvas, A3.this.dialogXPos, A3.this.dialogYPos, gle.getPartial_or_total(), gle.getDisjunct_or_notdisjunct());
|
|
gle.changeP_T_D_ND(ermend.getP_tTF().getText(), ermend.getD_ndTF().getText());
|
|
A3.this.view.graphicElemLV.refresh();
|
|
A3.this.thisERMDrawCanvas.dsasadasd345435fghgfh = false;
|
|
if (A3.this.view.generateRelationalModelCB.isSelected() &&
|
|
!A3.this.dsfdsdfssdf45645re()) {
|
|
A3.this.view.verticalBox.getChildren().clear();
|
|
}
|
|
});
|
|
|
|
|
|
this.sadsadas4353453retretret = new MenuItem("ES/RS Transformation");
|
|
this.sadsadas4353453retretret.setOnAction(event -> {
|
|
event.consume();
|
|
U3 tir = (U3) A3.this.sdadasd34535trertertret;
|
|
|
|
A9 ermend = new A9(A3.this.thisERMDrawCanvas, A3.this.dialogXPos, A3.this.dialogYPos,
|
|
A3.this.sdadasd34535trertertret.name,
|
|
tir.getCreateRelation(),
|
|
tir.getRelationName(),
|
|
tir.getRelationPraefix(),
|
|
tir.getCreateInserts(),
|
|
tir.getNumberRowsToInsert(),
|
|
false);
|
|
tir.setCreateRelation(ermend.getCreateRelationCB().isSelected());
|
|
tir.setRelationName(ermend.getRelationNameTF().getText());
|
|
tir.setRelationPraefix((ermend.getRelationPraefixTF().getText() == null) ? "" : ermend.getRelationPraefixTF().getText());
|
|
tir.setCreateInserts(ermend.getCreateInsertStatementsCB().isSelected());
|
|
tir.setNumberRowsToInsert(Long.parseLong(ermend.getNumberRowsToInsertTF().getText()));
|
|
A3.this.thisERMDrawCanvas.dsasadasd345435fghgfh = false;
|
|
|
|
A3.this.view.graphicElemLV.refresh();
|
|
if (A3.this.view.generateRelationalModelCB.isSelected() &&
|
|
!A3.this.dsfdsdfssdf45645re()) {
|
|
A3.this.view.verticalBox.getChildren().clear();
|
|
}
|
|
});
|
|
|
|
|
|
this.sdfsdfsdfsdfdsf324324 = new MenuItem("Attribute Transformation");
|
|
this.sdfsdfsdfsdfdsf324324.setOnAction(event -> {
|
|
event.consume();
|
|
U2 tir = (U2) A3.this.sdadasd34535trertertret;
|
|
if (A3.this.sdadasd34535trertertret instanceof Graphic_ATTR_Multi_Elem) {
|
|
B1 ermend = new B1(A3.this.thisERMDrawCanvas, A3.this.dialogXPos, A3.this.dialogYPos,
|
|
A3.this.sdadasd34535trertertret.name,
|
|
tir.getCreateColumn(),
|
|
tir.getColumnName(),
|
|
tir.getMVRelationName(),
|
|
tir.getMVRelationNamePraefix(),
|
|
tir.getColumnPostfix(),
|
|
tir.getDatatype(),
|
|
tir.isAutoincrement(),
|
|
tir.isKey(),
|
|
tir.isNullable(),
|
|
tir.isUnique());
|
|
tir.setCreateColumn(ermend.getCreateColumnCB().isSelected());
|
|
tir.setColumnName(ermend.getColumnNameTF().getText());
|
|
tir.setMVRelationName(ermend.getRelationNameTF().getText());
|
|
tir.setMVRelationNamePraefix(ermend.getRelationNamePraefixTF().getText());
|
|
tir.setColumnPostfix(ermend.getColumnPostfixTF().getText());
|
|
tir.setDatatype(ermend.getDatatypeTF().getText());
|
|
tir.setIsAutoincrement(ermend.getIsAutoincrementCB().isSelected());
|
|
tir.setIsKey(ermend.getIsKeyCB().isSelected());
|
|
tir.setIsNullable(ermend.getIsNullableCB().isSelected());
|
|
tir.setIsUnique(ermend.getIsUniqueCB().isSelected());
|
|
} else {
|
|
|
|
A8 ermend = new A8(A3.this.thisERMDrawCanvas, A3.this.dialogXPos, A3.this.dialogYPos,
|
|
A3.this.sdadasd34535trertertret.name,
|
|
tir.getCreateColumn(),
|
|
tir.getColumnName(),
|
|
tir.getColumnPostfix(),
|
|
tir.getDatatype(),
|
|
(A3.this.sdadasd34535trertertret instanceof Graphic_ATTR_Weak_Key_Elem),
|
|
tir.isAutoincrement(),
|
|
tir.getAutoincrementStartAt(),
|
|
tir.isKey(),
|
|
tir.isNullable(),
|
|
tir.isUnique(),
|
|
tir.getDataGenerationType(),
|
|
tir.getPar1(),
|
|
tir.getPar1_label(),
|
|
tir.getPar2(),
|
|
tir.getPar2_label());
|
|
tir.setCreateColumn(ermend.getCreateColumnCB().isSelected());
|
|
tir.setColumnName(ermend.getColumnNameTF().getText());
|
|
tir.setColumnPostfix(ermend.getColumnPostfixTF().getText());
|
|
tir.setDatatype(ermend.getDatatypeTF().getText());
|
|
tir.setIsAutoincrement(ermend.getIsAutoincrementCB().isSelected());
|
|
tir.setAutoincrementStartAt(Long.parseLong(ermend.getAutoincrementStartAtTF().getText()));
|
|
tir.setIsKey(ermend.getIsKeyCB().isSelected());
|
|
tir.setIsNullable(ermend.getIsNullableCB().isSelected());
|
|
tir.setIsUnique(ermend.getIsUniqueCB().isSelected());
|
|
tir.setDataGenerationType(ermend.getDataGenerationTypeCoB().getSelectionModel().getSelectedItem());
|
|
tir.setPar1(ermend.getPar1TF().getText());
|
|
tir.setPar1_label(ermend.getPar1LBL().getText());
|
|
tir.setPar2(ermend.getPar2TF().getText());
|
|
tir.setPar2_label(ermend.getPar2LBL().getText());
|
|
}
|
|
|
|
|
|
A3.this.view.graphicElemLV.refresh();
|
|
|
|
A3.this.thisERMDrawCanvas.dsasadasd345435fghgfh = false;
|
|
if (A3.this.view.generateRelationalModelCB.isSelected() &&
|
|
!A3.this.dsfdsdfssdf45645re()) {
|
|
A3.this.view.verticalBox.getChildren().clear();
|
|
}
|
|
});
|
|
|
|
|
|
this.changeDockingPointAtFigure1 = new MenuItem("Change Docking Point at ");
|
|
this.changeDockingPointAtFigure1.setOnAction(event -> A3.this.prepareForDockingChange(A3.this.figureToChange2,
|
|
A3.this.connectionToChange.getxPos(), A3.this.connectionToChange.getyPos(),
|
|
A3.this.connectionToChange.getLineConnectedWithPointAtStart()));
|
|
|
|
|
|
this.changeDockingPointAtFigure2 = new MenuItem("Change Docking Point at ");
|
|
this.changeDockingPointAtFigure2.setOnAction(event -> A3.this.prepareForDockingChange(A3.this.figureToChange1,
|
|
A3.this.connectionToChange.getxEnd(), A3.this.connectionToChange.getyEnd(),
|
|
A3.this.connectionToChange.getLineConnectedWithPointAtEnd()));
|
|
|
|
this.contextMenu.getItems().addAll(this.addName, this.addText, this.addMinMax, this.addISASpec, this.sadsadas4353453retretret, this.sdfsdfsdfsdfdsf324324, this.changeDockingPointAtFigure1, this.changeDockingPointAtFigure2);
|
|
}
|
|
|
|
|
|
private void prepareForDockingChange(Graphic_Figure_Elem figureHold, double x, double y, byte pointAt) {
|
|
this.sdadasd34535trertertret.dsfsdfsfd();
|
|
this.graphicElementsObservable.remove(this.sdadasd34535trertertret);
|
|
|
|
this.connectionModeSet = true;
|
|
if (this.sdadasd34535trertertret instanceof Graphic_LINE_RSISAG_ES_Elem)
|
|
this.view.rsisaGeToESBTN.setSelected(true);
|
|
if (this.sdadasd34535trertertret instanceof Graphic_LINE_RSISAS_ES_Elem)
|
|
this.view.rsisaSpToESBTN.setSelected(true);
|
|
if (this.sdadasd34535trertertret instanceof Graphic_LINE_Attr_Attr_Elem)
|
|
this.view.attrToAttrBTN.setSelected(true);
|
|
if (this.sdadasd34535trertertret instanceof Graphic_LINE_Attr_ES_Elem) this.view.attrToESBTN.setSelected(true);
|
|
if (this.sdadasd34535trertertret instanceof Graphic_LINE_Attr_RS_Elem) this.view.attrToRSBTN.setSelected(true);
|
|
if (this.sdadasd34535trertertret instanceof Graphic_LINE_RSID_ESWEAK_Elem)
|
|
this.view.rsidToESWeakBTN.setSelected(true);
|
|
if (this.sdadasd34535trertertret instanceof Graphic_LINE_RSID_ES_Elem) this.view.rsidToESBTN.setSelected(true);
|
|
if (this.sdadasd34535trertertret instanceof Graphic_LINE_RS_ES_Elem) this.view.rsToESBTN.setSelected(true);
|
|
|
|
|
|
this.anyElem1 = figureHold;
|
|
this.anyElem2 = null;
|
|
this.dockXAnyElem1 = x;
|
|
this.dockYAnyElem1 = y;
|
|
this.dockAtPointAnyElem1 = pointAt;
|
|
this.selectCounterConnection = 1;
|
|
|
|
this.changeDockingPoint = true;
|
|
|
|
this.view.buttonPane.setDisable(true);
|
|
}
|
|
|
|
|
|
private void setContextMenuItems(double xPos, double yPos) {
|
|
this.dialogXPos = xPos;
|
|
this.dialogYPos = yPos;
|
|
|
|
|
|
this.addText.setVisible(false);
|
|
this.addName.setVisible(false);
|
|
this.addMinMax.setVisible(false);
|
|
this.addISASpec.setVisible(false);
|
|
this.sadsadas4353453retretret.setVisible(false);
|
|
this.sdfsdfsdfsdfdsf324324.setVisible(false);
|
|
this.changeDockingPointAtFigure1.setVisible(false);
|
|
this.changeDockingPointAtFigure2.setVisible(false);
|
|
|
|
|
|
if (this.sdadasd34535trertertret instanceof Graphic_Text_Elem) {
|
|
this.addText.setVisible(true);
|
|
this.addName.setVisible(false);
|
|
this.addMinMax.setVisible(false);
|
|
this.addISASpec.setVisible(false);
|
|
this.sadsadas4353453retretret.setVisible(false);
|
|
this.sdfsdfsdfsdfdsf324324.setVisible(false);
|
|
|
|
return;
|
|
}
|
|
|
|
if (this.sdadasd34535trertertret instanceof Graphic_ES_Main_Elem) {
|
|
this.addText.setVisible(false);
|
|
this.addName.setVisible(true);
|
|
this.addMinMax.setVisible(false);
|
|
this.addISASpec.setVisible(false);
|
|
this.sadsadas4353453retretret.setVisible(true);
|
|
this.sdfsdfsdfsdfdsf324324.setVisible(false);
|
|
|
|
return;
|
|
}
|
|
|
|
if (this.sdadasd34535trertertret instanceof Graphic_RS_Identifying_Elem) {
|
|
this.addText.setVisible(false);
|
|
this.addName.setVisible(true);
|
|
this.addMinMax.setVisible(false);
|
|
this.addISASpec.setVisible(false);
|
|
this.sadsadas4353453retretret.setVisible(false);
|
|
this.sdfsdfsdfsdfdsf324324.setVisible(false);
|
|
|
|
return;
|
|
}
|
|
|
|
if (this.sdadasd34535trertertret instanceof Graphic_RS_ISA_Elem) {
|
|
this.addText.setVisible(false);
|
|
this.addName.setVisible(false);
|
|
this.addMinMax.setVisible(false);
|
|
this.addISASpec.setVisible(true);
|
|
this.sadsadas4353453retretret.setVisible(false);
|
|
this.sdfsdfsdfsdfdsf324324.setVisible(false);
|
|
|
|
|
|
return;
|
|
}
|
|
|
|
if (this.sdadasd34535trertertret instanceof Graphic_RS_Main_Elem) {
|
|
this.addText.setVisible(false);
|
|
this.addName.setVisible(true);
|
|
this.addMinMax.setVisible(false);
|
|
this.addISASpec.setVisible(false);
|
|
this.sadsadas4353453retretret.setVisible(true);
|
|
this.sdfsdfsdfsdfdsf324324.setVisible(false);
|
|
|
|
return;
|
|
}
|
|
|
|
if (this.sdadasd34535trertertret instanceof Graphic_ATTR_Elem) {
|
|
this.addText.setVisible(false);
|
|
this.addName.setVisible(true);
|
|
this.addMinMax.setVisible(false);
|
|
this.addISASpec.setVisible(false);
|
|
this.sadsadas4353453retretret.setVisible(false);
|
|
this.sdfsdfsdfsdfdsf324324.setVisible(true);
|
|
|
|
|
|
return;
|
|
}
|
|
|
|
this.connectionToChange = null;
|
|
if (this.sdadasd34535trertertret instanceof Graphic_LINE_Elem &&
|
|
!(this.sdadasd34535trertertret instanceof Graphic_LINE_RSISAG_ES_Elem) &&
|
|
!(this.sdadasd34535trertertret instanceof Graphic_LINE_RSISAS_ES_Elem) &&
|
|
!(this.sdadasd34535trertertret instanceof Graphic_LINE_RSID_ESWEAK_Elem) &&
|
|
!(this.sdadasd34535trertertret instanceof Graphic_LINE_Attr_Attr_Elem) &&
|
|
!(this.sdadasd34535trertertret instanceof Graphic_LINE_Attr_ES_Elem) &&
|
|
!(this.sdadasd34535trertertret instanceof Graphic_LINE_Attr_RS_Elem)) {
|
|
this.addText.setVisible(false);
|
|
this.addName.setVisible(false);
|
|
this.addMinMax.setVisible(true);
|
|
this.addISASpec.setVisible(false);
|
|
this.sadsadas4353453retretret.setVisible(false);
|
|
this.sdfsdfsdfsdfdsf324324.setVisible(false);
|
|
this.connectionToChange = (Graphic_LINE_Elem) this.sdadasd34535trertertret;
|
|
this.figureToChange1 = this.connectionToChange.getConnectedWithEnd();
|
|
this.figureToChange2 = this.connectionToChange.getConnectedWithStart();
|
|
this.changeDockingPointAtFigure1.setVisible(true);
|
|
String elementToUndock1 = this.figureToChange1.sdfsdfsd32234243();
|
|
this.changeDockingPointAtFigure1.setText(this.changeDockingPointAtFigure1.getText() + " " + elementToUndock1);
|
|
this.changeDockingPointAtFigure2.setVisible(true);
|
|
String elementToUndock2 = this.figureToChange2.sdfsdfsd32234243();
|
|
this.changeDockingPointAtFigure2.setText(this.changeDockingPointAtFigure2.getText() + " " + elementToUndock2);
|
|
|
|
return;
|
|
}
|
|
|
|
if (this.sdadasd34535trertertret instanceof Graphic_LINE_RSISAG_ES_Elem ||
|
|
this.sdadasd34535trertertret instanceof Graphic_LINE_RSISAS_ES_Elem ||
|
|
this.sdadasd34535trertertret instanceof Graphic_LINE_Attr_Attr_Elem ||
|
|
this.sdadasd34535trertertret instanceof Graphic_LINE_Attr_ES_Elem ||
|
|
this.sdadasd34535trertertret instanceof Graphic_LINE_Attr_RS_Elem ||
|
|
this.sdadasd34535trertertret instanceof Graphic_LINE_RSID_ESWEAK_Elem) {
|
|
this.addText.setVisible(false);
|
|
this.addName.setVisible(false);
|
|
this.addMinMax.setVisible(false);
|
|
this.addISASpec.setVisible(false);
|
|
this.sadsadas4353453retretret.setVisible(false);
|
|
this.sdfsdfsdfsdfdsf324324.setVisible(false);
|
|
this.connectionToChange = (Graphic_LINE_Elem) this.sdadasd34535trertertret;
|
|
this.figureToChange1 = this.connectionToChange.getConnectedWithEnd();
|
|
this.figureToChange2 = this.connectionToChange.getConnectedWithStart();
|
|
this.changeDockingPointAtFigure1.setVisible(true);
|
|
String elementToUndock1 = this.figureToChange1.sdfsdfsd32234243();
|
|
this.changeDockingPointAtFigure1.setText(this.changeDockingPointAtFigure1.getText() + " " + elementToUndock1);
|
|
this.changeDockingPointAtFigure2.setVisible(true);
|
|
String elementToUndock2 = this.figureToChange2.sdfsdfsd32234243();
|
|
this.changeDockingPointAtFigure2.setText(this.changeDockingPointAtFigure2.getText() + " " + elementToUndock2);
|
|
}
|
|
}
|
|
|
|
|
|
private ArrayList<Graphic_Main_Elem> selectElementsInRectangle(double xStart, double yStart, double xEnd, double yEnd) {
|
|
if (xEnd < xStart) {
|
|
double t = xEnd;
|
|
xEnd = xStart;
|
|
xStart = t;
|
|
}
|
|
if (yEnd < yStart) {
|
|
double t = yEnd;
|
|
yEnd = yStart;
|
|
yStart = t;
|
|
}
|
|
ArrayList<Graphic_Main_Elem> selEl = new ArrayList<>();
|
|
for (Graphic_Main_Elem gme : this.graphicElements) {
|
|
if (gme.xPos >= xStart && gme.yPos >= yStart &&
|
|
gme.xPos <= xEnd && gme.yPos <= yEnd) {
|
|
|
|
gme.safdsadasds32432456456();
|
|
gme.selectElem();
|
|
|
|
selEl.add(gme);
|
|
}
|
|
}
|
|
return selEl;
|
|
}
|
|
|
|
|
|
public void sfsdfsfds4343(long elementID) {
|
|
for (int i = 0; i < this.graphicElements.size(); i++) {
|
|
if (this.graphicElements.get(i).sdfsdfsdfd() == elementID) {
|
|
this.graphicElementsObservable.remove(i);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
public void sdfdsfdsdf43543ref() {
|
|
if (this.rectangleSelection) {
|
|
this.rectangleSelection = false;
|
|
for (Graphic_Main_Elem ge : this.selectedElements) {
|
|
ge.safdsadasds32432456456();
|
|
}
|
|
this.selectedElements = null;
|
|
}
|
|
}
|
|
|
|
|
|
public void sfdsfsd43543() {
|
|
this.gc.clearRect(0.0D, 0.0D, this.canvasWidth, this.canvasHeight);
|
|
}
|
|
|
|
|
|
private boolean dsfsdfds435345esfsfd(double newX, double newY, ArrayList<Graphic_Main_Elem> selectedElements) {
|
|
for (Graphic_Main_Elem gme : selectedElements) {
|
|
if (dsfdsf43534dfdfhg(newX, newY, gme)) return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
|
|
private boolean dsfdsfds4354354fdhf(double newXd, double newYd) {
|
|
for (Graphic_Main_Elem gme : this.graphicElements) {
|
|
if (dsfdsf43534dfdfhg(gme.getxPos() + newXd, gme.getyPos() + newYd, gme)) return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
|
|
private boolean dsfdsf43534dfdfhg(double newX, double newY, Graphic_Main_Elem gme) {
|
|
if (gme instanceof Graphic_Figure_Elem || gme instanceof Graphic_Text_Elem) {
|
|
return !(newX - gme.dsfsfsd456457657() / 2.0D >= 0.0D) || !(newY - gme.getHeight() / 2.0D >= 0.0D);
|
|
} else return !(newX >= 0.0D) || !(newY >= 0.0D);
|
|
}
|
|
|
|
|
|
public double[] dssfsdfd43643634() {
|
|
double[] widthHeight = new double[2];
|
|
double maxHeight = 0.0D;
|
|
double maxWidth = 0.0D;
|
|
|
|
for (Graphic_Main_Elem gme : this.graphicElements) {
|
|
if (gme instanceof Graphic_Figure_Elem) {
|
|
if (maxWidth < gme.getxPos() + gme.dsfsfsd456457657()) {
|
|
maxWidth = gme.getxPos() + gme.dsfsfsd456457657();
|
|
}
|
|
if (maxHeight < gme.getyPos() + gme.getHeight()) {
|
|
maxHeight = gme.getyPos() + gme.getHeight();
|
|
}
|
|
}
|
|
}
|
|
widthHeight[0] = maxWidth;
|
|
widthHeight[1] = maxHeight;
|
|
return widthHeight;
|
|
}
|
|
|
|
|
|
public ArrayList<Graphic_Main_Elem> sddsfsfsdf45645645() {
|
|
return this.graphicElements;
|
|
}
|
|
|
|
|
|
public void safdsadsa65765ewthjk(ArrayList<Graphic_Main_Elem> graphicElements) {
|
|
this.graphicElementsObservable.addAll(graphicElements);
|
|
}
|
|
|
|
|
|
public File getSaveFile() {
|
|
return this.modelSavedInFile;
|
|
}
|
|
|
|
|
|
public void setSaveFile(File modelSavedInFile) {
|
|
this.modelSavedInFile = modelSavedInFile;
|
|
}
|
|
|
|
|
|
public void sdfdsfdsdf34543erretwre() {
|
|
setConnectivityForFigures();
|
|
for (Graphic_Main_Elem gme : this.graphicElements) {
|
|
if (gme instanceof Graphic_Figure_Elem) {
|
|
((Graphic_Figure_Elem) gme).dockablePointsAtElem();
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
public void sdfsdfds435634terf() {
|
|
this.rectangleSelection = false;
|
|
this.selectedElements = null;
|
|
this.anyElem1 = null;
|
|
this.selectCounterConnection = 0;
|
|
}
|
|
|
|
|
|
public void modelVisibility() {
|
|
if (this.view.menuVisibilityAllRMI == null)
|
|
return;
|
|
if (this.view.menuVisibilityAllRMI.isSelected() && this.view.menuVisibilityTEXTRMI.isSelected()) {
|
|
for (Graphic_Main_Elem gme : this.graphicElements) {
|
|
gme.isVisible = true;
|
|
}
|
|
|
|
return;
|
|
}
|
|
if (this.view.menuVisibilityAllRMI.isSelected() && !this.view.menuVisibilityTEXTRMI.isSelected()) {
|
|
for (Graphic_Main_Elem gme : this.graphicElements) {
|
|
gme.isVisible = !(gme instanceof Graphic_Text_Elem);
|
|
|
|
}
|
|
|
|
return;
|
|
}
|
|
for (Graphic_Main_Elem gme : this.graphicElements) {
|
|
gme.isVisible = false;
|
|
}
|
|
|
|
for (Graphic_Main_Elem gme : this.graphicElements) {
|
|
|
|
if (this.view.menuVisibilityTEXTRMI.isSelected() &&
|
|
gme instanceof Graphic_Text_Elem) {
|
|
gme.isVisible = true;
|
|
}
|
|
|
|
|
|
if ((this.view.menuVisibilityES_RSRMI.isSelected() || this.view.menuVisibilityES_RS_KEYRMI.isSelected()) && (
|
|
gme instanceof Graphic_ES_Main_Elem || gme instanceof Graphic_RS_Main_Elem)) {
|
|
gme.isVisible = true;
|
|
|
|
for (Graphic_LINE_Elem line : sdfsdfds23432rwefsd(gme)) {
|
|
line.isVisible = true;
|
|
}
|
|
for (Graphic_LINE_Elem line : dsfdsfdsjhkj456456(gme)) {
|
|
line.isVisible = true;
|
|
}
|
|
|
|
for (Graphic_Main_Elem attributes : getAttributesForVisibility(gme)) {
|
|
|
|
for (Graphic_LINE_Elem line : sdfsdfds23432rwefsd(attributes)) {
|
|
line.isVisible = false;
|
|
}
|
|
for (Graphic_LINE_Elem line : dsfdsfdsjhkj456456(attributes)) {
|
|
line.isVisible = false;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
if (this.view.menuVisibilityES_RS_KEYRMI.isSelected()) {
|
|
|
|
for (Graphic_Main_Elem attributes : getKeyAttributesForVisibility(gme)) {
|
|
attributes.isVisible = true;
|
|
|
|
for (Graphic_LINE_Elem line : sdfsdfds23432rwefsd(attributes)) {
|
|
line.isVisible = true;
|
|
}
|
|
for (Graphic_LINE_Elem line : dsfdsfdsjhkj456456(attributes)) {
|
|
line.isVisible = true;
|
|
}
|
|
}
|
|
|
|
for (Graphic_Main_Elem attributes : getWeakKeyAttributesForVisibility(gme)) {
|
|
attributes.isVisible = true;
|
|
|
|
for (Graphic_LINE_Elem line : sdfsdfds23432rwefsd(attributes)) {
|
|
line.isVisible = true;
|
|
}
|
|
for (Graphic_LINE_Elem line : dsfdsfdsjhkj456456(attributes)) {
|
|
line.isVisible = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
public long getElementID() {
|
|
return this.elementID;
|
|
}
|
|
|
|
|
|
public void dsfds124332(long elementID) {
|
|
this.elementID = elementID;
|
|
}
|
|
|
|
|
|
public long sdfsddf345ersdf() {
|
|
long lastId = 0L;
|
|
for (Graphic_Main_Elem gme : this.graphicElements) {
|
|
if (gme.sdfsdfsdfd() > lastId) lastId = gme.sdfsdfsdfd();
|
|
}
|
|
return lastId + 1L;
|
|
}
|
|
|
|
|
|
private void dsfsfdsd3453efs(double xd, double yd) {
|
|
for (Graphic_Main_Elem gme : this.graphicElements) {
|
|
gme.setxPos(gme.getxPos() + xd);
|
|
gme.setyPos(gme.getyPos() + yd);
|
|
if (gme instanceof Graphic_Figure_Elem gfe) {
|
|
gfe.calculateTextWidthHeight();
|
|
}
|
|
if (gme instanceof Graphic_LINE_Elem gle) {
|
|
gle.setxEnd(gle.getxEnd() + xd);
|
|
gle.setyEnd(gle.getyEnd() + yd);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
private void sdfdsfsfds() {
|
|
}
|
|
|
|
|
|
public double getCanvasWidth() {
|
|
return this.canvasWidth;
|
|
}
|
|
|
|
|
|
public double getCanvasHeight() {
|
|
return this.canvasHeight;
|
|
}
|
|
|
|
|
|
private void sfdsfsfdss324243wer(T1 table) {
|
|
this.view.rootColumnNode = new TreeItem<>(null);
|
|
|
|
this.view.treeColumnView = new TreeView<>(this.view.rootColumnNode);
|
|
|
|
this.view.treeColumnView.setShowRoot(false);
|
|
if (this.view.verticalBox.getChildren().size() > 1) {
|
|
this.view.verticalBox.getChildren().set(1, this.view.treeColumnView);
|
|
} else {
|
|
this.view.verticalBox.getChildren().add(this.view.treeColumnView);
|
|
}
|
|
|
|
this.view.treeColumnView.setCellFactory(p -> new TreeCell<>() {
|
|
protected void updateItem(C3 item, boolean empty) {
|
|
super.updateItem(item, empty);
|
|
if (!empty && item != null) {
|
|
setStyle("-fx-text-fill: black;-fx-font-size: 12;");
|
|
if (item.isKey()) {
|
|
setStyle("-fx-font-weight: bold;-fx-font-size: 12;");
|
|
}
|
|
|
|
if (item.isKey() && item.getReferencesTo() == null) {
|
|
setText(item.getColumnName() + "@PK," + item.getDatatype());
|
|
} else if (item.isKey() && item.getReferencesTo() != null) {
|
|
setText(item.getColumnName() + "@PFK," + item.getDatatype());
|
|
} else if (item.getReferencesTo() != null) {
|
|
setText(item.getColumnName() + "@FK," + item.getDatatype());
|
|
} else {
|
|
|
|
setText(item.getColumnName() + "@" + item.getDatatype());
|
|
}
|
|
} else {
|
|
setText("");
|
|
}
|
|
}
|
|
});
|
|
this.view.rootColumnNode.setExpanded(true);
|
|
this.view.rootColumnNode.getChildren().clear();
|
|
|
|
for (C3 column : table.getSkjdfhgdskjf674534()) {
|
|
TreeItem<C3> element;
|
|
|
|
element = new TreeItem<>(column);
|
|
this.view.rootColumnNode.getChildren().add(element);
|
|
}
|
|
}
|
|
|
|
|
|
public boolean dsfdsdfssdf45645re() {
|
|
if (!this.view.generateRelationalModelCB.isSelected()) {
|
|
return false;
|
|
}
|
|
ZZ30 mergedModel;
|
|
try {
|
|
mergedModel = new ZZ30(this.view, this.graphicElements, this.relationalModel);
|
|
if (!mergedModel.lkshjdskjhsdlkjhds()) return false;
|
|
this.relationalModel = mergedModel.getRelationalModel();
|
|
} catch (StackOverflowError sofe) {
|
|
|
|
|
|
this.view.verticalBox.getChildren().clear();
|
|
|
|
|
|
this.view.generateRelationalModelCB.setSelected(false);
|
|
return false;
|
|
}
|
|
|
|
|
|
ImageView treeviewImg = new ImageView(C2.esImage);
|
|
treeviewImg.setFitHeight(20.0D);
|
|
treeviewImg.setFitWidth(20.0D);
|
|
|
|
this.view.rootTableNode = new TreeItem<>(null);
|
|
|
|
this.view.treeTableView = new TreeView<>(this.view.rootTableNode);
|
|
this.view.treeTableView.setPrefHeight(600.0D);
|
|
this.view.treeTableView.setShowRoot(false);
|
|
|
|
this.view.treeTableView.setOnKeyReleased(event -> {
|
|
@SuppressWarnings("unchecked") TreeView<T1> tv = (TreeView<T1>) event.getSource();
|
|
TreeItem<T1> selectedItem = tv.getSelectionModel().getSelectedItem();
|
|
T1 selectedRelation = selectedItem.getValue();
|
|
A3.this.view.selectModeBTN.setSelected(true);
|
|
A3.this.thisERMDrawCanvas.sdfsdfds3465er(true);
|
|
A3.this.thisERMDrawCanvas.dsfdsfsdf43543refds(selectedRelation.getReferstoGraphicalElement());
|
|
|
|
A3.this.sfdsfsfdss324243wer(selectedRelation);
|
|
});
|
|
|
|
|
|
this.view.treeTableView.setOnMouseClicked(event -> {
|
|
@SuppressWarnings("unchecked") TreeView<T1> tv = (TreeView<T1>) event.getSource();
|
|
TreeItem<T1> selectedItem = tv.getSelectionModel().getSelectedItem();
|
|
if (selectedItem != null) {
|
|
T1 selectedRelation = selectedItem.getValue();
|
|
A3.this.view.selectModeBTN.setSelected(true);
|
|
A3.this.thisERMDrawCanvas.sdfsdfds3465er(true);
|
|
A3.this.thisERMDrawCanvas.dsfdsfsdf43543refds(selectedRelation.getReferstoGraphicalElement());
|
|
|
|
A3.this.sfdsfsfdss324243wer(selectedRelation);
|
|
}
|
|
event.consume();
|
|
});
|
|
|
|
|
|
if (this.view.verticalBox.getChildren().size() > 0) {
|
|
this.view.verticalBox.getChildren().set(0, this.view.treeTableView);
|
|
} else {
|
|
this.view.verticalBox.getChildren().add(this.view.treeTableView);
|
|
}
|
|
this.view.treeTableView.setCellFactory(p -> new TreeCell<>() {
|
|
protected void updateItem(T1 item, boolean empty) {
|
|
super.updateItem(item, empty);
|
|
if (!empty && item != null) {
|
|
setStyle("-fx-text-fill: black;-fx-font-size: 11;");
|
|
setText(item.getTablename());
|
|
} else {
|
|
setText("");
|
|
}
|
|
}
|
|
});
|
|
|
|
|
|
this.view.rootTableNode.setExpanded(true);
|
|
this.view.rootTableNode.getChildren().clear();
|
|
for (T1 table : mergedModel.getRelationalModel().getTables()) {
|
|
TreeItem<T1> element;
|
|
|
|
element = new TreeItem<>(table);
|
|
this.view.rootTableNode.getChildren().add(element);
|
|
|
|
for (T1 fktable : mergedModel.getRelationalModel().getTables()) {
|
|
for (C3 column : fktable.getSkjdfhgdskjf674534()) {
|
|
if (column.getReferencesTo() != null && column.getReferencesTo().tablename().equals(table.getTablename())) {
|
|
TreeItem<T1> fkTreeItem = new TreeItem<>(fktable);
|
|
element.getChildren().add(fkTreeItem);
|
|
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (this.view.rootTableNode.getChildren().size() > 0) {
|
|
this.view.treeTableView.getSelectionModel().select(0);
|
|
T1 selectedRelation = (T1) ((TreeItem<?>) this.view.treeTableView.getSelectionModel().getSelectedItem()).getValue();
|
|
this.view.selectModeBTN.setSelected(true);
|
|
this.thisERMDrawCanvas.sdfsdfds3465er(true);
|
|
this.thisERMDrawCanvas.dsfdsfsdf43543refds(selectedRelation.getReferstoGraphicalElement());
|
|
|
|
sfdsfsfdss324243wer(selectedRelation);
|
|
} else {
|
|
|
|
this.view.verticalBox.getChildren().clear();
|
|
}
|
|
|
|
|
|
return true;
|
|
}
|
|
|
|
|
|
public C4 dsfdsfd45645zr() {
|
|
return this.relationalModel;
|
|
}
|
|
|
|
|
|
private ArrayList<Graphic_Main_Elem> getAttributesForVisibility(Graphic_Main_Elem gme) {
|
|
ArrayList<Graphic_Main_Elem> attributes = new ArrayList<>();
|
|
for (Graphic_Main_Elem gmLooking : this.graphicElements) {
|
|
|
|
|
|
if (gmLooking instanceof Graphic_LINE_Elem) {
|
|
|
|
|
|
if (((Graphic_LINE_Elem) gmLooking).getConnectedWithEnd().sdfsdfsdfd() == gme.sdfsdfsdfd() && ((Graphic_LINE_Elem) gmLooking).getConnectedWithStart() instanceof Graphic_ATTR_Elem gae) {
|
|
attributes.add(gae);
|
|
}
|
|
if (((Graphic_LINE_Elem) gmLooking).getConnectedWithStart().sdfsdfsdfd() == gme.sdfsdfsdfd() && ((Graphic_LINE_Elem) gmLooking).getConnectedWithEnd() instanceof Graphic_ATTR_Elem gae) {
|
|
attributes.add(gae);
|
|
}
|
|
}
|
|
}
|
|
return attributes;
|
|
}
|
|
|
|
|
|
private ArrayList<Graphic_Main_Elem> getKeyAttributesForVisibility(Graphic_Main_Elem gme) {
|
|
ArrayList<Graphic_Main_Elem> attributes = new ArrayList<>();
|
|
for (Graphic_Main_Elem gmLooking : this.graphicElements) {
|
|
|
|
|
|
if (gmLooking instanceof Graphic_LINE_Elem) {
|
|
|
|
|
|
if (((Graphic_LINE_Elem) gmLooking).getConnectedWithEnd().sdfsdfsdfd() == gme.sdfsdfsdfd() && (
|
|
(Graphic_LINE_Elem) gmLooking).getConnectedWithStart() instanceof Graphic_ATTR_Key_Elem) {
|
|
Graphic_ATTR_Elem gae = (Graphic_ATTR_Elem) ((Graphic_LINE_Elem) gmLooking).getConnectedWithStart();
|
|
|
|
attributes.add(gae);
|
|
}
|
|
if (((Graphic_LINE_Elem) gmLooking).getConnectedWithStart().sdfsdfsdfd() == gme.sdfsdfsdfd() && (
|
|
(Graphic_LINE_Elem) gmLooking).getConnectedWithEnd() instanceof Graphic_ATTR_Key_Elem) {
|
|
Graphic_ATTR_Elem gae = (Graphic_ATTR_Elem) ((Graphic_LINE_Elem) gmLooking).getConnectedWithEnd();
|
|
|
|
attributes.add(gae);
|
|
}
|
|
}
|
|
}
|
|
return attributes;
|
|
}
|
|
|
|
|
|
private ArrayList<Graphic_Main_Elem> getWeakKeyAttributesForVisibility(Graphic_Main_Elem gme) {
|
|
ArrayList<Graphic_Main_Elem> attributes = new ArrayList<>();
|
|
for (Graphic_Main_Elem gmLooking : this.graphicElements) {
|
|
|
|
|
|
if (gmLooking instanceof Graphic_LINE_Elem) {
|
|
|
|
|
|
if (((Graphic_LINE_Elem) gmLooking).getConnectedWithEnd().sdfsdfsdfd() == gme.sdfsdfsdfd() && (
|
|
(Graphic_LINE_Elem) gmLooking).getConnectedWithStart() instanceof Graphic_ATTR_Weak_Key_Elem) {
|
|
Graphic_ATTR_Elem gae = (Graphic_ATTR_Elem) ((Graphic_LINE_Elem) gmLooking).getConnectedWithStart();
|
|
|
|
attributes.add(gae);
|
|
}
|
|
if (((Graphic_LINE_Elem) gmLooking).getConnectedWithStart().sdfsdfsdfd() == gme.sdfsdfsdfd() && (
|
|
(Graphic_LINE_Elem) gmLooking).getConnectedWithEnd() instanceof Graphic_ATTR_Weak_Key_Elem) {
|
|
Graphic_ATTR_Elem gae = (Graphic_ATTR_Elem) ((Graphic_LINE_Elem) gmLooking).getConnectedWithEnd();
|
|
|
|
attributes.add(gae);
|
|
}
|
|
}
|
|
}
|
|
return attributes;
|
|
}
|
|
|
|
|
|
public void dsfdsfsdf43543refds(long refersToElement) {
|
|
for (Graphic_Main_Elem gme : this.graphicElements) {
|
|
if (gme.sdfsdfsdfd() == refersToElement) {
|
|
gme.selectElem();
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
public B3 getView() {
|
|
return this.view;
|
|
}
|
|
|
|
|
|
private void dsfsdfds7687683rew(TreeItem<?> item) {
|
|
if (item != null && !item.isLeaf()) {
|
|
item.setExpanded(false);
|
|
for (TreeItem<?> child : item.getChildren()) {
|
|
dsfsdfds7687683rew(child);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
public String getInitialDirectory() {
|
|
return this.initialDirectory;
|
|
}
|
|
|
|
|
|
public void setInitialDirectory(String initialDirectory) {
|
|
this.initialDirectory = initialDirectory;
|
|
}
|
|
|
|
|
|
public ObservableList<Graphic_Main_Elem> fsdfdsfds1231278() {
|
|
return this.graphicElementsObservable;
|
|
}
|
|
|
|
|
|
public void asdadsa32432rweewr() {
|
|
Collections.sort(this.graphicElements);
|
|
}
|
|
|
|
|
|
public void sortGraphicElementsByName() {
|
|
this.attributeElements.sort(Comparator.comparing(arg0 -> arg0.sdfsdfsd32234243().toLowerCase()));
|
|
}
|
|
|
|
|
|
public ArrayList<Graphic_Main_Elem> getAttributeElements() {
|
|
return this.attributeElements;
|
|
}
|
|
|
|
|
|
public boolean isConnectionModeSet() {
|
|
return this.connectionModeSet;
|
|
}
|
|
|
|
|
|
public void setConnectionModeSet(boolean connectionModeSet) {
|
|
this.connectionModeSet = connectionModeSet;
|
|
}
|
|
|
|
|
|
public U1 getTabWithCanvas() {
|
|
return this.u1;
|
|
}
|
|
}
|
|
|
|
|