FogLayerFactory { public static FogLayer createFromDefinition(Element domElement, AVList params) { if (params == null) { params = new AVListImpl(); } AbstractLayer.getLayerConfigParams(domElement, params); checkAndSetFloatParam(domElement, params, AVKeyMore.FOG_NEAR_FACTOR, "NearFactor", null); checkAndSetFloatParam(domElement, params, AVKeyMore.FOG_FAR_FACTOR, "FarFactor", null); WWXML.checkAndSetColorParam(domElement, params, AVKeyMore.FOG_COLOR, "FogColor", null); return createFromParams(params); }  static FogLayer createFromParams(AVList params); static FogLayer createFromDefinition(Element domElement, AVList params); static final String LAYER_TYPE; }
@Test public void testXMLCtorWithCompleteDefinition() { Document document = WWXML.openDocument(getClass().getResource("fogLayerDefinitionComplete.xml")); FogLayer result = FogLayerFactory.createFromDefinition(document.getDocumentElement(), null); assertEquals("testName", result.getName()); assertEquals(1.2f, result.getNearFactor(), ALLOWED_ERROR); assertEquals(1.3f, result.getFarFactor(), ALLOWED_ERROR); assertEquals(123, result.getColor().getRed()); assertEquals(23, result.getColor().getGreen()); assertEquals(222, result.getColor().getBlue()); assertEquals(255, result.getColor().getAlpha()); }