@Test public void testCreateVolumeLayer() { URL url = this.getClass().getResource("dummyVolumeLayer.xml"); Element element = XMLUtil.getElementFromSource(url); AVList params = new AVListImpl(); VolumeLayer layer = VolumeLayerFactory.createVolumeLayer(element, params); assertNotNull(layer); assertNotNull(params.getValue(AVKeyMore.COLOR_MAP)); assertNotNull(params.getValue(AVKeyMore.NO_DATA_COLOR)); assertEquals(new Color(255,255,255,255), params.getValue(AVKeyMore.NO_DATA_COLOR)); assertNotNull(params.getValue(AVKeyMore.INITIAL_OFFSET_MIN_U)); assertEquals(1, params.getValue(AVKeyMore.INITIAL_OFFSET_MIN_U)); assertNotNull(params.getValue(AVKeyMore.MAX_VARIANCE)); assertEquals(1.0, params.getValue(AVKeyMore.MAX_VARIANCE)); assertNotNull(params.getValue(AVKeyMore.MINIMUM_DISTANCE)); assertEquals(1e5, (Double)params.getValue(AVKeyMore.MINIMUM_DISTANCE), 0.001); assertNotNull(params.getValue(AVKeyMore.DATA_LAYER_PROVIDER)); assertTrue(params.getValue(AVKeyMore.DATA_LAYER_PROVIDER) instanceof ArrayVolumeDataProvider); assertNotNull(params.getValue(AVKeyMore.PAINTED_VARIABLE)); assertEquals("var1", params.getValue(AVKeyMore.PAINTED_VARIABLE)); assertEquals(layer.getPaintedVariableName(), "var1"); }
public static VolumeLayer createVolumeLayer(Element domElement, AVList params) { params = AbstractLayer.getLayerConfigParams(domElement, params); params = getParamsFromDocument(domElement, params); VolumeLayer layer = new BasicVolumeLayer(params); DataLayerFactory.setLayerParams(layer, params); return layer; }
VolumeLayerFactory { public static VolumeLayer createVolumeLayer(Element domElement, AVList params) { params = AbstractLayer.getLayerConfigParams(domElement, params); params = getParamsFromDocument(domElement, params); VolumeLayer layer = new BasicVolumeLayer(params); DataLayerFactory.setLayerParams(layer, params); return layer; } }
VolumeLayerFactory { public static VolumeLayer createVolumeLayer(Element domElement, AVList params) { params = AbstractLayer.getLayerConfigParams(domElement, params); params = getParamsFromDocument(domElement, params); VolumeLayer layer = new BasicVolumeLayer(params); DataLayerFactory.setLayerParams(layer, params); return layer; }  }
VolumeLayerFactory { public static VolumeLayer createVolumeLayer(Element domElement, AVList params) { params = AbstractLayer.getLayerConfigParams(domElement, params); params = getParamsFromDocument(domElement, params); VolumeLayer layer = new BasicVolumeLayer(params); DataLayerFactory.setLayerParams(layer, params); return layer; }  static VolumeLayer createVolumeLayer(Element domElement, AVList params); static AVList getParamsFromDocument(Element domElement, AVList params); }
VolumeLayerFactory { public static VolumeLayer createVolumeLayer(Element domElement, AVList params) { params = AbstractLayer.getLayerConfigParams(domElement, params); params = getParamsFromDocument(domElement, params); VolumeLayer layer = new BasicVolumeLayer(params); DataLayerFactory.setLayerParams(layer, params); return layer; }  static VolumeLayer createVolumeLayer(Element domElement, AVList params); static AVList getParamsFromDocument(Element domElement, AVList params);  }