@Test public void builderWithPadSpreadingTest() throws IOException, InterruptedException { Rectangle targetBoundingBox = new Rectangle(50f, 450f, 300f, 300f); AbstractLinearGradientBuilder gradientBuilder = new LinearGradientBuilder() .setGradientVector(targetBoundingBox.getLeft() + 100f, targetBoundingBox.getBottom() + 100f, targetBoundingBox.getRight() - 100f, targetBoundingBox.getTop() - 100f) .setSpreadMethod(GradientSpreadMethod.PAD) .addColorStop(new GradientColorStop(ColorConstants.RED.getColorValue(), 0d, OffsetType.RELATIVE)) .addColorStop(new GradientColorStop(ColorConstants.GREEN.getColorValue(), 0.5, OffsetType.RELATIVE)) .addColorStop(new GradientColorStop(ColorConstants.BLUE.getColorValue(), 1d, OffsetType.RELATIVE)); generateAndComparePdfs("builderWithPadSpreadingTest.pdf", targetBoundingBox, null, gradientBuilder); }
public LinearGradientBuilder setGradientVector(double x0, double y0, double x1, double y1) { this.coordinates[0].setLocation(x0, y0); this.coordinates[1].setLocation(x1, y1); return this; }
LinearGradientBuilder extends AbstractLinearGradientBuilder { public LinearGradientBuilder setGradientVector(double x0, double y0, double x1, double y1) { this.coordinates[0].setLocation(x0, y0); this.coordinates[1].setLocation(x1, y1); return this; } }
LinearGradientBuilder extends AbstractLinearGradientBuilder { public LinearGradientBuilder setGradientVector(double x0, double y0, double x1, double y1) { this.coordinates[0].setLocation(x0, y0); this.coordinates[1].setLocation(x1, y1); return this; } LinearGradientBuilder(); }
LinearGradientBuilder extends AbstractLinearGradientBuilder { public LinearGradientBuilder setGradientVector(double x0, double y0, double x1, double y1) { this.coordinates[0].setLocation(x0, y0); this.coordinates[1].setLocation(x1, y1); return this; } LinearGradientBuilder(); LinearGradientBuilder setGradientVector(double x0, double y0, double x1, double y1); LinearGradientBuilder setCurrentSpaceToGradientVectorSpaceTransformation(
            AffineTransform transformation); @Override Point[] getGradientVector(Rectangle targetBoundingBox, AffineTransform contextTransform); @Override AffineTransform getCurrentSpaceToGradientVectorSpaceTransformation(
            Rectangle targetBoundingBox, AffineTransform contextTransform); }
LinearGradientBuilder extends AbstractLinearGradientBuilder { public LinearGradientBuilder setGradientVector(double x0, double y0, double x1, double y1) { this.coordinates[0].setLocation(x0, y0); this.coordinates[1].setLocation(x1, y1); return this; } LinearGradientBuilder(); LinearGradientBuilder setGradientVector(double x0, double y0, double x1, double y1); LinearGradientBuilder setCurrentSpaceToGradientVectorSpaceTransformation(
            AffineTransform transformation); @Override Point[] getGradientVector(Rectangle targetBoundingBox, AffineTransform contextTransform); @Override AffineTransform getCurrentSpaceToGradientVectorSpaceTransformation(
            Rectangle targetBoundingBox, AffineTransform contextTransform);  }