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.

BeforeFloat.java 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * $Id$
  3. * Copyright (C) 2001-2002 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. /**
  9. * The before float area.
  10. * This is used to place the before float areas.
  11. * It has an optional separator and before float block children.
  12. */
  13. public class BeforeFloat extends BlockParent {
  14. // this is an optional block area that will be rendered
  15. // as the separator only if there are float areas
  16. private Block separator = null;
  17. /**
  18. * Set the separator area for this before float.
  19. *
  20. * @param sep the before float separator area
  21. */
  22. public void setSeparator(Block sep) {
  23. separator = sep;
  24. }
  25. /**
  26. * Get the separator area for this before float.
  27. *
  28. * @return the before float separator area
  29. */
  30. public Block getSeparator() {
  31. return separator;
  32. }
  33. /**
  34. * Get the height of this before float.
  35. * It gets the height of the children and if there is a
  36. * separator its height is also added.
  37. *
  38. * @return the height of the before float including separator
  39. */
  40. public int getHeight() {
  41. int h = super.getHeight();
  42. if (separator != null) {
  43. h += separator.getHeight();
  44. }
  45. return h;
  46. }
  47. }