Class ColorCache


  • public class ColorCache
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      ColorCache()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static void addColor​(java.lang.Long key, org.eclipse.swt.graphics.Color color)  
      static void dispose()  
      private static void ensureMapColorsInitialized​(org.eclipse.swt.graphics.Device device)  
      static org.eclipse.swt.graphics.Color getColor​(org.eclipse.swt.graphics.Device device, float[] hsb)  
      static org.eclipse.swt.graphics.Color getColor​(org.eclipse.swt.graphics.Device device, int[] rgb)  
      static org.eclipse.swt.graphics.Color getColor​(org.eclipse.swt.graphics.Device device, int red, int green, int blue)  
      static org.eclipse.swt.graphics.Color getColor​(org.eclipse.swt.graphics.Device device, java.lang.String value)  
      private static org.eclipse.swt.graphics.Color getColor​(org.eclipse.swt.graphics.Device device, java.lang.String c_value, boolean useScheme)  
      static org.eclipse.swt.graphics.Color getColor​(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.RGB rgb)  
      static org.eclipse.swt.graphics.Color getRandomColor()  
      static org.eclipse.swt.graphics.Color getSchemedColor​(org.eclipse.swt.graphics.Device device, int red, int green, int blue)  
      static org.eclipse.swt.graphics.Color getSchemedColor​(org.eclipse.swt.graphics.Device device, java.lang.String value)  
      static void reset()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEBUG

        private static final boolean DEBUG
      • mapColors

        private static final java.util.Map<java.lang.Long,​org.eclipse.swt.graphics.Color> mapColors
      • colorsToDispose

        private static final java.util.HashSet<org.eclipse.swt.graphics.Color> colorsToDispose
      • SYSTEMCOLOR_INDEXSTART

        private static final int SYSTEMCOLOR_INDEXSTART
        See Also:
        Constant Field Values
      • systemColorNames

        private static final java.lang.String[] systemColorNames
      • forceNoColor

        private static boolean forceNoColor
    • Constructor Detail

      • ColorCache

        public ColorCache()
    • Method Detail

      • reset

        public static void reset()
      • dispose

        public static void dispose()
      • getSchemedColor

        public static org.eclipse.swt.graphics.Color getSchemedColor​(org.eclipse.swt.graphics.Device device,
                                                                     int red,
                                                                     int green,
                                                                     int blue)
      • getColor

        public static org.eclipse.swt.graphics.Color getColor​(org.eclipse.swt.graphics.Device device,
                                                              int red,
                                                              int green,
                                                              int blue)
      • ensureMapColorsInitialized

        private static void ensureMapColorsInitialized​(org.eclipse.swt.graphics.Device device)
      • getColor

        public static org.eclipse.swt.graphics.Color getColor​(org.eclipse.swt.graphics.Device device,
                                                              java.lang.String value)
      • getSchemedColor

        public static org.eclipse.swt.graphics.Color getSchemedColor​(org.eclipse.swt.graphics.Device device,
                                                                     java.lang.String value)
      • getColor

        private static org.eclipse.swt.graphics.Color getColor​(org.eclipse.swt.graphics.Device device,
                                                               java.lang.String c_value,
                                                               boolean useScheme)
      • addColor

        private static void addColor​(java.lang.Long key,
                                     org.eclipse.swt.graphics.Color color)
      • getColor

        public static org.eclipse.swt.graphics.Color getColor​(org.eclipse.swt.graphics.Device device,
                                                              int[] rgb)
        Since:
        3.0.4.3
      • getRandomColor

        public static org.eclipse.swt.graphics.Color getRandomColor()
      • getColor

        public static org.eclipse.swt.graphics.Color getColor​(org.eclipse.swt.graphics.Device device,
                                                              float[] hsb)
        Since:
        3.1.1.1
      • getColor

        public static org.eclipse.swt.graphics.Color getColor​(org.eclipse.swt.graphics.Device device,
                                                              org.eclipse.swt.graphics.RGB rgb)
        Parameters:
        device -
        rgb -
        Returns:
        Since:
        3.1.1.1