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.

Marker.java 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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.datatypes.*;
  13. import org.apache.fop.apps.FOPException;
  14. import org.xml.sax.Attributes;
  15. public class Marker extends FObjMixed {
  16. private String markerClassName;
  17. public Marker(FONode parent) {
  18. super(parent);
  19. }
  20. public void handleAttrs(Attributes attlist) throws FOPException {
  21. super.handleAttrs(attlist);
  22. // do check to see that 'this' is under fo:flow
  23. this.markerClassName =
  24. this.properties.get("marker-class-name").getString();
  25. // check to ensure that no other marker with same parent
  26. // has this 'marker-class-name' is in addMarker() method
  27. try {
  28. ((FObj)parent).addMarker(this);
  29. } catch (FOPException fopex) {
  30. getLogger().error("marker cannot be added to '" + parent
  31. + "'");
  32. }
  33. }
  34. public String getMarkerClassName() {
  35. return markerClassName;
  36. }
  37. }