public final class TraitSetter
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
addBackground(Area area,
CommonBorderPaddingBackground backProps,
PercentBaseContext context)
Add background to an area.
|
static void |
addBackground(Area area,
CommonBorderPaddingBackground backProps,
PercentBaseContext context,
int ipdShift,
int bpdShift,
int referenceIPD,
int referenceBPD)
Add background to an area.
|
static void |
addBorders(Area area,
CommonBorderPaddingBackground borderProps,
boolean discardBefore,
boolean discardAfter,
boolean discardStart,
boolean discardEnd,
PercentBaseContext context)
Add borders to an area.
|
static void |
addBorders(Area area,
CommonBorderPaddingBackground borderProps,
PercentBaseContext context)
Deprecated.
Call the other addBorders() method and addPadding separately.
|
static void |
addBreaks(Area area,
int breakBefore,
int breakAfter)
Sets the traits for breaks on an area.
|
static void |
addCollapsingBorders(Area area,
CommonBorderPaddingBackground.BorderInfo borderBefore,
CommonBorderPaddingBackground.BorderInfo borderAfter,
CommonBorderPaddingBackground.BorderInfo borderStart,
CommonBorderPaddingBackground.BorderInfo borderEnd,
boolean[] outer)
Add borders to an area for the collapsing border model in tables.
|
static void |
addFontTraits(Area area,
Font font)
Adds font traits to an area
|
static void |
addMargins(Area area,
CommonBorderPaddingBackground bpProps,
CommonMarginBlock marginProps,
PercentBaseContext context)
Add space to a block area.
|
static void |
addMargins(Area area,
CommonBorderPaddingBackground bpProps,
int startIndent,
int endIndent,
PercentBaseContext context)
Add space to a block area.
|
static void |
addPadding(Area area,
CommonBorderPaddingBackground bordProps,
boolean discardBefore,
boolean discardAfter,
boolean discardStart,
boolean discardEnd,
PercentBaseContext context)
Add padding to an area.
|
static void |
addSpaceBeforeAfter(Area area,
double adjust,
MinOptMax spaceBefore,
MinOptMax spaceAfter)
Adds traits for space-before and space-after to an area.
|
static void |
addStructureTreeElement(Area area,
StructureTreeElement structureTreeElement)
Sets the structure tree element associated to the given area.
|
static void |
addTextDecoration(Area area,
CommonTextDecoration deco)
Adds the text-decoration traits to the area.
|
static int |
getEffectiveSpace(double adjust,
MinOptMax space)
Returns the effective space length of a resolved space specifier based on the adjustment
value.
|
static void |
setBorderPaddingTraits(Area area,
CommonBorderPaddingBackground bpProps,
boolean isNotFirst,
boolean isNotLast,
PercentBaseContext context)
Sets border and padding traits on areas.
|
static void |
setLayer(Area area,
java.lang.String layer)
Sets the optional content group layer as a trait on the area.
|
static void |
setProducerID(Area area,
java.lang.String id)
Sets the producer's ID as a trait on the area.
|
static void |
setVisibility(Area area,
int visibility) |
public static void setBorderPaddingTraits(Area area, CommonBorderPaddingBackground bpProps, boolean isNotFirst, boolean isNotLast, PercentBaseContext context)
area - area to set the traits onbpProps - border and padding propertiesisNotFirst - True if the area is not the first areaisNotLast - True if the area is not the last areacontext - Property evaluation contextpublic static void addBorders(Area area, CommonBorderPaddingBackground borderProps, PercentBaseContext context)
area - the area to set the traits on.borderProps - border propertiescontext - Property evaluation contextpublic static void addBorders(Area area, CommonBorderPaddingBackground borderProps, boolean discardBefore, boolean discardAfter, boolean discardStart, boolean discardEnd, PercentBaseContext context)
area - the area to set the traits on.borderProps - border propertiesdiscardBefore - true if the before border should be discardeddiscardAfter - true if the after border should be discardeddiscardStart - true if the start border should be discardeddiscardEnd - true if the end border should be discardedcontext - Property evaluation contextpublic static void addCollapsingBorders(Area area, CommonBorderPaddingBackground.BorderInfo borderBefore, CommonBorderPaddingBackground.BorderInfo borderAfter, CommonBorderPaddingBackground.BorderInfo borderStart, CommonBorderPaddingBackground.BorderInfo borderEnd, boolean[] outer)
area - the area to set the traits on.borderBefore - the resolved before borderborderAfter - the resolved after borderborderStart - the resolved start borderborderEnd - the resolved end borderouter - 4 boolean values indicating if the side represents the
table's outer border. Order: before, after, start, endpublic static void addPadding(Area area, CommonBorderPaddingBackground bordProps, boolean discardBefore, boolean discardAfter, boolean discardStart, boolean discardEnd, PercentBaseContext context)
area - the area to set the traits on.bordProps - border and padding propertiesdiscardBefore - true if the before padding should be discardeddiscardAfter - true if the after padding should be discardeddiscardStart - true if the start padding should be discardeddiscardEnd - true if the end padding should be discardedcontext - Property evaluation contextpublic static void addBackground(Area area, CommonBorderPaddingBackground backProps, PercentBaseContext context, int ipdShift, int bpdShift, int referenceIPD, int referenceBPD)
Note: The area's IPD and BPD must be set before calling this method.
TODO the regular
addBackground(Area, CommonBorderPaddingBackground, PercentBaseContext)
method should be used instead, and a means to retrieve the original area's
dimensions must be found.
TODO the placement of images in the x- or y-direction will be incorrect if background-repeat is set for that direction.
area - the area to set the traits onbackProps - the background propertiescontext - Property evaluation contextipdShift - horizontal shift to affect to the background, in addition to the
value of the background-position-horizontal propertybpdShift - vertical shift to affect to the background, in addition to the
value of the background-position-vertical propertyreferenceIPD - value to use as a reference for percentage calculationreferenceBPD - value to use as a reference for percentage calculationpublic static void addBackground(Area area, CommonBorderPaddingBackground backProps, PercentBaseContext context)
area - the area to set the traits onbackProps - the background propertiescontext - Property evaluation contextpublic static void addMargins(Area area, CommonBorderPaddingBackground bpProps, int startIndent, int endIndent, PercentBaseContext context)
area - the area to set the traits on.bpProps - the border, padding and background propertiesstartIndent - the effective start-indent valueendIndent - the effective end-indent valuecontext - the context for evaluation of percentagespublic static void addMargins(Area area, CommonBorderPaddingBackground bpProps, CommonMarginBlock marginProps, PercentBaseContext context)
area - the area to set the traits on.bpProps - the border, padding and background propertiesmarginProps - the margin properties.context - the context for evaluation of percentagespublic static int getEffectiveSpace(double adjust,
MinOptMax space)
adjust - the adjustment valuespace - the space specifierpublic static void addSpaceBeforeAfter(Area area, double adjust, MinOptMax spaceBefore, MinOptMax spaceAfter)
area - the target areaadjust - the adjustment valuespaceBefore - the space-before space specifierspaceAfter - the space-after space specifierpublic static void addBreaks(Area area, int breakBefore, int breakAfter)
area - the area to set the traits on.breakBefore - the value for break-beforebreakAfter - the value for break-afterpublic static void addFontTraits(Area area, Font font)
area - the target arefont - the font to usepublic static void addTextDecoration(Area area, CommonTextDecoration deco)
area - the area to set the traits ondeco - the text decorationspublic static void setVisibility(Area area, int visibility)
public static void addStructureTreeElement(Area area, StructureTreeElement structureTreeElement)
area - the area to set the traits onstructureTreeElement - the element the area is associated to in the document structurepublic static void setProducerID(Area area, java.lang.String id)
area - the area to set the traits onid - the ID to setpublic static void setLayer(Area area, java.lang.String layer)
area - the area to set the traits onlayer - the layer ID to setCopyright 1999-2022 The Apache Software Foundation. All Rights Reserved.