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.

BodyRegion.java 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /*
  2. * Copyright 1999-2004 The Apache Software Foundation.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /* $Id$ */
  17. package org.apache.fop.area;
  18. import org.apache.fop.fo.pagination.Region;
  19. /**
  20. * The body region area.
  21. * This area contains a main reference area and optionally a
  22. * before float and footnote area.
  23. */
  24. public class BodyRegion extends RegionReference {
  25. private BeforeFloat beforeFloat;
  26. private MainReference mainReference;
  27. private Footnote footnote;
  28. private int columnGap;
  29. private int columnCount;
  30. /** Reference inline progression dimension for the body. */
  31. private int refIPD;
  32. /**
  33. * Create a new body region area.
  34. * This sets the region reference area class to BODY.
  35. */
  36. public BodyRegion() {
  37. super(Region.BODY_CODE);
  38. }
  39. /**
  40. * Set the number of columns for blocks when not spanning
  41. *
  42. * @param colCount the number of columns
  43. */
  44. public void setColumnCount(int colCount) {
  45. this.columnCount = colCount;
  46. }
  47. /**
  48. * Get the number of columns when not spanning
  49. *
  50. * @return the number of columns
  51. */
  52. public int getColumnCount() {
  53. return this.columnCount;
  54. }
  55. /**
  56. * Set the column gap between columns
  57. * The length is in millipoints.
  58. *
  59. * @param colGap the column gap in millipoints
  60. */
  61. public void setColumnGap(int colGap) {
  62. this.columnGap = colGap;
  63. }
  64. /**
  65. * Set the before float area.
  66. *
  67. * @param bf the before float area
  68. */
  69. public void setBeforeFloat(BeforeFloat bf) {
  70. beforeFloat = bf;
  71. }
  72. /**
  73. * Set the main reference area.
  74. *
  75. * @param mr the main reference area
  76. */
  77. public void setMainReference(MainReference mr) {
  78. mainReference = mr;
  79. }
  80. /**
  81. * Set the footnote area.
  82. *
  83. * @param foot the footnote area
  84. */
  85. public void setFootnote(Footnote foot) {
  86. footnote = foot;
  87. }
  88. /**
  89. * Get the before float area.
  90. *
  91. * @return the before float area
  92. */
  93. public BeforeFloat getBeforeFloat() {
  94. return beforeFloat;
  95. }
  96. /**
  97. * Get the main reference area.
  98. *
  99. * @return the main reference area
  100. */
  101. public MainReference getMainReference() {
  102. return mainReference;
  103. }
  104. /**
  105. * Get the footnote area.
  106. *
  107. * @return the footnote area
  108. */
  109. public Footnote getFootnote() {
  110. return footnote;
  111. }
  112. /**
  113. * Clone this object.
  114. *
  115. * @return a shallow copy of this object
  116. */
  117. public Object clone() {
  118. BodyRegion br = new BodyRegion();
  119. br.setCTM(getCTM());
  120. br.setIPD(getIPD());
  121. br.columnGap = columnGap;
  122. br.columnCount = columnCount;
  123. br.beforeFloat = beforeFloat;
  124. br.mainReference = mainReference;
  125. br.footnote = footnote;
  126. return br;
  127. }
  128. }