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 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * $Id$
  3. * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
  4. * For details on use and redistribution please refer to the
  5. * LICENSE file included with these sources.
  6. */
  7. package org.apache.fop.area;
  8. import java.awt.geom.Rectangle2D;
  9. public class BodyRegion extends RegionReference {
  10. BeforeFloat beforeFloat;
  11. MainReference mainReference;
  12. Footnote footnote;
  13. private int columnGap;
  14. private int columnCount;
  15. /** Maximum block progression dimension. Note: min=opt=max */
  16. private MinOptMax maxBPD;
  17. /** Referenc inline progression dimension for the body. */
  18. private int refIPD;
  19. public BodyRegion() {
  20. super(BODY);
  21. }
  22. // Number of columns when not spanning
  23. public void setColumnCount(int colCount) {
  24. this.columnCount = colCount;
  25. }
  26. // Number of columns when not spanning
  27. public int getColumnCount() {
  28. return this.columnCount ;
  29. }
  30. // A length (mpoints)
  31. public void setColumnGap(int colGap) {
  32. this.columnGap = colGap;
  33. }
  34. public void setParent(Area area) {
  35. super.setParent(area);
  36. // Only if not scrolling or overflow !!!
  37. Rectangle2D refRect = ((RegionViewport)area).getViewArea();
  38. maxBPD = new MinOptMax((int)refRect.getHeight());
  39. refIPD = (int)refRect.getWidth();
  40. }
  41. public void setBeforeFloat(BeforeFloat bf) {
  42. beforeFloat = bf;
  43. beforeFloat.setParent(this);
  44. }
  45. public void setMainReference(MainReference mr) {
  46. mainReference = mr;
  47. mainReference.setParent(this);
  48. }
  49. public void setFootnote(Footnote foot) {
  50. footnote = foot;
  51. footnote.setParent(this);
  52. }
  53. public BeforeFloat getBeforeFloat() {
  54. return beforeFloat;
  55. }
  56. public MainReference getMainReference() {
  57. return mainReference;
  58. }
  59. public Footnote getFootnote() {
  60. return footnote;
  61. }
  62. public MinOptMax getMaxBPD() {
  63. return maxBPD;
  64. }
  65. }