Class MediaService

java.lang.Object
org.csstudio.opibuilder.util.MediaService

public final class MediaService extends Object
A service help to maintain the color macros.
  • Field Details

  • Method Details

    • getInstance

      public static MediaService getInstance()
    • reloadColors

      public void reloadColors()
      Reload predefined colors from color file in a background job.
    • reloadFonts

      public void reloadFonts()
    • getColor

      public RGB getColor(String name)
      Get the color from the predefined color map, which is defined in the color file.
      Parameters:
      name - the predefined name of the color.
      Returns:
      the RGB color, or the default RGB value if the name doesn't exist in the color file.
    • getOPIColor

      public OPIColor getOPIColor(String name)
    • getOPIColor

      public OPIColor getOPIColor(String name, RGB rgb)
      Get OPIColor based on name. If no such name exist, use the rgb value as its color.
    • getAllPredefinedColors

      public OPIColor[] getAllPredefinedColors()
    • isColorNameDefined

      public boolean isColorNameDefined(String name)
    • getOPIFont

      public OPIFont getOPIFont(String name, FontData fontData)
      Get a copy the OPIFont from the configured defaults based on name. Use the provided fontData if the name is not in the cache.
      Parameters:
      name - of predefined font
      fontData - to use if name is not in cache
    • getOPIFont

      public OPIFont getOPIFont(String name)
      Get a copy of the OPIFont from the configured defaults based on name. Use DEFAULT_UNKNOWN_FONT if the name is not in the cache.
      Parameters:
      name - of predefined font
    • getAllPredefinedFonts

      public OPIFont[] getAllPredefinedFonts()