import org.apache.fop.fo.GraphicsProperties;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
+import org.apache.fop.fo.properties.KeepProperty;
import org.apache.fop.fo.properties.LengthRangeProperty;
import org.apache.fop.fo.properties.SpaceProperty;
/**
- * Common base class for instream-foreign-object and external-graphics
- * flow formatting objects.
+ * Common base class for the <a href="http://www.w3.org/TR/xsl/#fo_instream-foreign-object">
+ * <code>fo:instream-foreign-object</code></a>
+ * and <a href="http://www.w3.org/TR/xsl/#fo_external-graphic">
+ * <code>fo:external-graphic</code></a> flow formatting objects.
*/
public abstract class AbstractGraphics extends FObj implements GraphicsProperties {
-
+
// The value of properties relevant for fo:instream-foreign-object
// and external-graphics.
private CommonBorderPaddingBackground commonBorderPaddingBackground;
private Length height;
private String id;
private LengthRangeProperty inlineProgressionDimension;
+ private KeepProperty keepWithNext;
+ private KeepProperty keepWithPrevious;
private SpaceProperty lineHeight;
private int overflow;
private int scaling;
// private CommonMarginInline commonMarginInline;
// private CommonRelativePosition commonRelativePosition;
// private String contentType;
- // private KeepProperty keepWithNext;
- // private KeepProperty keepWithPrevious;
// private int scalingMethod;
// End of property values
super(parent);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void bind(PropertyList pList) throws FOPException {
commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
alignmentAdjust = pList.get(PR_ALIGNMENT_ADJUST).getLength();
height = pList.get(PR_HEIGHT).getLength();
id = pList.get(PR_ID).getString();
inlineProgressionDimension = pList.get(PR_INLINE_PROGRESSION_DIMENSION).getLengthRange();
+ keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep();
+ keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep();
lineHeight = pList.get(PR_LINE_HEIGHT).getSpace();
overflow = pList.get(PR_OVERFLOW).getEnum();
scaling = pList.get(PR_SCALING).getEnum();
return id;
}
- /**
- * @return the Common Border, Padding, and Background Properties.
- */
+ /** @return the {@link CommonBorderPaddingBackground} */
public CommonBorderPaddingBackground getCommonBorderPaddingBackground() {
return commonBorderPaddingBackground;
}
- /**
- * @return the "line-height" property.
- */
+ /** @return the "line-height" property */
public SpaceProperty getLineHeight() {
return lineHeight;
}
- /** {@inheritDoc} */
+ /** @return the "inline-progression-dimension" property */
public LengthRangeProperty getInlineProgressionDimension() {
return inlineProgressionDimension;
}
- /** {@inheritDoc} */
+ /** @return the "block-progression-dimension" property */
public LengthRangeProperty getBlockProgressionDimension() {
return blockProgressionDimension;
}
- /**
- * @return the "height" property.
- */
+ /** @return the "height" property */
public Length getHeight() {
return height;
}
- /**
- * @return the "width" property.
- */
+ /** @return the "width" property */
public Length getWidth() {
return width;
}
- /** {@inheritDoc} */
+ /** @return the "content-height" property */
public Length getContentHeight() {
return contentHeight;
}
- /** {@inheritDoc} */
+ /** @return the "content-width" property */
public Length getContentWidth() {
return contentWidth;
}
- /** {@inheritDoc} */
+ /** @return the "scaling" property */
public int getScaling() {
return scaling;
}
- /** {@inheritDoc} */
+ /** @return the "overflow" property */
public int getOverflow() {
return overflow;
}
return textAlign;
}
- /**
- * @return the "alignment-adjust" property
- */
+ /** @return the "alignment-adjust" property */
public Length getAlignmentAdjust() {
if (alignmentAdjust.getEnum() == EN_AUTO) {
final Length intrinsicAlignmentAdjust = this.getIntrinsicAlignmentAdjust();
}
return alignmentAdjust;
}
-
- /**
- * @return the "alignment-baseline" property
- */
+
+ /** @return the "alignment-baseline" property */
public int getAlignmentBaseline() {
return alignmentBaseline;
}
-
- /**
- * @return the "baseline-shift" property
- */
+
+ /** @return the "baseline-shift" property */
public Length getBaselineShift() {
return baselineShift;
}
-
- /**
- * @return the "dominant-baseline" property
- */
+
+ /** @return the "dominant-baseline" property */
public int getDominantBaseline() {
return dominantBaseline;
}
-
- /**
- * @return the graphics intrinsic width in millipoints
- */
+
+ /** @return the "keep-with-next" property */
+ public KeepProperty getKeepWithNext() {
+ return keepWithNext;
+ }
+
+ /** @return the "keep-with-previous" property */
+ public KeepProperty getKeepWithPrevious() {
+ return keepWithPrevious;
+ }
+
+ /** @return the graphic's intrinsic width in millipoints */
public abstract int getIntrinsicWidth();
- /**
- * @return the graphics intrinsic height in millipoints
- */
+ /** @return the graphic's intrinsic height in millipoints */
public abstract int getIntrinsicHeight();
- /**
- * @return the graphics intrinsic alignment-adjust
- */
+ /** @return the graphic's intrinsic alignment-adjust */
public abstract Length getIntrinsicAlignmentAdjust();
}
import org.apache.fop.fo.properties.CommonFont;
import org.apache.fop.fo.properties.CommonHyphenation;
import org.apache.fop.fo.properties.CommonTextDecoration;
+import org.apache.fop.fo.properties.KeepProperty;
import org.apache.fop.fo.properties.Property;
import org.apache.fop.fo.properties.SpaceProperty;
/**
- * Class modelling the fo:character object.
- * Its use is defined by the spec:
- * "The fo:character flow object represents a character that is mapped to
- * a glyph for presentation. It is an atomic unit to the formatter.
- * When the result tree is interpreted as a tree of formatting objects,
- * a character in the result tree is treated as if it were an empty
- * element of type fo:character with a character attribute
- * equal to the Unicode representation of the character.
- * The semantics of an "auto" value for character properties, which is
- * typically their initial value, are based on the Unicode codepoint.
- * Overrides may be specified in an implementation-specific manner." (6.6.3)
- *
+ * Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_character">
+ * <code>fo:character</code></a> object.
*/
public class Character extends FObj {
// The value of properties relevant for fo:character.
private char character;
private Color color;
private int dominantBaseline;
- // private ToBeImplementedProperty glyphOrientationHorizontal;
- // private ToBeImplementedProperty glyphOrientationVertical;
+ private KeepProperty keepWithNext;
+ private KeepProperty keepWithPrevious;
private Property letterSpacing;
private SpaceProperty lineHeight;
/** Holds the text decoration values. May be null */
// private CommonAural commonAural;
// private CommonMarginInline commonMarginInline;
// private CommonRelativePosition commonRelativePosition;
+ // private ToBeImplementedProperty glyphOrientationHorizontal;
+ // private ToBeImplementedProperty glyphOrientationVertical;
// private int treatAsWordSpace;
// private Length textDepth;
// private Length textAltitude;
- // private KeepProperty keepWithNext;
- // private KeepProperty keepWithPrevious;
// private int scoreSpaces;
// private int suppressAtLineBreak;
// private int textTransform;
public static final int DOESNOT_FIT = 1;
/**
- * @param parent FONode that is the parent of this object
+ * @param parent {@link FONode} that is the parent of this object
*/
public Character(FONode parent) {
super(parent);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void bind(PropertyList pList) throws FOPException {
super.bind(pList);
commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
character = pList.get(PR_CHARACTER).getCharacter();
color = pList.get(PR_COLOR).getColor(getUserAgent());
dominantBaseline = pList.get(PR_DOMINANT_BASELINE).getEnum();
- // glyphOrientationHorizontal = pList.get(PR_GLYPH_ORIENTATION_HORIZONTAL);
- // glyphOrientationVertical = pList.get(PR_GLYPH_ORIENTATION_VERTICAL);
+ keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep();
+ keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep();
letterSpacing = pList.get(PR_LETTER_SPACING);
lineHeight = pList.get(PR_LINE_HEIGHT).getSpace();
textDecoration = pList.getTextDecorationProps();
- // textShadow = pList.get(PR_TEXT_SHADOW);
wordSpacing = pList.get(PR_WORD_SPACING);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void startOfNode() throws FOPException {
super.startOfNode();
getFOEventHandler().character(this);
/**
* {@inheritDoc}
- * XSL Content Model: empty
+ * <br>XSL Content Model: empty
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public CharIterator charIterator() {
return new FOCharIterator(this);
}
- /**
- * @return the Common Border, Padding, and Background Properties.
- */
+ /** @return the Common Border, Padding, and Background Properties */
public CommonBorderPaddingBackground getCommonBorderPaddingBackground() {
return commonBorderPaddingBackground;
}
- /**
- * @return the Common Font Properties.
- */
+ /** @return the Common Font Properties */
public CommonFont getCommonFont() {
return commonFont;
}
- /**
- * @return the Common Hyphenation Properties.
- */
+ /** @return the Common Hyphenation Properties */
public CommonHyphenation getCommonHyphenation() {
return commonHyphenation;
}
- /**
- * @return the "character" property.
- */
+ /** @return the "character" property */
public char getCharacter() {
return character;
}
- /**
- * @return the "color" property.
- */
+ /** @return the "color" property */
public Color getColor() {
return color;
}
- /**
- * @return the "alignment-adjust" property
- */
+ /** @return the "alignment-adjust" property */
public Length getAlignmentAdjust() {
return alignmentAdjust;
}
- /**
- * @return the "alignment-baseline" property
- */
+ /** @return the "alignment-baseline" property */
public int getAlignmentBaseline() {
return alignmentBaseline;
}
- /**
- * @return the "baseline-shift" property
- */
+ /** @return the "baseline-shift" property */
public Length getBaselineShift() {
return baselineShift;
}
- /**
- * @return the "dominant-baseline" property
- */
+ /** @return the "dominant-baseline" property */
public int getDominantBaseline() {
return dominantBaseline;
}
- /**
- * @return the "letter-spacing" property.
- */
+ /** @return the "letter-spacing" property */
public Property getLetterSpacing() {
return letterSpacing;
}
- /**
- * @return the "line-height" property.
- */
+ /** @return the "line-height" property */
public SpaceProperty getLineHeight() {
return lineHeight;
}
return textDecoration;
}
- /**
- * @return the "word-spacing" property.
- */
+ /** @return the "word-spacing" property */
public Property getWordSpacing() {
return wordSpacing;
}
+ /** @return the "keep-with-next" property */
+ public KeepProperty getKeepWithNext() {
+ return keepWithNext;
+ }
+
+ /** @return the "keep-with-previous" property */
+ public KeepProperty getKeepWithPrevious() {
+ return keepWithPrevious;
+ }
+
/** {@inheritDoc} */
public String getLocalName() {
return "character";
/**
* {@inheritDoc}
+ * @return {@link org.apache.fop.fo.Constants#FO_CHARACTER}
*/
public int getNameId() {
return FO_CHARACTER;