Class CheckBoxRenderer

    • Constructor Detail

      • CheckBoxRenderer

        public CheckBoxRenderer​(CheckBox modelElement)
        Creates a new CheckBoxRenderer instance.
        Parameters:
        modelElement - the model element
    • Method Detail

      • 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
      • getRenderingMode

        public RenderingMode getRenderingMode()
        Gets the rendering mode of the checkbox.
        Returns:
        the rendering mode of the checkbox
      • getCheckBoxType

        public CheckBoxType getCheckBoxType()
        Gets the checkBoxType.
        Returns:
        the checkBoxType
      • createCheckBoxRenderStrategy

        public ICheckBoxRenderingStrategy createCheckBoxRenderStrategy()
        creates a ICheckBoxRenderingStrategy based on the current settings.
        Returns:
        the ICheckBoxRenderingStrategy
      • 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
      • isBoxChecked

        public boolean isBoxChecked()
        Defines whether the box is checked or not.
        Returns:
        the default value of the checkbox field
      • applyPaddings

        protected Rectangle applyPaddings​(Rectangle rect,
                                          UnitValue[] paddings,
                                          boolean reverse)
        Applies given paddings to the given rectangle.

        Checkboxes don't support setting of paddings as they are always centered. So that this method returns the rectangle as is.

        Overrides:
        applyPaddings in class AbstractRenderer
        Parameters:
        rect - a rectangle paddings will be applied on.
        paddings - the paddings to be applied on the given rectangle
        reverse - indicates whether paddings will be applied inside (in case of false) or outside (in case of true) the rectangle.
        Returns:
        The rectangle NOT modified by the paddings.
      • 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.