CategorizedLine extends AbstractCategorizedLegend<LineParameters> { @Override public LineParameters put(Double d, LineParameters lp) { forceMapping(d); LineParameters ret = null; if(containsKey(d)){ ret = get(d); } color.put(d,lp.getLineColor()); opacity.put(d,lp.getLineOpacity()); width.put(d,lp.getLineWidth()); dash.put(d, lp.getLineDash()); return ret; } CategorizedLine();  CategorizedLine(LineSymbolizer ls); @Override List<CategorizedLegend> getCategorizedLegend(); @Override void setFallbackParameters(LineParameters fallback); @Override LineParameters getFallbackParameters(); @Override Symbolizer getSymbolizer(); @Override String getLegendTypeName(); @Override LineParameters get(Object o); @Override LineParameters put(Double d, LineParameters lp); @Override LineParameters remove(Object o); @Override Uom getStrokeUom(); @Override void setStrokeUom(Uom u); @Override String getLegendTypeId(); static final String NAME; }
@Test public void testTransformToCategorize() throws Exception { LineSymbolizer ls = new LineSymbolizer(); CategorizedLine cl = new CategorizedLine(ls); cl.put(25.0, new LineParameters(Color.decode("#dd6643"), .725, 10.0, "2 2 5")); PenStroke ps = (PenStroke) ls.getStroke(); assertTrue(ps.getWidth() instanceof Categorize); assertTrue(ps.getDashArray() instanceof Categorize); assertTrue(((SolidFill)ps.getFill()).getColor() instanceof Categorize); assertTrue(((SolidFill)ps.getFill()).getOpacity() instanceof Categorize); }