Class FormLayout.ComponentSizeCache

  • All Implemented Interfaces:
    java.io.Serializable
    Enclosing class:
    FormLayout

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

      Fields 
      Modifier and Type Field Description
      private java.util.Map<java.awt.Component,​java.awt.Dimension> minimumSizes
      Maps components to their minimum sizes.
      private java.util.Map<java.awt.Component,​java.awt.Dimension> preferredSizes
      Maps components to their preferred sizes.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ComponentSizeCache​(int initialCapacity)
      Constructs a ComponentSizeCache.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) java.awt.Dimension getMinimumSize​(java.awt.Component component)
      Returns the minimum size for the given component.
      (package private) java.awt.Dimension getPreferredSize​(java.awt.Component component)
      Returns the preferred size for the given component.
      (package private) void invalidate()
      Invalidates the cache.
      (package private) void removeEntry​(java.awt.Component component)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • minimumSizes

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

        private final java.util.Map<java.awt.Component,​java.awt.Dimension> preferredSizes
        Maps components to their preferred sizes.
    • Constructor Detail

      • ComponentSizeCache

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

      • invalidate

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

        java.awt.Dimension getMinimumSize​(java.awt.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

        java.awt.Dimension getPreferredSize​(java.awt.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​(java.awt.Component component)