Class OPIColor

java.lang.Object
org.csstudio.opibuilder.util.OPIColor
All Implemented Interfaces:
IAdaptable

public class OPIColor extends Object implements IAdaptable
The dedicated color type which supports predefined color name in OPI builder color file. If the color name doesn't exist in the color file, the color value is null.
  • Constructor Details

    • OPIColor

      public OPIColor(String colorName)
    • OPIColor

      public OPIColor(RGB rgb)
    • OPIColor

      public OPIColor(int red, int green, int blue)
    • OPIColor

      public OPIColor(String name, RGB rgb, boolean predefined)
  • Method Details

    • getColorName

      public String getColorName()
      Returns:
      the name of color if it is a predefined color macro; otherwise, it is a string of the RGB values.
    • getRGBValue

      public RGB getRGBValue()
      Returns:
      the rgb value of the color. null if the predefined color does not exist.
    • getSWTColor

      public Color getSWTColor()
      Returns:
      the swt color. No dispose is needed, the system will handle the dispose.
    • isPreDefined

      public boolean isPreDefined()
      Returns:
      true if this color is predefined in color file, false otherwise.
    • setColorName

      public void setColorName(String colorName)
    • setColorValue

      public void setColorValue(RGB rgb)
    • getAdapter

      public <T> T getAdapter(Class<T> adapter)
      Specified by:
      getAdapter in interface IAdaptable
    • getImage

      public Image getImage()
      Get the color image for this color.
      Returns:
      the color image
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getCopy

      public OPIColor getCopy()