Class CardLayout
java.lang.Object
com.vaadin.featurepack.desktop.layouts.AbstractLayout
com.vaadin.featurepack.desktop.layouts.CardLayout
- All Implemented Interfaces:
Serializable
Card layout treats each component in the container as a card. Only one card
is visible at a time, and the container acts as a stack of cards.
- Author:
- Vaadin Ltd
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new aCardLayoutwith no gaps between edges of a container and the current component.CardLayout(int hgap, int vgap) Constructs a newCardLayoutusing the provided horizontal and vertical gap between edges of a container and the current component. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddComponent(com.vaadin.flow.component.Component component) voidfirst()SeeBaseCardLayoutList<com.vaadin.flow.component.Component> getCards()SeeBaseCardLayoutgetConstraints(com.vaadin.flow.component.Component component) intSeeBaseCardLayoutintgetHgap()Returns the horizontal gap between the left and right edges of a container and the current component.intgetVgap()Returns the vertical gap between the top and bottom edges of a container and the current component.voidlast()SeeBaseCardLayoutvoidnext()SeeBaseCardLayoutprotected voidonContainerAttach(com.vaadin.flow.component.AttachEvent event) voidprevious()SeeBaseCardLayoutvoidremoveComponent(com.vaadin.flow.component.Component component) voidsetConstraints(com.vaadin.flow.component.Component component, Object constraints) voidsetContainer(com.vaadin.flow.component.Component container) voidsetCurrentCard(int currentCard) SeeBaseCardLayoutvoidsetHgap(int hgap) Sets the horizontal gap between the left and right edges of a container and the current component.voidsetVgap(int vgap) Sets the vertical gap between the top and bottom edges of a container and the current component.voidSeeBaseCardLayoutMethods inherited from class com.vaadin.featurepack.desktop.layouts.AbstractLayout
getComponents, getContainer, onContainerDetach
-
Constructor Details
-
CardLayout
public CardLayout()Constructs a new aCardLayoutwith no gaps between edges of a container and the current component. -
CardLayout
public CardLayout(int hgap, int vgap) Constructs a newCardLayoutusing the provided horizontal and vertical gap between edges of a container and the current component.- Parameters:
hgap- The horizontal gap to set.vgap- The vertical gap to set.- See Also:
-
-
Method Details
-
onContainerAttach
protected void onContainerAttach(com.vaadin.flow.component.AttachEvent event) - Overrides:
onContainerAttachin classAbstractLayout
-
setContainer
public void setContainer(com.vaadin.flow.component.Component container) - Overrides:
setContainerin classAbstractLayout
-
addComponent
public void addComponent(com.vaadin.flow.component.Component component) - Overrides:
addComponentin classAbstractLayout
-
removeComponent
public void removeComponent(com.vaadin.flow.component.Component component) - Overrides:
removeComponentin classAbstractLayout
-
setConstraints
- Specified by:
setConstraintsin classAbstractLayout
-
getConstraints
- Specified by:
getConstraintsin classAbstractLayout
-
getHgap
public int getHgap()Returns the horizontal gap between the left and right edges of a container and the current component.- Returns:
- the horizontal gap between the left and right edges of a container and the current component.
-
setHgap
public void setHgap(int hgap) Sets the horizontal gap between the left and right edges of a container and the current component.- Parameters:
hgap- the horizontal gap between the left and right edges of a container and the current component.
-
getVgap
public int getVgap()Returns the vertical gap between the top and bottom edges of a container and the current component.- Returns:
- the vertical gap between the top and bottom edges of a container and the current component
-
setVgap
public void setVgap(int vgap) Sets the vertical gap between the top and bottom edges of a container and the current component.- Parameters:
vgap- the vertical gap between the top and bottom edges of a container and the current component
-
first
public void first()SeeBaseCardLayout -
last
public void last()SeeBaseCardLayout -
previous
public void previous()SeeBaseCardLayout -
next
public void next()SeeBaseCardLayout -
show
SeeBaseCardLayout -
getCards
SeeBaseCardLayout -
getCurrentCard
public int getCurrentCard()SeeBaseCardLayout -
setCurrentCard
public void setCurrentCard(int currentCard) SeeBaseCardLayout
-