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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * Copyright 1999-2004 The Apache Software Foundation.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /* $Id$ */
  17. package org.apache.fop.area.inline;
  18. import org.apache.fop.area.Area;
  19. import org.apache.fop.area.Block;
  20. import java.util.List;
  21. import java.util.ArrayList;
  22. /**
  23. * Container area for inline container.
  24. * This area should be placed in a viewport as a result of the
  25. * inline container formatting object.
  26. * This allows an inline area to have blocks as children.
  27. */
  28. public class Container extends Area {
  29. /**
  30. * The list of block areas stacked inside this container
  31. */
  32. protected List blocks = new ArrayList();
  33. /**
  34. * The width of this container
  35. */
  36. protected int width;
  37. /**
  38. * Create a new container area
  39. */
  40. public Container() {
  41. }
  42. /**
  43. * Add the block to this area.
  44. *
  45. * @param block the block area to add
  46. */
  47. public void addBlock(Block block) {
  48. blocks.add(block);
  49. }
  50. /**
  51. * Get the block areas stacked inside this container area.
  52. *
  53. * @return the list of block areas
  54. */
  55. public List getBlocks() {
  56. return blocks;
  57. }
  58. /**
  59. * Get the width of this container area.
  60. *
  61. * @return the width
  62. */
  63. public int getWidth() {
  64. return width;
  65. }
  66. }