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.

Space.java 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * $Id$
  3. * Copyright (C) 2001-2002 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.datatypes;
  8. import org.apache.fop.fo.Property;
  9. /**
  10. * a space quantity in XSL (space-before, space-after)
  11. */
  12. public class Space extends LengthRange {
  13. private Property precedence;
  14. private Property conditionality;
  15. // From CompoundDatatype
  16. public void setComponent(String sCmpnName, Property cmpnValue,
  17. boolean bIsDefault) {
  18. if (sCmpnName.equals("precedence")) {
  19. setPrecedence(cmpnValue, bIsDefault);
  20. } else if (sCmpnName.equals("conditionality")) {
  21. setConditionality(cmpnValue, bIsDefault);
  22. } else {
  23. super.setComponent(sCmpnName, cmpnValue, bIsDefault);
  24. }
  25. }
  26. // From CompoundDatatype
  27. public Property getComponent(String sCmpnName) {
  28. if (sCmpnName.equals("precedence")) {
  29. return getPrecedence();
  30. } else if (sCmpnName.equals("conditionality")) {
  31. return getConditionality();
  32. } else {
  33. return super.getComponent(sCmpnName);
  34. }
  35. }
  36. protected void setPrecedence(Property precedence, boolean bIsDefault) {
  37. this.precedence = precedence;
  38. }
  39. protected void setConditionality(Property conditionality,
  40. boolean bIsDefault) {
  41. this.conditionality = conditionality;
  42. }
  43. public Property getPrecedence() {
  44. return this.precedence;
  45. }
  46. public Property getConditionality() {
  47. return this.conditionality;
  48. }
  49. }