Changes to interface CorrespodingProperties Work on Padding properties git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197543 13f79535-47bb-0310-9956-ffa450edef68tags/Defoe_export
throw new PropertyException("Called from superclass"); | throw new PropertyException("Called from superclass"); | ||||
} | } | ||||
/** | |||||
* @return | |||||
* @throws PropertyException | |||||
*/ | |||||
public boolean overridesCorresponding() | |||||
throws PropertyException { | |||||
throw new PropertyException("Called from superclass"); | |||||
} | |||||
} | } |
package org.apache.fop.fo.properties; | package org.apache.fop.fo.properties; | ||||
import org.apache.fop.datatypes.PropertyValue; | import org.apache.fop.datatypes.PropertyValue; | ||||
import org.apache.fop.fo.FONode; | |||||
import org.apache.fop.fo.PropNames; | import org.apache.fop.fo.PropNames; | ||||
import org.apache.fop.fo.expr.PropertyException; | import org.apache.fop.fo.expr.PropertyException; | ||||
public class BorderAfterWidthLength extends BorderCommonWidth { | |||||
public class BorderAfterWidthLength extends BorderCommonWidthRelative { | |||||
public static final int dataTypes = LENGTH; | public static final int dataTypes = LENGTH; | ||||
public int getDataTypes() { | public int getDataTypes() { | ||||
return inherited; | return inherited; | ||||
} | } | ||||
public int getCorrespondingProperty(FONode foNode) | |||||
throws PropertyException { | |||||
return getCorrespondingWidthProperty( | |||||
foNode, WritingMode.AFTER); | |||||
} | |||||
} | } | ||||
package org.apache.fop.fo.properties; | package org.apache.fop.fo.properties; | ||||
import org.apache.fop.datatypes.PropertyValue; | import org.apache.fop.datatypes.PropertyValue; | ||||
import org.apache.fop.fo.FONode; | |||||
import org.apache.fop.fo.PropNames; | import org.apache.fop.fo.PropNames; | ||||
import org.apache.fop.fo.expr.PropertyException; | import org.apache.fop.fo.expr.PropertyException; | ||||
public class BorderBeforeWidthLength extends BorderCommonWidth { | |||||
public class BorderBeforeWidthLength extends BorderCommonWidthRelative { | |||||
public static final int dataTypes = LENGTH; | public static final int dataTypes = LENGTH; | ||||
public int getDataTypes() { | public int getDataTypes() { | ||||
return inherited; | return inherited; | ||||
} | } | ||||
public int getCorrespondingProperty(FONode foNode) | |||||
throws PropertyException { | |||||
return getCorrespondingWidthProperty( | |||||
foNode, WritingMode.BEFORE); | |||||
} | |||||
} | } | ||||
foNode, WritingMode.BOTTOM); | foNode, WritingMode.BOTTOM); | ||||
} | } | ||||
public boolean overridesCorresponding(FONode foNode) { | |||||
return false; | |||||
} | |||||
} | } | ||||
foNode, WritingMode.BOTTOM); | foNode, WritingMode.BOTTOM); | ||||
} | } | ||||
public boolean overridesCorresponding(FONode foNode) { | |||||
return false; | |||||
} | |||||
} | } | ||||
foNode, WritingMode.BOTTOM); | foNode, WritingMode.BOTTOM); | ||||
} | } | ||||
public boolean overridesCorresponding(FONode foNode) { | |||||
return false; | |||||
} | |||||
} | } | ||||
throws PropertyException { | throws PropertyException { | ||||
throw new PropertyException("Called from superclass"); | throw new PropertyException("Called from superclass"); | ||||
} | } | ||||
/* (non-Javadoc) | |||||
* @see org.apache.fop.fo.properties.CorrespondingProperty#overridesCorresponding(org.apache.fop.fo.FONode) | |||||
*/ | |||||
public boolean overridesCorresponding(FONode foNode) | |||||
throws PropertyException { | |||||
throw new PropertyException("Called from superclass"); | |||||
} | |||||
} | } |
return absBorderColorProps[absEdge]; | return absBorderColorProps[absEdge]; | ||||
} | } | ||||
public boolean overridesCorresponding(FONode foNode) { | |||||
return false; | |||||
} | |||||
public boolean isCorrespondingRelative() { | public boolean isCorrespondingRelative() { | ||||
return true; | return true; | ||||
} | } |
import java.util.HashMap; | import java.util.HashMap; | ||||
import org.apache.fop.datatypes.Ints; | import org.apache.fop.datatypes.Ints; | ||||
import org.apache.fop.fo.FONode; | |||||
import org.apache.fop.fo.expr.PropertyException; | import org.apache.fop.fo.expr.PropertyException; | ||||
/** | /** | ||||
return rwEnums[index]; | return rwEnums[index]; | ||||
} | } | ||||
public boolean overridesCorresponding(FONode foNode) | |||||
throws PropertyException { | |||||
throw new PropertyException("Called within superclass"); | |||||
} | |||||
} | } | ||||
return absBorderStyleProps[absEdge]; | return absBorderStyleProps[absEdge]; | ||||
} | } | ||||
public boolean overridesCorresponding(FONode foNode) { | |||||
return false; | |||||
} | |||||
public boolean isCorrespondingRelative() { | public boolean isCorrespondingRelative() { | ||||
return true; | return true; | ||||
} | } |
return rwEnums[index]; | return rwEnums[index]; | ||||
} | } | ||||
public boolean overridesCorresponding(FONode foNode) | |||||
throws PropertyException { | |||||
throw new PropertyException("Called within superclass"); | |||||
} | |||||
} | } | ||||
return absBorderWidthProps[absEdge]; | return absBorderWidthProps[absEdge]; | ||||
} | } | ||||
public boolean overridesCorresponding(FONode foNode) { | |||||
return false; | |||||
} | |||||
public boolean isCorrespondingRelative() { | public boolean isCorrespondingRelative() { | ||||
return true; | return true; | ||||
} | } |
package org.apache.fop.fo.properties; | package org.apache.fop.fo.properties; | ||||
import org.apache.fop.datatypes.PropertyValue; | import org.apache.fop.datatypes.PropertyValue; | ||||
import org.apache.fop.fo.FONode; | |||||
import org.apache.fop.fo.PropNames; | import org.apache.fop.fo.PropNames; | ||||
import org.apache.fop.fo.expr.PropertyException; | import org.apache.fop.fo.expr.PropertyException; | ||||
public class BorderEndWidthLength extends BorderCommonWidth { | |||||
public class BorderEndWidthLength extends BorderCommonWidthRelative { | |||||
public static final int dataTypes = LENGTH; | public static final int dataTypes = LENGTH; | ||||
public int getDataTypes() { | public int getDataTypes() { | ||||
public int getInherited() { | public int getInherited() { | ||||
return inherited; | return inherited; | ||||
} | } | ||||
public int getCorrespondingProperty(FONode foNode) | |||||
throws PropertyException { | |||||
return getCorrespondingWidthProperty( | |||||
foNode, WritingMode.END); | |||||
} | |||||
} | } | ||||
foNode, WritingMode.LEFT); | foNode, WritingMode.LEFT); | ||||
} | } | ||||
public boolean overridesCorresponding(FONode foNode) { | |||||
return false; | |||||
} | |||||
} | } | ||||
foNode, WritingMode.LEFT); | foNode, WritingMode.LEFT); | ||||
} | } | ||||
public boolean overridesCorresponding(FONode foNode) { | |||||
return false; | |||||
} | |||||
} | } | ||||
foNode, WritingMode.LEFT); | foNode, WritingMode.LEFT); | ||||
} | } | ||||
public boolean overridesCorresponding(FONode foNode) { | |||||
return false; | |||||
} | |||||
} | } | ||||
foNode, WritingMode.RIGHT); | foNode, WritingMode.RIGHT); | ||||
} | } | ||||
public boolean overridesCorresponding(FONode foNode) { | |||||
return false; | |||||
} | |||||
} | } | ||||
foNode, WritingMode.RIGHT); | foNode, WritingMode.RIGHT); | ||||
} | } | ||||
public boolean overridesCorresponding(FONode foNode) { | |||||
return false; | |||||
} | |||||
} | } | ||||
foNode, WritingMode.RIGHT); | foNode, WritingMode.RIGHT); | ||||
} | } | ||||
public boolean overridesCorresponding(FONode foNode) { | |||||
return false; | |||||
} | |||||
} | } | ||||
foNode, WritingMode.START); | foNode, WritingMode.START); | ||||
} | } | ||||
public boolean overridesCorresponding(FONode foNode) { | |||||
return false; | |||||
} | |||||
} | } | ||||
package org.apache.fop.fo.properties; | package org.apache.fop.fo.properties; | ||||
import org.apache.fop.datatypes.PropertyValue; | import org.apache.fop.datatypes.PropertyValue; | ||||
import org.apache.fop.fo.FONode; | |||||
import org.apache.fop.fo.PropNames; | import org.apache.fop.fo.PropNames; | ||||
import org.apache.fop.fo.expr.PropertyException; | import org.apache.fop.fo.expr.PropertyException; | ||||
public class BorderStartWidthLength extends BorderCommonWidth { | |||||
public class BorderStartWidthLength extends BorderCommonWidthRelative { | |||||
public static final int dataTypes = LENGTH; | public static final int dataTypes = LENGTH; | ||||
public int getDataTypes() { | public int getDataTypes() { | ||||
return inherited; | return inherited; | ||||
} | } | ||||
public int getCorrespondingProperty(FONode foNode) | |||||
throws PropertyException { | |||||
return getCorrespondingWidthProperty( | |||||
foNode, WritingMode.END); | |||||
} | |||||
} | } | ||||
foNode, WritingMode.TOP); | foNode, WritingMode.TOP); | ||||
} | } | ||||
public boolean overridesCorresponding(FONode foNode) { | |||||
return false; | |||||
} | |||||
} | } | ||||
foNode, WritingMode.TOP); | foNode, WritingMode.TOP); | ||||
} | } | ||||
public boolean overridesCorresponding(FONode foNode) { | |||||
return false; | |||||
} | |||||
} | } | ||||
foNode, WritingMode.TOP); | foNode, WritingMode.TOP); | ||||
} | } | ||||
public boolean overridesCorresponding(FONode foNode) { | |||||
return false; | |||||
} | |||||
} | } | ||||
throws PropertyException; | throws PropertyException; | ||||
public int getCorrespondingProperty(FONode foNode) | public int getCorrespondingProperty(FONode foNode) | ||||
throws PropertyException; | throws PropertyException; | ||||
public boolean overridesCorresponding(FONode foNode) | |||||
throws PropertyException; | |||||
} | } |
import org.apache.fop.datatypes.Length; | import org.apache.fop.datatypes.Length; | ||||
import org.apache.fop.datatypes.PropertyValue; | import org.apache.fop.datatypes.PropertyValue; | ||||
import org.apache.fop.fo.FONode; | |||||
import org.apache.fop.fo.PropNames; | import org.apache.fop.fo.PropNames; | ||||
import org.apache.fop.fo.expr.PropertyException; | import org.apache.fop.fo.expr.PropertyException; | ||||
public class PaddingAfter extends Property { | |||||
public class PaddingAfter extends PaddingCorrespondingRelative { | |||||
public static final int dataTypes = | public static final int dataTypes = | ||||
COMPOUND | PERCENTAGE | LENGTH | INHERIT; | COMPOUND | PERCENTAGE | LENGTH | INHERIT; | ||||
return inherited; | return inherited; | ||||
} | } | ||||
public int getCorrespondingProperty(FONode foNode) | |||||
throws PropertyException { | |||||
return getCorrespondingPaddingProperty( | |||||
foNode, WritingMode.AFTER); | |||||
} | |||||
} | } | ||||
import org.apache.fop.datatypes.Length; | import org.apache.fop.datatypes.Length; | ||||
import org.apache.fop.datatypes.PropertyValue; | import org.apache.fop.datatypes.PropertyValue; | ||||
import org.apache.fop.fo.FONode; | |||||
import org.apache.fop.fo.PropNames; | import org.apache.fop.fo.PropNames; | ||||
import org.apache.fop.fo.expr.PropertyException; | import org.apache.fop.fo.expr.PropertyException; | ||||
public class PaddingAfterLength extends Property { | |||||
public class PaddingAfterLength extends PaddingCorrespondingRelative { | |||||
public static final int dataTypes = PERCENTAGE | LENGTH; | public static final int dataTypes = PERCENTAGE | LENGTH; | ||||
public int getDataTypes() { | public int getDataTypes() { | ||||
return inherited; | return inherited; | ||||
} | } | ||||
public int getCorrespondingProperty(FONode foNode) | |||||
throws PropertyException { | |||||
return getCorrespondingPaddingProperty( | |||||
foNode, WritingMode.AFTER); | |||||
} | |||||
} | } | ||||
import org.apache.fop.datatypes.Length; | import org.apache.fop.datatypes.Length; | ||||
import org.apache.fop.datatypes.PropertyValue; | import org.apache.fop.datatypes.PropertyValue; | ||||
import org.apache.fop.fo.FONode; | |||||
import org.apache.fop.fo.PropNames; | import org.apache.fop.fo.PropNames; | ||||
import org.apache.fop.fo.expr.PropertyException; | import org.apache.fop.fo.expr.PropertyException; | ||||
public class PaddingBefore extends Property { | |||||
public class PaddingBefore extends PaddingCorrespondingRelative { | |||||
public static final int dataTypes = | public static final int dataTypes = | ||||
COMPOUND |PERCENTAGE | LENGTH | INHERIT; | COMPOUND |PERCENTAGE | LENGTH | INHERIT; | ||||
return inherited; | return inherited; | ||||
} | } | ||||
public int getCorrespondingProperty(FONode foNode) | |||||
throws PropertyException { | |||||
return getCorrespondingPaddingProperty( | |||||
foNode, WritingMode.BEFORE); | |||||
} | |||||
} | } | ||||
import org.apache.fop.datatypes.Length; | import org.apache.fop.datatypes.Length; | ||||
import org.apache.fop.datatypes.PropertyValue; | import org.apache.fop.datatypes.PropertyValue; | ||||
import org.apache.fop.fo.FONode; | |||||
import org.apache.fop.fo.PropNames; | import org.apache.fop.fo.PropNames; | ||||
import org.apache.fop.fo.expr.PropertyException; | import org.apache.fop.fo.expr.PropertyException; | ||||
public class PaddingBeforeLength extends Property { | |||||
public class PaddingBeforeLength extends PaddingCorrespondingRelative { | |||||
public static final int dataTypes = LENGTH; | public static final int dataTypes = LENGTH; | ||||
public int getDataTypes() { | public int getDataTypes() { | ||||
return inherited; | return inherited; | ||||
} | } | ||||
public int getCorrespondingProperty(FONode foNode) | |||||
throws PropertyException { | |||||
return getCorrespondingPaddingProperty( | |||||
foNode, WritingMode.BEFORE); | |||||
} | |||||
} | } | ||||
/* | |||||
* | |||||
* Copyright 2004 The Apache Software Foundation. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* | |||||
* Created on 29/04/2004 | |||||
* $Id$ | |||||
*/ | |||||
package org.apache.fop.fo.properties; | |||||
import org.apache.fop.fo.FONode; | |||||
import org.apache.fop.fo.PropNames; | |||||
import org.apache.fop.fo.expr.PropertyException; | |||||
/** | |||||
* @author pbw | |||||
* @version $Revision$ $Name$ | |||||
*/ | |||||
public abstract class PaddingCorrespondingAbsolute | |||||
extends AbstractCorrespondingProperty { | |||||
/** Array of relative padding properties, | |||||
* indexed by relative edge constants */ | |||||
private static int[] relPaddingProps = { | |||||
PropNames.NO_PROPERTY | |||||
,PropNames.PADDING_BEFORE | |||||
,PropNames.PADDING_AFTER | |||||
,PropNames.PADDING_START | |||||
,PropNames.PADDING_END | |||||
}; | |||||
/** | |||||
* Gets the relative padding property corresponding to the given | |||||
* absolute edge | |||||
* @param foNode the node on which the property is being defined | |||||
* @param absoluteEdge | |||||
* @return the relative padding property index | |||||
* @throws PropertyException | |||||
*/ | |||||
protected int getCorrespondingPaddingProperty( | |||||
FONode foNode, int absoluteEdge) | |||||
throws PropertyException { | |||||
int relEdge = WritingMode.getCorrespondingRelativeEdge( | |||||
getWritingMode(foNode), absoluteEdge); | |||||
return relPaddingProps[relEdge]; | |||||
} | |||||
public boolean isCorrespondingAbsolute() { | |||||
return true; | |||||
} | |||||
} |
/* | |||||
* | |||||
* Copyright 2004 The Apache Software Foundation. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* | |||||
* Created on 29/04/2004 | |||||
* $Id$ | |||||
*/ | |||||
package org.apache.fop.fo.properties; | |||||
import org.apache.fop.fo.FONode; | |||||
import org.apache.fop.fo.PropNames; | |||||
import org.apache.fop.fo.expr.PropertyException; | |||||
/** | |||||
* @author pbw | |||||
* @version $Revision$ $Name$ | |||||
*/ | |||||
public abstract class PaddingCorrespondingRelative extends AbstractCorrespondingProperty { | |||||
/** Array of absolute padding properties, | |||||
* indexed by absolute edge constants */ | |||||
private static int[] absPaddingProps = { | |||||
PropNames.NO_PROPERTY | |||||
,PropNames.PADDING_TOP | |||||
,PropNames.PADDING_BOTTOM | |||||
,PropNames.PADDING_LEFT | |||||
,PropNames.PADDING_RIGHT | |||||
}; | |||||
/** | |||||
* Gets the absolute padding property corresponding to the given | |||||
* relative edge | |||||
* @param foNode the node on which the property is being defined | |||||
* @param relativeEdge | |||||
* @return the absolute padding property index | |||||
* @throws PropertyException | |||||
*/ | |||||
protected int getCorrespondingPaddingProperty( | |||||
FONode foNode, int relativeEdge) | |||||
throws PropertyException { | |||||
int relEdge = WritingMode.getCorrespondingAbsoluteEdge( | |||||
getWritingMode(foNode), relativeEdge); | |||||
return absPaddingProps[relEdge]; | |||||
} | |||||
public boolean isCorrespondingRelative() { | |||||
return true; | |||||
} | |||||
} |
import org.apache.fop.datatypes.Length; | import org.apache.fop.datatypes.Length; | ||||
import org.apache.fop.datatypes.PropertyValue; | import org.apache.fop.datatypes.PropertyValue; | ||||
import org.apache.fop.fo.FONode; | |||||
import org.apache.fop.fo.PropNames; | import org.apache.fop.fo.PropNames; | ||||
import org.apache.fop.fo.expr.PropertyException; | import org.apache.fop.fo.expr.PropertyException; | ||||
public class PaddingEnd extends Property { | |||||
public class PaddingEnd extends PaddingCorrespondingRelative { | |||||
public static final int dataTypes = | public static final int dataTypes = | ||||
COMPOUND | PERCENTAGE | LENGTH | INHERIT; | COMPOUND | PERCENTAGE | LENGTH | INHERIT; | ||||
return inherited; | return inherited; | ||||
} | } | ||||
public int getCorrespondingProperty(FONode foNode) | |||||
throws PropertyException { | |||||
return getCorrespondingPaddingProperty( | |||||
foNode, WritingMode.END); | |||||
} | |||||
} | } | ||||
import org.apache.fop.datatypes.Length; | import org.apache.fop.datatypes.Length; | ||||
import org.apache.fop.datatypes.PropertyValue; | import org.apache.fop.datatypes.PropertyValue; | ||||
import org.apache.fop.fo.FONode; | |||||
import org.apache.fop.fo.PropNames; | import org.apache.fop.fo.PropNames; | ||||
import org.apache.fop.fo.expr.PropertyException; | import org.apache.fop.fo.expr.PropertyException; | ||||
public class PaddingEndLength extends Property { | |||||
public class PaddingEndLength extends PaddingCorrespondingRelative { | |||||
public static final int dataTypes = PERCENTAGE | LENGTH; | public static final int dataTypes = PERCENTAGE | LENGTH; | ||||
public int getDataTypes() { | public int getDataTypes() { | ||||
return inherited; | return inherited; | ||||
} | } | ||||
public int getCorrespondingProperty(FONode foNode) | |||||
throws PropertyException { | |||||
return getCorrespondingPaddingProperty( | |||||
foNode, WritingMode.END); | |||||
} | |||||
} | } | ||||
import org.apache.fop.datatypes.Length; | import org.apache.fop.datatypes.Length; | ||||
import org.apache.fop.datatypes.PropertyValue; | import org.apache.fop.datatypes.PropertyValue; | ||||
import org.apache.fop.fo.FONode; | |||||
import org.apache.fop.fo.PropNames; | import org.apache.fop.fo.PropNames; | ||||
import org.apache.fop.fo.expr.PropertyException; | import org.apache.fop.fo.expr.PropertyException; | ||||
public class PaddingStart extends Property { | |||||
public class PaddingStart extends PaddingCorrespondingRelative { | |||||
public static final int dataTypes = | public static final int dataTypes = | ||||
COMPOUND | PERCENTAGE | LENGTH | INHERIT; | COMPOUND | PERCENTAGE | LENGTH | INHERIT; | ||||
return inherited; | return inherited; | ||||
} | } | ||||
public int getCorrespondingProperty(FONode foNode) | |||||
throws PropertyException { | |||||
return getCorrespondingPaddingProperty( | |||||
foNode, WritingMode.START); | |||||
} | |||||
} | } | ||||
import org.apache.fop.datatypes.Length; | import org.apache.fop.datatypes.Length; | ||||
import org.apache.fop.datatypes.PropertyValue; | import org.apache.fop.datatypes.PropertyValue; | ||||
import org.apache.fop.fo.FONode; | |||||
import org.apache.fop.fo.PropNames; | import org.apache.fop.fo.PropNames; | ||||
import org.apache.fop.fo.expr.PropertyException; | import org.apache.fop.fo.expr.PropertyException; | ||||
public class PaddingStartLength extends Property { | |||||
public class PaddingStartLength extends PaddingCorrespondingRelative { | |||||
public static final int dataTypes = PERCENTAGE | LENGTH; | public static final int dataTypes = PERCENTAGE | LENGTH; | ||||
public int getDataTypes() { | public int getDataTypes() { | ||||
return inherited; | return inherited; | ||||
} | } | ||||
public int getCorrespondingProperty(FONode foNode) | |||||
throws PropertyException { | |||||
return getCorrespondingPaddingProperty( | |||||
foNode, WritingMode.START); | |||||
} | |||||
} | } | ||||