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

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