|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectComponent
Container
JComponent
ColorRamp
public class ColorRamp
A color ramp with a graduation. The colors can be specified with a SampleDimension,
an array of Colors or an IndexColorModel object, and the graduation is
specified with a Graduation object. The resulting ColorRamp object
is usually painted together with a remote sensing image.

| display/geotk-widgets-swing (download) | View source code for this class |
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
ColorRamp()
Constructs an initially empty color ramp. |
|
ColorRamp(Coverage coverage)
Constructs a color ramp for the specified coverage. |
|
| Method Summary | |
|---|---|
void |
addNotify()
Notifies this component that it now has a parent component. |
protected Graduation |
createGraduation(Graduation reuse,
SampleDimension band,
double minimum,
double maximum)
Returns a graduation for the specified sample dimension, minimum and maximum values. |
Color[] |
getColors()
Returns the colors painted by this ColorRamp. |
Graduation |
getGraduation()
Returns the graduation to paint over colors. |
int |
getOrientation()
Returns the component's orientation (horizontal or vertical). |
boolean |
isInterpolationEnabled()
Returns true if the colors are interpolated at rendering time. |
boolean |
isLabelVisibles()
Tests if graduation labels are paint on top of the colors ramp. |
void |
removeNotify()
Notifies this component that it no longer has a parent component. |
boolean |
setColors(Color... colors)
Sets the colors to paint. |
boolean |
setColors(Coverage coverage)
Sets the graduation and the colors from a coverage. |
boolean |
setColors(IndexColorModel model)
Sets the colors to paint from an IndexColorModel. |
boolean |
setColors(int... colors)
Sets the colors to paint as an array of ARGB values. |
boolean |
setColors(SampleDimension band)
Sets the graduation and the colors from a sample dimension. |
void |
setForeground(Color color)
Sets the label colors. |
boolean |
setGraduation(Graduation graduation)
Sets the graduation to paint on top of the color bar. |
void |
setInterpolationEnabled(boolean enabled)
Sets whatever the colors should be interpolated at rendering time. |
void |
setLabelVisibles(boolean visible)
Sets whatever the graduation labels should be painted on top of the colors ramp. |
void |
setOrientation(int orient)
Sets the component's orientation (horizontal or vertical). |
BufferedImage |
toImage()
Returns an image representation for this color ramp. |
String |
toString()
Returns a string representation for this color ramp. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ColorRamp()
setColors(...) methods.
public ColorRamp(Coverage coverage)
coverage - The coverage for which to create a color ramp.| Method Detail |
|---|
public Graduation getGraduation()
null.
public boolean setGraduation(Graduation graduation)
setColors(SampleDimension) and setColors(Coverage).
This method will fire a property change event with the "graduation" name.
The graduation minimum and maximum values should be both inclusive.
graduation - The new graduation, or null if none.
true if this object changed as a result of this call.public Color[] getColors()
ColorRamp.
null).public boolean setColors(Color... colors)
"colors"
with values of type Color[].
colors - The colors to paint, or null if none.
true if the state of this ColorRamp changed as a result of this call.setColors(Coverage),
setColors(SampleDimension),
setColors(IndexColorModel),
getColors(),
getGraduation()public boolean setColors(int... colors)
setColors(Color[]), but is more efficient if the colors were
already available as an array of ARGB values.
If the new colors are different than the old ones, then this method fires a
property change event named "colors"
with values of type Color[] - not int[].
colors - The colors to paint, or null if none.
true if the state of this ColorRamp changed as a result of this call.public boolean setColors(IndexColorModel model)
IndexColorModel. The default implementation
fetches the ARGB values from the index color model and invokes setColors(int[]).
model - The colors to paint, or null if none.
true if the state of this ColorRamp changed as a result of this call.setColors(Coverage),
setColors(SampleDimension),
setColors(Color[]),
getColors(),
getGraduation()public boolean setColors(SampleDimension band)
setColors and
setGraduation.
band - The sample dimension, or null if none.
true if the state of this ColorRamp changed as a result of this call.setColors(Coverage),
setColors(SampleDimension),
setColors(IndexColorModel),
setColors(Color[]),
getColors(),
getGraduation()public boolean setColors(Coverage coverage)
setColors and setGraduation.
coverage - The coverage, or null.
true if the state of this ColorRamp changed as a result of this call.setColors(IndexColorModel),
setColors(SampleDimension),
getColors(),
getGraduation()public boolean isInterpolationEnabled()
true if the colors are interpolated at rendering time. If false,
only the colors given to the setColors(...) method will be used: the color ramp
will be painted using rectangles of uniform colors. If true, then a linear
interpolation will be used between every colors given to the setColors(...)
method.
public void setInterpolationEnabled(boolean enabled)
true.
enabled - Whatever the colors will be interpolated at rendering time.public int getOrientation()
SwingConstants.HORIZONTAL or SwingConstants.VERTICAL.
public void setOrientation(int orient)
orient - SwingConstants.HORIZONTAL or SwingConstants.VERTICAL.public boolean isLabelVisibles()
true.
true if graduation labels are drawn.public void setLabelVisibles(boolean visible)
visible - true if graduation labels should be drawn.public void setForeground(Color color)
null value reset the automatic color.
setForeground in class JComponentcolor - The new label color, or null for the default.Component.getForeground()
protected Graduation createGraduation(Graduation reuse,
SampleDimension band,
double minimum,
double maximum)
reuse object is non-null and is of the appropriate class, then this
method can return reuse without creating a new graduation object. Otherwise this
method must returns a graduation of the appropriate class, usually
NumberGraduation or
LogarithmicNumberGraduation.
In every cases, this method must set graduations minimum, maximum and unit according the values given in arguments.
reuse - The graduation to reuse if possible.band - The sample dimension to create graduation for.minimum - The minimal geophysics value to appear in the graduation.maximum - The maximal geophysics value to appear in the graduation.
public BufferedImage toImage()
public String toString()
toString in class Componentpublic void addNotify()
addNotify in class JComponentpublic void removeNotify()
removeNotify in class JComponent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||