f6f5d8dc57ef51b636470bd6c2b79d4bd1120561
[Mograsim.git] / net.mograsim.preferences / src / net / mograsim / preferences / ColorManager.java
1 package net.mograsim.preferences;
2
3 import org.eclipse.swt.graphics.Color;
4
5 public abstract class ColorManager
6 {
7         private static ColorManager currentManager;
8
9         public static void setColorManager(ColorManager manager)
10         {
11                 if (manager == null)
12                         throw new NullPointerException();
13                 currentManager = manager;
14         }
15
16         public static ColorManager current()
17         {
18                 if (currentManager == null)
19                         currentManager = new SimpleColorManager();
20                 return currentManager;
21         }
22
23         public abstract Color toColor(ColorDefinition col);
24
25         public void clearCache()
26         {
27                 // this method is intended to be overridden
28         }
29 }