List<Double> matrix = createTransform(gradient, baseTransform, transform);
List<Double> bounds = createBounds(gradient);
List<Function> functions = createFunctions(gradient);
- //Gradients are currently restricted to sRGB
- PDFDeviceColorSpace colSpace = new PDFDeviceColorSpace(PDFDeviceColorSpace.DEVICE_RGB);
+ // Gradients are currently restricted to sRGB
+ PDFDeviceColorSpace colorSpace = new PDFDeviceColorSpace(PDFDeviceColorSpace.DEVICE_RGB);
Function function = new Function(3, null, null, functions, bounds, null);
- Shading shading = makeShading(gradient instanceof LinearGradientPaint ? 2 : 3,
- colSpace, null, null, false, coords, null, function, null);
- return makePattern(2, shading, null, null, matrix);
+ Shading shading = makeShading(gradient instanceof LinearGradientPaint ? 2 : 3, colorSpace,
+ coords, function);
+ return makePattern(2, shading, matrix);
}
private List<Double> createTransform(MultipleGradientPaint gradient,
return gradientColors;
}
- public abstract Shading makeShading(int shadingType,
- PDFDeviceColorSpace colorSpace, List<Double> background, List<Double> bbox,
- boolean antiAlias, List<Double> coords, List<Double> domain,
- Function function, List<Integer> extend);
+ protected abstract Shading makeShading(int shadingType, PDFDeviceColorSpace colorSpace,
+ List<Double> coords, Function function);
- public abstract P makePattern(int patternType, Shading shading, List xuid,
- StringBuffer extGState, List<Double> matrix);
+ protected abstract P makePattern(int patternType, Shading shading, List<Double> matrix);
}
}
@Override
- public Shading makeShading(int shadingType,
- PDFDeviceColorSpace colorSpace, List<Double> background, List<Double> bbox,
- boolean antiAlias, List<Double> coords, List<Double> domain,
- Function function, List<Integer> extend) {
+ protected Shading makeShading(int shadingType, PDFDeviceColorSpace colorSpace,
+ List<Double> coords, Function function) {
List<PDFFunction> pdfFunctions = new ArrayList<PDFFunction>(function.getFunctions().size());
for (Function f : function.getFunctions()) {
pdfFunctions.add(graphics2D.registerFunction(new PDFFunction(f)));
}
PDFFunction pdfFunction = graphics2D.registerFunction(new PDFFunction(function, pdfFunctions));
- PDFShading newShading = new PDFShading(shadingType, colorSpace, background,
- bbox, antiAlias, coords, domain, pdfFunction, extend);
- newShading = graphics2D.registerShading(newShading);
- return newShading;
+ PDFShading shading = new PDFShading(shadingType, colorSpace, null, null, false,
+ coords, null, pdfFunction, null);
+ return graphics2D.registerShading(shading);
}
@Override
- public PDFPattern makePattern(int patternType, Shading shading, List xuid,
- StringBuffer extGState, List<Double> matrix) {
- PDFPattern newPattern = new PDFPattern(patternType, shading, xuid, extGState, matrix);
- newPattern = graphics2D.registerPattern(newPattern);
- return newPattern;
+ protected PDFPattern makePattern(int patternType, Shading shading, List<Double> matrix) {
+ PDFPattern pattern = new PDFPattern(patternType, shading, null, null, matrix);
+ return graphics2D.registerPattern(pattern);
}
}
public class PSGradientFactory extends GradientFactory<PSPattern> {
@Override
- public Shading makeShading(int shadingType,
- PDFDeviceColorSpace colorSpace, List<Double> background, List<Double> bbox,
- boolean antiAlias, List<Double> coords, List<Double> domain,
- Function function, List<Integer> extend) {
- Shading newShading = new PSShading(shadingType, colorSpace, background, bbox,
- antiAlias, coords, domain, function, extend);
- return newShading;
+ protected Shading makeShading(int shadingType,
+ PDFDeviceColorSpace colorSpace, List<Double> coords, Function function) {
+ return new PSShading(shadingType, colorSpace, null, null, false, coords, null, function, null);
}
@Override
- public PSPattern makePattern(int patternType, Shading shading, List xuid,
- StringBuffer extGState, List<Double> matrix) {
- return new PSPattern(patternType, shading, xuid, extGState, matrix);
+ protected PSPattern makePattern(int patternType, Shading shading, List<Double> matrix) {
+ return new PSPattern(patternType, shading, null, null, matrix);
}
}