package org.apache.fop.fo;
import java.lang.Character;
import java.util.HashMap;
import java.util.HashSet;
import java.util.StringTokenizer;
import java.util.BitSet;
import java.util.Iterator;
import org.apache.fop.apps.FOPException;
import org.apache.fop.fo.FObjectNames;
import org.apache.fop.fo.PropertySets;
import org.apache.fop.fo.PropNames;
import org.apache.fop.fo.FONode;
import org.apache.fop.datatypes.Ints;
import org.apache.fop.datastructs.ROIntArray;
import org.apache.fop.datastructs.ROBitSet;
public class FOPropertySets {
private static final String tag = "$Name$";
private static final String revision = "$Revision$";
public static final String packageNamePrefix = "org.apache.fop";
public static String getAttrSetName(int ancestry) throws FOPException {
if ((ancestry & FONode.MC_MARKER) != 0)
return "MARKER";
if ((ancestry & FONode.FLOW) != 0)
return "FLOW";
if ((ancestry & FONode.STATIC) != 0)
return "STATIC";
if ((ancestry & FONode.TITLE) != 0)
return "TITLE";
if ((ancestry & FONode.PAGESEQ) != 0)
return "PAGESEQ";
if ((ancestry & FONode.SEQ_MASTER) != 0)
return "SEQ_MASTER";
if ((ancestry & FONode.LAYOUT) != 0)
return "LAYOUT_MASTER";
if ((ancestry & FONode.DECLARATIONS) != 0)
return "DECLARATIONS";
if ((ancestry & FONode.ROOT) != 0)
return "ROOT";
throw new FOPException("Invalid attribute set: " + ancestry);
}
public static ROBitSet getAttrROBitSet(int ancestry)
throws FOPException
{
if ((ancestry & FONode.MC_MARKER) != 0)
return markerAllSet;
if ((ancestry & FONode.FLOW) != 0)
return flowAllSet;
if ((ancestry & FONode.STATIC) != 0)
return staticAllSet;
if ((ancestry & FONode.TITLE) != 0)
return titleAllSet;
if ((ancestry & FONode.PAGESEQ) != 0)
return pageSeqSet;
if ((ancestry & FONode.SEQ_MASTER) != 0)
return seqMasterSet;
if ((ancestry & FONode.LAYOUT) != 0)
return layoutMasterSet;
if ((ancestry & FONode.DECLARATIONS) != 0)
return declarationsAll;
if ((ancestry & FONode.ROOT) != 0)
return allProps;
throw new FOPException("Invalid attribute set: " + ancestry);
}
public static final ROBitSet allProps;
public static final ROBitSet declarationsAll;
public static final ROBitSet seqMasterSet;
public static final ROBitSet layoutMasterSet;
public static final ROBitSet pageSeqSet;
public static final ROBitSet flowAllSet;
within
public static final ROBitSet markerAllSet;
public static final ROBitSet staticAllSet;
public static final ROBitSet titleAllSet;
static {
BitSet allprops = new BitSet(PropNames.LAST_PROPERTY_INDEX + 1);
allprops.set(1, PropNames.LAST_PROPERTY_INDEX);
allProps = new ROBitSet(allprops);
BitSet rootonly = new BitSet(PropNames.MEDIA_USAGE + 1);
rootonly.set(PropNames.MEDIA_USAGE);
BitSet declarationsonly = new BitSet();
declarationsonly.set(PropNames.COLOR_PROFILE_NAME);
declarationsonly.set(PropNames.RENDERING_INTENT);
BitSet declarationsall = (BitSet)declarationsonly.clone();
declarationsall.set(PropNames.SRC);
declarationsAll = new ROBitSet(declarationsall);
BitSet seqmasteronly = new BitSet();
seqmasteronly.set(PropNames.MAXIMUM_REPEATS);
seqmasteronly.set(PropNames.PAGE_POSITION);
seqmasteronly.set(PropNames.ODD_OR_EVEN);
seqmasteronly.set(PropNames.BLANK_OR_NOT_BLANK);
BitSet seqmasterset = (BitSet)seqmasteronly.clone();
seqmasterset.set(PropNames.MASTER_NAME);
seqmasterset.set(PropNames.MASTER_REFERENCE);
seqMasterSet = new ROBitSet(seqmasterset);
BitSet layoutmasteronly = (BitSet)seqmasteronly.clone();
layoutmasteronly.set(PropNames.MASTER_NAME);
layoutmasteronly.set(PropNames.PAGE_HEIGHT);
layoutmasteronly.set(PropNames.PAGE_WIDTH);
layoutmasteronly.set(PropNames.COLUMN_COUNT);
layoutmasteronly.set(PropNames.COLUMN_GAP);
layoutmasteronly.set(PropNames.REGION_NAME);
layoutmasteronly.set(PropNames.EXTENT);
layoutmasteronly.set(PropNames.PRECEDENCE);
BitSet layoutmasterset = (BitSet)layoutmasteronly.clone();
layoutmasterset.set(PropNames.MASTER_REFERENCE);
layoutmasterset.set(PropNames.REFERENCE_ORIENTATION);
layoutmasterset.set(PropNames.WRITING_MODE);
layoutmasterset.set(PropNames.CLIP);
layoutmasterset.set(PropNames.DISPLAY_ALIGN);
layoutmasterset.set(PropNames.OVERFLOW);
layoutmasterset.or(PropertySets.marginBlockSet);
layoutmasterset.or(PropertySets.borderSet);
layoutmasterset.or(PropertySets.paddingSet);
layoutmasterset.or(PropertySets.backgroundSet);
layoutMasterSet = new ROBitSet(layoutmasterset);
BitSet flowonlyset = new BitSet();
flowonlyset.set(PropNames.MARKER_CLASS_NAME);
BitSet staticonlyset = new BitSet();
staticonlyset.set(PropNames.RETRIEVE_CLASS_NAME);
staticonlyset.set(PropNames.RETRIEVE_POSITION);
staticonlyset.set(PropNames.RETRIEVE_BOUNDARY);
BitSet pageseqonly = new BitSet();
pageseqonly.set(PropNames.FORMAT);
pageseqonly.set(PropNames.LETTER_VALUE);
pageseqonly.set(PropNames.GROUPING_SEPARATOR);
pageseqonly.set(PropNames.GROUPING_SIZE);
pageseqonly.set(PropNames.INITIAL_PAGE_NUMBER);
pageseqonly.set(PropNames.FORCE_PAGE_COUNT);
BitSet pageseqset = (BitSet)allprops.clone();
pageseqset.andNot(rootonly);
pageseqset.andNot(declarationsonly);
pageseqset.andNot(layoutmasteronly);
pageSeqSet = new ROBitSet(pageseqset);
BitSet flowallset = (BitSet)pageseqset.clone();
flowallset.andNot(pageseqonly);
flowallset.andNot(staticonlyset);
flowAllSet = new ROBitSet(flowallset);
BitSet staticallset = (BitSet)pageseqset.clone();
staticallset.andNot(pageseqonly);
staticallset.andNot(flowonlyset);
staticAllSet = new ROBitSet(staticallset);
BitSet markerallset = (BitSet)flowallset.clone();
markerallset.clear(PropNames.MARKER_CLASS_NAME);
markerAllSet = new ROBitSet(markerallset);
titleAllSet = markerAllSet;
}
public static final ROBitSet isReferenceArea;
static {
BitSet refareas = new BitSet(FObjectNames.LAST_FO + 1);
refareas.set(FObjectNames.SIMPLE_PAGE_MASTER);
refareas.set(FObjectNames.REGION_AFTER);
refareas.set(FObjectNames.REGION_BEFORE);
refareas.set(FObjectNames.REGION_BODY);
refareas.set(FObjectNames.REGION_END);
refareas.set(FObjectNames.REGION_START);
refareas.set(FObjectNames.BLOCK_CONTAINER);
refareas.set(FObjectNames.INLINE_CONTAINER);
refareas.set(FObjectNames.TABLE);
refareas.set(FObjectNames.TABLE_CAPTION);
refareas.set(FObjectNames.TABLE_CELL);
refareas.set(FObjectNames.TITLE);
isReferenceArea = new ROBitSet(refareas);
}
}