Commit 39819854 authored by Nico Mack's avatar Nico Mack

Added DisplayWidget

parent cb5e1e6b
/**
* Copyright Luxembourg Institute of Science and Technology, 2017. All rights reserved. If you wish
* to use this code for any purpose, please contact the author(s).
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package lu.list.itis.dkd.tui.bootstrapping;
import lu.list.itis.dkd.tui.cps.variable.Variable;
import lu.list.itis.dkd.tui.cps.variable.tangible.TangibleNumericalVariable;
import lu.list.itis.dkd.tui.exception.BuildException;
import lu.list.itis.dkd.tui.utility.ColorFactory;
import lu.list.itis.dkd.tui.utility.Templating;
import lu.list.itis.dkd.tui.widget.BaseWidget;
import lu.list.itis.dkd.tui.widget.DisplayWidget;
import org.jdom2.Element;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.awt.Color;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;
/**
* @author mack
* @since [major].[minor]
* @version [major].[minor].[micro]
*/
// ***************************************************************************
// * Class Definition and Members *
// ***************************************************************************
public class DisplayWidgetBootstrapper implements BootstrapCallback {
private List<Variable<?>> variables;
private Iterator<Variable<?>> variableIterator;
private Variable<?> variable;
private Vector<Color> variableColours;
private Integer index;
// ***************************************************************************
// * Constants *
// ***************************************************************************
private static Logger LOGGER = LoggerFactory.getLogger(DisplayWidgetBootstrapper.class.getName());
// ---------------------------------------------------------------------------
// ***************************************************************************
// * Constructor(s) *
// ***************************************************************************
// ---------------------------------------------------------------------------
public DisplayWidgetBootstrapper(List<Variable<?>> variables) {
this.variables = variables;
this.variableColours = ColorFactory.makeRainbowColours(variables.size());
}
// ---------------------------------------------------------------------------
// ***************************************************************************
// * Class Body *
// ***************************************************************************
// ---------------------------------------------------------------------------
public List<BaseWidget> buildWidgetsFromVariables(Element template, Integer widgetId, BootstrapContext context, BootstrapCallback callback) throws BuildException {
List<BaseWidget> widgets = null;
index = 0;
context.setProperty(Templating.HANDLE_ID_PROPERTY, widgetId);
context.setProperty(Templating.NUMBER_OF_VARIABLES_PROPERTY, variables.size());
variableIterator = variables.iterator();
if (variableIterator.hasNext()) {
this.variable = variableIterator.next();
widgets = TangibleObjectBootstrapper.buildWidgetFromTemplate(template, context, this);
for (BaseWidget widget : widgets) {
if (widget.getClass().isAssignableFrom(DisplayWidget.class)) {
DisplayWidget display = (DisplayWidget) widget;
display.setVariables(this.variables);
for (Variable<?> displayVariable : variables)
displayVariable.addListener(display);
}
}
} else {
LOGGER.warn("Encountered a Widget without any variables. Won't build Widget! ID of offending Widget is {}", widgetId); //$NON-NLS-1$
}
return widgets;
}
// ---------------------------------------------------------------------------
/** {@inheritDoc} */
@Override
public BootstrapContext preInstantiation(Element node, BootstrapContext context) {
context.setProperty(Templating.VARIABLE_NAME_PROPERTY, variable.getName());
context.setProperty(Templating.VARIABLE_UNIT_PROPERTY, variable.getUnit());
if (variable instanceof TangibleNumericalVariable) {
TangibleNumericalVariable tangibleVariable = (TangibleNumericalVariable) variable;
context.setProperty(Templating.VARIABLE_MINVALUE_PROPERTY, tangibleVariable.getMinValue());
context.setProperty(Templating.VARIABLE_MAXVALUE_PROPERTY, tangibleVariable.getMaxValue());
context.setProperty(Templating.VARIABLE_SCALE_PROPERTY, tangibleVariable.getScale());
}
Color colour = variableColours.get(index);
context.setProperty(Templating.VARIABLE_COLOUR_PROPERTY, colour.getRGB());
return context;
}
// ---------------------------------------------------------------------------
/** {@inheritDoc} */
@Override
public BootstrapContext postInstantiation(Element node, BootstrapContext context) {
return context;
}
// ---------------------------------------------------------------------------
/** {@inheritDoc} */
@Override
public BootstrapContext next(BootstrapContext context) {
if (variableIterator.hasNext()) {
this.variable = variableIterator.next();
this.index++;
}
return context;
}
// ---------------------------------------------------------------------------
}
......@@ -27,8 +27,8 @@ import org.jdom2.Element;
* @version [major].[minor].[micro]
*/
public class VariableBootstrapper {
public static Variable buildVariableFromElement(Element variableNode, BootstrapContext context, BootstrapCallback callback) throws BuildException {
Variable variable = null;
public static Variable<?> buildVariableFromElement(Element variableNode, BootstrapContext context, BootstrapCallback callback) throws BuildException {
Variable<?> variable = null;
if (variableNode == null)
return null;
......@@ -56,7 +56,7 @@ public class VariableBootstrapper {
break;
default:
throw new BuildException("Don't know how to build a Variable of type " + type);
throw new BuildException("Don't know how to build a Variable of type " + type); //$NON-NLS-1$
}
return variable;
......
......@@ -315,7 +315,7 @@ public class EquationSystemBuilder {
numericVariable.setMinValue(this.getDoubleValue(attributes.get(Externalization.MINIMUM_ATTRIBUTE)));
if (!Strings.isNullOrEmpty(attributes.get(Externalization.MAXIMUM_ATTRIBUTE)))
numericVariable.setMinValue(this.getDoubleValue(attributes.get(Externalization.MAXIMUM_ATTRIBUTE)));
numericVariable.setMaxValue(this.getDoubleValue(attributes.get(Externalization.MAXIMUM_ATTRIBUTE)));
if (!Strings.isNullOrEmpty(attributes.get(Externalization.EQUATE_ATTRIBUTE)))
numericVariable.setEquate(attributes.get(Externalization.EQUATE_ATTRIBUTE));
......
......@@ -193,9 +193,8 @@ public class SqlExecutor extends Executor {
// ---------------------------------------------------------------------------
private PreparedStatement setStatementParameters(PreparedStatement statement, List<String> placeholders, Map<String, Object> context) throws SQLException {
int index = 1;
for (String placeholder : placeholders) {
int index = 1;
if (context.containsKey(placeholder)) {
Object value = context.get(placeholder);
if (value instanceof Array)
......@@ -385,8 +384,14 @@ public class SqlExecutor extends Executor {
}
} else {
// Column value is a scalar
Object[] values = columnValues.get(0);
variable.setValueFromObject(values[index]);
if (columnValues.size() > 0) {
Object[] values = columnValues.get(0);
variable.setValueFromObject(values[index]);
} else {
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Query returned no results!"); //$NON-NLS-1$
}
}
}
}
if (LOGGER.isTraceEnabled()) {
......
package lu.list.itis.dkd.tui.widget;
import lu.list.itis.dkd.tui.cps.InputChangeListener;
import lu.list.itis.dkd.tui.cps.InputEvent;
import lu.list.itis.dkd.tui.cps.variable.NumericalVariable;
import lu.list.itis.dkd.tui.cps.variable.Variable;
import lu.list.itis.dkd.tui.widget.builder.BaseDisplayWidgetBuilder;
import lu.list.itis.dkd.tui.widget.builder.DisplayWidgetBuilder;
import lu.list.itis.dkd.tui.widget.corona.ValueCorona;
import org.python.google.common.base.Preconditions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
/**
* @author nmack
* @date 20 Jan 2016
*
* <br>
* $Log: DisplayWidget.java,v $
*/
// ***************************************************************************
// * Class Definition and Members *
// ***************************************************************************
public class DisplayWidget extends BaseWidget implements InputChangeListener {
HashMap<String, NumericalVariable> variables;
HashMap<String, ValueCorona> dispatcher;
// ***************************************************************************
// * Constants *
// ***************************************************************************
private static Logger LOGGER = LoggerFactory.getLogger(DisplayWidget.class.getSimpleName());
// ---------------------------------------------------------------------------
// ***************************************************************************
// * Constructor(s) *
// ***************************************************************************
// ---------------------------------------------------------------------------
public DisplayWidget(BaseDisplayWidgetBuilder<DisplayWidgetBuilder> builder) {
super(builder);
if (builder.variables != null) {
this.setVariables(builder.variables);
}
this.dispatcher = new HashMap<String, ValueCorona>();
List<ValueCorona> displays = this.getCoronas(ValueCorona.class);
for (ValueCorona display : displays) {
Variable<?> variable = display.getVariable();
if (variable != null) {
dispatcher.put(variable.getName(), display);
}
}
}
// ---------------------------------------------------------------------------
// ***************************************************************************
// * Primitives *
// ***************************************************************************
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// ***************************************************************************
// * Class Body *
// ***************************************************************************
// ---------------------------------------------------------------------------
public void setVariables(Collection<Variable<?>> newVariables) {
Preconditions.checkArgument(variables == null, "Set of variables can't be null!"); //$NON-NLS-1$
this.variables = new HashMap<String, NumericalVariable>();
for (Variable<?> variable : newVariables) {
this.variables.put(variable.getName(), (NumericalVariable) variable);
}
List<ValueCorona> displays = this.getCoronas(ValueCorona.class);
for (ValueCorona display : displays) {
Variable<?> variable = display.getVariable();
if (variable != null) {
String variableName = variable.getName();
if (this.variables.containsKey(variableName)) {
display.setVariable(this.variables.get(variableName));
} else {
LOGGER.warn("Corona requires variable {} unkown to display widget!", variableName); //$NON-NLS-1$
}
}
}
}
// ---------------------------------------------------------------------------
@Override
public void inputChanged(InputEvent input) {
// Variable<?> variable = input.getSource();
// if (dispatcher.containsKey(variable.getName())) {
// ValueCorona display = dispatcher.get(variable.getName());
// display.setInformation(variable.getValue());
// }
for (String variableName : this.variables.keySet()) {
ValueCorona display = dispatcher.get(variableName);
display.setInformation(this.variables.get(variableName).getValue());
}
}
// ---------------------------------------------------------------------------
// ***************************************************************************
// * End of Class *
// ***************************************************************************
// ---------------------------------------------------------------------------
}
\ No newline at end of file
......@@ -22,6 +22,7 @@ public class SelectorWidget extends ValueWidget {
protected int numberOfPositions;
/** The currently selected position */
protected int currentPosition = NONE;
protected int presetPosition = NONE;
// ***************************************************************************
// * Constants *
......@@ -46,8 +47,10 @@ public class SelectorWidget extends ValueWidget {
public SelectorWidget(SelectorWidgetBuilder<?> builder) {
super(builder);
this.numberOfPositions = this.getNumberOfPositions();
if (builder.preselect != NONE) {
this.selectPosition(builder.preselect);
this.presetPosition = builder.preselect;
if (presetPosition != NONE) {
this.selectPosition(presetPosition);
}
}
......@@ -72,6 +75,13 @@ public class SelectorWidget extends ValueWidget {
// ---------------------------------------------------------------------------
@Override
protected void updateFromRotation(double angle) {
}
// ---------------------------------------------------------------------------
private int getCurrentPosition(float angle) {
double segment = TWO_PI / numberOfPositions;
int current = 0;
......@@ -99,6 +109,7 @@ public class SelectorWidget extends ValueWidget {
if (variable != null) {
variable.setValue((double) position);
this.updateTethers((double) position);
}
currentPosition = position;
}
......@@ -138,7 +149,6 @@ public class SelectorWidget extends ValueWidget {
int widgetId = tuioObject.getObjectId();
this.getCoronas(FadingCorona.class).forEach(corona -> corona.fadeIn());
StateManager manager = states.get(widgetId);
if (manager.isRotating()) {
......@@ -160,8 +170,9 @@ public class SelectorWidget extends ValueWidget {
@Override
public void actionDrop(TangibleObject tuioObject) {
int position = (this.isPersistent(tuioObject.getObjectId())) ? currentPosition : presetPosition;
super.actionDrop(tuioObject);
this.selectPosition(currentPosition);
this.selectPosition(position);
}
// ---------------------------------------------------------------------------
......
......@@ -26,6 +26,7 @@ import lu.list.itis.dkd.tui.adapter.TangibleObject;
import lu.list.itis.dkd.tui.content.InformationProvider;
import lu.list.itis.dkd.tui.content.InformationReceiver;
import lu.list.itis.dkd.tui.cps.utility.Externalization;
import lu.list.itis.dkd.tui.cps.variable.Variable;
import lu.list.itis.dkd.tui.cps.variable.tangible.TangibleNumericalVariable;
import lu.list.itis.dkd.tui.utility.Point;
import lu.list.itis.dkd.tui.widget.builder.BaseValueWidgetBuilder;
......@@ -40,6 +41,7 @@ import java.awt.Graphics2D;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.List;
import java.util.Map;
/**
* A simple widget that holds an integer value and may modify the value base on a rotation.
......@@ -121,7 +123,7 @@ public class ValueWidget extends TetherableWidget implements InformationProvider
}
@SuppressWarnings("unchecked")
private void updateTethers(Double value) {
protected void updateTethers(Double value) {
@SuppressWarnings("rawtypes")
List<DataFeed> dataFeeds = this.getTethers(DataFeed.class);
for (DataFeed<Double> tether : dataFeeds) {
......@@ -226,6 +228,16 @@ public class ValueWidget extends TetherableWidget implements InformationProvider
}
}
public void connectWithInputs(Map<String, Variable<?>> inputs) {
if ((inputs != null) && inputs.containsKey(this.variable.getName())) {
Variable<?> input = inputs.get(this.variable.getName());
if (this.variable.getClass().isAssignableFrom(input.getClass())) {
this.variable = (TangibleNumericalVariable) input;
}
}
}
@SuppressWarnings("unchecked")
@Override
public void paint(Graphics2D canvas) {
......@@ -254,7 +266,7 @@ public class ValueWidget extends TetherableWidget implements InformationProvider
super.paint(canvas);
}
private void updateFromRotation(double angle) {
protected void updateFromRotation(double angle) {
double value;
if (constrainted) {
......
package lu.list.itis.dkd.tui.widget.builder;
import lu.list.itis.dkd.tui.bootstrapping.BootstrapCallback;
import lu.list.itis.dkd.tui.bootstrapping.BootstrapContext;
import lu.list.itis.dkd.tui.cps.variable.Variable;
import lu.list.itis.dkd.tui.exception.BuildException;
import lu.list.itis.dkd.tui.widget.DisplayWidget;
import org.jdom2.Element;
import java.util.Collection;
import java.util.Vector;
/**
* @author nmack
* @date 20 Jan 2016
*
* <br>
* $Log: BaseDisplayWidgetBuilder.java,v $
*/
// ***************************************************************************
// * Class Definition and Members *
// ***************************************************************************
public abstract class BaseDisplayWidgetBuilder<B extends BaseDisplayWidgetBuilder<B>> extends BaseBuilder<B> {
public Collection<Variable<?>> variables;
// ***************************************************************************
// * Constants *
// ***************************************************************************
// ---------------------------------------------------------------------------
// ***************************************************************************
// * Constructor(s) *
// ***************************************************************************
// ---------------------------------------------------------------------------
/**
* Constructor initializing all fields from an {@link Element} containing as child elements all
* the information on fields to initialize.
*
* @param rootElement
* The element harbouring, on child nodes, the necessary information to initialize all
* fields of the builder.
* @throws BuildException
* Thrown when any of the fields fail to populate due to an error in reading information
* from the XML file.
*/
public BaseDisplayWidgetBuilder(Element rootElement, BootstrapContext context, BootstrapCallback callback) throws BuildException {
super(rootElement, context, callback);
}
// ---------------------------------------------------------------------------
// ***************************************************************************
// * Primitives *
// ***************************************************************************
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// ***************************************************************************
// * Class Body *
// ***************************************************************************
// ---------------------------------------------------------------------------
@SuppressWarnings("unchecked")
public B withVariables(Collection<Variable<?>> variables) {
this.variables = new Vector<Variable<?>>();
this.variables.addAll(variables);
return (B) this;
}
// ---------------------------------------------------------------------------
@Override
public abstract DisplayWidget build();
// ---------------------------------------------------------------------------
// ***************************************************************************
// * End of Class *
// ***************************************************************************
// ---------------------------------------------------------------------------
}
\ No newline at end of file
package lu.list.itis.dkd.tui.widget.builder;
import lu.list.itis.dkd.tui.bootstrapping.BootstrapCallback;
import lu.list.itis.dkd.tui.bootstrapping.BootstrapContext;
import lu.list.itis.dkd.tui.exception.BuildException;
import lu.list.itis.dkd.tui.widget.DisplayWidget;
import org.jdom2.Element;
/**
* @author nmack
* @date 20 Jan 2016
*
* <br>
* $Log: DisplayWidgetBuilder.java,v $
*/
// ***************************************************************************
// * Class Definition and Members *
// ***************************************************************************
public class DisplayWidgetBuilder extends BaseDisplayWidgetBuilder<DisplayWidgetBuilder> {
// ***************************************************************************
// * Constants *
// ***************************************************************************
// ---------------------------------------------------------------------------
// ***************************************************************************
// * Constructor(s) *
// ***************************************************************************
// ---------------------------------------------------------------------------
/**
* Constructor initializing all fields from an {@link Element} containing as child elements all
* the information on fields to initialize.
*
* @param rootElement
* The element harbouring, on child nodes, the necessary information to initialize all
* fields of the builder.
* @throws BuildException
* Thrown when any of the fields fail to populate due to an error in reading information
* from the XML file.
*/
public DisplayWidgetBuilder(Element rootElement, BootstrapContext context, BootstrapCallback callback) throws BuildException {
super(rootElement, context, callback);
}
// ---------------------------------------------------------------------------
// ***************************************************************************
// * Primitives *
// ***************************************************************************
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// ***************************************************************************
// * Class Body *
// ***************************************************************************
// ---------------------------------------------------------------------------
@Override
public DisplayWidget build() {
return new DisplayWidget(this);
}
// ---------------------------------------------------------------------------
// ***************************************************************************
// * End of Class *
// ***************************************************************************
// ---------------------------------------------------------------------------
}
\ No newline at end of file
......@@ -252,7 +252,7 @@ public class ArcGraph extends ValueCorona {
@Override
public void setInformation(Object information) {
if (variable != null) {
double value = (double) this.variable.getValue();
double value = this.variable.getValue();
if ((balisticTimeline != null) && (!balisticTimeline.isDone()))
balisticTimeline.cancel();
......
package lu.list.itis.dkd.tui.widget.corona;
import lu.list.itis.dkd.tui.content.InformationReceiver;
import lu.list.itis.dkd.tui.cps.variable.tangible.TangibleNumericalVariable;
import lu.list.itis.dkd.tui.cps.variable.NumericalVariable;
import lu.list.itis.dkd.tui.widget.corona.builder.ValueCoronaBuilder;
import java.awt.Graphics2D;
......@@ -20,7 +20,7 @@ import java.awt.Graphics2D;
// ***************************************************************************
public class ValueCorona extends Corona implements InformationReceiver<Object> {
protected TangibleNumericalVariable variable;
protected NumericalVariable variable;
protected boolean selected;
// ***************************************************************************
......@@ -53,13 +53,13 @@ public class ValueCorona extends Corona implements InformationReceiver<Object> {
// ***************************************************************************
// ---------------------------------------------------------------------------
public TangibleNumericalVariable getVariable() {
public NumericalVariable getVariable() {
return this.variable;
}
// ---------------------------------------------------------------------------
public void setVariable(TangibleNumericalVariable variable) {
public void setVariable(NumericalVariable variable) {
this.variable = variable;
}
// ---------------------------------------------------------------------------
......
......@@ -4,6 +4,7 @@ import lu.list.itis.dkd.dbc.annotation.Nullable;
import lu.list.itis.dkd.tui.bootstrapping.BootstrapCallback;
import lu.list.itis.dkd.tui.bootstrapping.BootstrapContext;
import lu.list.itis.dkd.tui.bootstrapping.BootstrappingUtils;
import lu.list.itis.dkd.tui.bootstrapping.ShapeBootstrapper;
import lu.list.itis.dkd.tui.exception.BuildException;
import lu.list.itis.dkd.tui.utility.ColorPair;
import lu.list.itis.dkd.tui.utility.Externalization;
......@@ -96,6 +97,9 @@ public class ArcGraphBuilder extends ValueCoronaBuilder<ArcGraphBuilder> {
fillColour = buildColorPair(rootElement.getChild(Externalization.FILL_COLOUR_ELEMENT), context);
textColour = buildColorPair(rootElement.getChild(Externalization.TEXT_COLOUR_ELEMENT), context);
strokeColour = buildColorPair(rootElement.getChild(Externalization.STROKE_COLOUR_ELEMENT), context);
labelColour = buildColorPair(rootElement.getChild(Externalization.LABEL_COLOUR_ELEMENT), context);
labelShape = ShapeBootstrapper.getShape(rootElement.getChild(Externalization.LABEL_SHAPE_NODE), context, callback);
String fontName = BootstrappingUtils.getContentAsString(rootElement, Externalization.FONT_NODE, BootstrappingUtils.OPTIONAL, "Monospaced"); //$NON-NLS-1$
Integer fontSize = BootstrappingUtils.getContentAsInteger(rootElement, Externalization.FONT_SIZE_NODE, BootstrappingUtils.OPTIONAL, 14);
......@@ -109,7 +113,7 @@ public class ArcGraphBuilder extends ValueCoronaBuilder<ArcGraphBuilder> {
private ColorPair buildColorPair(Element rootElement, BootstrapContext context) throws BuildException {
Color selectedColour = BootstrappingUtils.getContentAsColour(rootElement, Externalization.SELECTED_ELEMENT, BootstrappingUtils.MANDATORY, null, context);
Color deselectedColour = BootstrappingUtils.getContentAsColour(rootElement, Externalization.SELECTED_ELEMENT, BootstrappingUtils.MANDATORY, null, context);
Color deselectedColour = BootstrappingUtils.getContentAsColour(rootElement, Externalization.DESELECTED_ELEMENT, BootstrappingUtils.MANDATORY, null, context);
return new ColorPair(selectedColour, deselectedColour);
}
......
......@@ -6,6 +6,7 @@ import lu.list.itis.dkd.tui.bootstrapping.BootstrapContext;
import lu.list.itis.dkd.tui.bootstrapping.VariableBootstrapper;
import lu.list.itis.dkd.tui.cps.variable.tangible.TangibleNumericalVariable;
import lu.list.itis.dkd.tui.exception.BuildException;
import lu.list.itis.dkd.tui.utility.Externalization;
import lu.list.itis.dkd.tui.utility.Point;
import lu.list.itis.dkd.tui.widget.corona.ValueCorona;
......@@ -57,7 +58,10 @@ public abstract class BaseValueCoronaBuilder<B extends BaseValueCoronaBuilder<B>
// ***************************************************************************
// ---------------------------------------------------------------------------
private void buildFromBootstrap(@Nullable Element rootElement, BootstrapContext context, BootstrapCallback callback) throws BuildException {
variable = (TangibleNumericalVariable) VariableBootstrapper.buildVariableFromElement(rootElement, context, callback);
Element variableElement = rootElement.getChild(Externalization.VARIABLE_NODE);
if (variableElement != null) {
variable = (TangibleNumericalVariable) VariableBootstrapper.buildVariableFromElement(variableElement, context, callback);
}
}
// ---------------------------------------------------------------------------
......
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