APIdia Launch Partner
Top Description Inners Fields Constructors Methods
javax.swing.plaf.nimbus

pack-priv Class DerivedColor

extends Color
Class Inheritance
Known Direct Subclasses
javax.swing.plaf.nimbus.DerivedColor.UIResource
Annotations
@SuppressWarnings:serial
Imports
javax.swing.UIManager, java.awt.Color, java.beans.PropertyChangeSupport, .PropertyChangeListener

DerivedColor - A color implementation that is derived from a UIManager defaults table color and a set of offsets. It can be rederived at any point by calling rederiveColor(). For example when its parent color changes and it value will update to reflect the new derived color. Property change events are fired for the "rgb" property when the derived color changes.
Author
Jasper Potts

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final int
private int
private final float
private final float
private final float
private final String
Inherited from java.awt.Color:
blackBLACKblueBLUEcyanCYANDARK_GRAYdarkGraygrayGRAYgreenGREENLIGHT_GRAYlightGraymagentaMAGENTAorangeORANGEpinkPINKredREDwhiteWHITEyellowYELLOW

Constructor Summary

AccessConstructor and Description
pack-priv
DerivedColor(String uiDefaultParentName, float hOffset, float sOffset, float bOffset, int aOffset)

Method Summary

Modifier and TypeMethod and Description
private float
clamp(float value)

private int
clamp(int value)

public boolean
equals(Object o)

Overrides java.awt.Color.equals.

Determines whether another object is equal to this Color.

public int
public float
public float
public int

Returns:

the RGB value of the color in the default sRGB ColorModel.
getRGB
()

Overrides java.awt.Color.getRGB.

Returns the RGB value representing the color in the default sRGB java.awt.image.ColorModel.

public float
public String
public int
hashCode()

Overrides java.awt.Color.hashCode.

Computes the hash code for this Color.

public void
rederiveColor()

Recalculate the derived color from the UIManager parent color and offsets

public String

Returns:

a String representation of this Color.
toString
()

Overrides java.awt.Color.toString.

Returns a string representation of this Color.

Inherited from java.awt.Color:
brightercreateContextdarkerdecodegetAlphagetBluegetColorgetColorgetColorgetColorComponentsgetColorComponentsgetColorSpacegetComponentsgetComponentsgetGreengetHSBColorgetRedgetRGBColorComponentsgetRGBComponentsgetTransparencyHSBtoRGBRGBtoHSB

Field Detail

aOffsetback to summary
private final int aOffset
argbValueback to summary
private int argbValue
bOffsetback to summary
private final float bOffset
hOffsetback to summary
private final float hOffset
sOffsetback to summary
private final float sOffset
uiDefaultParentNameback to summary
private final String uiDefaultParentName

Constructor Detail

DerivedColorback to summary
pack-priv DerivedColor(String uiDefaultParentName, float hOffset, float sOffset, float bOffset, int aOffset)

Method Detail

clampback to summary
private float clamp(float value)
clampback to summary
private int clamp(int value)
equalsback to summary
public boolean equals(Object o)

Overrides java.awt.Color.equals.

Doc from java.awt.Color.equals.

Determines whether another object is equal to this Color.

The result is true if and only if the argument is not null and is a Color object that has the same red, green, blue, and alpha values as this object.

Annotations
@Override
getAlphaOffsetback to summary
public int getAlphaOffset()
getBrightnessOffsetback to summary
public float getBrightnessOffset()
getHueOffsetback to summary
public float getHueOffset()
getRGBback to summary
public int getRGB()

Overrides java.awt.Color.getRGB.

Returns the RGB value representing the color in the default sRGB java.awt.image.ColorModel. (Bits 24-31 are alpha, 16-23 are red, 8-15 are green, 0-7 are blue).

Returns:int

the RGB value of the color in the default sRGB ColorModel.

Annotations
@Override
Since
1.0
See Also
java.awt.image.ColorModel#getRGBdefault, getRed, getGreen, getBlue
getSaturationOffsetback to summary
public float getSaturationOffset()
getUiDefaultParentNameback to summary
public String getUiDefaultParentName()
hashCodeback to summary
public int hashCode()

Overrides java.awt.Color.hashCode.

Doc from java.awt.Color.hashCode.

Computes the hash code for this Color.

Annotations
@Override
rederiveColorback to summary
public void rederiveColor()

Recalculate the derived color from the UIManager parent color and offsets

toStringback to summary
public String toString()

Overrides java.awt.Color.toString.

Returns a string representation of this Color. This method is intended to be used only for debugging purposes. The content and format of the returned string might vary between implementations. The returned string might be empty but cannot be null.

Returns:String

a String representation of this Color.

Annotations
@Override
javax.swing.plaf.nimbus back to summary

pack-priv Class DerivedColor.UIResource

extends DerivedColor
implements UIResource
Class Inheritance
All Implemented Interfaces
javax.swing.plaf.UIResource
Annotations
@SuppressWarnings:serial

Constructor Summary

AccessConstructor and Description
pack-priv
UIResource(String uiDefaultParentName, float hOffset, float sOffset, float bOffset, int aOffset)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object o)

Overrides javax.swing.plaf.nimbus.DerivedColor.equals.

Determines whether another object is equal to this Color.

public int
hashCode()

Overrides javax.swing.plaf.nimbus.DerivedColor.hashCode.

Computes the hash code for this Color.

Inherited from javax.swing.plaf.nimbus.DerivedColor:
getAlphaOffsetgetBrightnessOffsetgetHueOffsetgetRGBgetSaturationOffsetgetUiDefaultParentNamerederiveColortoString

Constructor Detail

UIResourceback to summary
pack-priv UIResource(String uiDefaultParentName, float hOffset, float sOffset, float bOffset, int aOffset)

Method Detail

equalsback to summary
public boolean equals(Object o)

Overrides javax.swing.plaf.nimbus.DerivedColor.equals.

Doc from java.awt.Color.equals.

Determines whether another object is equal to this Color.

The result is true if and only if the argument is not null and is a Color object that has the same red, green, blue, and alpha values as this object.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides javax.swing.plaf.nimbus.DerivedColor.hashCode.

Doc from java.awt.Color.hashCode.

Computes the hash code for this Color.

Annotations
@Override