diff --git a/README.md b/README.md
index 7fce947..a0da376 100644
--- a/README.md
+++ b/README.md
@@ -6,6 +6,6 @@ A library to create graphical menus for java projects.
io.github.Fi0xJavaGUIMenu
- 1.1.0
+ 1.1.3
```
diff --git a/pom.xml b/pom.xml
index 2db0b2a..68a942a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
io.github.Fi0xJavaGUIMenu
- 1.1.2
+ 1.1.3Java GUI MenuThis is a library to quickly create a menu in javahttp://github.com/Fi0x/JavaGUIMenu
@@ -49,7 +49,7 @@
org.apache.maven.pluginsmaven-compiler-plugin
- 3.11.0
+ 3.12.11919
@@ -82,7 +82,7 @@
org.apache.maven.pluginsmaven-javadoc-plugin
- 3.6.2
+ 3.6.3attach-javadocs
@@ -113,7 +113,7 @@
io.github.Fi0xJavaLogger
- 1.3.1
+ 1.3.3org.openjfx
diff --git a/src/main/java/io/fi0x/javaguimenu/GUIWindow.java b/src/main/java/io/fi0x/javaguimenu/GUIWindow.java
index 44e0de2..e71bc35 100644
--- a/src/main/java/io/fi0x/javaguimenu/GUIWindow.java
+++ b/src/main/java/io/fi0x/javaguimenu/GUIWindow.java
@@ -34,6 +34,13 @@ public class GUIWindow extends Application
private static int rows = 1;
private static boolean gridLaneVisibility = false;
+ /**
+ * Default constructor of this class.
+ */
+ public GUIWindow()
+ {
+ }
+
@Override
public void start(Stage primaryStage)
{
@@ -164,7 +171,6 @@ public static void addElement(AbstractElement node)
break;
}
}
- Logger.log("Added new element to window", Logger.TEMPLATE.VERBOSE);
}
/**
* This method changes the behaviour of the element placement inside the layout.
diff --git a/src/main/java/io/fi0x/javaguimenu/controller/MainController.java b/src/main/java/io/fi0x/javaguimenu/controller/MainController.java
index 4391773..d68e961 100644
--- a/src/main/java/io/fi0x/javaguimenu/controller/MainController.java
+++ b/src/main/java/io/fi0x/javaguimenu/controller/MainController.java
@@ -1,65 +1,76 @@
package io.fi0x.javaguimenu.controller;
import io.fi0x.javaguimenu.layouts.*;
-import io.fi0x.javalogger.logging.Logger;
+import io.fi0x.javalogger.logging.LOG;
import javafx.fxml.FXML;
import javafx.scene.layout.AnchorPane;
import java.util.Map;
+/**
+ * This class controls the GUI.
+ */
public class MainController
{
+ /**
+ * This pane is the anchor-pane of the GUI where all other elements get added.
+ */
@FXML
public AnchorPane apMain;
+ /**
+ * Default constructor of this class.
+ */
+ public MainController()
+ {
+ }
+
@FXML
private void initialize()
{
}
+ /**
+ * This method lets the user add individual options for the layout.
+ *
+ * @param settings The settings that should be integrated into the layout.
+ */
public void setUserOptions(Map settings)
{
LayoutTypes layout = (LayoutTypes) settings.get("layout");
if(layout == null)
{
- Logger.log("No layout type found", Logger.TEMPLATE.WARNING);
+ LOG.WARN("No layout type found", "JavaGUIMenu", 611);
return;
}
settings.remove("layout");
setLayout(layout, settings);
-
- Logger.log("Main controller initialized", Logger.TEMPLATE.VERBOSE);
}
private void setLayout(LayoutTypes type, Map settings)
{
switch(type)
{
- case Grid:
- Logger.log("Using Grid layout", Logger.TEMPLATE.VERBOSE);
- apMain.getChildren().add(new GridLayout(settings));
- break;
- case VBox:
- Logger.log("Using VBox layout", Logger.TEMPLATE.VERBOSE);
+ case Grid -> apMain.getChildren().add(new GridLayout(settings));
+ case VBox ->
+ {
settings.remove("columns");
apMain.getChildren().add(new VBoxLayout(settings));
- break;
- case HBox:
- Logger.log("Using HBox layout", Logger.TEMPLATE.VERBOSE);
+ }
+ case HBox ->
+ {
settings.remove("rows");
apMain.getChildren().add(new HBoxLayout(settings));
- break;
- case Absolute:
- Logger.log("Using Absolute layout", Logger.TEMPLATE.VERBOSE);
+ }
+ case Absolute ->
+ {
settings.remove("elementSpacing");
settings.remove("rows");
settings.remove("columns");
apMain.getChildren().add(new AbsoluteLayout(settings));
- break;
- default:
- Logger.log("The selected layout is not valid", Logger.TEMPLATE.WARNING);
- break;
+ }
+ default -> LOG.WARN("The selected layout is not valid", "JavaGUIMenu", 611);
}
}
}
diff --git a/src/main/java/io/fi0x/javaguimenu/elements/AbstractElement.java b/src/main/java/io/fi0x/javaguimenu/elements/AbstractElement.java
index e13fc80..7e47de1 100644
--- a/src/main/java/io/fi0x/javaguimenu/elements/AbstractElement.java
+++ b/src/main/java/io/fi0x/javaguimenu/elements/AbstractElement.java
@@ -7,18 +7,49 @@
*/
public abstract class AbstractElement
{
+ /**
+ * The index of the column this element should be in.
+ */
protected int colIdx = -1;
+ /**
+ * The index of the row this element should be in.
+ */
protected int rowIdx = -1;
+ /**
+ * The amount of cells in a column this element should occupy.
+ */
protected int colSpan = 1;
+ /**
+ * The amount of cells in a row this element should occupy.
+ */
protected int rowSpan = 1;
+ /**
+ * The x-position of this element in an absolute layout.
+ */
protected double xPos;
+ /**
+ * The y-position of this element in an absolute layout.
+ */
protected double yPos;
+ /**
+ * Default constructor of this class.
+ */
+ public AbstractElement()
+ {
+ }
+
+ /**
+ * This method returns the node that this element represents.
+ *
+ * @return The Node.
+ */
public abstract Node getNodeVersion();
/**
* Sets the index for the column that should be used. Index starts at 0.
* Should only be changed when using grid-layouts.
+ *
* @param columnIndex The index that should be used for this element.
* Must not be greater or equal to the column count.
*/
@@ -26,6 +57,11 @@ public void setColIdx(int columnIndex)
{
colIdx = columnIndex;
}
+ /**
+ * This method returns the index of the column this element is in.
+ *
+ * @return The index.
+ */
public int getColIdx()
{
return colIdx;
@@ -33,6 +69,7 @@ public int getColIdx()
/**
* Sets the index for the row that should be used. Index starts at 0.
* Should only be changed when using grid-layouts.
+ *
* @param rowIndex The index that should be used for this element.
* Must not be greater or equal to the row count.
*/
@@ -40,54 +77,83 @@ public void setRowIdx(int rowIndex)
{
rowIdx = rowIndex;
}
+ /**
+ * This method returns the index of the row this element is in.
+ *
+ * @return The index.
+ */
public int getRowIdx()
{
return rowIdx;
}
/**
* Determines how many columns this element should occupy. Default is 1.
+ *
* @param columnSpan The amount of columns this element should be in.
*/
public void setColSpan(int columnSpan)
{
colSpan = columnSpan;
}
+ /**
+ * This method returns the amount of cells this element spans in its column.
+ *
+ * @return The column span.
+ */
public int getColSpan()
{
return colSpan;
}
/**
* Determines how many rows this element should occupy. Default is 1.
+ *
* @param rowSpan The amount of rows this element should be in.
*/
public void setRowSpan(int rowSpan)
{
this.rowSpan = rowSpan;
}
+ /**
+ * This method returns the amount of cells this element spans in its row.
+ *
+ * @return The row span.
+ */
public int getRowSpan()
{
return rowSpan;
}
/**
* Sets the x-offset for this element from its default position.
+ *
* @param xPosition The offset from the default position.
*/
public void setXPos(double xPosition)
{
xPos = xPosition;
}
+ /**
+ * This method returns the position of this element in an absolute layout.
+ *
+ * @return The x-position.
+ */
public double getXPos()
{
return xPos;
}
/**
* Sets the y-offset for this element from its default position.
+ *
* @param yPosition The offset from the default position.
*/
public void setYPos(double yPosition)
{
yPos = yPosition;
}
+ /**
+ * This method returns the position of this element in an absolute layout.
+ *
+ * @return The y-position.
+ */
public double getYPos()
{
return yPos;
diff --git a/src/main/java/io/fi0x/javaguimenu/elements/Listener.java b/src/main/java/io/fi0x/javaguimenu/elements/Listener.java
index f041caf..b7d6635 100644
--- a/src/main/java/io/fi0x/javaguimenu/elements/Listener.java
+++ b/src/main/java/io/fi0x/javaguimenu/elements/Listener.java
@@ -1,6 +1,14 @@
package io.fi0x.javaguimenu.elements;
+/**
+ * This interface allows a class to listen for trigger events.
+ */
public interface Listener
{
+ /**
+ * This method gets triggered, when the sender-element is triggered.
+ *
+ * @param sender The element that got triggered.
+ */
void trigger(AbstractElement sender);
}
diff --git a/src/main/java/io/fi0x/javaguimenu/elements/PriorityButton.java b/src/main/java/io/fi0x/javaguimenu/elements/PriorityButton.java
index 3f48253..d5ac887 100644
--- a/src/main/java/io/fi0x/javaguimenu/elements/PriorityButton.java
+++ b/src/main/java/io/fi0x/javaguimenu/elements/PriorityButton.java
@@ -8,6 +8,19 @@
*/
public class PriorityButton extends RegularButton
{
+ /**
+ * Default constructor of this class.
+ */
+ public PriorityButton()
+ {
+ super();
+ }
+
+ /**
+ * This method returns the node that this element represents.
+ *
+ * @return The Node.
+ */
@Override
public Node getNodeVersion()
{
diff --git a/src/main/java/io/fi0x/javaguimenu/elements/RegularButton.java b/src/main/java/io/fi0x/javaguimenu/elements/RegularButton.java
index b278f02..5974f76 100644
--- a/src/main/java/io/fi0x/javaguimenu/elements/RegularButton.java
+++ b/src/main/java/io/fi0x/javaguimenu/elements/RegularButton.java
@@ -1,9 +1,7 @@
package io.fi0x.javaguimenu.elements;
-import io.fi0x.javalogger.logging.Logger;
import javafx.scene.Node;
import javafx.scene.control.Button;
-import javafx.scene.text.TextAlignment;
import java.util.ArrayList;
@@ -12,13 +10,27 @@
*/
public class RegularButton extends AbstractElement
{
+ /**
+ * The text that should be displayed on the button.
+ */
protected String buttonText;
+ /**
+ * The listeners that will react to this button press.
+ */
protected final ArrayList listeners = new ArrayList<>();
+ /**
+ * Default constructor of this class.
+ */
+ public RegularButton()
+ {
+ }
+
/**
* Get an object of this UI element to place later.
+ *
* @param columnIndex The index of the column this button should be in.
- * @param rowIndex The index of the row this button should be in.
+ * @param rowIndex The index of the row this button should be in.
* @return The new object with the desired settings.
*/
public static RegularButton create(int columnIndex, int rowIndex)
@@ -27,6 +39,7 @@ public static RegularButton create(int columnIndex, int rowIndex)
}
/**
* Get an object of this UI element to place later.
+ *
* @param xPosition The x-offset of this element from its default position.
* @param yPosition The y-offset of this element from its default position.
* @return The new object with the desired settings.
@@ -37,10 +50,11 @@ public static RegularButton create(double xPosition, double yPosition)
}
/**
* Get an object of this UI element to place later.
+ *
* @param columnIndex The index of the column this button should be in.
- * @param rowIndex The index of the row this button should be in.
- * @param xPosition The x-offset of this element from its default position.
- * @param yPosition The y-offset of this element from its default position.
+ * @param rowIndex The index of the row this button should be in.
+ * @param xPosition The x-offset of this element from its default position.
+ * @param yPosition The y-offset of this element from its default position.
* @return The new object with the desired settings.
*/
public static RegularButton create(int columnIndex, int rowIndex, double xPosition, double yPosition)
@@ -49,10 +63,11 @@ public static RegularButton create(int columnIndex, int rowIndex, double xPositi
}
/**
* Get an object of this UI element to place later.
+ *
* @param columnIndex The index of the column this button should be in.
- * @param rowIndex The index of the row this button should be in.
- * @param columnSpan How many columns this element should fill.
- * @param rowSpan How many rows this element should fill.
+ * @param rowIndex The index of the row this button should be in.
+ * @param columnSpan How many columns this element should fill.
+ * @param rowSpan How many rows this element should fill.
* @return The new object with the desired settings.
*/
public static RegularButton create(int columnIndex, int rowIndex, int columnSpan, int rowSpan)
@@ -61,12 +76,13 @@ public static RegularButton create(int columnIndex, int rowIndex, int columnSpan
}
/**
* Get an object of this UI element to place later.
+ *
* @param columnIndex The index of the column this button should be in.
- * @param rowIndex The index of the row this button should be in.
- * @param columnSpan How many columns this element should fill.
- * @param rowSpan How many rows this element should fill.
- * @param xPosition The x-offset of this element from its default position.
- * @param yPosition The y-offset of this element from its default position.
+ * @param rowIndex The index of the row this button should be in.
+ * @param columnSpan How many columns this element should fill.
+ * @param rowSpan How many rows this element should fill.
+ * @param xPosition The x-offset of this element from its default position.
+ * @param yPosition The y-offset of this element from its default position.
* @return The new object with the desired settings.
*/
public static RegularButton create(int columnIndex, int rowIndex, int columnSpan, int rowSpan, double xPosition, double yPosition)
@@ -79,13 +95,12 @@ public static RegularButton create(int columnIndex, int rowIndex, int columnSpan
btn.setXPos(xPosition);
btn.setYPos(yPosition);
- Logger.log("New button created", Logger.TEMPLATE.VERBOSE);
-
return btn;
}
/**
* This method adds a listener to the button.
+ *
* @param listener The listener that should be added.
*/
public void addListener(Listener listener)
@@ -93,6 +108,11 @@ public void addListener(Listener listener)
listeners.add(listener);
}
+ /**
+ * This method returns the node that this element represents.
+ *
+ * @return The Node.
+ */
@Override
public Node getNodeVersion()
{
@@ -112,6 +132,7 @@ public Node getNodeVersion()
/**
* Set the text this button should display.
+ *
* @param text The text to display.
*/
public void setText(String text)
diff --git a/src/main/java/io/fi0x/javaguimenu/layouts/AbsoluteLayout.java b/src/main/java/io/fi0x/javaguimenu/layouts/AbsoluteLayout.java
index 2dcc980..b419b66 100644
--- a/src/main/java/io/fi0x/javaguimenu/layouts/AbsoluteLayout.java
+++ b/src/main/java/io/fi0x/javaguimenu/layouts/AbsoluteLayout.java
@@ -1,7 +1,7 @@
package io.fi0x.javaguimenu.layouts;
import io.fi0x.javaguimenu.elements.AbstractElement;
-import io.fi0x.javalogger.logging.Logger;
+import io.fi0x.javalogger.logging.LOG;
import javafx.scene.Node;
import javafx.scene.layout.*;
@@ -17,6 +17,11 @@ public class AbsoluteLayout extends Pane
{
private ArrayList elements;
+ /**
+ * The main constructor of this method.
+ *
+ * @param userSettings The user-settings that should be used for this layout.
+ */
public AbsoluteLayout(Map userSettings)
{
AnchorPane.setTopAnchor(this, 0d);
@@ -29,16 +34,12 @@ public AbsoluteLayout(Map userSettings)
private void setUserOptions(Map settings)
{
- Logger.log("Absolute layout setup started", Logger.TEMPLATE.VERBOSE);
for(Map.Entry entry : settings.entrySet())
{
if("elements".equals(entry.getKey()))
- {
elements = (ArrayList) entry.getValue();
- Logger.log("Loaded " + elements.size() + " elements from settings-map", Logger.TEMPLATE.VERBOSE);
- }
else
- Logger.log("Invalid user-settings-entry in grid layout detected", Logger.TEMPLATE.INFO);
+ LOG.WARN("Invalid user-settings-entry in absolute layout detected", "JavaGUIMenu", 610);
}
addAllElements();
}
@@ -52,6 +53,5 @@ private void addAllElements()
n.setTranslateY(e.getYPos());
this.getChildren().add(n);
}
- Logger.log("Added " + elements.size() + " elements to layout", Logger.TEMPLATE.VERBOSE);
}
}
diff --git a/src/main/java/io/fi0x/javaguimenu/layouts/GridLayout.java b/src/main/java/io/fi0x/javaguimenu/layouts/GridLayout.java
index 417b6c8..db9de46 100644
--- a/src/main/java/io/fi0x/javaguimenu/layouts/GridLayout.java
+++ b/src/main/java/io/fi0x/javaguimenu/layouts/GridLayout.java
@@ -1,7 +1,7 @@
package io.fi0x.javaguimenu.layouts;
import io.fi0x.javaguimenu.elements.AbstractElement;
-import io.fi0x.javalogger.logging.Logger;
+import io.fi0x.javalogger.logging.LOG;
import javafx.geometry.HPos;
import javafx.geometry.VPos;
import javafx.scene.layout.*;
@@ -25,6 +25,11 @@ public class GridLayout extends GridPane
private int rowCount = 1;
private boolean gridLaneVisibility = false;
+ /**
+ * Main constructor of this class.
+ *
+ * @param userSettings The user-settings that should be used for this layout.
+ */
public GridLayout(Map userSettings)
{
AnchorPane.setTopAnchor(this, 0d);
@@ -39,29 +44,16 @@ public GridLayout(Map userSettings)
private void setUserOptions(Map settings)
{
- Logger.log("Grid layout setup started", Logger.TEMPLATE.VERBOSE);
for(Map.Entry entry : settings.entrySet())
{
switch(entry.getKey())
{
- case "elementSpacing":
- spaceElementsEvenly = (boolean) entry.getValue();
- break;
- case "elements":
- elements = (ArrayList) entry.getValue();
- Logger.log("Loaded " + elements.size() + " elements from settings-map", Logger.TEMPLATE.VERBOSE);
- break;
- case "columns":
- colCount = (int) entry.getValue();
- break;
- case "rows":
- rowCount = (int) entry.getValue();
- break;
- case "gridLanes":
- gridLaneVisibility = (boolean) entry.getValue();
- break;
- default:
- Logger.log("Invalid user-settings-entry in grid layout detected", Logger.TEMPLATE.INFO);
+ case "elementSpacing" -> spaceElementsEvenly = (boolean) entry.getValue();
+ case "elements" -> elements = (ArrayList) entry.getValue();
+ case "columns" -> colCount = (int) entry.getValue();
+ case "rows" -> rowCount = (int) entry.getValue();
+ case "gridLanes" -> gridLaneVisibility = (boolean) entry.getValue();
+ default -> LOG.WARN("Invalid user-settings-entry in grid layout detected", "JavaGUIMenu", 610);
}
}
setConstraints();
@@ -75,7 +67,6 @@ private void addAllElements()
refineElementValues(e);
this.add(e.getNodeVersion(), e.getColIdx(), e.getRowIdx(), e.getColSpan(), e.getRowSpan());
}
- Logger.log("Added " + elements.size() + " elements to layout", Logger.TEMPLATE.VERBOSE);
}
private void refineElementValues(AbstractElement element)
{
@@ -93,8 +84,7 @@ private void refineElementValues(AbstractElement element)
element.setRowIdx(nextRowIdx);
nextColIdx++;
- }
- else
+ } else
{
if(element.getColIdx() < 0)
element.setColIdx(0);
diff --git a/src/main/java/io/fi0x/javaguimenu/layouts/HBoxLayout.java b/src/main/java/io/fi0x/javaguimenu/layouts/HBoxLayout.java
index 1b19449..c815edf 100644
--- a/src/main/java/io/fi0x/javaguimenu/layouts/HBoxLayout.java
+++ b/src/main/java/io/fi0x/javaguimenu/layouts/HBoxLayout.java
@@ -1,7 +1,7 @@
package io.fi0x.javaguimenu.layouts;
import io.fi0x.javaguimenu.elements.AbstractElement;
-import io.fi0x.javalogger.logging.Logger;
+import io.fi0x.javalogger.logging.LOG;
import javafx.scene.layout.*;
import java.util.ArrayList;
@@ -19,6 +19,12 @@ public class HBoxLayout extends HBox
private int nextColIdx = 0;
private int colCount = 1;
+
+ /**
+ * The main constructor of this method.
+ *
+ * @param userSettings The user-settings that should be used for this h-box.
+ */
public HBoxLayout(Map userSettings)
{
AnchorPane.setTopAnchor(this, 0d);
@@ -31,23 +37,14 @@ public HBoxLayout(Map userSettings)
private void setUserOptions(Map settings)
{
- Logger.log("HBox layout setup started", Logger.TEMPLATE.VERBOSE);
for(Map.Entry entry : settings.entrySet())
{
switch(entry.getKey())
{
- case "elementSpacing":
- spaceElementsEvenly = (boolean) entry.getValue();
- break;
- case "elements":
- elements = (ArrayList) entry.getValue();
- Logger.log("Loaded " + elements.size() + " elements from settings-map", Logger.TEMPLATE.VERBOSE);
- break;
- case "columns":
- colCount = (int) entry.getValue();
- break;
- default:
- Logger.log("Invalid user-settings-entry in grid layout detected", Logger.TEMPLATE.INFO);
+ case "elementSpacing" -> spaceElementsEvenly = (boolean) entry.getValue();
+ case "elements" -> elements = (ArrayList) entry.getValue();
+ case "columns" -> colCount = (int) entry.getValue();
+ default -> LOG.WARN("Invalid user-settings-entry in h-box layout detected", "JavaGUIMenu", 610);
}
}
addAllElements();
@@ -60,7 +57,6 @@ private void addAllElements()
refineElementValues(e);
this.getChildren().add(e.getColIdx(), e.getNodeVersion());
}
- Logger.log("Added " + elements.size() + " elements to layout", Logger.TEMPLATE.VERBOSE);
}
private void refineElementValues(AbstractElement element)
{
diff --git a/src/main/java/io/fi0x/javaguimenu/layouts/LayoutTypes.java b/src/main/java/io/fi0x/javaguimenu/layouts/LayoutTypes.java
index 61e80eb..21b6d55 100644
--- a/src/main/java/io/fi0x/javaguimenu/layouts/LayoutTypes.java
+++ b/src/main/java/io/fi0x/javaguimenu/layouts/LayoutTypes.java
@@ -6,8 +6,20 @@
*/
public enum LayoutTypes
{
+ /**
+ * A layout that looks like a table.
+ */
Grid,
+ /**
+ * A layout that looks like a column.
+ */
VBox,
+ /**
+ * A layout that looks like a row.
+ */
HBox,
+ /**
+ * An absolute layout where each element can be positioned by coordinates.
+ */
Absolute
}
diff --git a/src/main/java/io/fi0x/javaguimenu/layouts/VBoxLayout.java b/src/main/java/io/fi0x/javaguimenu/layouts/VBoxLayout.java
index 568685c..7033c31 100644
--- a/src/main/java/io/fi0x/javaguimenu/layouts/VBoxLayout.java
+++ b/src/main/java/io/fi0x/javaguimenu/layouts/VBoxLayout.java
@@ -1,7 +1,7 @@
package io.fi0x.javaguimenu.layouts;
import io.fi0x.javaguimenu.elements.AbstractElement;
-import io.fi0x.javalogger.logging.Logger;
+import io.fi0x.javalogger.logging.LOG;
import javafx.scene.layout.*;
import java.util.ArrayList;
@@ -19,6 +19,11 @@ public class VBoxLayout extends VBox
private int nextRowIdx = 0;
private int rowCount = 1;
+ /**
+ * The main constructor of this method.
+ *
+ * @param userSettings The user-settings that should be used for this V-Box.
+ */
public VBoxLayout(Map userSettings)
{
AnchorPane.setTopAnchor(this, 0d);
@@ -31,23 +36,14 @@ public VBoxLayout(Map userSettings)
private void setUserOptions(Map settings)
{
- Logger.log("VBox layout setup started", Logger.TEMPLATE.VERBOSE);
for(Map.Entry entry : settings.entrySet())
{
switch(entry.getKey())
{
- case "elementSpacing":
- spaceElementsEvenly = (boolean) entry.getValue();
- break;
- case "elements":
- elements = (ArrayList) entry.getValue();
- Logger.log("Loaded " + elements.size() + " elements from settings-map", Logger.TEMPLATE.VERBOSE);
- break;
- case "rows":
- rowCount = (int) entry.getValue();
- break;
- default:
- Logger.log("Invalid user-settings-entry in grid layout detected", Logger.TEMPLATE.INFO);
+ case "elementSpacing" -> spaceElementsEvenly = (boolean) entry.getValue();
+ case "elements" -> elements = (ArrayList) entry.getValue();
+ case "rows" -> rowCount = (int) entry.getValue();
+ default -> LOG.WARN("Invalid user-settings-entry in v-box layout detected", "JavaGUIMenu", 610);
}
}
addAllElements();
@@ -60,7 +56,6 @@ private void addAllElements()
refineElementValues(e);
this.getChildren().add(e.getRowIdx(), e.getNodeVersion());
}
- Logger.log("Added " + elements.size() + " elements to layout", Logger.TEMPLATE.VERBOSE);
}
private void refineElementValues(AbstractElement element)
{
@@ -71,8 +66,7 @@ private void refineElementValues(AbstractElement element)
element.setRowIdx(nextRowIdx);
nextRowIdx++;
- }
- else
+ } else
{
if(element.getRowIdx() < 0)
element.setRowIdx(0);