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

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