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.

Container.java 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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.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. * Container area for inline container.
  15. * This area should be placed in a viewport as a result of the
  16. * inline container formatting object.
  17. * This allows an inline area to have blocks as children.
  18. */
  19. public class Container extends Area {
  20. /**
  21. * The list of block areas stacked inside this container
  22. */
  23. protected List blocks = new ArrayList();
  24. /**
  25. * The width of this container
  26. */
  27. protected int width;
  28. /**
  29. * Create a new container area
  30. */
  31. public Container() {
  32. }
  33. /**
  34. * Add the block to this area.
  35. *
  36. * @param block the block area to add
  37. */
  38. public void addBlock(Block block) {
  39. blocks.add(block);
  40. }
  41. /**
  42. * Get the block areas stacked inside this container area.
  43. *
  44. * @return the list of block areas
  45. */
  46. public List getBlocks() {
  47. return blocks;
  48. }
  49. /**
  50. * Get the width of this container area.
  51. *
  52. * @return the width
  53. */
  54. public int getWidth() {
  55. return width;
  56. }
  57. }