Package org.jungrapht.visualization.util
Class IconCache<V>
- java.lang.Object
-
- org.jungrapht.visualization.util.IconCache<V>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IconCache.Builder<V>
Builder for IconCachestatic interface
IconCache.Decorator<V>
extend this interface to apply 'decorations' to the vertex labels after they are drawn.static interface
IconCache.Stylist<V>
allows for functional interface method to set the font, colors, etc for the vertex JLabel.
-
Field Summary
Fields Modifier and Type Field Description protected Function<V,Paint>
colorFunction
protected JLabel
label
protected IconCache.Decorator<V>
postDecorator
protected IconCache.Decorator<V>
preDecorator
protected Map<RenderingHints.Key,Object>
renderingHints
protected IconCache.Stylist<V>
stylist
protected Function<V,String>
vertexLabelFunction
protected Function<V,Shape>
vertexShapeFunction
-
Constructor Summary
Constructors Modifier Constructor Description protected
IconCache(IconCache.Builder<V> builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Icon
apply(V n)
static <V> IconCache.Builder<V>
builder(Function<V,String> vertexLabelFunction)
protected void
cacheIconFor(JLabel label, V vertex, Function<V,String> vertexLabelFunction, Function<V,Paint> colorFunction)
-
-
-
Field Detail
-
label
protected JLabel label
-
renderingHints
protected Map<RenderingHints.Key,Object> renderingHints
-
stylist
protected IconCache.Stylist<V> stylist
-
preDecorator
protected IconCache.Decorator<V> preDecorator
-
postDecorator
protected IconCache.Decorator<V> postDecorator
-
-
Constructor Detail
-
IconCache
protected IconCache(IconCache.Builder<V> builder)
- Parameters:
builder
- the configured Builder
-
-
Method Detail
-
builder
public static <V> IconCache.Builder<V> builder(Function<V,String> vertexLabelFunction)
- Type Parameters:
V
- vertex type- Parameters:
vertexLabelFunction
- function to return String labels for vertices- Returns:
- the Builder
-
-