fop 0.95

org.apache.fop.layoutmgr
Class LayoutContext

java.lang.Object
  extended by org.apache.fop.layoutmgr.LayoutContext

public class LayoutContext
extends java.lang.Object

This class is used to pass information to the getNextKnuthElements() method. It is set up by higher level LM and used by lower level LM.


Field Summary
static int CHECK_REF_AREA
          Signal to a Line LM that a higher level LM may provoke a change in the reference area, thus ref area IPD.
static int FIRST_AREA
           
static int IPD_UNKNOWN
           
static int KEEP_WITH_NEXT_PENDING
          This flag indicates that there's a keep-with-next that hasn't been processed, yet.
static int KEEP_WITH_PREVIOUS_PENDING
          This flag indicates that there's a keep-with-previous that hasn't been processed, yet.
static int LAST_AREA
           
static int LINEBREAK_AT_LF_ONLY
          Values for flags.
static int NEW_AREA
          Generated break possibility is first in a new area
static int RESOLVE_LEADING_SPACE
           
static int SUPPRESS_BREAK_BEFORE
          If this flag is set, it indicates that any break-before values other than "auto" should not cause a mandatory break as this break was already handled by a parent layout manager.
static int TRY_HYPHENATE
           
 
Constructor Summary
LayoutContext(int flags)
          Main constructor.
LayoutContext(LayoutContext parentLC)
          Copy constructor for creating child layout contexts.
 
Method Summary
 void addPendingAfterMark(UnresolvedListElementWithLength element)
          Adds a border or padding element to the pending list which will be used to generate the right element list for break possibilities.
 void addPendingBeforeMark(UnresolvedListElementWithLength element)
          Adds a border or padding element to the pending list which will be used to generate the right element list for break possibilities.
 void clearPendingMarks()
          Clears all pending marks on the LayoutContext.
 void copyPendingMarksFrom(LayoutContext source)
           
 AlignmentContext getAlignmentContext()
           
 int getBPAlignment()
           
 int getBreakAfter()
          Returns the value of the break after the element whose LayoutManager.getNextKnuthElements(LayoutContext, int) method has just been called.
 int getBreakBefore()
          Returns the value of the break before the element whose LayoutManager.getNextKnuthElements(LayoutContext, int) method has just been called.
 HyphContext getHyphContext()
           
 double getIPDAdjust()
           
 SpaceSpecifier getLeadingSpace()
           
 int getLineEndBorderAndPaddingWidth()
          Get the width to be reserved for border and padding at the end of the line.
 int getLineStartBorderAndPaddingWidth()
          Get the width to be reserved for border and padding at the start of the line.
 int getNextSpan()
           
 java.util.List getPendingAfterMarks()
           
 java.util.List getPendingBeforeMarks()
           
 int getRefIPD()
          Returns the inline-progression-dimension of the nearest ancestor reference area.
 double getSpaceAdjust()
           
 int getSpaceAfter()
          Get the current amount of space after / end
 int getSpaceBefore()
          Get the current amount of space before / start
 MinOptMax getStackLimitBP()
          Returns the stack limit in block-progression-dimension.
 MinOptMax getStackLimitIP()
          Returns the stack limit in inline-progression-dimension.
 SpaceSpecifier getTrailingSpace()
           
 int getWritingMode()
          Get the writing mode of the relevant reference area.
 boolean isFirstArea()
           
 boolean isKeepWithNextPending()
           
 boolean isKeepWithPreviousPending()
           
 boolean isLastArea()
           
 boolean isStart()
           
 void resetAlignmentContext()
           
 boolean resolveLeadingSpace()
           
 void setAlignmentContext(AlignmentContext alignmentContext)
           
 void setBPAlignment(int alignment)
          Sets the currently applicable alignment in BP direction.
 void setBreakAfter(int breakAfter)
          Sets the value of the break after the current element.
 void setBreakBefore(int breakBefore)
          Sets the value of the break before the current element.
 void setFlags(int flags)
           
 void setFlags(int flags, boolean bSet)
           
 void setHyphContext(HyphContext hyph)
           
 void setIPDAdjust(double ipdA)
           
 void setLeadingSpace(SpaceSpecifier space)
           
 void setLineEndBorderAndPaddingWidth(int lineEndBorderAndPaddingWidth)
          Set the width to be reserved for border and padding at the end of the line.
 void setLineStartBorderAndPaddingWidth(int lineStartBorderAndPaddingWidth)
          Set the width to be reserved for border and padding at the start of the line.
 void setRefIPD(int ipd)
          Sets the inline-progression-dimension of the nearest ancestor reference area.
 void setSpaceAdjust(double adjust)
           
 void setSpaceAfter(int spaceAfter)
          Set the amount of space after / end
 void setSpaceBefore(int spaceBefore)
          Set the amount of space before / start
 void setStackLimitBP(MinOptMax limit)
          Sets the stack limit in block-progression-dimension.
 void setStackLimitIP(MinOptMax limit)
          Sets the stack limit in inline-progression-dimension.
 void setStackLimitsFrom(LayoutContext context)
          Sets (Copies) the stack limits in both directions from another layout context.
 void setTrailingSpace(SpaceSpecifier space)
           
 void setWritingMode(int writingMode)
          Set the writing mode.
 void signalSpanChange(int span)
          Used to signal the PSLM that the element list ends early because of a span change in multi-column layout.
 boolean startsNewArea()
           
 boolean suppressBreakBefore()
           
 java.lang.String toString()
          
 boolean tryHyphenate()
           
 void unsetFlags(int flags)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LINEBREAK_AT_LF_ONLY

