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.

BlockViewport.java 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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.area;
  19. /**
  20. * A BlockViewport.
  21. * This is used for block level Viewport/reference pairs.
  22. * The block-container creates this area.
  23. */
  24. public class BlockViewport extends Block {
  25. private static final long serialVersionUID = -7840580922580735157L;
  26. // clipping for this viewport
  27. private boolean clip = false;
  28. // transform if rotated or absolute
  29. private CTM viewportCTM;
  30. /**
  31. * Create a new block viewport area.
  32. */
  33. public BlockViewport() {
  34. this(false);
  35. }
  36. /**
  37. * Create a new block viewport area.
  38. * @param allowBPDUpdate true allows the BPD to be updated when children are added
  39. */
  40. public BlockViewport(boolean allowBPDUpdate) {
  41. this.allowBPDUpdate = allowBPDUpdate;
  42. }
  43. /**
  44. * Set the transform of this viewport.
  45. * If the viewport is rotated or has an absolute positioning
  46. * this transform will do the work.
  47. *
  48. * @param ctm the transformation
  49. */
  50. public void setCTM(CTM ctm) {
  51. viewportCTM = ctm;
  52. }
  53. /**
  54. * Get the transform of this block viewport.
  55. *
  56. * @return the transformation of this viewport
  57. * or null if normally stacked without rotation
  58. */
  59. public CTM getCTM() {
  60. return viewportCTM;
  61. }
  62. /**
  63. * Set the clipping for this viewport.
  64. *
  65. * @param cl the clipping for the viewport
  66. */
  67. public void setClip(boolean cl) {
  68. clip = cl;
  69. }
  70. /**
  71. * Get the clipping for this viewport.
  72. *
  73. * @return the clipping for the viewport
  74. * true if the contents should be clipped for this viewport
  75. */
  76. public boolean getClip() {
  77. return clip;
  78. }
  79. }