public class PropertiesBasedStyleLibrary extends java.lang.Object implements StyleLibrary
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,java.lang.Object> |
cache
Cache
|
static java.lang.String |
DEFAULT_PROPERTIES_EXTENSION
File extension
|
private static java.lang.String |
DEFAULT_PROPERTIES_PATH
Default properties path
|
static java.lang.String |
DEFAULT_SCHEME_FILENAME
File name of the default color scheme.
|
static java.lang.String |
DEFAULT_SCHEME_NAME
Name of the default color scheme.
|
private LineStyleLibrary |
linelib
Line style library to use
|
static java.lang.String |
LIST_SEPARATOR
Separator for lists.
|
private static Logging |
LOG
Logger
|
private MarkerLibrary |
markerlib
Marker library to use
|
private java.lang.String |
name
Style scheme name
|
static java.lang.String |
PROP_LINES_LIBRARY
Property string for the line style library
|
static java.lang.String |
PROP_MARKER_LIBRARY
Property string for the marker style library
|
private java.util.Properties |
properties
Properties file to use.
|
AXIS, AXIS_LABEL, AXIS_TICK, AXIS_TICK_MINOR, BACKGROUND_COLOR, BUBBLEPLOT, CLUSTERORDER, COLOR, COLORSET, DEFAULT, DOTPLOT, FONT_FAMILY, GENERIC_SIZE, KEY, LINE_WIDTH, MARGIN, MARKERPLOT, OPACITY, PAGE, PLOT, PLOTGREY, POLYGONS, REFERENCE_POINTS, SCALE, SELECTION, SELECTION_ACTIVE, TEXT_COLOR, TEXT_SIZE, XYCURVE
Constructor and Description |
---|
PropertiesBasedStyleLibrary()
Constructor without a properties file name.
|
PropertiesBasedStyleLibrary(java.lang.String filename,
java.lang.String name)
Constructor with a given file name.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getBackgroundColor(java.lang.String key)
Retrieve background color for an item
|
private <T> T |
getCached(java.lang.String prefix,
java.lang.String postfix,
java.lang.Class<T> cls)
Get a value from the cache (to avoid repeated parsing)
|
java.lang.String |
getColor(java.lang.String key)
Retrieve a color for an item
|
ColorLibrary |
getColorSet(java.lang.String key)
Retrieve colorset for an item
|
java.lang.String |
getFontFamily(java.lang.String key)
Get font family
|
double |
getLineWidth(java.lang.String key)
Get line width
|
protected java.lang.String |
getName()
Get the style scheme name.
|
double |
getOpacity(java.lang.String key)
Get opacity
|
protected java.lang.String |
getPropertyValue(java.lang.String prefix,
java.lang.String postfix)
Retrieve the property value for a particular path + type pair.
|
double |
getSize(java.lang.String key)
Get generic size
|
java.lang.String |
getTextColor(java.lang.String key)
Retrieve text color for an item
|
double |
getTextSize(java.lang.String key)
Get text size
|
LineStyleLibrary |
lines()
Get the line style library to use.
|
MarkerLibrary |
markers()
Get the marker library to use.
|
private <T> void |
setCached(java.lang.String prefix,
java.lang.String postfix,
T data)
Set a cache value
|
private static final Logging LOG
public static final java.lang.String DEFAULT_SCHEME_NAME
public static final java.lang.String DEFAULT_SCHEME_FILENAME
public static final java.lang.String DEFAULT_PROPERTIES_EXTENSION
private static final java.lang.String DEFAULT_PROPERTIES_PATH
public static final java.lang.String LIST_SEPARATOR
public static final java.lang.String PROP_LINES_LIBRARY
public static final java.lang.String PROP_MARKER_LIBRARY
private java.util.Properties properties
private java.lang.String name
private java.util.Map<java.lang.String,java.lang.Object> cache
private LineStyleLibrary linelib
private MarkerLibrary markerlib
public PropertiesBasedStyleLibrary()
public PropertiesBasedStyleLibrary(java.lang.String filename, java.lang.String name)
filename
- Name of properties file.name
- NAme for this styleprotected java.lang.String getName()
private <T> T getCached(java.lang.String prefix, java.lang.String postfix, java.lang.Class<T> cls)
T
- Typeprefix
- Tree namepostfix
- Property namecls
- Class restrictionprivate <T> void setCached(java.lang.String prefix, java.lang.String postfix, T data)
T
- Typeprefix
- Tree namepostfix
- Property namedata
- Dataprotected java.lang.String getPropertyValue(java.lang.String prefix, java.lang.String postfix)
prefix
- Pathpostfix
- Typepublic java.lang.String getColor(java.lang.String key)
StyleLibrary
getColor
in interface StyleLibrary
key
- Reference namepublic java.lang.String getBackgroundColor(java.lang.String key)
StyleLibrary
getBackgroundColor
in interface StyleLibrary
key
- Reference namepublic java.lang.String getTextColor(java.lang.String key)
StyleLibrary
getTextColor
in interface StyleLibrary
key
- Reference namepublic ColorLibrary getColorSet(java.lang.String key)
StyleLibrary
getColorSet
in interface StyleLibrary
key
- Reference namepublic double getLineWidth(java.lang.String key)
StyleLibrary
getLineWidth
in interface StyleLibrary
key
- Keypublic double getTextSize(java.lang.String key)
StyleLibrary
getTextSize
in interface StyleLibrary
key
- Keypublic java.lang.String getFontFamily(java.lang.String key)
StyleLibrary
getFontFamily
in interface StyleLibrary
key
- Keypublic double getSize(java.lang.String key)
StyleLibrary
getSize
in interface StyleLibrary
key
- Keypublic double getOpacity(java.lang.String key)
StyleLibrary
getOpacity
in interface StyleLibrary
key
- Keypublic LineStyleLibrary lines()
StyleLibrary
lines
in interface StyleLibrary
public MarkerLibrary markers()
StyleLibrary
markers
in interface StyleLibrary
Copyright © 2019 ELKI Development Team. License information.