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.5KB

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