gishur.gui2.adapter
Class ColorNameAdapter
java.lang.Object
|
+--gishur.gui2.SourcePropertyAdapter
|
+--gishur.gui2.adapter.ObjectAdapter
|
+--gishur.gui2.adapter.ColorNameAdapter
- public class ColorNameAdapter
- extends ObjectAdapter
A SourcePropertyAdapter
, that maps a palette of colors to
specified names. The colors are read via another
SourcePropertyAdapter
.
- Version:
- 1.0
- Author:
- Thomas Wolf
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ColorNameAdapter
public ColorNameAdapter(SourcePropertyAdapter source,
ColorNameAdapter base)
- Constructs a new
ColorNameAdapter
, which gets its colors
from the given SourcePropertyAdapter
.
- Parameters:
source
- SourcePropertyAdapter
to get colorsbase
- the ColorNameAdapter
, which color table to share
ColorNameAdapter
public ColorNameAdapter(SourcePropertyAdapter source)
- Constructs a new
ColorNameAdapter
, which gets its colors
from the given SourcePropertyAdapter
.
- Parameters:
source
- SourcePropertyAdapter
to get colors
add
public void add(java.awt.Color color,
java.lang.String name)
- Maps the given
Color
to its name.
- Parameters:
color
- the Color
name
- the name of the Color
addDefaultColorPalette
public void addDefaultColorPalette()
- Adds the default color palette.
getProperty
public java.lang.Object getProperty(java.lang.String key,
java.lang.Object source,
PropertyStatusReader prop)
- Returns a property value with a given key using the source-object
(and perhaps the given
PropertyStatusReader
).
- Overrides:
getProperty
in class ObjectAdapter
- Parameters:
key
- the property namesource
- the source object to useprop
- the PropertyStatusReader
- Returns:
- property value