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.

ListItemLabel.java 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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.fo.flow;
  8. // FOP
  9. import org.apache.fop.fo.*;
  10. import org.apache.fop.fo.properties.*;
  11. import org.apache.fop.layout.*;
  12. import org.apache.fop.layout.FontState;
  13. import org.apache.fop.apps.FOPException;
  14. // Java
  15. import java.util.Enumeration;
  16. public class ListItemLabel extends FObj {
  17. public ListItemLabel(FONode parent) {
  18. super(parent);
  19. }
  20. public Status layout(Area area) throws FOPException {
  21. int numChildren = this.children.size();
  22. if (numChildren != 1) {
  23. throw new FOPException("list-item-label must have exactly one block in this version of FOP");
  24. }
  25. // Common Accessibility Properties
  26. AccessibilityProps mAccProps = propMgr.getAccessibilityProps();
  27. // this.properties.get("id");
  28. // this.properties.get("keep-together");
  29. // initialize id
  30. String id = this.properties.get("id").getString();
  31. area.getIDReferences().initializeID(id, area);
  32. Block block = (Block)children.get(0);
  33. /*
  34. * For calculating the lineage - The fo:list-item-label formatting object
  35. * does not generate any areas. The fo:list-item-label formatting object
  36. * returns the sequence of areas created by concatenating the sequences
  37. * of areas returned by each of the children of the fo:list-item-label.
  38. */
  39. Status status;
  40. status = block.layout(area);
  41. area.addDisplaySpace(-block.getAreaHeight());
  42. return status;
  43. }
  44. }