public static final int LINEBREAK_AT_LF_ONLY
Values for flags.

See Also:
Constant Field Values

NEW_AREA

public static final int NEW_AREA
Generated break possibility is first in a new area

See Also:
Constant Field Values

IPD_UNKNOWN

public static final int IPD_UNKNOWN
See Also:
Constant Field Values

CHECK_REF_AREA

public static final int CHECK_REF_AREA
Signal to a Line LM that a higher level LM may provoke a change in the reference area, thus ref area IPD. The LineLM should return without looking for a line break.

See Also:
Constant Field Values

SUPPRESS_BREAK_BEFORE

public static final int SUPPRESS_BREAK_BEFORE
If this flag is set, it indicates that any break-before values other than "auto" should not cause a mandatory break as this break was already handled by a parent layout manager.

See Also:
Constant Field Values

FIRST_AREA

public static final int FIRST_AREA
See Also:
Constant Field Values

TRY_HYPHENATE

public static final int TRY_HYPHENATE
See Also:
Constant Field Values

LAST_AREA

public static final int LAST_AREA
See Also:
Constant Field Values

RESOLVE_LEADING_SPACE

public static final int RESOLVE_LEADING_SPACE
See Also:
Constant Field Values

KEEP_WITH_NEXT_PENDING

public static final int KEEP_WITH_NEXT_PENDING
This flag indicates that there's a keep-with-next that hasn't been processed, yet.

See Also:
Constant Field Values

KEEP_WITH_PREVIOUS_PENDING

public static final int KEEP_WITH_PREVIOUS_PENDING
This flag indicates that there's a keep-with-previous that hasn't been processed, yet.

See Also:
Constant Field Values
Constructor Detail

LayoutContext

public LayoutContext(LayoutContext parentLC)
Copy constructor for creating child layout contexts.

Parameters:
parentLC - the parent layout context to copy from

LayoutContext

public LayoutContext(int flags)
Main constructor.

Parameters:
flags - the initial flags
Method Detail

copyPendingMarksFrom

public void copyPendingMarksFrom(LayoutContext source)

setFlags

public void setFlags(int flags)

setFlags

public void setFlags(int flags,
                     boolean bSet)

unsetFlags

public void unsetFlags(int flags)

isStart

public boolean isStart()

startsNewArea

public boolean startsNewArea()

isFirstArea

public boolean isFirstArea()

isLastArea

public boolean isLastArea()

suppressBreakBefore

public boolean suppressBreakBefore()

isKeepWithNextPending

public boolean isKeepWithNextPending()

isKeepWithPreviousPending

public boolean isKeepWithPreviousPending()

setLeadingSpace

public void setLeadingSpace(SpaceSpecifier space)

getLeadingSpace

public SpaceSpecifier getLeadingSpace()

resolveLeadingSpace

public boolean resolveLeadingSpace()

setTrailingSpace

public void setTrailingSpace(SpaceSpecifier space)

getTrailingSpace

public SpaceSpecifier getTrailingSpace()

addPendingAfterMark

public void addPendingAfterMark(UnresolvedListElementWithLength element)
Adds a border or padding element to the pending list which will be used to generate the right element list for break possibilities. Conditionality resolution will be done elsewhere.

Parameters:
element - the border, padding or space element

getPendingAfterMarks

public java.util.List getPendingAfterMarks()
Returns:
the pending border and padding elements at the after edge
See Also:
addPendingAfterMark(UnresolvedListElementWithLength)

clearPendingMarks

public void clearPendingMarks()
Clears all pending marks on the LayoutContext.


addPendingBeforeMark

public void addPendingBeforeMark(UnresolvedListElementWithLength element)
Adds a border or padding element to the pending list which will be used to generate the right element list for break possibilities. Conditionality resolution will be done elsewhere.

Parameters:
element - the border, padding or space element

getPendingBeforeMarks

public java.util.List getPendingBeforeMarks()
Returns:
the pending border and padding elements at the before edge
See Also:
addPendingBeforeMark(UnresolvedListElementWithLength)

setStackLimitBP

public void setStackLimitBP(MinOptMax limit)
Sets the stack limit in block-progression-dimension.

Parameters:
limit - the stack limit

getStackLimitBP

public MinOptMax getStackLimitBP()
Returns the stack limit in block-progression-dimension.

