/** Return object used to calculate base Length
* for percent specifications.
*/
public PercentBase getPercentBase(final FObj fo, final PropertyList propertyList) {
return new LengthBase(fo, propertyList, LengthBase.);
return (new LengthBase(fo, propertyList, LengthBase.CUSTOM_BASE ) {
public int getBaseLength() {
return ();
}
});
}
protected boolean isAutoLengthAllowed() {
return true;
}
public Property checkEnumValues(String value) {
return super.checkEnumValues(value);
}
// Initialize hashtable of keywords
static HashMap s_htKeywords;
static {
s_htKeywords = new HashMap();
s_htKeywords.put("", "");
}
protected String checkValueKeywords(String keyword) {
String value = (String)s_htKeywords.get(keyword);
if (value == null) {
return super.checkValueKeywords(keyword);
}
else return value;
}
// See if other value types are acceptable
protected Property convertPropertyDatatype(Property p,
PropertyList propertyList, FObj fo) {
{
=
p.get();
if ( != null) {
return new (
);
}
}
return super.convertPropertyDatatype(p, propertyList, fo);
}
protected String getDefaultFor() {
return "";
}
private Property m_defaultProp=null;
public Property make(PropertyList propertyList) throws FOPException {
return make(propertyList, "", propertyList.getParentFObj());
if (m_defaultProp == null) {
m_defaultProp=make(propertyList, "", propertyList.getParentFObj());
}
return m_defaultProp;
}
Maker
.Maker
Property.Maker
implements
package org.apache.fop.fo.properties;
import java.util.HashMap;
import org.apache.fop.datatypes.*;
import org.apache.fop.fo.*;
import org.apache.fop.apps.FOPException;
public class extends {
public interface Enums {
int = Constants.;
public interface {
int = Constants.;
}
}
protected final static EnumProperty s_prop = new EnumProperty(Enums.);
Enums
Property.Maker
static private class SP_Maker
extends
implements . {
SP_Maker(String sPropName) {
super(sPropName);
}
protected final static EnumProperty s_prop = new EnumProperty();
}
final private static Property.Maker s_Maker =
new SP_Maker(
".");
final private static Property.Maker s_Maker =
new (
".");
static public Property.Maker maker(String propName) {
return new (propName);
}
protected (String name) {
super(name);
m_shorthandMaker= getSubpropMaker("");
}
Property.Maker m_shorthandMaker;
public Property checkEnumValues(String value) {
return m_shorthandMaker.checkEnumValues(value);
}
protected boolean isCompoundMaker() {
return true;
}
protected Property.Maker getSubpropMaker(String subprop) {
if (subprop.equals(""))
return s_Maker;
return super.getSubpropMaker(subprop);
}
protected Property setSubprop(Property baseProp, String subpropName,
Property subProp) {
val = baseProp.get();
// Do some type checking???
// Check if one of our subproperties???
val.setComponent(subpropName, subProp, false);
return baseProp;
}
public Property getSubpropValue(Property baseProp, String subpropName) {
val = baseProp.get();
return val.getComponent(subpropName);
}
public Property make(PropertyList propertyList) throws FOPException {
return makeCompound(propertyList, propertyList.getParentFObj());
}
private Property m_defaultProp=null;
public Property make(PropertyList propertyList) throws FOPException {
if (m_defaultProp == null) {
m_defaultProp=makeCompound(propertyList, propertyList.getParentFObj());
}
return m_defaultProp;
}
protected Property makeCompound(PropertyList pList, FObj fo) throws FOPException {
p = new ();
Property subProp;
// set default for subprop
subProp = getSubpropMaker("").make(pList,
getDefaultFor(), fo);
p.setComponent("", subProp, true);
return new (p);
}
protected String getDefaultFor() {
return "";
return "";
return "";
}
/** Set the appropriate components when the "base" property is set. */
public Property convertProperty(Property p, PropertyList pList,FObj fo)
throws FOPException
{
if (p instanceof ) return p;
if (! (p instanceof EnumProperty)) {
// delegate to the subprop maker to do conversions
p = m_shorthandMaker.convertProperty(p,pList,fo);
}
if (p != null) {
Property prop = makeCompound(pList, fo);
pval = prop.get();
pval.setComponent("", p, false);
return prop;
}
else return null;
}
public boolean isInherited() { return ; }
public boolean inheritsSpecified() {
return true;
}
public Property compute(PropertyList propertyList) {
Property computedProperty = null;
Property correspondingProperty = propertyList.get("");
if (correspondingProperty != null) {
int correspondingValue = correspondingProperty.getEnum();
if (correspondingValue == )
computedProperty = new EnumProperty();
else
;
}
return computedProperty;
}
public boolean isCorrespondingForced(PropertyList propertyList) {
FObj parentFO = propertyList.getParentFObj();
StringBuffer sbExpr=new StringBuffer();
sbExpr.setLength(0);
if (propertyList.getExplicit(sbExpr.toString()) != null) return true;
return false;
}
public Property compute(PropertyList propertyList) throws FOPException {
FObj parentFO = propertyList.getParentFObj();
StringBuffer sbExpr=new StringBuffer();
Property p=null;
// Make sure the property is set before calculating it!
if (propertyList.getExplicitOrShorthand(sbExpr.toString()) == null) return p;
sbExpr.setLength(0);
p= make(propertyList, sbExpr.toString(), propertyList.getParentFObj());
p= propertyList.getExplicitOrShorthand(sbExpr.toString());
if (p != null) {
p = convertProperty(p, propertyList, parentFO );
}
else p= makeCompound(propertyList, parentFO);
Property subprop;
sbExpr.setLength(0);
subprop= getSubpropMaker("").
make(propertyList, sbExpr.toString(), parentFO);
subprop= propertyList.getExplicitOrShorthand(sbExpr.toString());
if (subprop != null) {
setSubprop(p, "", subprop);
}
return p;
}
public Property getShorthand(PropertyList propertyList) {
Property p = null;
ListProperty listprop;
if (p == null) {
listprop = (ListProperty)propertyList.getExplicit("");
if (listprop != null) {
// Get a parser for the shorthand to set the individual properties
ShorthandParser shparser = new (listprop);
p = shparser.getValueForProperty(getPropName(), this, propertyList);
}
}
return p;
}
}
sbExpr.append("_fop-property-value(");
sbExpr.append(")");
sbExpr.append("");
sbExpr.append(propertyList.wmRelToAbs(PropertyList.));
sbExpr.append(parentFO.properties.wmRelToAbs(PropertyList.));
sbExpr.append(propertyList.wmAbsToRel(PropertyList.));
Conflict between subproperty datatypes:
!=
if (value.equals("")) { return s_prop; }