CategorizedArea extends AbstractCategorizedLegend<AreaParameters> implements EnablesStroke { @Override public AreaParameters remove(Object o) { if(!(o instanceof Double)){ throw new IllegalArgumentException("Keys are double values in this map"); } Double inp = (Double)o; forceMapping(inp); AreaParameters ret; if(containsKey(inp)){ ret = get(inp); } else { return null; } if(strokeEnabled){ colorStroke.remove(inp); opacityStroke.remove(inp); widthStroke.remove(inp); dashStroke.remove(inp); } colorFill.remove(inp); opacityFill.remove(inp); return ret; } CategorizedArea();  CategorizedArea(AreaSymbolizer as); @Override List<CategorizedLegend> getCategorizedLegend(); @Override Symbolizer getSymbolizer(); @Override String getLegendTypeName(); @Override AreaParameters get(Object o); @Override AreaParameters put(Double d, AreaParameters ap); @Override AreaParameters remove(Object o); @Override void setFallbackParameters(AreaParameters fallback); @Override AreaParameters getFallbackParameters(); @Override boolean isStrokeEnabled(); @Override void setStrokeEnabled(boolean enable); @Override Uom getStrokeUom(); @Override void setStrokeUom(Uom u); @Override String getLegendTypeId(); static final String NAME; }
@Test public void testRemove() throws Exception { CategorizedArea ca = getCategorizedArea(); AreaParameters tester = ca.remove(75000.0); assertTrue(tester.equals(new AreaParameters(Color.decode("#dd77ee"),.2,7.0,"1 6 8 1",Color.decode("#dd66ee"),.5))); tester = new AreaParameters(Color.decode("#dd77ee"),.2,2.0,"1 3 1 2 5",Color.decode("#dd66ee"),.5); assertTrue(ca.get(70000.0).equals(tester)); tester = new AreaParameters(Color.decode("#dd77ee"),.2,10.0,"5 5",Color.decode("#ffaa99"),.5); assertTrue(ca.get(100000.0).equals(tester)); assertFalse(ca.containsKey(75000.0)); }
@Test public void testRemoveNoStroke() throws Exception { CategorizedArea ca = getNoStroke(); AreaParameters rm = ca.remove(100000.0); AreaParameters tester = new AreaParameters(Color.WHITE,.0,.0,"",Color.decode("#ffaa99"),.5); assertTrue(rm.equals(tester)); }