better naming

This commit is contained in:
Mystikfluu 2023-04-02 22:30:52 +02:00
parent 14c697ec1d
commit a1a397d06d
2 changed files with 14 additions and 30 deletions

View File

@ -159,6 +159,7 @@ public class B3
this.showAttributeCB.setTooltip(new Tooltip("Check data generation")); this.showAttributeCB.setTooltip(new Tooltip("Check data generation"));
this.showAttributeCB.setPrefWidth(40.0D); this.showAttributeCB.setPrefWidth(40.0D);
this.showAttributeCB.setMinWidth(40.0D); this.showAttributeCB.setMinWidth(40.0D);
this.showAttributeCB.setOnAction(new EventHandler<>() { this.showAttributeCB.setOnAction(new EventHandler<>() {
public void handle(ActionEvent event) { public void handle(ActionEvent event) {
if (B3.this.showAttributeCB.isSelected()) { if (B3.this.showAttributeCB.isSelected()) {
@ -707,6 +708,8 @@ public class B3
this.generateRelationalModelCB = new CheckBox("Generate Relational Model"); this.generateRelationalModelCB = new CheckBox("Generate Relational Model");
this.generateRelationalModelCB.setTooltip(new Tooltip("To check the relational model open the area right to the working area")); this.generateRelationalModelCB.setTooltip(new Tooltip("To check the relational model open the area right to the working area"));
this.generateRelationalModelCB.setSelected(false); this.generateRelationalModelCB.setSelected(false);
generateRelationalModelCB.setStyle("-fx-text-fill: #ffffff;");
setMouseHandler(this.generateRelationalModelCB); setMouseHandler(this.generateRelationalModelCB);
this.generateRelationalModelCB.setOnAction(arg0 -> { this.generateRelationalModelCB.setOnAction(arg0 -> {
if (B3.this.generateRelationalModelCB.isSelected()) { if (B3.this.generateRelationalModelCB.isSelected()) {
@ -746,7 +749,7 @@ public class B3
setMouseHandler(this.generateInsertsCB); setMouseHandler(this.generateInsertsCB);
this.generateInsertsCB.setFont(Font.font(null, FontWeight.NORMAL, 11.0D)); this.generateInsertsCB.setFont(Font.font(null, FontWeight.NORMAL, 11.0D));
this.generateInsertsCB.setSelected(false); this.generateInsertsCB.setSelected(false);
this.singleInsertStatementCB = new CheckBox("-> as single insert statement"); this.singleInsertStatementCB = new CheckBox("-> as multiple insert statements");
this.singleInsertStatementCB.setTooltip(new Tooltip("If selected, all inserts are seperated statements")); this.singleInsertStatementCB.setTooltip(new Tooltip("If selected, all inserts are seperated statements"));
setMouseHandler(this.singleInsertStatementCB); setMouseHandler(this.singleInsertStatementCB);
this.singleInsertStatementCB.setFont(Font.font(null, FontWeight.NORMAL, 11.0D)); this.singleInsertStatementCB.setFont(Font.font(null, FontWeight.NORMAL, 11.0D));

View File

@ -1,5 +1,4 @@
package at.fos.ermodel.gui; package at.fos.ermodel.gui;
/* */
import javafx.scene.Node; import javafx.scene.Node;
import javafx.scene.effect.ColorAdjust; import javafx.scene.effect.ColorAdjust;
@ -44,7 +43,7 @@ public class T3 {
"Random Street"}; "Random Street"};
public static Object copyObject(Object objSource) { public static Object copyObject(Graphic_Main_Elem objSource) {
Object objDest = null; Object objDest = null;
try { try {
ByteArrayOutputStream bos = new ByteArrayOutputStream(); ByteArrayOutputStream bos = new ByteArrayOutputStream();
@ -110,50 +109,32 @@ public class T3 {
return text; return text;
} }
public static String getRandomDouble(double valuesVon, double valuesBis) {
return String.valueOf(valuesVon + (new Random()).nextDouble(valuesBis - valuesVon) + 1);
}
public static String getRandomInteger(int valuesVon, int valuesBis) { public static String getRandomInteger(int valuesVon, int valuesBis) {
int randomValue = valuesVon + (new Random()).nextInt(valuesBis - valuesVon) + 1; return getRandomDouble(valuesVon, valuesBis);
return String.valueOf(randomValue);
} }
public static String getRandomBoolean() { public static String getRandomBoolean() {
boolean randomValue = (new Random()).nextBoolean(); return getRandomInteger(0,1);
String booleanAsString;
booleanAsString = "0";
if (randomValue) booleanAsString = "1";
return booleanAsString;
} }
public static String getRandomDecimal(int digitsBeforeComma, int digitsAfterComma) { public static String getRandomDecimal(int digitsBeforeComma, int digitsAfterComma) {
StringBuilder digitsAfterCommaAsString = new StringBuilder(); return getRandomDouble(0,Math.pow(10,digitsBeforeComma)-1) + "." + getRandomDouble(0,Math.pow(10,digitsAfterComma)-1);
StringBuilder digitsBeforeCommaAsString = new StringBuilder();
int i;
for (i = 0; i < digitsAfterComma; i++) {
digitsAfterCommaAsString.append("9");
}
int digitsAfterCommaRange = Integer.parseInt((digitsAfterCommaAsString.length() == 0) ? "0" : digitsAfterCommaAsString.toString());
for (i = 0; i < digitsBeforeComma; i++) {
digitsBeforeCommaAsString.append("9");
}
int digitsBeforeCommaRange = Integer.parseInt(digitsBeforeCommaAsString.toString());
return (new Random()).nextInt(digitsBeforeCommaRange + 1) + "." + (new Random()).nextInt(digitsAfterCommaRange + 1);
} }
public static String getRandomTextGivenLength(int textLength) { public static String getRandomTextGivenLength(int textLength) {
String str = "abcdefghijklmnopqrstuvwxyz"; String str = "abcdefghijklmnopqrstuvwxyz";
StringBuilder randomText = new StringBuilder(); StringBuilder randomText = new StringBuilder();
ArrayList<Character> charactersAsList = new ArrayList<>();
for (int j = 0; j < textLength; j++) { for (int j = 0; j < textLength; j++) {
charactersAsList.add(str.charAt((new Random()).nextInt(26))); randomText.append(str.charAt((new Random()).nextInt(26)));
}
for (int k = 0; k < charactersAsList.size(); ) {
randomText.append(charactersAsList.get(k));
k++;
} }
return randomText.toString(); return randomText.toString();
} }