Class StyleManager

java.lang.Object
org.eclipse.tracecompass.tmf.ui.model.StyleManager

public class StyleManager extends Object
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 Details

  • Method Details

    • empty

      public static StyleManager 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

      public @Nullable Object getStyle(OutputElementStyle elementStyle, String property)
      Get the style property value for the specified element style. The style hierarchy is traversed until a value is found.
      Parameters:
      elementStyle - the style
      property - the style property
      Returns:
      the style value, or null
    • getFactorStyle

      public @Nullable Float getFactorStyle(OutputElementStyle elementStyle, String property)
      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 first StyleProperties.FACTOR suffixed modifier style that was found along the way, if any.
      Parameters:
      elementStyle - the style
      property - the style property
      Returns:
      the style float value, or null
    • getColorStyle

      public @Nullable RGBAColor getColorStyle(OutputElementStyle elementStyle, String property)
      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 first StyleProperties.BLEND suffixed modifier style that was found along the way, if any.
      Parameters:
      elementStyle - the style
      property - the style property
      Returns:
      the style value, or null