Package com.jgoodies.forms.layout
Class FormLayout.ComponentSizeCache
- java.lang.Object
-
- com.jgoodies.forms.layout.FormLayout.ComponentSizeCache
-
- All Implemented Interfaces:
java.io.Serializable
- Enclosing class:
- FormLayout
private static final class FormLayout.ComponentSizeCache extends java.lang.Object implements java.io.SerializableA 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>minimumSizesMaps components to their minimum sizes.private java.util.Map<java.awt.Component,java.awt.Dimension>preferredSizesMaps components to their preferred sizes.
-
Constructor Summary
Constructors Modifier Constructor Description privateComponentSizeCache(int initialCapacity)Constructs aComponentSizeCache.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.awt.DimensiongetMinimumSize(java.awt.Component component)Returns the minimum size for the given component.(package private) java.awt.DimensiongetPreferredSize(java.awt.Component component)Returns the preferred size for the given component.(package private) voidinvalidate()Invalidates the cache.(package private) voidremoveEntry(java.awt.Component component)
-
-
-
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)
-
-