Class AbstractSelectFieldRenderer

All Implemented Interfaces:
IPropertyContainer, IRenderer
Direct Known Subclasses:
SelectFieldComboBoxRenderer, SelectFieldListBoxRenderer

public abstract class AbstractSelectFieldRenderer extends BlockRenderer
Abstract BlockRenderer for select form fields.
  • Constructor Details

  • Method Details

    • layout

      public LayoutResult layout (LayoutContext layoutContext)
      Description copied from class: BlockRenderer
      This method simulates positioning of the renderer, including all of its children, and returns the LayoutResult, representing the layout result, including occupied area, status, i.e. if there was enough place to fit the renderer subtree, etc. LayoutResult can be extended to return custom layout results for custom elements, e.g. TextRenderer uses TextLayoutResult as its result. This method can be called standalone to learn how much area the renderer subtree needs, or can be called before IRenderer.draw(DrawContext), to prepare the renderer to be flushed to the output stream.
      Specified by:
      layout in interface IRenderer
      Overrides:
      layout in class BlockRenderer
      Parameters:
      layoutContext - the description of layout area and any other additional information
      Returns:
      result of the layout process
    • draw

      public void draw (DrawContext drawContext)
      Flushes the renderer subtree contents, i.e. draws itself on canvas, adds necessary objects to the PdfDocument etc.
      Specified by:
      draw in interface IRenderer
      Overrides:
      draw in class BlockRenderer
      Parameters:
      drawContext - contains the PdfDocument to which the renderer subtree if flushed, the PdfCanvas on which the renderer subtree is drawn and other additional parameters needed to perform drawing
    • drawChildren

      public void drawChildren (DrawContext drawContext)
      Description copied from class: AbstractRenderer
      Performs the drawing operation for all children of this renderer.
      Overrides:
      drawChildren in class AbstractRenderer
      Parameters:
      drawContext - the context (canvas, document, etc) of this drawing operation.
    • getLang

      protected String getLang()
      Gets the accessibility language.
      Returns:
      the accessibility language
    • writeAcroFormFieldLangAttribute

      protected void writeAcroFormFieldLangAttribute (PdfDocument pdfDoc)
    • createFlatRenderer

      protected abstract IRenderer createFlatRenderer()
    • applyAcroField

      protected abstract void applyAcroField (DrawContext drawContext)
    • isFlatten

      protected boolean isFlatten()
      Checks if form fields need to be flattened.
      Returns:
      true, if fields need to be flattened
    • getModelId

      protected String getModelId()
      Gets the model id.
      Returns:
      the model id
    • setupBuilderValues

      protected void setupBuilderValues (ChoiceFormFieldBuilder builder, AbstractSelectField field)
      Retrieve the options from select field (can be combo box or list box field) and set them to the form field builder.
      Parameters:
      builder - ChoiceFormFieldBuilder to set options to.
      field - AbstractSelectField to retrieve the options from.
    • getFinalSelectFieldHeight

      protected float getFinalSelectFieldHeight (float availableHeight, float actualHeight, boolean isClippedHeight)
    • getConformanceLevel

      protected PdfAConformanceLevel getConformanceLevel (PdfDocument document)
      Gets the conformance level. If the conformance level is not set, the conformance level of the document is used.
      Parameters:
      document - the document
      Returns:
      the conformance level or null if the conformance level is not set.
    • getOptionsMarkedSelected

      protected List<IRenderer> getOptionsMarkedSelected (IRenderer optionsSubTree)