Class AbstractVaadinLayoutStyle
java.lang.Object
com.vaadin.featurepack.desktop.graphics.LayoutStyle
com.vaadin.featurepack.desktop.graphics.AbstractVaadinLayoutStyle
- All Implemented Interfaces:
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 -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidcheckPosition(int position) protected intflipDirection(int position) intgetContainerGap(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 intgetIndent(com.vaadin.flow.component.Component component1, int position) intgetPreferredGap(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.
-
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:LayoutStyleReturns the amount of space to use between two components. The return value indicates the distance to placecomponent2relative tocomponent1. For example, the following returns the amount of space to place betweencomponent2andcomponent1whencomponent2is placed vertically abovecomponent1:int gap = getPreferredGap(component1, component2, ComponentPlacement.RELATED, SwingConstants.NORTH, parent);Thetypeparameter 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, useRELATED. If the two components will be contained in the same parent but show logically unrelated items useUNRELATED. Some look and feels may not distinguish between theRELATEDandUNRELATEDtypes.The return value is not intended to take into account the current size and position of
component2orcomponent1. 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:
getPreferredGapin classLayoutStyle- Parameters:
component1- theJComponentcomponent2is being placed relative tocomponent2- theJComponentbeing placedtype- how the two components are being placedposition- the positioncomponent2is being placed relative tocomponent1; one ofSwingConstants.NORTH,SwingConstants.SOUTH,SwingConstants.EASTorSwingConstants.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:LayoutStyleReturns the amount of space to place between the component and specified edge of its parent.- Specified by:
getContainerGapin classLayoutStyle- Parameters:
component- theJComponentbeing positionedposition- the positioncomponentis being placed relative to its parent; one ofSwingConstants.NORTH,SwingConstants.SOUTH,SwingConstants.EASTorSwingConstants.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)
-