IConfig<?> configModel = null;
switch (type) {
case SCAN_1D:
IConfig<?> tmp = new Config1DImpl();
tmp.setScanAddOn(new ScanAddOnImp());
tmp.getScanAddOn().setDisplay(new DisplayImpl());
((IConfig1D) tmp).setDimensionX(new Dimension1DImpl());
// Creates one range for a new 1D config.
IRange1D range1DToAdd = new Range1DImpl();
range1DToAdd.setDimension(((IConfig1D) tmp).getDimensionX());
range1DToAdd.setIntegrationTime(1.0);
range1DToAdd.setStepsNumber(1);
((IConfig1D) tmp).getDimensionX().getRangesXList().add(range1DToAdd);
configModel = wrap(tmp);
break;
case SCAN_2D:
IConfig<?> tmp2d = new Config2DImpl();
tmp2d.setScanAddOn(new ScanAddOnImp());
tmp2d.getScanAddOn().setDisplay(new DisplayImpl());
((IConfig2D) tmp2d).setDimensionX(new Dimension2DXImpl());
// Creates one X range for a new 2D config.
IRange2DX xRangeToAdd = new Range2DXImpl();
xRangeToAdd.setDimension(((IConfig2D) tmp2d).getDimensionX());
xRangeToAdd.setIntegrationTime(1.0);
xRangeToAdd.setStepsNumber(1);
((IConfig2D) tmp2d).getDimensionX().getRangesList().add(xRangeToAdd);
// Creates one Y range for a new 2D config.
((IConfig2D) tmp2d).setDimensionY(new Dimension2DYImpl());
Range2DYImpl yRangeToAdd = new Range2DYImpl();
yRangeToAdd.setDimension(((IConfig2D) tmp2d).getDimensionY());
yRangeToAdd.setStepsNumber(1);
((IConfig2D) tmp2d).getDimensionY().getRangesList().add(yRangeToAdd);
configModel = wrap(tmp2d);
break;
case SCAN_HCS:
ConfigHCSImpl tmpHCS = new ConfigHCSImpl();
tmpHCS.setScanAddOn(new ScanAddOnImp());
tmpHCS.getScanAddOn().setDisplay(new DisplayImpl());
tmpHCS.setDimensionX(new DimensionHCSImpl());
// ((IConfigHCS) configModel).setDimensionX(new DimensionHCSModel());
// Creates one range for a new HCS config.
IRangeHCS rangeHCSToAdd = new RangeHCSImpl();
rangeHCSToAdd.setDimension(((IConfigHCS) tmpHCS).getDimensionX());
((IConfigHCS) tmpHCS).getDimensionX().getRangesXList().add(rangeHCSToAdd);
configModel = wrap(tmpHCS);
break;
case SCAN_K:
ConfigKImpl tmpK = new ConfigKImpl();
tmpK.setScanAddOn(new ScanAddOnImp());
tmpK.getScanAddOn().setDisplay(new DisplayImpl());
((IConfigK) tmpK).setDimensionX(new DimensionKImpl());
configModel = wrap(tmpK);
break;
case SCAN_ENERGY:
ConfigEnergyImpl tmpEnergy = new ConfigEnergyImpl();
tmpEnergy.setScanAddOn(new ScanAddOnImp());
tmpEnergy.getScanAddOn().setDisplay(new DisplayImpl());
tmpEnergy.setDimensionX(new DimensionEnergyImpl());
configModel = wrap(tmpEnergy);
break;
default: