Unified Typesetting API M1-20040817

de.inghuimische.uta.typeset
Interface Box

All Known Subinterfaces:
EmbeddingLevel, Glyph
All Known Implementing Classes:
AbstractBox, AbstractGlyph, SimpleEmbeddingLevel

public interface Box

The base element of everything that should be typeset.

Author:
Christian Ziesemer

Method Summary
 List getAnchors()
          Returns a list of all anchors.
 List getAnchorsByClass(AnchorClass anchorClass)
          Returns a list containing only those anchors of the given type.
 Map getAttributes()
          Returns a map of key value pairs, the attributes of this box.
 Rectangle2D getBoundingBox()
          Returns the bounding box of this object containing the whole shape.
 Shape getShape()
          Returns the shape of this box.
 AffineTransform getTransformation()
          Returns the transformation matrix associated with this box.
 void setTransformation(AffineTransform aTransformation)
          Sets the relative transformation to the previous box.
 

Method Detail

getAnchors

public List getAnchors()
Returns a list of all anchors. A box has n anchors.

Returns:
A list of all anchors.

getAnchorsByClass

public List getAnchorsByClass(AnchorClass anchorClass)
Returns a list containing only those anchors of the given type.

Parameters:
anchorClass - One of the anchor types defined in Anchor.
Returns:
A list containing only those anchors of the given type.

getShape

public Shape getShape()
Returns the shape of this box.

In the case of a box this is simply a rectangle while other classes implementing this interface may have quite complex shapes.

Document processors may never need this method therefore implementations should care that the shape is returned on demand to save runtime/memory.

Returns:
The shape of this box.

getAttributes

public Map getAttributes()
Returns a map of key value pairs, the attributes of this box.

Returns:
A map of key value pairs.

setTransformation

public void setTransformation(AffineTransform aTransformation)
Sets the relative transformation to the previous box. The previous box is either a normal preceding box or the embedding level this box is placed in. In the latter case this box is the first to be placed in the embedding level and the transformation is therefore absolute to the origin of the embedding level.

Parameters:
aTransformation - The transformation relative to the origin of the previous box.

getTransformation

public AffineTransform getTransformation()
Returns the transformation matrix associated with this box. This transformation is relative to the origin.

Returns:
The transformation matrix associated with this box.

getBoundingBox

public Rectangle2D getBoundingBox()
Returns the bounding box of this object containing the whole shape. The returned rectangle therefore provides the exact dimension of the box.

Returns:
The bounding box of this object.

Unified Typesetting API M1-20040817


An inghuimische.de project.
Copyright (C) 2004 Christian Ziesemer; See the Mozilla Public License for more details.