Package com.itextpdf.forms.form.renderer
Class RadioRenderer
java.lang.Object
com.itextpdf.layout.renderer.AbstractRenderer
com.itextpdf.layout.renderer.BlockRenderer
com.itextpdf.forms.form.renderer.AbstractFormFieldRenderer
com.itextpdf.forms.form.renderer.RadioRenderer
- All Implemented Interfaces:
-
IPropertyContainer
,IRenderer
The
AbstractFormFieldRenderer
implementation for radio buttons.
-
Field Summary
Fields inherited from class com.itextpdf.forms.form.renderer.AbstractFormFieldRenderer
flatRenderer
Fields inherited from class com.itextpdf.layout.renderer.AbstractRenderer
childRenderers, EPS, flushed, INF, isLastRendererForModelElement, modelElement, occupiedArea, OVERLAP_EPSILON, parent, positionedRenderers, properties
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
adjustFieldLayout
(LayoutContext layoutContext) Adjusts the field layout.protected void
applyAcroField
(DrawContext drawContext) Applies the AcroField widget.protected Rectangle
applyBorderBox
(Rectangle rect, Border[] borders, boolean reverse) Applies the given border box (borders) on the given rectangleprotected IRenderer
Creates the flat renderer instance.void
drawBackground
(DrawContext drawContext) Draws a background layer if it is defined by a keyProperty.BACKGROUND
in either the layout element or thisIRenderer
itself.void
drawBorder
(DrawContext drawContext) Performs the drawing operation for the border of this renderer, if defined by any of theProperty.BORDER
values in either the layout element or thisIRenderer
itself.Gets a new instance of this class to be used as a next renderer, after this renderer is used, ifIRenderer.layout(LayoutContext)
is called more than once.boolean
Defines whether the radio is checked or not.protected boolean
Determines, whether the layout is based in the renderer itself or flat renderer.Methods inherited from class com.itextpdf.forms.form.renderer.AbstractFormFieldRenderer
draw, drawChildren, getDefaultValue, getLang, getMinMaxWidth, getModelId, isFlatten, isRendererFit, layout, writeAcroFormFieldLangAttribute
Methods inherited from class com.itextpdf.layout.renderer.BlockRenderer
applyRotationLayout, applyVerticalAlignment, beginRotationIfApplied, createOverflowRenderer, createRotationTransformInsideOccupiedArea, createSplitRenderer, endRotationIfApplied, getOccupiedAreaBBox
Methods inherited from class com.itextpdf.layout.renderer.AbstractRenderer
addAllProperties, addChild, alignChildHorizontally, allowLastYLineRecursiveExtraction, applyAbsolutePosition, applyAction, applyBorderBox, applyDestination, applyDestinationsAndAnnotation, applyLinkAnnotation, applyMargins, applyMargins, applyPaddings, applyPaddings, applyRelativePositioningTranslation, beginElementOpacityApplying, beginTransformationIfApplied, calculateAbsolutePdfBBox, calculateBBox, calculateShiftToPositionBBoxOfPointsAt, clipBackgroundArea, clipBackgroundArea, clipBorderArea, createXObject, deleteOwnProperty, deleteProperty, endElementOpacityApplying, endTransformationIfApplied, getBackgroundArea, getBorderAreaBBox, getBorderRadii, getBorders, getChildRenderers, getDefaultProperty, getFirstYLineRecursively, getInnerAreaBBox, getLastYLineRecursively, getMargins, getModelElement, getOccupiedArea, getOwnProperties, getOwnProperty, getPaddings, getParent, getProperty, getProperty, getPropertyAsBoolean, getPropertyAsColor, getPropertyAsFloat, getPropertyAsFloat, getPropertyAsFont, getPropertyAsInteger, getPropertyAsTransparentColor, getPropertyAsUnitValue, hasAbsoluteUnitValue, hasOwnOrModelProperty, hasOwnProperty, hasProperty, hasRelativeUnitValue, initElementAreas, isAbsolutePosition, isBorderBoxSizing, isFirstOnRootArea, isFixedLayout, isFlushed, isKeepTogether, isNotFittingHeight, isNotFittingLayoutArea, isNotFittingWidth, isOverflowFit, isOverflowProperty, isOverflowProperty, isOverflowProperty, isPositioned, isRelativePosition, isStaticLayout, move, rectangleToPointsList, retrieveHeight, retrieveMaxHeight, retrieveMaxWidth, retrieveMinHeight, retrieveMinWidth, retrieveUnitValue, retrieveUnitValue, retrieveWidth, setBorders, setMinMaxWidthBasedOnFixedWidth, setParent, setProperty, toString, transformPoints, updateHeight, updateHeightsOnSplit, updateMaxHeight, updateMinHeight, updateWidth
-
Constructor Details
-
RadioRenderer
Creates a newRadioRenderer
instance.- Parameters:
-
modelElement
- the model element
-
-
Method Details
-
getNextRenderer
Gets a new instance of this class to be used as a next renderer, after this renderer is used, ifIRenderer.layout(LayoutContext)
is called more than once.- Returns:
- new renderer instance
-
drawBorder
Performs the drawing operation for the border of this renderer, if defined by any of theProperty.BORDER
values in either the layout element or thisIRenderer
itself.- Overrides:
-
drawBorder
in classAbstractRenderer
- Parameters:
-
drawContext
- the context (canvas, document, etc) of this drawing operation.
-
drawBackground
Draws a background layer if it is defined by a keyProperty.BACKGROUND
in either the layout element or thisIRenderer
itself.- Overrides:
-
drawBackground
in classAbstractRenderer
- Parameters:
-
drawContext
- the context (canvas, document, etc) of this drawing operation.
-
applyBorderBox
Applies the given border box (borders) on the given rectangle- Overrides:
-
applyBorderBox
in classAbstractRenderer
- Parameters:
-
rect
- a rectangle paddings will be applied on. -
borders
- theborders
to be applied on the given rectangle -
reverse
- indicates whether the border box will be applied inside (in case of false) or outside (in case of false) the rectangle. - Returns:
-
a
border box
of the renderer
-
createFlatRenderer
Creates the flat renderer instance.- Specified by:
-
createFlatRenderer
in classAbstractFormFieldRenderer
- Returns:
- the renderer instance
-
adjustFieldLayout
Adjusts the field layout.- Specified by:
-
adjustFieldLayout
in classAbstractFormFieldRenderer
- Parameters:
-
layoutContext
- layout context
-
isBoxChecked
public boolean isBoxChecked()Defines whether the radio is checked or not.- Returns:
- the default value of the radio field
-
applyAcroField
Applies the AcroField widget.- Specified by:
-
applyAcroField
in classAbstractFormFieldRenderer
- Parameters:
-
drawContext
- the draw context
-
isLayoutBasedOnFlatRenderer
protected boolean isLayoutBasedOnFlatRenderer()Determines, whether the layout is based in the renderer itself or flat renderer.- Overrides:
-
isLayoutBasedOnFlatRenderer
in classAbstractFormFieldRenderer
- Returns:
-
true
if layout is based on flat renderer, false otherwise
-