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.

Graphics2DAdapter.java 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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.render;
  19. import java.io.IOException;
  20. /**
  21. * This interface represents an optional feature that can be provided by
  22. * a renderer. It is exposed by calling the getGraphics2DAdapter() method
  23. * on the renderer. Renderers that support this feature allow painting
  24. * of arbitrary images through a Graphics2D instance.
  25. */
  26. public interface Graphics2DAdapter {
  27. /**
  28. * Paints an arbitrary images on a given Graphics2D instance. The renderer
  29. * providing this functionality must set up a Graphics2D instance so that
  30. * the image with the given extents (in mpt) can be painted by the painter
  31. * passed to this method. The Graphics2DImagePainter is then passed this
  32. * Graphics2D instance so the image can be painted.
  33. * @param painter the painter which will paint the actual image
  34. * @param context the renderer context for the current renderer
  35. * @param x X position of the image
  36. * @param y Y position of the image
  37. * @param width width of the image
  38. * @param height height of the image
  39. * @throws IOException In case of an I/O error while writing the output format
  40. */
  41. void paintImage(org.apache.xmlgraphics.java2d.Graphics2DImagePainter painter,
  42. RendererContext context,
  43. int x, int y, int width, int height) throws IOException;
  44. /**
  45. * Paints an arbitrary images on a given Graphics2D instance. The renderer
  46. * providing this functionality must set up a Graphics2D instance so that
  47. * the image with the given extents (in mpt) can be painted by the painter
  48. * passed to this method. The Graphics2DImagePainter is then passed this
  49. * Graphics2D instance so the image can be painted.
  50. * @param painter the painter which will paint the actual image
  51. * @param context the renderer context for the current renderer
  52. * @param x X position of the image
  53. * @param y Y position of the image
  54. * @param width width of the image
  55. * @param height height of the image
  56. * @throws IOException In case of an I/O error while writing the output format
  57. * @deprecated Use the variant with the Graphics2DImagePainter from XML Graphics Commons instead
  58. */
  59. void paintImage(Graphics2DImagePainter painter,
  60. RendererContext context,
  61. int x, int y, int width, int height) throws IOException;
  62. }