Class RadioRenderer

All Implemented Interfaces:
IPropertyContainer, IRenderer

public class RadioRenderer extends AbstractFormFieldRenderer
The AbstractFormFieldRenderer implementation for radio buttons.
  • Constructor Details

    • RadioRenderer

      public RadioRenderer (Radio modelElement)
      Creates a new RadioRenderer instance.
      Parameters:
      modelElement - the model element
  • Method Details

    • getNextRenderer

      public IRenderer getNextRenderer()
      Gets a new instance of this class to be used as a next renderer, after this renderer is used, if IRenderer.layout(LayoutContext) is called more than once.
      Returns:
      new renderer instance
    • drawBorder

      public void drawBorder (DrawContext drawContext)
      Performs the drawing operation for the border of this renderer, if defined by any of the Property.BORDER values in either the layout element or this IRenderer itself.
      Overrides:
      drawBorder in class AbstractRenderer
      Parameters:
      drawContext - the context (canvas, document, etc) of this drawing operation.
    • drawBackground

      public void drawBackground (DrawContext drawContext)
      Draws a background layer if it is defined by a key Property.BACKGROUND in either the layout element or this IRenderer itself.
      Overrides:
      drawBackground in class AbstractRenderer
      Parameters:
      drawContext - the context (canvas, document, etc) of this drawing operation.
    • applyBorderBox

      protected Rectangle applyBorderBox (Rectangle rect, Border[] borders, boolean reverse)
      Applies the given border box (borders) on the given rectangle
      Overrides:
      applyBorderBox in class AbstractRenderer
      Parameters:
      rect - a rectangle paddings will be applied on.
      borders - the borders 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

      protected IRenderer createFlatRenderer()
      Creates the flat renderer instance.
      Specified by:
      createFlatRenderer in class AbstractFormFieldRenderer
      Returns:
      the renderer instance
    • adjustFieldLayout

      protected void adjustFieldLayout (LayoutContext layoutContext)
      Adjusts the field layout.
      Specified by:
      adjustFieldLayout in class AbstractFormFieldRenderer
      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

      protected void applyAcroField (DrawContext drawContext)
      Applies the AcroField widget.
      Specified by:
      applyAcroField in class AbstractFormFieldRenderer
      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 class AbstractFormFieldRenderer
      Returns:
      true if layout is based on flat renderer, false otherwise