public class ParagraphWidowsControl extends Object
Paragraph
's widows restrictions. This class is meant to be used as the value for the Property.WIDOWS_CONTROL
key.
Constructor and Description |
---|
ParagraphWidowsControl(int minWidows, int maxLinesToMove, boolean overflowParagraphOnViolation)
Creates a ParagraphWidowsControl instance with specified widows restrictions.
|
Modifier and Type | Method and Description |
---|---|
int |
getMaxLinesToMove()
Gets a number of lines that are allowed to be moved to the next area in order to fix widows constraint violation.
|
int |
getMinWidows()
Gets minimal number of paragraph's lines to be overflowed to the next area.
|
void |
handleViolatedWidows(ParagraphRenderer widowsRenderer, String message)
Writes a log message reporting that widows constraint is violated and cannot be automatically fixed.
|
boolean |
isOverflowOnWidowsViolation()
Indicates whether paragraph should be completely pushed to the next area if widows constraint is violated and cannot be automatically fixed.
|
ParagraphWidowsControl |
setMinAllowedWidows(int minWidows, int maxLinesToMove, boolean overflowParagraphOnViolation)
Sets parameters that define widows restrictions and conditions of handling cases of widows constraint violation.
|
public ParagraphWidowsControl(int minWidows, int maxLinesToMove, boolean overflowParagraphOnViolation)
ParagraphWidowsControl
instance with specified widows restrictions.
minWidows
- minimal number of paragraph's lines to be overflowed to the next area.
maxLinesToMove
- a number of lines that are allowed to be moved to the next area in order to fix widows constraint violation.
overflowParagraphOnViolation
- defines whether the entire paragraph should be pushed to the next area if widows constraint is violated and cannot be automatically fixed.
public ParagraphWidowsControl setMinAllowedWidows(int minWidows, int maxLinesToMove, boolean overflowParagraphOnViolation)
minWidows
- minimal number of paragraph's lines to be overflowed to the next area.
maxLinesToMove
- a number of lines that are allowed to be moved to the next area in order to fix widows constraint violation.
overflowParagraphOnViolation
- defines whether paragraph should be completely pushed to the next area if widows constraint is violated and cannot be automatically fixed.
ParagraphWidowsControl
instance.
public int getMinWidows()
public int getMaxLinesToMove()
public boolean isOverflowOnWidowsViolation()
public void handleViolatedWidows(ParagraphRenderer widowsRenderer, String message)
widowsRenderer
- a renderer processing widows
message
- String
explaining the reason for violation
Copyright © 1998–2023 iText Group NV. All rights reserved.