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.

InlineParent.java 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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.inline;
  8. import org.apache.fop.area.Area;
  9. import org.apache.fop.area.Block;
  10. import org.apache.fop.render.Renderer;
  11. import java.util.List;
  12. import java.util.ArrayList;
  13. /**
  14. * Inline parent area.
  15. * This is an inline area that can have other inlines as children.
  16. */
  17. public class InlineParent extends InlineArea {
  18. /**
  19. * The list of inline areas added to this inline parent.
  20. */
  21. protected ArrayList inlines = new ArrayList();
  22. /**
  23. * Create a new inline parent to add areas to.
  24. */
  25. public InlineParent() {
  26. }
  27. /**
  28. * Render this area.
  29. *
  30. * @param renderer the renderer to render this area in
  31. */
  32. public void render(Renderer renderer) {
  33. renderer.renderInlineParent(this);
  34. }
  35. /**
  36. * Override generic Area method.
  37. *
  38. * @param childArea the child area to add
  39. */
  40. public void addChild(Area childArea) {
  41. if (childArea instanceof InlineArea) {
  42. inlines.add(childArea);
  43. increaseIPD(((InlineArea) childArea).getAllocIPD());
  44. }
  45. }
  46. /**
  47. * Get the child areas for this inline parent.
  48. *
  49. * @return the list of child areas
  50. */
  51. public List getChildAreas() {
  52. return inlines;
  53. }
  54. }