Number period = NumberStringComparator.stringToNumber(tfPeriod.getText());
if (buf==null) buf = new Long(0);
if (useLong) {
long step = s.longValue();
long max = (e!=null) ? e.longValue() : ( (step>0) ? Long.MAX_VALUE : Long.MIN_VALUE );
if (period==null) ds = new DataSourceAnimator(new RangeSource(name, i.longValue(), max, step), buf.intValue());
else ds = new DataSourceAnimator(new RangeSource(name, i.longValue(), max, step), buf.intValue(), period.intValue());
} else {
double step = s.doubleValue();
double max = (e!=null) ? e.doubleValue() : ( (step>0) ? Double.POSITIVE_INFINITY : Double.NEGATIVE_INFINITY );
if (period==null) ds = new DataSourceAnimator(new RangeSource(name, i.doubleValue(), max, step), buf.intValue());
else ds = new DataSourceAnimator(new RangeSource(name, i.doubleValue(), max, step), buf.intValue(), period.intValue());
}
} else {
Number min = NumberStringComparator.stringToNumber(tfMin.getText());
if (min==null) min = new Long(0);
Number max = NumberStringComparator.stringToNumber(tfMax.getText());