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.

SpacePropertyMaker.java 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright 2005 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.fo.properties;
  18. import org.apache.fop.fo.Constants;
  19. import org.apache.fop.fo.PropertyList;
  20. import org.apache.fop.fo.expr.PropertyException;
  21. /**
  22. * Special CorrespondingPropertyMaker that sets the conditionality subproperty
  23. * correctly for space-* properties.
  24. */
  25. public class SpacePropertyMaker extends CorrespondingPropertyMaker {
  26. /**
  27. * @param baseMaker base property maker
  28. */
  29. public SpacePropertyMaker(PropertyMaker baseMaker) {
  30. super(baseMaker);
  31. }
  32. /**
  33. * @see org.apache.fop.fo.properties.CorrespondingPropertyMaker#compute(PropertyList)
  34. */
  35. public Property compute(PropertyList propertyList) throws PropertyException {
  36. Property prop = super.compute(propertyList);
  37. if (prop != null && prop instanceof SpaceProperty) {
  38. ((SpaceProperty)prop).setConditionality(
  39. new EnumProperty(Constants.EN_RETAIN, "RETAIN"), false);
  40. }
  41. return prop;
  42. }
  43. }