|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ascape.util.vis.ColorFeatureConcrete
public abstract class ColorFeatureConcrete
A Color feature returns a color based on the state of an object of known type provided to it. This class provides a concrete version of color feature for convenience in implementing subclasses. Used to provide an appropriate color for some feature or aspect of an object.
Field Summary | |
---|---|
protected static java.util.Map<org.eclipse.swt.graphics.RGB,org.eclipse.swt.graphics.Color> |
colorCache
|
protected java.lang.String |
name
The name of the feature. |
Fields inherited from interface org.ascape.util.vis.ColorFeature |
---|
BLACK, BLUE, CYAN, DARK_BLUE, DARK_GRAY, DARK_GREEN, DARK_MAGENTA, DARK_RED, DARK_YELLOW, DEFAULT_BG, GRAY, GREEN, HIGHLIGHT_AGENT_COLOR, LIGHT_GRAY, MAGENTA, ORANGE, RED, WHITE, YELLOW |
Constructor Summary | |
---|---|
ColorFeatureConcrete()
Constructs a concrete instantiation of a color feature. |
|
ColorFeatureConcrete(java.lang.String name)
Constructs a concrete instantiation of a color feature with the supplied name. |
Method Summary | |
---|---|
static org.eclipse.swt.graphics.Color |
adjustBrightness(org.eclipse.swt.graphics.Color color,
float factor)
|
static org.eclipse.swt.graphics.Color |
create(float r,
float g,
float b)
|
static org.eclipse.swt.graphics.Color |
create(int r,
int g,
int b)
|
static org.eclipse.swt.graphics.Color |
create(int r,
int g,
int b,
int a)
|
static org.eclipse.swt.graphics.Color |
create(org.eclipse.swt.graphics.RGB rgb)
|
static org.eclipse.swt.graphics.Color |
createHSB(float hue,
float sat,
float brightness)
|
static org.eclipse.swt.graphics.Color |
createRandom()
|
abstract org.eclipse.swt.graphics.Color |
getColor(java.lang.Object object)
Returns a color for the object as defined in implementions of this class. |
java.lang.String |
getName()
Returns a name for the object as defined by set name. |
void |
setName(java.lang.String name)
Sets the name of this feature. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String name
protected static java.util.Map<org.eclipse.swt.graphics.RGB,org.eclipse.swt.graphics.Color> colorCache
Constructor Detail |
---|
public ColorFeatureConcrete()
public ColorFeatureConcrete(java.lang.String name)
name
- the user relevant name of the featureMethod Detail |
---|
public static final org.eclipse.swt.graphics.Color create(org.eclipse.swt.graphics.RGB rgb)
public static final org.eclipse.swt.graphics.Color create(int r, int g, int b)
public static final org.eclipse.swt.graphics.Color create(float r, float g, float b)
public static final org.eclipse.swt.graphics.Color create(int r, int g, int b, int a)
public static org.eclipse.swt.graphics.Color adjustBrightness(org.eclipse.swt.graphics.Color color, float factor)
public static final org.eclipse.swt.graphics.Color createHSB(float hue, float sat, float brightness)
public static final org.eclipse.swt.graphics.Color createRandom()
public java.lang.String getName()
getName
in interface HasName
public final void setName(java.lang.String name)
name
- a user relevant name for this featurepublic abstract org.eclipse.swt.graphics.Color getColor(java.lang.Object object)
getColor
in interface ColorFeature
object
- the object to get a color from.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |