FogLayerFactory { public static FogLayer createFromParams(AVList params) { FogLayer result = new FogLayer(); String s = params.getStringValue(AVKeyMore.DISPLAY_NAME); if (!isBlank(s)) { result.setName(s); } Float f = (Float)params.getValue(AVKeyMore.FOG_NEAR_FACTOR); if (f != null) { result.setNearFactor(f); } f = (Float)params.getValue(AVKeyMore.FOG_FAR_FACTOR); if (f != null) { result.setFarFactor(f); } Color c = (Color)params.getValue(AVKeyMore.FOG_COLOR); if (c != null) { result.setColor(c); } return result; }  static FogLayer createFromParams(AVList params); static FogLayer createFromDefinition(Element domElement, AVList params); static final String LAYER_TYPE; }
@Test public void testParamCtorWithAllParams() { AVList params = new AVListImpl(); params.setValue(AVKeyMore.DISPLAY_NAME, "testFogLayer"); params.setValue(AVKeyMore.FOG_NEAR_FACTOR, 2f); params.setValue(AVKeyMore.FOG_FAR_FACTOR, 3f); params.setValue(AVKeyMore.FOG_COLOR, new Color(12,13,14,15)); FogLayer result = FogLayerFactory.createFromParams(params); assertEquals("testFogLayer", result.getName()); assertEquals(2f, result.getNearFactor(), ALLOWED_ERROR); assertEquals(3f, result.getFarFactor(), ALLOWED_ERROR); assertEquals(12, result.getColor().getRed()); assertEquals(13, result.getColor().getGreen()); assertEquals(14, result.getColor().getBlue()); assertEquals(255, result.getColor().getAlpha()); }