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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. * The before-float-reference-area optionally generated by an fo:region-body.
  21. * It has an optional separator and before float block children.
  22. * See fo:region-body definition in the XSL Rec for more information.
  23. */
  24. public class BeforeFloat extends BlockParent {
  25. private static final long serialVersionUID = 4101415711488333380L;
  26. // this is an optional block area that will be rendered
  27. // as the separator only if there are float areas
  28. private Block separator;
  29. /**
  30. * Set the separator area for this before float.
  31. *
  32. * @param sep the before float separator area
  33. */
  34. public void setSeparator(Block sep) {
  35. separator = sep;
  36. }
  37. /**
  38. * Get the separator area for this before float.
  39. *
  40. * @return the before float separator area
  41. */
  42. public Block getSeparator() {
  43. return separator;
  44. }
  45. /**
  46. * Get the height of this before float.
  47. * It gets the height of the children and if there is a
  48. * separator its height is also added.
  49. *
  50. * @return the height of the before float including separator
  51. */
  52. @Override
  53. public int getBPD() {
  54. int h = super.getBPD();
  55. if (separator != null) {
  56. h += separator.getBPD();
  57. }
  58. return h;
  59. }
  60. /** {@inheritDoc} */
  61. @Override
  62. public boolean isEmpty() {
  63. return true; // before floats are not yet implemented
  64. }
  65. }