Class FormLayout.ComponentSizeCache
java.lang.Object
com.jgoodies.forms.layout.FormLayout.ComponentSizeCache
- All Implemented Interfaces:
Serializable
- Enclosing class:
FormLayout
A cache for component minimum and preferred sizes.
Used to reduce the requests to determine a component's size.
- Version:
- $Revision: 1.30 $
-
Field Summary
FieldsModifier and TypeFieldDescriptionMaps components to their minimum sizes.Maps components to their preferred sizes. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateComponentSizeCache(int initialCapacity) Constructs aComponentSizeCache. -
Method Summary
Modifier and TypeMethodDescription(package private) DimensiongetMinimumSize(Component component) Returns the minimum size for the given component.(package private) DimensiongetPreferredSize(Component component) Returns the preferred size for the given component.(package private) voidInvalidates the cache.(package private) voidremoveEntry(Component component)
-
Field Details
-
minimumSizes
-
preferredSizes
-
-
Constructor Details
-
ComponentSizeCache
private ComponentSizeCache(int initialCapacity) Constructs aComponentSizeCache.- Parameters:
initialCapacity- the initial cache capacity
-
-
Method Details
-
invalidate
void invalidate()Invalidates the cache. Clears all stored size information. -
getMinimumSize
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
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
-