org.apache.fop.layoutmgr

Class KnuthGlue


public class KnuthGlue
extends KnuthElement

An instance of this class represents a piece of content with adjustable width: for example a space between words of justified text. A KnuthGlue is a feasible breaking point only if it immediately follows a KnuthBox. The represented piece of content is suppressed if either the KnuthGlue is a chosen breaking point or there isn't any KnuthBox between the previous breaking point and the KnuthGlue itself. So, an unsuppressible piece of content with adjustable width, for example a leader or a word with adjustable letter space, cannot be represented by a single KnuthGlue; it can be represented using the sequence: KnuthBox(width = 0) KnuthPenalty(width = 0, penalty = infinity) KnuthGlue(...) KnuthBox(width = 0) where the infinity penalty avoids choosing the KnuthGlue as a breaking point and the 0-width KnuthBoxes prevent suppression. Besides the inherited methods and attributes, this class has two attributes used to store the stretchability (difference between max and opt width) and the shrinkability (difference between opt and min width), and the methods to get these values.

Field Summary

Fields inherited from class org.apache.fop.layoutmgr.KnuthElement

INFINITE

Constructor Summary

KnuthGlue(int w, int y, int z, int iAdjClass, Position pos, boolean bAux)
KnuthGlue(int w, int y, int z, Position pos, boolean bAux)
Create a new KnuthGlue.

Method Summary

int
getAdjustmentClass()
int
getY()
int
getZ()
boolean
isGlue()
String
toString()

Methods inherited from class org.apache.fop.layoutmgr.KnuthElement

getP, getW, getY, getZ, isAuxiliary, isUnresolvedElement

Methods inherited from class org.apache.fop.layoutmgr.ListElement

getLayoutManager, getPosition, isBox, isForcedBreak, isGlue, isPenalty, isUnresolvedElement, setPosition

Constructor Details

KnuthGlue

public KnuthGlue(int w,
                 int y,
                 int z,
                 int iAdjClass,
                 Position pos,
                 boolean bAux)

KnuthGlue

public KnuthGlue(int w,
                 int y,
                 int z,
                 Position pos,
                 boolean bAux)
Create a new KnuthGlue.
Parameters:
w - the width of this glue
y - the stretchability of this glue
z - the shrinkability of this glue
pos - the Position stored in this glue
bAux - is this glue auxiliary?

Method Details

getAdjustmentClass

public int getAdjustmentClass()
Returns:
the adjustment class (or role) of this glue.

getY

public int getY()
Overrides:
getY in interface KnuthElement
Returns:
the stretchability of this glue.

getZ

public int getZ()
Overrides:
getZ in interface KnuthElement
Returns:
the shrinkability of this glue.

isGlue

public boolean isGlue()
Overrides:
isGlue in interface ListElement

toString

public String toString()
See Also:
java.lang.Object.toString()

Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.