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.

IFDocumentHandlerProxy.java 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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.intermediate.util;
  19. import java.awt.Dimension;
  20. import java.util.Locale;
  21. import javax.xml.transform.Result;
  22. import org.apache.fop.accessibility.DummyStructureTreeEventHandler;
  23. import org.apache.fop.accessibility.StructureTreeEventHandler;
  24. import org.apache.fop.fonts.FontInfo;
  25. import org.apache.fop.render.intermediate.IFContext;
  26. import org.apache.fop.render.intermediate.IFDocumentHandler;
  27. import org.apache.fop.render.intermediate.IFDocumentHandlerConfigurator;
  28. import org.apache.fop.render.intermediate.IFDocumentNavigationHandler;
  29. import org.apache.fop.render.intermediate.IFException;
  30. import org.apache.fop.render.intermediate.IFPainter;
  31. /**
  32. * This class is a simple proxy that delegates all method calls to another {@link IFDocumentHandler}
  33. * instance.
  34. */
  35. public class IFDocumentHandlerProxy implements IFDocumentHandler {
  36. /** the delegate IFDocumentHandler */
  37. protected IFDocumentHandler delegate;
  38. /**
  39. * Creates a new proxy instance.
  40. * @param delegate the delegate instance
  41. */
  42. public IFDocumentHandlerProxy(IFDocumentHandler delegate) {
  43. this.delegate = delegate;
  44. }
  45. /** {@inheritDoc} */
  46. public boolean supportsPagesOutOfOrder() {
  47. return this.delegate.supportsPagesOutOfOrder();
  48. }
  49. /** {@inheritDoc} */
  50. public String getMimeType() {
  51. return this.delegate.getMimeType();
  52. }
  53. /** {@inheritDoc} */
  54. public void setContext(IFContext context) {
  55. this.delegate.setContext(context);
  56. }
  57. /** {@inheritDoc} */
  58. public IFContext getContext() {
  59. return this.delegate.getContext();
  60. }
  61. /** {@inheritDoc} */
  62. public FontInfo getFontInfo() {
  63. return this.delegate.getFontInfo();
  64. }
  65. /** {@inheritDoc} */
  66. public void setFontInfo(FontInfo fontInfo) {
  67. this.delegate.setFontInfo(fontInfo);
  68. }
  69. /** {@inheritDoc} */
  70. public void setDefaultFontInfo(FontInfo fontInfo) {
  71. this.delegate.setDefaultFontInfo(fontInfo);
  72. }
  73. /** {@inheritDoc} */
  74. public IFDocumentHandlerConfigurator getConfigurator() {
  75. return this.delegate.getConfigurator();
  76. }
  77. /** {@inheritDoc} */
  78. public IFDocumentNavigationHandler getDocumentNavigationHandler() {
  79. return this.delegate.getDocumentNavigationHandler();
  80. }
  81. /** {@inheritDoc} */
  82. public StructureTreeEventHandler getStructureTreeEventHandler() {
  83. return DummyStructureTreeEventHandler.INSTANCE;
  84. }
  85. /** {@inheritDoc} */
  86. public void setResult(Result result) throws IFException {
  87. this.delegate.setResult(result);
  88. }
  89. /** {@inheritDoc} */
  90. public void startDocument() throws IFException {
  91. this.delegate.startDocument();
  92. }
  93. /** {@inheritDoc} */
  94. public void setDocumentLocale(Locale locale) {
  95. this.delegate.setDocumentLocale(locale);
  96. }
  97. /** {@inheritDoc} */
  98. public void startDocumentHeader() throws IFException {
  99. this.delegate.startDocumentHeader();
  100. }
  101. /** {@inheritDoc} */
  102. public void endDocumentHeader() throws IFException {
  103. this.delegate.endDocumentHeader();
  104. }
  105. /** {@inheritDoc} */
  106. public void startPageSequence(String id) throws IFException {
  107. this.delegate.startPageSequence(id);
  108. }
  109. /** {@inheritDoc} */
  110. public void startPage(int index, String name, String pageMasterName, Dimension size)
  111. throws IFException {
  112. this.delegate.startPage(index, name, pageMasterName, size);
  113. }
  114. /** {@inheritDoc} */
  115. public void startPageHeader() throws IFException {
  116. this.delegate.startPageHeader();
  117. }
  118. /** {@inheritDoc} */
  119. public void endPageHeader() throws IFException {
  120. this.delegate.endPageHeader();
  121. }
  122. /** {@inheritDoc} */
  123. public IFPainter startPageContent() throws IFException {
  124. return this.delegate.startPageContent();
  125. }
  126. /** {@inheritDoc} */
  127. public void endPageContent() throws IFException {
  128. this.delegate.endPageContent();
  129. }
  130. /** {@inheritDoc} */
  131. public void startPageTrailer() throws IFException {
  132. this.delegate.startPageTrailer();
  133. }
  134. /** {@inheritDoc} */
  135. public void endPageTrailer() throws IFException {
  136. this.delegate.endPageTrailer();
  137. }
  138. /** {@inheritDoc} */
  139. public void endPage() throws IFException {
  140. this.delegate.endPage();
  141. }
  142. /** {@inheritDoc} */
  143. public void endPageSequence() throws IFException {
  144. this.delegate.endPageSequence();
  145. }
  146. /** {@inheritDoc} */
  147. public void startDocumentTrailer() throws IFException {
  148. this.delegate.startDocumentTrailer();
  149. }
  150. /** {@inheritDoc} */
  151. public void endDocumentTrailer() throws IFException {
  152. this.delegate.endDocumentTrailer();
  153. }
  154. /** {@inheritDoc} */
  155. public void endDocument() throws IFException {
  156. this.delegate.endDocument();
  157. }
  158. /** {@inheritDoc} */
  159. public void handleExtensionObject(Object extension) throws IFException {
  160. this.delegate.handleExtensionObject(extension);
  161. }
  162. }