aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/backend/parameters
diff options
context:
space:
mode:
authorEduardo Pedroni <ep625@york.ac.uk>2014-04-01 23:00:53 +0100
committerEduardo Pedroni <ep625@york.ac.uk>2014-04-01 23:00:53 +0100
commit02fd2bc7059da416937beb1abe67e5ca60379030 (patch)
tree609341fe10aaa0f2dc45a1e72eba20bd24fb1281 /src/jcgp/backend/parameters
parenta757deacded0d7357a9f68462d3f2051e16004ee (diff)
Settings pane now actually controls the parameters, not much left to do.
Diffstat (limited to 'src/jcgp/backend/parameters')
-rw-r--r--src/jcgp/backend/parameters/BooleanParameter.java32
-rw-r--r--src/jcgp/backend/parameters/DoubleParameter.java33
-rw-r--r--src/jcgp/backend/parameters/IntegerParameter.java33
-rw-r--r--src/jcgp/backend/parameters/Parameter.java35
4 files changed, 133 insertions, 0 deletions
diff --git a/src/jcgp/backend/parameters/BooleanParameter.java b/src/jcgp/backend/parameters/BooleanParameter.java
new file mode 100644
index 0000000..d5904cd
--- /dev/null
+++ b/src/jcgp/backend/parameters/BooleanParameter.java
@@ -0,0 +1,32 @@
+package jcgp.backend.parameters;
+
+import javafx.beans.property.SimpleBooleanProperty;
+
+public class BooleanParameter extends Parameter {
+
+ private SimpleBooleanProperty value;
+
+ public BooleanParameter(boolean value, String name, boolean monitor, boolean hidden, boolean critical) {
+ super(name, monitor, hidden, critical);
+ this.value = new SimpleBooleanProperty(value);
+ }
+
+ public BooleanParameter(boolean value, String name) {
+ super(name, false, false, true);
+ this.value = new SimpleBooleanProperty(value);
+ }
+
+ public boolean get() {
+ return value.get();
+ }
+
+ public void set(boolean newValue) {
+ if (!value.isBound()) {
+ value.set(newValue);
+ }
+ }
+
+ public SimpleBooleanProperty valueProperty() {
+ return value;
+ }
+}
diff --git a/src/jcgp/backend/parameters/DoubleParameter.java b/src/jcgp/backend/parameters/DoubleParameter.java
new file mode 100644
index 0000000..26031be
--- /dev/null
+++ b/src/jcgp/backend/parameters/DoubleParameter.java
@@ -0,0 +1,33 @@
+package jcgp.backend.parameters;
+
+import javafx.beans.property.SimpleDoubleProperty;
+
+public class DoubleParameter extends Parameter {
+
+ protected SimpleDoubleProperty value;
+
+ public DoubleParameter(double value, String name, boolean monitor, boolean hidden, boolean critical) {
+ super(name, monitor, hidden, critical);
+ this.value = new SimpleDoubleProperty(value);
+ }
+
+ public DoubleParameter(double value, String name) {
+ super(name, false, false, true);
+ this.value = new SimpleDoubleProperty(value);
+ }
+
+ public double get() {
+ return value.get();
+ }
+
+ public void set(double newValue) {
+ if (!value.isBound()) {
+ value.set(newValue);
+ }
+ }
+
+ public SimpleDoubleProperty valueProperty() {
+ return value;
+ }
+
+}
diff --git a/src/jcgp/backend/parameters/IntegerParameter.java b/src/jcgp/backend/parameters/IntegerParameter.java
new file mode 100644
index 0000000..dbfa5c5
--- /dev/null
+++ b/src/jcgp/backend/parameters/IntegerParameter.java
@@ -0,0 +1,33 @@
+package jcgp.backend.parameters;
+
+import javafx.beans.property.SimpleIntegerProperty;
+
+public class IntegerParameter extends Parameter {
+
+ protected SimpleIntegerProperty value;
+
+ public IntegerParameter(int value, String name, boolean monitor, boolean hidden, boolean critical) {
+ super(name, monitor, hidden, critical);
+ this.value = new SimpleIntegerProperty(value);
+ }
+
+ public IntegerParameter(int value, String name) {
+ super(name, false, false, true);
+ this.value = new SimpleIntegerProperty(value);
+ }
+
+ public int get() {
+ return value.get();
+ }
+
+ public void set(int newValue) {
+ if (!value.isBound()) {
+ value.set(newValue);
+ }
+ }
+
+ public SimpleIntegerProperty valueProperty() {
+ return value;
+ }
+
+}
diff --git a/src/jcgp/backend/parameters/Parameter.java b/src/jcgp/backend/parameters/Parameter.java
new file mode 100644
index 0000000..2f584a4
--- /dev/null
+++ b/src/jcgp/backend/parameters/Parameter.java
@@ -0,0 +1,35 @@
+package jcgp.backend.parameters;
+
+import javafx.beans.property.Property;
+
+public abstract class Parameter {
+
+ protected boolean hidden, monitor, critical;
+
+ protected String name;
+
+ public Parameter(String name, boolean monitor, boolean hidden, boolean critical) {
+ this.name = name;
+ this.hidden = hidden;
+ this.monitor = monitor;
+ this.critical = critical;
+ }
+
+ public boolean isHidden() {
+ return hidden;
+ }
+
+ public boolean isMonitor() {
+ return monitor;
+ }
+
+ public boolean isCritical() {
+ return critical;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public abstract Property<?> valueProperty();
+}