Class VaadinLayoutStyle

All Implemented Interfaces:
Serializable

public class VaadinLayoutStyle extends AbstractVaadinLayoutStyle
An implementation of LayoutStyle that returns 6 for related components, otherwise 12. This class also provides helper methods for subclasses.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.vaadin.featurepack.desktop.graphics.LayoutStyle

    LayoutStyle.ComponentPlacement
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    checkPosition(int position)
     
    int
    getButtonGap(com.vaadin.flow.component.Component c, int position)
    If c is a check box or radio button, and the border is not painted this returns the inset along the specified axis.
    protected int
    getButtonGap(com.vaadin.flow.component.Component source, int position, int offset)
    For some look and feels check boxs and radio buttons typically don't paint the border, yet they have padding for a border.
    protected int
    getButtonGap(com.vaadin.flow.component.Component source, com.vaadin.flow.component.Component target, int position, int offset)
    For some look and feels check boxs and radio buttons typically don't paint the border, yet they have padding for a border.
    protected int
    getIndent(com.vaadin.flow.component.Component c, int position)
    Returns the amount to indent the specified component if it's a JCheckBox or JRadioButton.
     
    protected boolean
    isLabelAndNonlabel(com.vaadin.flow.component.Component c1, com.vaadin.flow.component.Component c2, int position)
    Returns true if the classes identify a JLabel and a non-JLabel along the horizontal axis.

    Methods inherited from class com.vaadin.featurepack.desktop.graphics.AbstractVaadinLayoutStyle

    flipDirection, getContainerGap, getPreferredGap

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • VaadinLayoutStyle

      public VaadinLayoutStyle()
  • Method Details

    • getInstance

      public static LayoutStyle getInstance()
    • isLabelAndNonlabel

      protected boolean isLabelAndNonlabel(com.vaadin.flow.component.Component c1, com.vaadin.flow.component.Component c2, int position)
      Returns true if the classes identify a JLabel and a non-JLabel along the horizontal axis.
    • getButtonGap

      protected int getButtonGap(com.vaadin.flow.component.Component source, com.vaadin.flow.component.Component target, int position, int offset)
      For some look and feels check boxs and radio buttons typically don't paint the border, yet they have padding for a border. Look and feel guidelines generally don't include this space. Use this method to subtract this space from the specified components.
      Parameters:
      source - First component
      target - Second component
      position - Position doing layout along.
      offset - Ideal offset, not including border/margin
      Returns:
      offset - border/margin around the component.
    • getButtonGap

      protected int getButtonGap(com.vaadin.flow.component.Component source, int position, int offset)
      For some look and feels check boxs and radio buttons typically don't paint the border, yet they have padding for a border. Look and feel guidelines generally don't include this space. Use this method to subtract this space from the specified components.
      Parameters:
      source - Component
      position - Position doing layout along.
      offset - Ideal offset, not including border/margin
      Returns:
      offset - border/margin around the component.
    • getButtonGap

      public int getButtonGap(com.vaadin.flow.component.Component c, int position)
      If c is a check box or radio button, and the border is not painted this returns the inset along the specified axis.
    • checkPosition

      protected void checkPosition(int position)
      Specified by:
      checkPosition in class AbstractVaadinLayoutStyle
    • getIndent

      protected int getIndent(com.vaadin.flow.component.Component c, int position)
      Returns the amount to indent the specified component if it's a JCheckBox or JRadioButton. If the component is not a JCheckBox or JRadioButton, 0 will be returned.
      Specified by:
      getIndent in class AbstractVaadinLayoutStyle