/* * Created on May 14, 2003 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package CDBuilder.couplingSyntaxEditor; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.widgets.Display; /** * This class sets up all the colouring schemes * for syntax colouring * * @author Sherwin Sim and Lucie Zhao * @version 1 May - August 2003 * */ public class ColorManager { /** the colour table */ protected Map fColorTable = new HashMap(10); public void dispose() { Iterator e = fColorTable.values().iterator(); while (e.hasNext()) ((Color) e.next()).dispose(); } public Color getColor(RGB rgb) { Color color = (Color) fColorTable.get(rgb); if (color == null) { color = new Color(Display.getCurrent(), rgb); fColorTable.put(rgb, color); } return color; } }