Commit 52cd22f6 authored by Nico Mack's avatar Nico Mack

Enable grouping for NumericalVariable format

SelectorWidget selects preselect position in connectWithSystemVariables
method
parent dd949d97
......@@ -31,6 +31,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.Vector;
/**
......@@ -92,7 +93,12 @@ public class NumericalVariable extends Variable<Double> {
format = new DecimalFormat();
format.setDecimalSeparatorAlwaysShown(false);
format.setMaximumFractionDigits(0);
format.setGroupingUsed(false);
format.setGroupingUsed(true);
DecimalFormatSymbols symbols = format.getDecimalFormatSymbols();
symbols.setGroupingSeparator('.');
symbols.setDecimalSeparator(',');
format.setDecimalFormatSymbols(symbols);
minValue = -Double.MAX_VALUE;
maxValue = Double.MAX_VALUE;
......
package lu.list.itis.dkd.tui.widget;
import lu.list.itis.dkd.tui.adapter.TangibleObject;
import lu.list.itis.dkd.tui.cps.variable.Variable;
import lu.list.itis.dkd.tui.utility.AngleUtils;
import lu.list.itis.dkd.tui.utility.Point;
import lu.list.itis.dkd.tui.widget.builder.SelectorWidgetBuilder;
......@@ -186,6 +187,19 @@ public class SelectorWidget extends ValueWidget {
// ---------------------------------------------------------------------------
@Override
public List<Variable<?>> connectWithSystemVariables(Map<String, Variable<?>> systemVariables) {
List<Variable<?>> connected = super.connectWithSystemVariables(systemVariables);
if (presetPosition != NONE) {
this.selectPosition(presetPosition);
}
return connected;
}
// ---------------------------------------------------------------------------
public void setSelectedPosition(int position) {
currentPosition = position;
}
......@@ -198,8 +212,8 @@ public class SelectorWidget extends ValueWidget {
// ---------------------------------------------------------------------------
/**
* Method invoked when a handle of the widget was moved. This default implementation will set
* the position and angle fields to the corresponding values.
* Method invoked when a handle of the widget was moved. This default implementation will set the
* position and angle fields to the corresponding values.
*
* @param tuioObject
* The TuioObject that was triggering the move
......@@ -250,8 +264,8 @@ public class SelectorWidget extends ValueWidget {
// ---------------------------------------------------------------------------
/**
* Method invoked when the tangible is removed from the table surface. The
* {@link TangibleWidget} instance will be set to no longer be active.
* Method invoked when the tangible is removed from the table surface. The {@link TangibleWidget}
* instance will be set to no longer be active.
*
* @param tuioObject
* The TuioObject that was triggering the drop action.
......
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