PenStroke extends Stroke implements FillNode { public void setWidth(RealParameter width) { this.width = width == null ? new RealLiteral(DEFAULT_WIDTH) : width; if (width != null) { width.setContext(RealParameterContext.NON_NEGATIVE_CONTEXT); width.setParent(this); } } PenStroke();  PenStroke(PenStrokeType t);  PenStroke(JAXBElement<PenStrokeType> s); @Override Double getNaturalLength(Map<String,Object> map, Shape shp, MapTransform mt); @Override Double getNaturalLengthForCompound(Map<String,Object> map,
            Shape shp, MapTransform mt); @Override List<SymbolizerNode> getChildren(); @Override Fill getFill(); @Override void setFill(Fill fill); void setLineCap(LineCap cap); LineCap getLineCap(); void setLineJoin(LineJoin join); LineJoin getLineJoin(); void setWidth(RealParameter width); RealParameter getWidth(); RealParameter getDashOffset(); void setDashOffset(RealParameter dashOffset); StringParameter getDashArray(); void setDashArray(StringParameter dashArray); BasicStroke getBasicStroke(Map<String,Object> map, MapTransform mt, Double v100p); @Override void draw(Graphics2D g2, Map<String,Object> map, Shape shape,
            boolean selected, MapTransform mt, double offset); double getWidthInPixel(Map<String,Object> map, MapTransform mt); double getMinLength(Map<String,Object> map, MapTransform mt); @Override JAXBElement<PenStrokeType> getJAXBElement(); PenStrokeType getJAXBType(); static final double DEFAULT_WIDTH; static final LineCap DEFAULT_CAP; static final LineJoin DEFAULT_JOIN; }
@Test public void testSetWidth() throws Exception { PenStroke ps = new PenStroke(); assertEquals(ps.getWidth().getValue(null), (Double) PenStroke.DEFAULT_WIDTH); ps.setWidth(null); assertEquals(ps.getWidth().getValue(null), (Double) PenStroke.DEFAULT_WIDTH); ps.setWidth(new RealLiteral(0.4)); assertEquals(ps.getWidth().getValue(null),(Double) 0.4); }