org.foray.fotree.value
Class DtShape

java.lang.Object
  extended by org.foray.fotree.value.Expr
      extended by org.foray.fotree.value.ExprAdditive
          extended by org.foray.fotree.value.ExprMultiplicative
              extended by org.foray.fotree.value.ExprUnary
                  extended by org.foray.fotree.value.ExprPrimary
                      extended by org.foray.fotree.value.Datatype
                          extended by 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.


Field Summary
 
Fields inherited from class org.foray.fotree.value.Expr
OPERATION_ADD, OPERATION_DIVIDE, OPERATION_MOD, OPERATION_MULTIPLY, OPERATION_NEGATION, OPERATION_SUBTRACT, UNIT_POWER_AREA, UNIT_POWER_LENGTH, UNIT_POWER_NON_NUMERIC, UNIT_POWER_NUMERIC
 
Constructor Summary
DtShape()
           
 
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 org.foray.fotree.value.Datatype
convertValueToFoValue
 
Methods inherited from class org.foray.fotree.value.Expr
evalColorException, evalIntegerException, evalKeywordException, evalLengthException, evalNumericException, evalPercentageException
 
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
 

Constructor Detail

DtShape

public DtShape()
Method Detail

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.