Package com.metsci.glimpse.core.layout
Class GlimpseLayoutCache<D>
- java.lang.Object
-
- com.metsci.glimpse.core.layout.GlimpseLayoutCache<D>
-
public class GlimpseLayoutCache<D> extends Object
Stores the bounds of a GlimpseLayout keyed off of the sequence of nested parent GlimpseLayouts leading back to the GlimpseCanvas. If a given GlimpseLayout is rendered to the same sequence of parent GlimpseLayouts and none of the parent GlimpseLayouts have changed shape, then the layout algorithm does not need to be run, the cached LayoutBounds can be used.- Author:
- ulman
-
-
Constructor Summary
Constructors Constructor Description GlimpseLayoutCache()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Removes all mappings from the cache, the component associated with this cache will have to be laid out again for each of its RenderTargets.static booleancompareBounds(List<GlimpseBounds> list1, List<GlimpseBounds> list2)Collection<D>getMatching(TargetStackMatcher matcher)DgetValue(GlimpseContext context)DgetValue(GlimpseTargetStack layoutStack)DgetValueNoBoundsCheck(GlimpseContext context)DgetValueNoBoundsCheck(GlimpseTargetStack layoutStack)List<D>getValues()voidsetValue(GlimpseContext context, D value)voidsetValue(GlimpseTargetStack stack, D value)intsize()
-
-
-
Method Detail
-
size
public int size()
-
getValue
public D getValue(GlimpseContext context)
-
getValue
public D getValue(GlimpseTargetStack layoutStack)
-
getValueNoBoundsCheck
public D getValueNoBoundsCheck(GlimpseContext context)
-
getValueNoBoundsCheck
public D getValueNoBoundsCheck(GlimpseTargetStack layoutStack)
-
setValue
public void setValue(GlimpseTargetStack stack, D value)
-
setValue
public void setValue(GlimpseContext context, D value)
-
clear
public void clear()
Removes all mappings from the cache, the component associated with this cache will have to be laid out again for each of its RenderTargets.
-
compareBounds
public static boolean compareBounds(List<GlimpseBounds> list1, List<GlimpseBounds> list2)
-
getMatching
public Collection<D> getMatching(TargetStackMatcher matcher)
- Returns:
- all keys in the cache which match the provided predicate
-
-