選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

BlockViewport.java 2.4KB

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