info.informatica.doc.style.css.visual.box
Class AbstractBlockBox

java.lang.Object
  extended by info.informatica.doc.style.css.visual.box.AbstractCSSBox
      extended by info.informatica.doc.style.css.visual.box.AbstractBlockBox
All Implemented Interfaces:
CSSBox
Direct Known Subclasses:
BlockBox, Table

public abstract class AbstractBlockBox
extends AbstractCSSBox

Abstract block box.

Author:
Carlos Amengual (amengual at informatica.info)

Constructor Summary
AbstractBlockBox(CSS2ComputedProperties style)
           
 
Method Summary
protected  float automaticLeftMargin()
           
protected  float automaticRightMargin()
           
protected abstract  float computeAutoHeight(float containerWidth)
           
protected  float computeMarginSubproperty(String marginProperty, boolean auto)
           
protected  float computeScrollbarWidth()
          Computes the possible scrollbar width, in case that this box overflows with scroll (see the 'overflow' property).
 float getHeight()
          Gets the height of this box.
 float getMarginBottom()
          Gets the value of the margin-bottom property, expressed in the unit given by the StyleDatabase.getNaturalUnit() method.
 float getMarginLeft()
          Gets the value of the margin-left property, expressed in the unit given by the StyleDatabase.getNaturalUnit() method.
 float getMarginRight()
          Gets the value of the margin-right property, expressed in the unit given by the StyleDatabase.getNaturalUnit() method.
 float getMarginTop()
          Gets the value of the margin-top property, expressed in the unit given by the StyleDatabase.getNaturalUnit() method.
 float getWidth()
          Gets the width of this box.
 
Methods inherited from class info.informatica.doc.style.css.visual.box.AbstractCSSBox
computeNumberOrZero, computeNumberOrZero, getBackgroundPosition, getBorderBottomColor, getBorderBottomWidth, getBorderLeftColor, getBorderLeftWidth, getBorderRightColor, getBorderRightWidth, getBorderTopColor, getBorderTopWidth, getComputedStyle, getContainerWidth, getContainingBlock, getCSSValue, getErrorHandler, getFontFamily, getFontSize, getFontWeight, getGeneratedSibling, getLeading, getLeading, getLeft, getLineHeight, getLineHeight, getLineHeightCSSValue, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingSubproperty, getPaddingTop, getRight, isContainerHeightAuto, isHeightAuto, isWidthAuto, overflowsWithScroll, setContainingBlock, setErrorHandler, shrinkToFit, textLengthToNaturalUnit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractBlockBox

public AbstractBlockBox(CSS2ComputedProperties style)
Method Detail

getWidth

public float getWidth()
Description copied from class: AbstractCSSBox
Gets the width of this box.

This is defined to be the value of the width property, for boxes where it is defined, or the content width otherwise.

Specified by:
getWidth in class AbstractCSSBox
Returns:
the width of this box.

getHeight

public float getHeight()
Description copied from class: AbstractCSSBox
Gets the height of this box.

This is defined to be the value of the height property, for boxes where it is defined, or the content height otherwise.

Specified by:
getHeight in class AbstractCSSBox
Returns:
the height of this box.

computeAutoHeight

protected abstract float computeAutoHeight(float containerWidth)

getMarginTop

public float getMarginTop()
Gets the value of the margin-top property, expressed in the unit given by the StyleDatabase.getNaturalUnit() method.

Specified by:
getMarginTop in interface CSSBox
Overrides:
getMarginTop in class AbstractCSSBox
Returns:
the value of the margin-top property.

getMarginBottom

public float getMarginBottom()
Gets the value of the margin-bottom property, expressed in the unit given by the StyleDatabase.getNaturalUnit() method.

Specified by:
getMarginBottom in interface CSSBox
Overrides:
getMarginBottom in class AbstractCSSBox
Returns:
the value of the margin-bottom property.

getMarginRight

public float getMarginRight()
Gets the value of the margin-right property, expressed in the unit given by the StyleDatabase.getNaturalUnit() method.

Specified by:
getMarginRight in interface CSSBox
Overrides:
getMarginRight in class AbstractCSSBox
Returns:
the value of the margin-right property.

getMarginLeft

public float getMarginLeft()
Gets the value of the margin-left property, expressed in the unit given by the StyleDatabase.getNaturalUnit() method.

Specified by:
getMarginLeft in interface CSSBox
Overrides:
getMarginLeft in class AbstractCSSBox
Returns:
the value of the margin-left property.

computeMarginSubproperty

protected float computeMarginSubproperty(String marginProperty,
                                         boolean auto)

automaticRightMargin

protected float automaticRightMargin()

automaticLeftMargin

protected float automaticLeftMargin()

computeScrollbarWidth

protected float computeScrollbarWidth()
Computes the possible scrollbar width, in case that this box overflows with scroll (see the 'overflow' property).

Returns:
the scrollbar width if this box overflows with scroll, or zero if don't overflows with scroll.


Copyright © 2011 informatica.info. All Rights Reserved.