public class CachedStylesheet extends Object implements Stylesheet
When a style is requested for a given widget, its style is retrieved from the wrapped stylesheet. If an equal style is available in the cache, it is returned. Otherwise, the style is added to the cache.
Constructor and Description |
---|
CachedStylesheet(Stylesheet stylesheet)
Creates a cached stylesheet with the given stylesheet to wrap and the default cache size.
|
CachedStylesheet(Stylesheet stylesheet,
int size)
Creates a cached stylesheet with the given stylesheet to wrap and the given cache size.
|
public CachedStylesheet(Stylesheet stylesheet)
stylesheet
- the sytlesheet to wrap.public CachedStylesheet(Stylesheet stylesheet, int size)
stylesheet
- the sytlesheet to wrap.size
- the size of the cache.public Style getStyle(Widget widget)
Stylesheet
getStyle
in interface Stylesheet
widget
- the widget to get the style for.