Class StyleManager
java.lang.Object
org.eclipse.tracecompass.tmf.ui.model.StyleManager
A manager for a map of output element styles. Styles have a key that is
unique to this manager instance. Style inheritance is possible by having a
style refer to a parent style key.
- Since:
- 5.2
- Author:
- Patrick Tasse
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StyleManagerempty()Get a manager that has an empty style map.@Nullable RGBAColorgetColorStyle(OutputElementStyle elementStyle, String property) Get the style property color value for the specified element style.@Nullable FloatgetFactorStyle(OutputElementStyle elementStyle, String property) Get the style property factor value for the specified element style.@Nullable ObjectgetStyle(OutputElementStyle elementStyle, String property) Get the style property value for the specified element style.
-
Constructor Details
-
StyleManager
Constructor- Parameters:
styleMap- a style map
-
-
Method Details
-
empty
Get a manager that has an empty style map. It can be used to resolve element styles that have no parent key.- Returns:
- an empty style manager
-
getStyle
Get the style property value for the specified element style. The style hierarchy is traversed until a value is found.- Parameters:
elementStyle- the styleproperty- the style property- Returns:
- the style value, or null
-
getFactorStyle
Get the style property factor value for the specified element style. The style hierarchy is traversed until a number value is found, and the returned float value will be multiplied by the firstStyleProperties.FACTORsuffixed modifier style that was found along the way, if any.- Parameters:
elementStyle- the styleproperty- the style property- Returns:
- the style float value, or null
-
getColorStyle
Get the style property color value for the specified element style. The style hierarchy is traversed until a color and opacity value is found, and the returned color value will be blended with the firstStyleProperties.BLENDsuffixed modifier style that was found along the way, if any.- Parameters:
elementStyle- the styleproperty- the style property- Returns:
- the style value, or null
-