import org.xml.sax.Locator;
import org.apache.fop.apps.FOPException;
+import org.apache.fop.datatypes.ColorType;
import org.apache.fop.datatypes.Length;
+import org.apache.fop.fo.Constants;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyList;
private int wrapOption;
// End of property values
+ // Properties which are not explicitely listed but are still applicable
+ private ColorType color;
+
/**
* @param parent FONode that is the parent of this object
*/
visibility = pList.get(PR_VISIBILITY).getEnum();
wordSpacing = pList.get(PR_WORD_SPACING).getSpace();
wrapOption = pList.get(PR_WRAP_OPTION).getEnum();
+
+ // implicit properties
+ color = pList.get(Constants.PR_COLOR).getColorType();
}
/**
invalidChildError(loc, nsURI, localName);
}
- /**
- * Return the Common Font Properties.
- */
+ /** @return the Common Font Properties. */
public CommonFont getCommonFont() {
return commonFont;
}
- /**
- * Return the Common Border, Padding, and Background Properties.
- */
+ /** @return the "color" property. */
+ public ColorType getColor() {
+ return color;
+ }
+
+ /** @return the Common Border, Padding, and Background Properties. */
public CommonBorderPaddingBackground getCommonBorderPaddingBackground() {
return commonBorderPaddingBackground;
}
- /**
- * @return the "id" property.
- */
+ /** @return the "id" property. */
public String getId() {
return id;
}
return textDecoration;
}
- /**
- * @see org.apache.fop.fo.FONode#getName()
- */
+ /** @see org.apache.fop.fo.FONode#getName() */
public String getName() {
return "fo:page-number";
}
- /**
- * @see org.apache.fop.fo.FObj#getNameId()
- */
+ /** @see org.apache.fop.fo.FObj#getNameId() */
public int getNameId() {
return FO_PAGE_NUMBER;
}
import org.xml.sax.Locator;
import org.apache.fop.apps.FOPException;
+import org.apache.fop.datatypes.ColorType;
import org.apache.fop.datatypes.Length;
+import org.apache.fop.fo.Constants;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyList;
private int wrapOption;
// End of property values
+ // Properties which are not explicitely listed but are still applicable
+ private ColorType color;
+
/**
* @param parent FONode that is the parent of this object
*/
visibility = pList.get(PR_VISIBILITY).getEnum();
wordSpacing = pList.get(PR_WORD_SPACING).getSpace();
wrapOption = pList.get(PR_WRAP_OPTION).getEnum();
+
+ // implicit properties
+ color = pList.get(Constants.PR_COLOR).getColorType();
}
/**
invalidChildError(loc, nsURI, localName);
}
- /**
- * Return the Common Font Properties.
- */
+ /** @return the Common Font Properties. */
public CommonFont getCommonFont() {
return commonFont;
}
+ /** @return the "color" property. */
+ public ColorType getColor() {
+ return color;
+ }
+
/** @return the "text-decoration" property. */
public CommonTextDecoration getTextDecoration() {
return textDecoration;
}
- /**
- * Return the "id" property.
- */
+ /** @return the "id" property. */
public String getId() {
return id;
}
- /**
- * Return the "ref-id" property.
- */
+ /** @return the "ref-id" property. */
public String getRefId() {
return refId;
}
- /**
- * @see org.apache.fop.fo.FObj#getName()
- */
+ /** @see org.apache.fop.fo.FObj#getName() */
public String getName() {
return "fo:page-number-citation";
}
- /**
- * @see org.apache.fop.fo.FObj#getNameId()
- */
+ /** @see org.apache.fop.fo.FObj#getNameId() */
public int getNameId() {
return FO_PAGE_NUMBER_CITATION;
}
inline.setOffset(font.getAscender());
inline.addTrait(Trait.FONT_NAME, font.getFontName());
inline.addTrait(Trait.FONT_SIZE, new Integer(font.getFontSize()));
+ inline.addTrait(Trait.COLOR, fobj.getColor());
TraitSetter.addTextDecoration(inline, fobj.getTextDecoration());
return inline;
public InlineArea get(LayoutContext context) {
// get page string from parent, build area
- TextArea inline = new TextArea();
+ TextArea text = new TextArea();
String str = getCurrentPV().getPageNumberString();
int width = 0;
for (int count = 0; count < str.length(); count++) {
width += font.getCharWidth(str.charAt(count));
}
- inline.setTextArea(str);
- inline.setIPD(width);
- inline.setBPD(font.getAscender() - font.getDescender());
- inline.setOffset(font.getAscender());
- inline.addTrait(Trait.FONT_NAME, font.getFontName());
- inline.addTrait(Trait.FONT_SIZE,
+ text.setTextArea(str);
+ text.setIPD(width);
+ text.setBPD(font.getAscender() - font.getDescender());
+ text.setOffset(font.getAscender());
+ text.addTrait(Trait.FONT_NAME, font.getFontName());
+ text.addTrait(Trait.FONT_SIZE,
new Integer(font.getFontSize()));
+ text.addTrait(Trait.COLOR, fobj.getColor());
- TraitSetter.addTextDecoration(inline, fobj.getTextDecoration());
+ TraitSetter.addTextDecoration(text, fobj.getTextDecoration());
- return inline;
+ return text;
}