org.foray.fotree.fo.prop
Class AbstractContentDimension

java.lang.Object
  extended by org.foray.fotree.Property
      extended by org.foray.fotree.fo.AbstractFoProperty
          extended by org.foray.fotree.fo.prop.AbstractContentDimension
Direct Known Subclasses:
PdContentHeight, PdContentWidth

public abstract class AbstractContentDimension
extends AbstractFoProperty

Abstract superclass for the "content-width" and "content-height" properties in XSL-FO.


Field Summary
 
Fields inherited from class org.foray.fotree.fo.AbstractFoProperty
VALID_KEYWORDS_INHERIT_ONLY
 
Fields inherited from class org.foray.fotree.Property
PRECEDENCE_FORCE
 
Constructor Summary
AbstractContentDimension(FObj fobj, String propertyFullName, String attributeValue)
          Constructor.
 
Method Summary
 boolean dependsOnPd(FObj fobj, org.axsl.fo.FoContext context)
          Indicates whether the computation of the scaling factor is dependent on the progression dimension (either IPD or BPD).
protected abstract  float getInheritedValue(org.axsl.fo.FoContext context, FObjScaled fobjScaled, FObj parent)
          Returns the inherited value for this property.
protected  FoValue[] getValidKeywords()
          Returns the valid keywords for this property.
 float getValue(org.axsl.fo.FoContext context, FObj fobj, FObjScaled fobjScaled)
          Returns the implied or stated scaling factor.
static float getValueNoInstance()
          Returns the default (initial) value for this property.
protected abstract  int intrinsicContentDimension(FObjScaled fobjScaled, org.axsl.fo.FoContext context)
          Returns either the intrinsic height or intrinsic width of the graphic, depending on the subclass.
 PropertyValue value()
          Returns the value for this property.
protected abstract  int viewportDimension(FObjScaled fobjScaled, org.axsl.fo.FoContext context)
          Returns either the viewport height or viewport width of the graphic, depending on the subclass.
 
Methods inherited from class org.foray.fotree.fo.AbstractFoProperty
canEvalBorderStyle, canEvalUri, checkKeywords, convertValueToFoValue, evalBorderStyle, evalUri, getPropertyType, isKeywordInherit, standardParse, standardParse
 
Methods inherited from class org.foray.fotree.Property
convertNumericToInteger, convertValueToLength, getBasePropertyName, getKeywordIndex, getKeywordInSet, getSubPropertyName, invalidPropertyName, keywordInSet, unexpectedInitialValueArgument, unexpectedRetrieval, unexpectedValue, unexpectedValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractContentDimension

public AbstractContentDimension(FObj fobj,
                                String propertyFullName,
                                String attributeValue)
                         throws PropertyException
Constructor.

Parameters:
fobj - The FObj to which this property belongs.
propertyFullName - The full name of the property.
attributeValue - The unparsed property value.
Throws:
PropertyException - For an invalid property value.
Method Detail

getValue

public float getValue(org.axsl.fo.FoContext context,
                      FObj fobj,
                      FObjScaled fobjScaled)
Returns the implied or stated scaling factor.

Parameters:
context - An object that knows how to resolve FO Tree context issues.
fobj - The FObj instance to which this property is attached.
fobjScaled - The object containing the scalable item whose content dimension is needed. This may be the same as fobj, but will not be the same for cases where we are looking for the dimension using "inherit".
Returns:
The scaling factor implied or stated by this property.

dependsOnPd

public boolean dependsOnPd(FObj fobj,
                           org.axsl.fo.FoContext context)
Indicates whether the computation of the scaling factor is dependent on the progression dimension (either IPD or BPD).

Parameters:
fobj - The FObj instance to which this property is attached.
context - An object that knows how to resolve FO Tree context issues.
Returns:
True if the IPD or BPD must be known in order to for getValue(FoContext, FObj, FObjScaled) to return a useful amount.

getInheritedValue

protected abstract float getInheritedValue(org.axsl.fo.FoContext context,
                                           FObjScaled fobjScaled,
                                           FObj parent)
Returns the inherited value for this property.

Parameters:
context - An object that knows how to resolve FO Tree context issues.
fobjScaled - The object containing the scalable item whose content dimension is needed. This may be the same as fobj, but will not be the same for cases where we are looking for the dimension using "inherit".
parent - The parent FObj instance who should provide the inherited value.
Returns:
The inherited scaling factor.

intrinsicContentDimension

protected abstract int intrinsicContentDimension(FObjScaled fobjScaled,
                                                 org.axsl.fo.FoContext context)
Returns either the intrinsic height or intrinsic width of the graphic, depending on the subclass.

Parameters:
fobjScaled - The object containing the scalable item whose content dimension is needed.
context - An object that knows how to resolve FO Tree context issues.
Returns:
The intrinsic dimension of the graphic on the axis being computed (height for content-height, width for content-width).

viewportDimension

protected abstract int viewportDimension(FObjScaled fobjScaled,
                                         org.axsl.fo.FoContext context)
Returns either the viewport height or viewport width of the graphic, depending on the subclass.

Parameters:
fobjScaled - The object containing the scalable item whose viewport dimension is needed.
context - An object that knows how to resolve FO Tree context issues.
Returns:
The intrinsic dimension of the graphic on the axis being computed (height for content-height, width for content-width).

getValueNoInstance

public static float getValueNoInstance()
Returns the default (initial) value for this property.

Returns:
The initial value for this property.

getValidKeywords

protected FoValue[] getValidKeywords()
Description copied from class: AbstractFoProperty
Returns the valid keywords for this property.

Specified by:
getValidKeywords in class AbstractFoProperty
Returns:
The valid keywords for this property.

value

public PropertyValue value()
Description copied from class: Property
Returns the value for this property.

Specified by:
value in class Property
Returns:
The value for this property.


Copyright © 2017. All rights reserved.