Last change
on this file since 193 was
193,
checked in by Maciej Komosinski, 10 years ago
|
Set svn:eol-style native for all textual files
|
-
Property svn:eol-style set to
native
-
Property svn:mime-type set to
text/plain
|
File size:
698 bytes
|
Line | |
---|
1 | package com.framsticks.framclipse.syntaxColoring; |
---|
2 | |
---|
3 | import java.util.HashMap; |
---|
4 | import java.util.Iterator; |
---|
5 | import java.util.Map; |
---|
6 | |
---|
7 | import org.eclipse.swt.graphics.Color; |
---|
8 | import org.eclipse.swt.graphics.RGB; |
---|
9 | import org.eclipse.swt.widgets.Display; |
---|
10 | |
---|
11 | @SuppressWarnings("unchecked") |
---|
12 | public class ColorManager { |
---|
13 | |
---|
14 | protected Map fColorTable = new HashMap(10); |
---|
15 | |
---|
16 | public void dispose() { |
---|
17 | Iterator e = fColorTable.values().iterator(); |
---|
18 | while (e.hasNext()) { |
---|
19 | ((Color) e.next()).dispose(); |
---|
20 | } |
---|
21 | } |
---|
22 | |
---|
23 | public Color getColor(RGB rgb) { |
---|
24 | Color color = (Color) fColorTable.get(rgb); |
---|
25 | if (color == null) { |
---|
26 | color = new Color(Display.getCurrent(), rgb); |
---|
27 | fColorTable.put(rgb, color); |
---|
28 | } |
---|
29 | return color; |
---|
30 | } |
---|
31 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.