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 stylesheet to wrap.public CachedStylesheet(Stylesheet stylesheet, int size)
stylesheet - the stylesheet to wrap.size - the size of the cache.public Style getStyle(Widget widget)
StylesheetgetStyle in interface Stylesheetwidget - the widget to get the style for.