private void testFromLineCss(FigureStyle expectedStyle, String css) { FigureStyle style = new DefaultFigureStyle(); style.fromCssString(css); assertEquals(expectedStyle.getStrokeOpacity(), style.getStrokeOpacity(), 1E-10); assertEquals(expectedStyle.getStrokeWidth(), style.getStrokeWidth(), 1E-10); assertEquals(expectedStyle.getStrokeColor(), style.getStrokeColor()); // FIXME - these sometimes fail due to lossy alpha conversion (nf) // assertEquals(expectedStyle.getStrokePaint(), style.getStrokePaint()); }
@Test public void testPolygonStyle() { FigureStyle style = DefaultFigureStyle.createPolygonStyle(Color.RED); assertEquals(Color.RED, style.getFillColor()); assertEquals(null, style.getStrokeColor()); assertEquals(0.0, style.getStrokeWidth(), 1E-10); assertNotNull(style.getStroke()); style = DefaultFigureStyle.createPolygonStyle(Color.RED, Color.BLUE); assertEquals(Color.RED, style.getFillColor()); assertEquals(Color.BLUE, style.getStrokeColor()); assertNotNull(style.getStroke()); }