AffineTransform.getScaleInstance(scaleFactor, scaleFactor) .createTransformedShape(markShape); ParallelLinesFiller filler = ParallelLinesFiller.fromStipple(rescaledStipple); if (filler != null) { Graphics2D clippedGraphics = (Graphics2D) graphics.create();
@Test public void testCircle() throws Exception { ParallelLinesFiller filler = ParallelLinesFiller.fromStipple( new WellKnownMarkFactory().getShape(null, ff.literal("circle"), null)); assertNull(filler); } }
@Test public void testOArrow() throws Exception { ParallelLinesFiller filler = ParallelLinesFiller.fromStipple( new ShapeMarkFactory().getShape(null, ff.literal("shape://oarrow"), null)); assertNull(filler); }
@Test public void testSlash() throws Exception { ParallelLinesFiller filler = ParallelLinesFiller.fromStipple( new ShapeMarkFactory().getShape(null, ff.literal("shape://slash"), null)); assertNotNull(filler); assertEquals(1, filler.lines.size()); assertEquals(1, filler.xStep, 0d); assertEquals(1, filler.yStep, 0d); }
@Test public void testTimes() throws Exception { ParallelLinesFiller filler = ParallelLinesFiller.fromStipple( new ShapeMarkFactory().getShape(null, ff.literal("shape://times"), null)); assertNotNull(filler); assertEquals(2, filler.lines.size()); assertEquals(1, filler.xStep, 0d); assertEquals(1, filler.yStep, 0d); }
@Test public void testPlus() throws Exception { ParallelLinesFiller filler = ParallelLinesFiller.fromStipple( new ShapeMarkFactory().getShape(null, ff.literal("shape://plus"), null)); assertNotNull(filler); assertEquals(2, filler.lines.size()); assertEquals(1, filler.xStep, 0d); assertEquals(1, filler.yStep, 0d); }
private boolean isMarkNonHatchFill(Style2D graphicFill) { if (!(graphicFill instanceof MarkStyle2D)) { return false; } if (OPTIMIZE_VECTOR_HATCH_FILLS) { MarkStyle2D ms = (MarkStyle2D) graphicFill; ParallelLinesFiller filler = ParallelLinesFiller.fromStipple(ms.getShape()); if (filler != null) { return false; } } return true; }