Class FormLayout.ComponentSizeCache

java.lang.Object
com.jgoodies.forms.layout.FormLayout.ComponentSizeCache
All Implemented Interfaces:
Serializable
Enclosing class:
FormLayout

private static final class FormLayout.ComponentSizeCache extends Object implements Serializable
A cache for component minimum and preferred sizes. Used to reduce the requests to determine a component's size.
  • Field Details

    • minimumSizes

      private final Map<Component,Dimension> minimumSizes
      Maps components to their minimum sizes.
    • preferredSizes

      private final Map<Component,Dimension> preferredSizes
      Maps components to their preferred sizes.
  • Constructor Details

    • ComponentSizeCache

      private ComponentSizeCache(int initialCapacity)
      Constructs a ComponentSizeCache.
      Parameters:
      initialCapacity - the initial cache capacity
  • Method Details

    • invalidate

      void invalidate()
      Invalidates the cache. Clears all stored size information.
    • getMinimumSize

      Dimension getMinimumSize(Component component)
      Returns the minimum size for the given component. Tries to look up the value from the cache; lazily creates the value if it has not been requested before.
      Parameters:
      component - the component to compute the minimum size
      Returns:
      the component's minimum size
    • getPreferredSize

      Dimension getPreferredSize(Component component)
      Returns the preferred size for the given component. Tries to look up the value from the cache; lazily creates the value if it has not been requested before.
      Parameters:
      component - the component to compute the preferred size
      Returns:
      the component's preferred size
    • removeEntry

      void removeEntry(Component component)