Class ComponentGeometryUtil

java.lang.Object
com.vaadin.featurepack.desktop.ComponentGeometryUtil
All Implemented Interfaces:
Serializable

public class ComponentGeometryUtil extends Object implements Serializable
Utility class for setting and getting the size, location and bounds of a component.
Author:
Vaadin Ltd
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    Appends "px" to the given pixel value
    static int
    getBaseline(com.vaadin.flow.component.Component component, int width, int height)
    Not implemented yet.
    static int
    getBaseline(com.vaadin.flow.component.Component component, Dimension dimension)
    Not implemented yet
    getBaselineResizeBehavior(com.vaadin.flow.component.Component component)
    Not implemented yet
    static Rectangle
    getBounds(com.vaadin.flow.component.Component component)
    Gets the bounds for the component.
    static Insets
    getInsets(com.vaadin.flow.component.Component component)
    Not implemented yet
    static Point
    getLocation(com.vaadin.flow.component.Component component)
    Gets the location for the component.
    static Dimension
    getMaximumSize(com.vaadin.flow.component.Component component)
    Gets the maximum size for the component.
    static Dimension
    getMinimumSize(com.vaadin.flow.component.Component component)
    Gets the minimum size for the component.
    static Dimension
    getPreferredSize(com.vaadin.flow.component.Component component)
    Gets the preferred size for the component.
    static Dimension
    getSize(com.vaadin.flow.component.Component component)
    Gets the size for the component.
    static int
    Parses the int value from given CSS pixel value
    static void
    resetToPreferredSizes(com.vaadin.flow.component.Component component)
    Rests component to its initial preferred sizes.
    static void
    setBounds(com.vaadin.flow.component.Component component, int x, int y, int width, int height)
    Sets the bounds for the component.
    static void
    setBounds(com.vaadin.flow.component.Component component, Rectangle bounds)
    Sets the bounds for the component.
    static void
    setLocation(com.vaadin.flow.component.Component component, int x, int y)
    Sets the location for the component.
    static void
    setLocation(com.vaadin.flow.component.Component component, Point location)
    Sets the location for the component.
    static void
    setMaximumSize(com.vaadin.flow.component.Component component, Dimension size)
    Sets the maximum size for the component.
    static void
    setMinimumSize(com.vaadin.flow.component.Component component, Dimension size)
    Sets the minimum size for the component.
    static void
    setPreferredSize(com.vaadin.flow.component.Component component, Dimension size)
    Sets the preferred size for the component.
    static void
    setSize(com.vaadin.flow.component.Component component, int width, int height)
    Sets the size for the component.
    static void
    setSize(com.vaadin.flow.component.Component component, Dimension size)
    Sets the size for the component.

    Methods inherited from class java.lang.Object

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

    • setSize

      public static void setSize(com.vaadin.flow.component.Component component, Dimension size)
      Sets the size for the component.
      Parameters:
      component - the component to set the size for
      size - 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 for
      width - the width to set
      height - the height to set
    • getSize

      public static Dimension getSize(com.vaadin.flow.component.Component component)
      Gets the size for the component.
      Parameters:
      component - the component to get the size for
      Returns:
      the size of the component
    • setMinimumSize

      public static void setMinimumSize(com.vaadin.flow.component.Component component, Dimension size)
      Sets the minimum size for the component.
      Parameters:
      component - the component to set the minimum size for
      size - the minimum size to set
    • getMinimumSize

      public static Dimension getMinimumSize(com.vaadin.flow.component.Component component)
      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

      public static void setMaximumSize(com.vaadin.flow.component.Component component, Dimension size)
      Sets the maximum size for the component.
      Parameters:
      component - the component to set the maximum size for
      size - the maximum size to set
    • getMaximumSize

      public static Dimension getMaximumSize(com.vaadin.flow.component.Component component)
      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

      public static void setPreferredSize(com.vaadin.flow.component.Component component, Dimension size)
      Sets the preferred size for the component.
      Parameters:
      component - the component to set the preferred size for
      size - 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

      public static Dimension getPreferredSize(com.vaadin.flow.component.Component component)
      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

      public static void setLocation(com.vaadin.flow.component.Component component, Point location)
      Sets the location for the component.
      Parameters:
      component - the component to set the location for
      location - 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 for
      x - the x coordinate to set
      y - the y coordinate to set
    • getLocation

      public static Point getLocation(com.vaadin.flow.component.Component component)
      Gets the location for the component.
      Parameters:
      component - the component to get the location for
      Returns:
      the location of the component
    • setBounds

      public static void setBounds(com.vaadin.flow.component.Component component, Rectangle bounds)
      Sets the bounds for the component.
      Parameters:
      component - the component to set the bounds for
      bounds - 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 for
      x - the x coordinate to set
      y - the y coordinate to set
      width - the width to set
      height - the height to set
    • getBounds

      public static Rectangle getBounds(com.vaadin.flow.component.Component component)
      Gets the bounds for the component.
      Parameters:
      component - the component to get the bounds for
      Returns:
      the bounds of the component
    • formatCSSPixelValue

      public static String formatCSSPixelValue(int value)
      Appends "px" to the given pixel value
      Parameters:
      value -
      Returns:
      the CSS representation E.g.: "5px"
    • parseCSSPixelValue

      public static int parseCSSPixelValue(String value)
      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

      public static int getBaseline(com.vaadin.flow.component.Component component, Dimension dimension)
      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

      public static Insets getInsets(com.vaadin.flow.component.Component component)
      Not implemented yet
      Parameters:
      component -
      Returns: