Class VisualStyleSet
java.lang.Object
edu.internet2.middleware.grouper.app.visualization.VisualStyleSet
a VisualStyleSet represents style properties for a specific module. The
styles are stored as a map keyed by a name string, such as "color" or "font".
The style set has an optional parent style set that it may inherit properties from.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
VisualStyleSet
(String name, String prefix, GrouperConfig config, VisualStyleSet parentStyleSet) This constructs a new style set based on a previously loaded grouper.properties config. -
Method Summary
Modifier and TypeMethodDescriptiongets the default object type stylegetStyle
(StyleObjectType objectType) retrieves a style based on its ObjectType enumretrieves a style based on its nameretrieves the set of all style namesgetStyleProperty
(StyleObjectType objectType, String propertyName) gets the value for a specific style and propertygetStyleProperty
(StyleObjectType objectType, String propertyName, String defaultValue) gets the value for a specific style and property, or a fallback default valuegetStyleProperty
(String typeName, String propertyName) gets the value for a specific style and propertygetStyleProperty
(String typeName, String propertyName, String defaultValue) gets the value for a specific style and property, or a fallback default value
-
Constructor Details
-
VisualStyleSet
protected VisualStyleSet(String name, String prefix, GrouperConfig config, VisualStyleSet parentStyleSet) This constructs a new style set based on a previously loaded grouper.properties config. The style set will have a unique module name. Styles will be read from the config based on the prefix, followed by the string name of theStyleObjectType
enum. Styles not in theStyleObjectType
will be ignored.- Parameters:
name
- the module nameprefix
- the config property prefix, for example visualization.style.default or visualization.module.graphvizconfig
- an instantiated grouper config to read properties fromparentStyleSet
- an optional style set to inerit from, or null if not relevant or is already the top level style set
-
-
Method Details
-
getStyle
retrieves a style based on its name- Parameters:
name
- lookup key for the style- Returns:
- style matching this name // todo or null?
-
getStyle
retrieves a style based on its ObjectType enum- Parameters:
objectType
- object type enum- Returns:
- style for this object type // todo or null?
-
getStyleProperty
gets the value for a specific style and property- Parameters:
typeName
- lookup key for the stylepropertyName
- lookup key for the property within the style- Returns:
- style property value, or null if either the style or property is not found
-
getStyleProperty
gets the value for a specific style and property, or a fallback default value- Parameters:
typeName
- lookup key for the stylepropertyName
- lookup key for the property within the style- Returns:
- style property value, or default value if either the style or property is not found
-
getStyleProperty
gets the value for a specific style and property- Parameters:
objectType
- object type enum for the stylepropertyName
- lookup key for the property within the style- Returns:
- style property value, or null if either the style or property is not found
-
getStyleProperty
public String getStyleProperty(StyleObjectType objectType, String propertyName, String defaultValue) gets the value for a specific style and property, or a fallback default value- Parameters:
objectType
- object type enum for the stylepropertyName
- lookup key for the property within the style- Returns:
- style property value, or default value if either the style or property is not found
-
getDefaultStyle
gets the default object type style- Returns:
- style for the default object type
-
getStyleNames
retrieves the set of all style names- Returns:
- set of key names for all defined styles in the StyleSet
-