|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.m2m.atl.adt.ui.text.AtlColorManager
public class AtlColorManager
This manager allows to share colors. A color is represented as a couple of a string and an RGB value.
| Field Summary | |
|---|---|
protected java.util.Map |
displayTable
displayTable stores a map for each display found. |
protected java.util.HashMap |
keyTable
keyTable is a hash map regrouping the string key of the color and the effective RGB
color associatede with. |
| Constructor Summary | |
|---|---|
AtlColorManager()
Creates a new color manager setting to auto dipose it when the display is disposed. |
|
AtlColorManager(boolean adodd)
Creates a new color manager setting the auto dispose on display dispose mode with the given parameter. |
|
| Method Summary | |
|---|---|
java.lang.Object |
add(java.lang.String key,
org.eclipse.swt.graphics.RGB rgb)
Adds in the table a new color. |
void |
bindColor(java.lang.String key,
org.eclipse.swt.graphics.RGB rgb)
Remembers the given color specification under the given key. |
void |
dispose()
|
protected void |
dispose(org.eclipse.swt.widgets.Display display)
Disposes the color manager with the values from the display. |
org.eclipse.swt.graphics.Color |
getColor(org.eclipse.swt.graphics.RGB rgb)
|
org.eclipse.swt.graphics.Color |
getColor(java.lang.String color)
Gets the color ressource matching the color string. |
java.lang.Object |
remove(java.lang.String key)
Removes from the table the color given by the string key. |
void |
unbindColor(java.lang.String key)
Forgets the color specification remembered under the given key. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Map displayTable
displayTable stores a map for each display found.
protected java.util.HashMap keyTable
keyTable is a hash map regrouping the string key of the color and the effective RGB
color associatede with.
| Constructor Detail |
|---|
public AtlColorManager()
public AtlColorManager(boolean adodd)
adodd - the auto dispose on display dispose mode| Method Detail |
|---|
public java.lang.Object add(java.lang.String key,
org.eclipse.swt.graphics.RGB rgb)
key - the string key representing the colorrgb - the RGB color associated to the color
public void bindColor(java.lang.String key,
org.eclipse.swt.graphics.RGB rgb)
key - the color keyrgb - the color specification
java.lang.UnsupportedOperationException - if there is already a color specification remembered under the given keypublic void dispose()
dispose in interface org.eclipse.jface.text.source.ISharedTextColorsprotected void dispose(org.eclipse.swt.widgets.Display display)
display - the display to usepublic org.eclipse.swt.graphics.Color getColor(org.eclipse.swt.graphics.RGB rgb)
getColor in interface org.eclipse.jface.text.source.ISharedTextColorspublic org.eclipse.swt.graphics.Color getColor(java.lang.String color)
color - the key string of the color
public java.lang.Object remove(java.lang.String key)
key - the string key of the color
public void unbindColor(java.lang.String key)
key - the color key
|
Copyright 2007 IBM Corporation and others. All Rights Reserved. |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||