Commit f175602e authored by Valérie Maquil's avatar Valérie Maquil

reverting some of the modifications done on valuewidget, and the

numerical variables. InformationProvider is again of type String.
parent 3346424c
......@@ -166,11 +166,6 @@ public class NumericalVariable extends Variable {
}
}
/** {@inheritDoc} */
@Override
public Object getValue() {
return this.value;
}
/**
*
......@@ -227,6 +222,12 @@ public class NumericalVariable extends Variable {
return this.scale;
}
/** {@inheritDoc} */
@Override
public Double getValue() {
return value;
}
/**
*
* @param decimals
......
......@@ -41,7 +41,7 @@ import org.jdom2.Element;
* @version 1.3.0
*/
@NonNullByDefault
public class TangibleNumericalVariable extends NumericalVariable implements ContextEventListener, InformationProvider<Double> {
public class TangibleNumericalVariable extends NumericalVariable implements ContextEventListener, InformationProvider<String> {
/**
* Constructor resorting to the super constructor to initialise the name and unit and locally
* initialising the numerical value.
......@@ -80,7 +80,7 @@ public class TangibleNumericalVariable extends NumericalVariable implements Cont
/** This method is not supported and will always return the general, position-agnostic value. */
@Override
public Double getInformation(@Nullable Point position) {
public String getInformation(@Nullable Point position) {
return this.getInformation();
}
......@@ -91,7 +91,8 @@ public class TangibleNumericalVariable extends NumericalVariable implements Cont
* This method returns the value.
*/
@Override
public Double getInformation() {
return Double.valueOf(this.value);
public String getInformation() {
// return String.valueOf(this.value);
return toString();
}
}
\ No newline at end of file
......@@ -91,11 +91,11 @@ public final class ValueWidget extends BaseWidget implements InformationProvider
* value widgets
*/
if (!modifyValueOnRotation) {
this.baseValue = getVariable().getInformation();
this.baseValue = getVariable().getValue();
getVariable().setValue(0d);
} else {
// this.baseValue = Double.NaN;
this.baseValue = getVariable().getInformation();
this.baseValue = getVariable().getValue();
}
dialAngle = lowerStopAngle;
......@@ -181,7 +181,7 @@ public final class ValueWidget extends BaseWidget implements InformationProvider
/** {@inheritDoc} */
@Override
public String getInformation() {
return variable.toString();
return variable.getInformation().toString();
}
/**
......@@ -222,13 +222,15 @@ public final class ValueWidget extends BaseWidget implements InformationProvider
String typeName = ((ParameterizedType) type).getActualTypeArguments()[0].getTypeName();
if (typeName.equals(String.class.getTypeName())) {
((InformationReceiver<String>) corona).setInformation(variable.getInformation().toString());
((InformationReceiver<String>) corona).setInformation(variable.getInformation());
continue;
}
if (typeName.equals(Double.class.getTypeName())) {
((InformationReceiver<Double>) corona).setInformation(variable.getInformation());
((InformationReceiver<Double>) corona).setInformation(variable.getValue());
continue;
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment