Package com.jgoodies.forms.layout
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionMaps components to their minimum sizes.Maps components to their preferred sizes. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ComponentSizeCache
(int initialCapacity) Constructs aComponentSizeCache
. -
Method Summary
Modifier and TypeMethodDescription(package private) Dimension
getMinimumSize
(Component component) Returns the minimum size for the given component.(package private) Dimension
getPreferredSize
(Component component) Returns the preferred size for the given component.(package private) void
Invalidates the cache.(package private) void
removeEntry
(Component component)
-
Field Details
-
minimumSizes
Maps components to their minimum sizes. -
preferredSizes
Maps components to their preferred sizes.
-
-
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
-