Returns:
the stack limit

setStackLimitIP

public void setStackLimitIP(MinOptMax limit)
Sets the stack limit in inline-progression-dimension.

Parameters:
limit - the stack limit

getStackLimitIP

public MinOptMax getStackLimitIP()
Returns the stack limit in inline-progression-dimension.

Returns:
the stack limit

setStackLimitsFrom

public void setStackLimitsFrom(LayoutContext context)
Sets (Copies) the stack limits in both directions from another layout context.

Parameters:
context - the layout context to taje the values from

setRefIPD

public void setRefIPD(int ipd)
Sets the inline-progression-dimension of the nearest ancestor reference area.


getRefIPD

public int getRefIPD()
Returns the inline-progression-dimension of the nearest ancestor reference area.

Returns:
the inline-progression-dimension of the nearest ancestor reference area

setHyphContext

public void setHyphContext(HyphContext hyph)

getHyphContext

public HyphContext getHyphContext()

tryHyphenate

public boolean tryHyphenate()

setBPAlignment

public void setBPAlignment(int alignment)
Sets the currently applicable alignment in BP direction.

Parameters:
alignment - one of EN_START, EN_JUSTIFY etc.

getBPAlignment

public int getBPAlignment()
Returns:
the currently applicable alignment in BP direction (EN_START, EN_JUSTIFY...)

setSpaceAdjust

public void setSpaceAdjust(double adjust)

getSpaceAdjust

public double getSpaceAdjust()

setIPDAdjust

public void setIPDAdjust(double ipdA)

getIPDAdjust

public double getIPDAdjust()

setAlignmentContext

public void setAlignmentContext(AlignmentContext alignmentContext)

getAlignmentContext

public AlignmentContext getAlignmentContext()

resetAlignmentContext

public void resetAlignmentContext()

getLineStartBorderAndPaddingWidth

public int getLineStartBorderAndPaddingWidth()
Get the width to be reserved for border and padding at the start of the line.

Returns:
the width to be reserved

setLineStartBorderAndPaddingWidth

public void setLineStartBorderAndPaddingWidth(int lineStartBorderAndPaddingWidth)
Set the width to be reserved for border and padding at the start of the line.

Parameters:
lineStartBorderAndPaddingWidth - the width to be reserved

getLineEndBorderAndPaddingWidth

public int getLineEndBorderAndPaddingWidth()
Get the width to be reserved for border and padding at the end of the line.

Returns:
the width to be reserved

setLineEndBorderAndPaddingWidth

public void setLineEndBorderAndPaddingWidth(int lineEndBorderAndPaddingWidth)
Set the width to be reserved for border and padding at the end of the line.

Parameters:
lineEndBorderAndPaddingWidth - the width to be reserved

getNextSpan

public int getNextSpan()
Returns:
true if the current element list ends early because of a span change in multi-column layout.

signalSpanChange

public void signalSpanChange(int span)
Used to signal the PSLM that the element list ends early because of a span change in multi-column layout.

Parameters:
span - the new span value (legal values: NOT_SET, EN_NONE, EN_ALL)

getWritingMode

public int getWritingMode()
Get the writing mode of the relevant reference area.

Returns:
the applicable writing mode

setWritingMode

public void setWritingMode(int writingMode)
Set the writing mode.

Parameters:
writingMode - the writing mode

getSpaceBefore

public int getSpaceBefore()
Get the current amount of space before / start

Returns:
the space before / start amount

setSpaceBefore

public void setSpaceBefore(int spaceBefore)
Set the amount of space before / start

Parameters:
spaceBefore - the amount of space before / start

getSpaceAfter

public int getSpaceAfter()
Get the current amount of space after / end

Returns:
the space after / end amount

setSpaceAfter

public void setSpaceAfter(int spaceAfter)
Set the amount of space after / end

Parameters:
spaceAfter - the amount of space after / end

getBreakBefore

public int getBreakBefore()
Returns the value of the break before the element whose LayoutManager.getNextKnuthElements(LayoutContext, int) method has just been called.

Returns:
one of Constants.EN_AUTO, Constants.EN_COLUMN, Constants.EN_PAGE, Constants.EN_EVEN_PAGE, or Constants.EN_ODD_PAGE

setBreakBefore

public void setBreakBefore(int breakBefore)
Sets the value of the break before the current element.

Parameters:
breakBefore - the value of the break-before
See Also:
getBreakBefore()

getBreakAfter

public int getBreakAfter()
Returns the value of the break after the element whose LayoutManager.getNextKnuthElements(LayoutContext, int) method has just been called.

Returns:
one of Constants.EN_AUTO, Constants.EN_COLUMN, Constants.EN_PAGE, Constants.EN_EVEN_PAGE, or Constants.EN_ODD_PAGE

setBreakAfter

public void setBreakAfter(int breakAfter)
Sets the value of the break after the current element.

Parameters:
breakAfter - the value of the break-after
See Also:
getBreakAfter()

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

fop 0.95

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