Class AbstractVaadinLayoutStyle

java.lang.Object
com.vaadin.featurepack.desktop.graphics.LayoutStyle
com.vaadin.featurepack.desktop.graphics.AbstractVaadinLayoutStyle
All Implemented Interfaces:
Serializable

public abstract class AbstractVaadinLayoutStyle extends LayoutStyle implements Serializable
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 abstract void
    checkPosition(int position)
     
    protected int
    flipDirection(int position)
     
    int
    getContainerGap(com.vaadin.flow.component.Component component, int position, com.vaadin.flow.component.Component parentContainer)
    Returns the amount of space to place between the component and specified edge of its parent.
    protected abstract int
    getIndent(com.vaadin.flow.component.Component component1, int position)
     
    int
    getPreferredGap(com.vaadin.flow.component.Component component1, com.vaadin.flow.component.Component component2, LayoutStyle.ComponentPlacement type, int position, com.vaadin.flow.component.Component parentContainer)
    Returns the amount of space to use between two components.

    Methods inherited from class java.lang.Object

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

    • AbstractVaadinLayoutStyle

      public AbstractVaadinLayoutStyle()
  • Method Details

    • getPreferredGap

      public int getPreferredGap(com.vaadin.flow.component.Component component1, com.vaadin.flow.component.Component component2, LayoutStyle.ComponentPlacement type, int position, com.vaadin.flow.component.Component parentContainer)
      Description copied from class: LayoutStyle
      Returns the amount of space to use between two components. The return value indicates the distance to place component2 relative to component1. For example, the following returns the amount of space to place between component2 and component1 when component2 is placed vertically above component1:
       int gap = getPreferredGap(component1, component2,
               ComponentPlacement.RELATED, SwingConstants.NORTH, parent);
       
      The type parameter indicates the relation between the two components. If the two components will be contained in the same parent and are showing similar logically related items, use RELATED. If the two components will be contained in the same parent but show logically unrelated items use UNRELATED. Some look and feels may not distinguish between the RELATED and UNRELATED types.

      The return value is not intended to take into account the current size and position of component2 or component1. The return value may take into consideration various properties of the components. For example, the space may vary based on font size, or the preferred size of the component.

      Specified by:
      getPreferredGap in class LayoutStyle
      Parameters:
      component1 - the JComponent component2 is being placed relative to
      component2 - the JComponent being placed
      type - how the two components are being placed
      position - the position component2 is being placed relative to component1; one of SwingConstants.NORTH, SwingConstants.SOUTH, SwingConstants.EAST or SwingConstants.WEST
      Returns:
      the amount of space to place between the two components
      See Also:
    • getContainerGap

      public int getContainerGap(com.vaadin.flow.component.Component component, int position, com.vaadin.flow.component.Component parentContainer)
      Description copied from class: LayoutStyle
      Returns the amount of space to place between the component and specified edge of its parent.
      Specified by:
      getContainerGap in class LayoutStyle
      Parameters:
      component - the JComponent being positioned
      position - the position component is being placed relative to its parent; one of SwingConstants.NORTH, SwingConstants.SOUTH, SwingConstants.EAST or SwingConstants.WEST
      Returns:
      the amount of space to place between the component and specified edge
    • flipDirection

      protected int flipDirection(int position)
    • checkPosition

      protected abstract void checkPosition(int position)
    • getIndent

      protected abstract int getIndent(com.vaadin.flow.component.Component component1, int position)