public class LayoutContext
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
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 |
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 and Description |
---|
LayoutContext(int flags)
Main constructor.
|
LayoutContext(LayoutContext parentLC)
Copy constructor for creating child layout contexts.
|
Modifier and Type | Method and Description |
---|---|
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 |
clearKeepsPending()
Clears both keep-with-previous and keep-with-next strengths.
|
void |
clearKeepWithNextPending()
Clears any pending keep-with-next strength.
|
void |
clearKeepWithPreviousPending()
Clears any pending keep-with-previous strength.
|
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. |
int |
getCurrentSpan() |
int |
getDisableColumnBalancing()
Returns whether the column balancer should be disabled before a spanning block
|
HyphContext |
getHyphContext() |
double |
getIPDAdjust() |
Keep |
getKeepWithNextPending()
Returns the strength of a keep-with-next currently pending.
|
Keep |
getKeepWithPreviousPending()
Returns the strength of a keep-with-previous currently pending.
|
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.
|
SpaceSpecifier |
getTrailingSpace() |
int |
getWritingMode()
Get the writing mode of the relevant reference area.
|
boolean |
isFirstArea() |
boolean |
isKeepWithNextPending()
Indicates whether a keep-with-next constraint is pending.
|
boolean |
isKeepWithPreviousPending()
Indicates whether a keep-with-previous constraint is pending.
|
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 |
setDisableColumnBalancing(int disableColumnBalancing)
Sets whether the column balancer should be disabled before a spanning block
|
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 |
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) |
void |
updateKeepWithNextPending(Keep keep)
Updates the currently pending keep-with-next strength.
|
void |
updateKeepWithPreviousPending(Keep keep)
Updates the currently pending keep-with-previous strength.
|
public static final int LINEBREAK_AT_LF_ONLY
public static final int NEW_AREA
public static final int IPD_UNKNOWN
public static final int CHECK_REF_AREA
public static final int SUPPRESS_BREAK_BEFORE
public static final int FIRST_AREA
public static final int TRY_HYPHENATE
public static final int LAST_AREA
public static final int RESOLVE_LEADING_SPACE
public LayoutContext(LayoutContext parentLC)
parentLC
- the parent layout context to copy frompublic LayoutContext(int flags)
flags
- the initial flagspublic void copyPendingMarksFrom(LayoutContext source)
public void setFlags(int flags)
public void setFlags(int flags, boolean bSet)
public void unsetFlags(int flags)
public boolean isStart()
public boolean startsNewArea()
public boolean isFirstArea()
public boolean isLastArea()
public boolean suppressBreakBefore()
public Keep getKeepWithNextPending()
public Keep getKeepWithPreviousPending()
public void clearKeepWithNextPending()
public void clearKeepWithPreviousPending()
public void clearKeepsPending()
public void updateKeepWithNextPending(Keep keep)
keep
- the new strength to considerpublic void updateKeepWithPreviousPending(Keep keep)
keep
- the new strength to considerpublic boolean isKeepWithNextPending()
public boolean isKeepWithPreviousPending()
public void setLeadingSpace(SpaceSpecifier space)
public SpaceSpecifier getLeadingSpace()
public boolean resolveLeadingSpace()
public void setTrailingSpace(SpaceSpecifier space)
public SpaceSpecifier getTrailingSpace()
public void addPendingAfterMark(UnresolvedListElementWithLength element)
element
- the border, padding or space elementpublic java.util.List getPendingAfterMarks()
addPendingAfterMark(UnresolvedListElementWithLength)
public void clearPendingMarks()
public void addPendingBeforeMark(UnresolvedListElementWithLength element)
element
- the border, padding or space elementpublic java.util.List getPendingBeforeMarks()
addPendingBeforeMark(UnresolvedListElementWithLength)
public void setStackLimitBP(MinOptMax limit)
limit
- the stack limitpublic MinOptMax getStackLimitBP()
public void setRefIPD(int ipd)
public int getRefIPD()
public void setHyphContext(HyphContext hyph)
public HyphContext getHyphContext()
public boolean tryHyphenate()
public void setBPAlignment(int alignment)
alignment
- one of EN_START, EN_JUSTIFY etc.public int getBPAlignment()
public void setSpaceAdjust(double adjust)
public double getSpaceAdjust()
public void setIPDAdjust(double ipdA)
public double getIPDAdjust()
public void setAlignmentContext(AlignmentContext alignmentContext)
public AlignmentContext getAlignmentContext()
public void resetAlignmentContext()
public int getLineStartBorderAndPaddingWidth()
public void setLineStartBorderAndPaddingWidth(int lineStartBorderAndPaddingWidth)
lineStartBorderAndPaddingWidth
- the width to be reservedpublic int getLineEndBorderAndPaddingWidth()
public void setLineEndBorderAndPaddingWidth(int lineEndBorderAndPaddingWidth)
lineEndBorderAndPaddingWidth
- the width to be reservedpublic int getNextSpan()
Constants.NOT_SET
, Constants.EN_NONE
Constants.EN_ALL
public int getCurrentSpan()
Constants.NOT_SET
, Constants.EN_NONE
Constants.EN_ALL
public void signalSpanChange(int span)
span
- the new span value (legal values: NOT_SET, EN_NONE, EN_ALL)public int getWritingMode()
public void setWritingMode(int writingMode)
writingMode
- the writing modepublic int getSpaceBefore()
public void setSpaceBefore(int spaceBefore)
spaceBefore
- the amount of space before / startpublic int getSpaceAfter()
public void setSpaceAfter(int spaceAfter)
spaceAfter
- the amount of space after / endpublic int getBreakBefore()
LayoutManager.getNextKnuthElements(LayoutContext, int)
method has just been
called.Constants.EN_AUTO
, Constants.EN_COLUMN
,
Constants.EN_PAGE
, Constants.EN_EVEN_PAGE
, or
Constants.EN_ODD_PAGE
public void setBreakBefore(int breakBefore)
breakBefore
- the value of the break-beforegetBreakBefore()
public int getBreakAfter()
LayoutManager.getNextKnuthElements(LayoutContext, int)
method has just been
called.Constants.EN_AUTO
, Constants.EN_COLUMN
,
Constants.EN_PAGE
, Constants.EN_EVEN_PAGE
, or
Constants.EN_ODD_PAGE
public void setBreakAfter(int breakAfter)
breakAfter
- the value of the break-aftergetBreakAfter()
public java.lang.String toString()
toString
in class java.lang.Object
public int getDisableColumnBalancing()
Constants.EN_TRUE
, Constants.EN_FALSE
public void setDisableColumnBalancing(int disableColumnBalancing)
disableColumnBalancing
- the value of the fox:disable-column-balancing propertygetDisableColumnBalancing()
Copyright 1999-2010 The Apache Software Foundation. All Rights Reserved.