java.lang.Object
edu.internet2.middleware.grouper.app.visualization.VisualStyleSet

public class VisualStyleSet extends Object
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 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 the StyleObjectType enum. Styles not in the StyleObjectType will be ignored.
      Parameters:
      name - the module name
      prefix - the config property prefix, for example visualization.style.default or visualization.module.graphviz
      config - an instantiated grouper config to read properties from
      parentStyleSet - an optional style set to inerit from, or null if not relevant or is already the top level style set
  • Method Details

    • getStyle

      public VisualStyle getStyle(String name)
      retrieves a style based on its name
      Parameters:
      name - lookup key for the style
      Returns:
      style matching this name // todo or null?
    • getStyle

      public VisualStyle getStyle(StyleObjectType objectType)
      retrieves a style based on its ObjectType enum
      Parameters:
      objectType - object type enum
      Returns:
      style for this object type // todo or null?
    • getStyleProperty

      public String getStyleProperty(String typeName, String propertyName)
      gets the value for a specific style and property
      Parameters:
      typeName - lookup key for the style
      propertyName - 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(String typeName, String propertyName, String defaultValue)
      gets the value for a specific style and property, or a fallback default value
      Parameters:
      typeName - lookup key for the style
      propertyName - 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

      public String getStyleProperty(StyleObjectType objectType, String propertyName)
      gets the value for a specific style and property
      Parameters:
      objectType - object type enum for the style
      propertyName - 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 style
      propertyName - 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

      public VisualStyle getDefaultStyle()
      gets the default object type style
      Returns:
      style for the default object type
    • getStyleNames

      public Set<String> getStyleNames()
      retrieves the set of all style names
      Returns:
      set of key names for all defined styles in the StyleSet