org.foray.fotree.value
Class DtShape
java.lang.Object
org.foray.fotree.value.Expr
org.foray.fotree.value.ExprAdditive
org.foray.fotree.value.ExprMultiplicative
org.foray.fotree.value.ExprUnary
org.foray.fotree.value.ExprPrimary
org.foray.fotree.value.Datatype
org.foray.fotree.value.DtShape
- All Implemented Interfaces:
- PropertyValue
- Direct Known Subclasses:
- DtRectangle
public abstract class DtShape
- extends Datatype
A "shape" datatype in XSL.
Note that such shapes in CSS and XSL-FO are defined relative to some other
shape.
This datatype is not specifically listed among the datatypes in the XSL-FO
Standard 1.0, at Section 5.11. However, it is described at Section 7.20.1,
and in the CSS 2.1 Specification at 11.1.2 and other places.
Method Summary |
abstract Shape |
computeShape(Shape inputShape,
int pointSize)
Computes the shape described by this. |
static DtShape |
makeShapeDT(String input)
Tries to construct an instance of each of the subclasses, returning the
instance if successful, or trying the next option if not. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.foray.fotree.value.PropertyValue |
canEvalColor, canEvalInteger, canEvalKeyword, canEvalLength, canEvalNumeric, canEvalPercentage, evalColor, evalInteger, evalKeyword, evalLength, evalNumeric, evalPercentage, getUnitPower, lengthRequiresFontSize |
DtShape
public DtShape()
makeShapeDT
public static DtShape makeShapeDT(String input)
- Tries to construct an instance of each of the subclasses, returning the
instance if successful, or trying the next option if not.
- Parameters:
input
- The String containing the shape information to be parsed.
- Returns:
- The ShapeDT subclass instance if one is found, or null if one
is not.
computeShape
public abstract Shape computeShape(Shape inputShape,
int pointSize)
- Computes the shape described by this.
- Parameters:
inputShape
- The shape to which the computed (returned) shape is
relative.
All encapsulated dimensions are expressed in millipoints.
CSS and XSL-FO shapes are defined as offsets to other shapes, and the
exact dimensions of those shapes are not necessarily known as the
data item is parsed, so the actual shape must be passed in here.pointSize
- The font size.
- Returns:
- The computed shape defined by this. All dimensions are in
millipoints, regardless of the implementation of Shape that is used.
Copyright © 2017. All rights reserved.