1 package com.quantum.editors;
3 import java.util.HashMap;
4 import java.util.Iterator;
7 import org.eclipse.swt.graphics.Color;
8 import org.eclipse.swt.graphics.RGB;
9 import org.eclipse.swt.widgets.Display;
11 public class ColorManager {
13 protected Map fColorTable = new HashMap(10);
15 public void dispose() {
16 Iterator e= fColorTable.values().iterator();
18 ((Color) e.next()).dispose();
20 public Color getColor(RGB rgb) {
21 Color color= (Color) fColorTable.get(rgb);
23 color= new Color(Display.getCurrent(), rgb);
24 fColorTable.put(rgb, color);