Package com.vaadin.featurepack.desktop
Class ComponentGeometryUtil
java.lang.Object
com.vaadin.featurepack.desktop.ComponentGeometryUtil
- All Implemented Interfaces:
Serializable
Utility class for setting and getting the size, location and bounds of a
component.
- Author:
- Vaadin Ltd
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringformatCSSPixelValue(int value) Appends "px" to the given pixel valuestatic intgetBaseline(com.vaadin.flow.component.Component component, int width, int height) Not implemented yet.static intgetBaseline(com.vaadin.flow.component.Component component, Dimension dimension) Not implemented yetgetBaselineResizeBehavior(com.vaadin.flow.component.Component component) Not implemented yetstatic RectanglegetBounds(com.vaadin.flow.component.Component component) Gets the bounds for the component.static InsetsgetInsets(com.vaadin.flow.component.Component component) Not implemented yetstatic PointgetLocation(com.vaadin.flow.component.Component component) Gets the location for the component.static DimensiongetMaximumSize(com.vaadin.flow.component.Component component) Gets the maximum size for the component.static DimensiongetMinimumSize(com.vaadin.flow.component.Component component) Gets the minimum size for the component.static DimensiongetPreferredSize(com.vaadin.flow.component.Component component) Gets the preferred size for the component.static DimensiongetSize(com.vaadin.flow.component.Component component) Gets the size for the component.static intparseCSSPixelValue(String value) Parses the int value from given CSS pixel valuestatic voidresetToPreferredSizes(com.vaadin.flow.component.Component component) Rests component to its initial preferred sizes.static voidsetBounds(com.vaadin.flow.component.Component component, int x, int y, int width, int height) Sets the bounds for the component.static voidSets the bounds for the component.static voidsetLocation(com.vaadin.flow.component.Component component, int x, int y) Sets the location for the component.static voidsetLocation(com.vaadin.flow.component.Component component, Point location) Sets the location for the component.static voidsetMaximumSize(com.vaadin.flow.component.Component component, Dimension size) Sets the maximum size for the component.static voidsetMinimumSize(com.vaadin.flow.component.Component component, Dimension size) Sets the minimum size for the component.static voidsetPreferredSize(com.vaadin.flow.component.Component component, Dimension size) Sets the preferred size for the component.static voidsetSize(com.vaadin.flow.component.Component component, int width, int height) Sets the size for the component.static voidSets the size for the component.
-
Method Details
-
setSize
Sets the size for the component.- Parameters:
component- the component to set the size forsize- the size to set
-
setSize
public static void setSize(com.vaadin.flow.component.Component component, int width, int height) Sets the size for the component.- Parameters:
component- the component to set the size forwidth- the width to setheight- the height to set
-
getSize
Gets the size for the component.- Parameters:
component- the component to get the size for- Returns:
- the size of the component
-
setMinimumSize
Sets the minimum size for the component.- Parameters:
component- the component to set the minimum size forsize- the minimum size to set
-
getMinimumSize
Gets the minimum size for the component.- Parameters:
component- the component to get the minimum size for- Returns:
- the minimum size of the component
-
setMaximumSize
Sets the maximum size for the component.- Parameters:
component- the component to set the maximum size forsize- the maximum size to set
-
getMaximumSize
Gets the maximum size for the component.- Parameters:
component- the component to get the maximum size for- Returns:
- the maximum size of the component
-
setPreferredSize
Sets the preferred size for the component.- Parameters:
component- the component to set the preferred size forsize- the preferred size to set
-
resetToPreferredSizes
public static void resetToPreferredSizes(com.vaadin.flow.component.Component component) Rests component to its initial preferred sizes.- Parameters:
component- the component to set the preferred size for
-
getPreferredSize
Gets the preferred size for the component.- Parameters:
component- the component to get the preferred size for- Returns:
- the preferred size of the component
-
setLocation
Sets the location for the component.- Parameters:
component- the component to set the location forlocation- the location to set
-
setLocation
public static void setLocation(com.vaadin.flow.component.Component component, int x, int y) Sets the location for the component.- Parameters:
component- the component to set the location forx- the x coordinate to sety- the y coordinate to set
-
getLocation
Gets the location for the component.- Parameters:
component- the component to get the location for- Returns:
- the location of the component
-
setBounds
Sets the bounds for the component.- Parameters:
component- the component to set the bounds forbounds- the bounds to set
-
setBounds
public static void setBounds(com.vaadin.flow.component.Component component, int x, int y, int width, int height) Sets the bounds for the component.- Parameters:
component- the component to set the bounds forx- the x coordinate to sety- the y coordinate to setwidth- the width to setheight- the height to set
-
getBounds
Gets the bounds for the component.- Parameters:
component- the component to get the bounds for- Returns:
- the bounds of the component
-
formatCSSPixelValue
Appends "px" to the given pixel value- Parameters:
value-- Returns:
- the CSS representation E.g.: "5px"
-
parseCSSPixelValue
Parses the int value from given CSS pixel value- Parameters:
value-- Returns:
- E.g.: 5 for "5px"
-
getBaseline
public static int getBaseline(com.vaadin.flow.component.Component component, int width, int height) Not implemented yet.- Parameters:
component-width-height-- Returns:
-
getBaseline
Not implemented yet- Parameters:
component-dimension-- Returns:
-
getBaselineResizeBehavior
public static Component.BaselineResizeBehavior getBaselineResizeBehavior(com.vaadin.flow.component.Component component) Not implemented yet- Parameters:
component-- Returns:
-
getInsets
Not implemented yet- Parameters:
component-- Returns:
-