You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BitmapRendererConfBuilder.java 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. /* $Id$ */
  18. package org.apache.fop.apps;
  19. import org.apache.fop.apps.FopConfBuilder.RendererConfBuilder;
  20. import static org.apache.fop.render.bitmap.BitmapRendererOption.ANTI_ALIASING;
  21. import static org.apache.fop.render.bitmap.BitmapRendererOption.BACKGROUND_COLOR;
  22. import static org.apache.fop.render.bitmap.BitmapRendererOption.COLOR_MODE;
  23. import static org.apache.fop.render.bitmap.BitmapRendererOption.JAVA2D_TRANSPARENT_PAGE_BACKGROUND;
  24. import static org.apache.fop.render.bitmap.BitmapRendererOption.RENDERING_QUALITY_ELEMENT;
  25. public class BitmapRendererConfBuilder extends RendererConfBuilder {
  26. protected BitmapRendererConfBuilder(String mimeType) {
  27. super(mimeType);
  28. }
  29. protected BitmapRendererConfBuilder() {
  30. super(getMimeType());
  31. }
  32. public BitmapRendererConfBuilder setPageBackgroundTransparency(boolean isTransparent) {
  33. createTextElement(JAVA2D_TRANSPARENT_PAGE_BACKGROUND, String.valueOf(isTransparent));
  34. return this;
  35. }
  36. public BitmapRendererConfBuilder setBackgroundColor(String color) {
  37. createTextElement(BACKGROUND_COLOR, color);
  38. return this;
  39. }
  40. public BitmapRendererConfBuilder setAntiAliasing(boolean antiAlias) {
  41. createTextElement(ANTI_ALIASING, String.valueOf(antiAlias));
  42. return this;
  43. }
  44. public BitmapRendererConfBuilder setRenderingQuality(String quality) {
  45. createTextElement(RENDERING_QUALITY_ELEMENT, quality);
  46. return this;
  47. }
  48. public BitmapRendererConfBuilder setColorMode(String colorMode) {
  49. createTextElement(COLOR_MODE, colorMode);
  50. return this;
  51. }
  52. public static String getMimeType() {
  53. return "Bitmap";
  54. }
  55. }