public class PropertiesBasedStyleLibrary extends Object implements StyleLibrary
Modifier and Type | Field and Description |
---|---|
private AnyMap<String> |
cache
Cache
|
static String |
DEFAULT_PROPERTIES_EXTENSION
File extension
|
private static String |
DEFAULT_PROPERTIES_PATH
Default properties path
|
static String |
DEFAULT_SCHEME_FILENAME
File name of the default color scheme.
|
static String |
DEFAULT_SCHEME_NAME
Name of the default color scheme.
|
private LineStyleLibrary |
linelib
Line style library to use
|
static String |
LIST_SEPARATOR
Separator for lists.
|
private static Logging |
LOG
Logger
|
private MarkerLibrary |
markerlib
Marker library to use
|
private String |
name
Style scheme name
|
static String |
PROP_LINES_LIBRARY
Property string for the line style library
|
static String |
PROP_MARKER_LIBRARY
Property string for the marker style library
|
private 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(String filename,
String name)
Constructor with a given file name.
|
Modifier and Type | Method and Description |
---|---|
String |
getBackgroundColor(String key)
Retrieve background color for an item
|
private <T> T |
getCached(String prefix,
String postfix,
Class<T> cls)
Get a value from the cache (to avoid repeated parsing)
|
String |
getColor(String key)
Retrieve a color for an item
|
ColorLibrary |
getColorSet(String key)
Retrieve colorset for an item
|
String |
getFontFamily(String key)
Get font family
|
double |
getLineWidth(String key)
Get line width
|
protected String |
getName()
Get the style scheme name.
|
double |
getOpacity(String key)
Get opacity
|
protected String |
getPropertyValue(String prefix,
String postfix)
Retrieve the property value for a particular path + type pair.
|
double |
getSize(String key)
Get generic size
|
String |
getTextColor(String key)
Retrieve text color for an item
|
double |
getTextSize(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(String prefix,
String postfix,
T data)
Set a cache value
|
private static final Logging LOG
public static final String DEFAULT_SCHEME_NAME
public static final String DEFAULT_SCHEME_FILENAME
public static final String DEFAULT_PROPERTIES_EXTENSION
private static final String DEFAULT_PROPERTIES_PATH
public static final String LIST_SEPARATOR
public static final String PROP_LINES_LIBRARY
public static final String PROP_MARKER_LIBRARY
private Properties properties
private String name
private LineStyleLibrary linelib
private MarkerLibrary markerlib
public PropertiesBasedStyleLibrary()
protected String getName()
private <T> T getCached(String prefix, String postfix, Class<T> cls)
T
- Typeprefix
- Tree namepostfix
- Property namecls
- Class restrictionprivate <T> void setCached(String prefix, String postfix, T data)
T
- Typeprefix
- Tree namepostfix
- Property namedata
- Dataprotected String getPropertyValue(String prefix, String postfix)
prefix
- Pathpostfix
- Typepublic String getColor(String key)
StyleLibrary
getColor
in interface StyleLibrary
key
- Reference namepublic String getBackgroundColor(String key)
StyleLibrary
getBackgroundColor
in interface StyleLibrary
key
- Reference namepublic String getTextColor(String key)
StyleLibrary
getTextColor
in interface StyleLibrary
key
- Reference namepublic ColorLibrary getColorSet(String key)
StyleLibrary
getColorSet
in interface StyleLibrary
key
- Reference namepublic double getLineWidth(String key)
StyleLibrary
getLineWidth
in interface StyleLibrary
key
- Keypublic double getTextSize(String key)
StyleLibrary
getTextSize
in interface StyleLibrary
key
- Keypublic String getFontFamily(String key)
StyleLibrary
getFontFamily
in interface StyleLibrary
key
- Keypublic double getSize(String key)
StyleLibrary
getSize
in interface StyleLibrary
key
- Keypublic double getOpacity(String key)
StyleLibrary
getOpacity
in interface StyleLibrary
key
- Keypublic LineStyleLibrary lines()
StyleLibrary
lines
in interface StyleLibrary
public MarkerLibrary markers()
StyleLibrary
markers
in interface StyleLibrary