|
||||||||||
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 Color
s 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, for example in a
org.geotools.gui.swing.MapPane
object.
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.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 |
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(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 |
setLabelVisibles(boolean visible)
Sets whatever the graduation labels should be painted on top of the colors ramp. |
void |
setOrientation(int orient)
Set 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"
name.
colors
- The colors to paint.
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(IndexColorModel model)
IndexColorModel
. The default implementation
fetches the colors from the index color model and invokes setColors(Color[])
.
model
- The colors to paint.
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
.
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 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 JComponent
getForeground(int)
protected Graduation createGraduation(Graduation reuse, SampleDimension band, double minimum, double maximum)
NumberGraduation
or LogarithmicNumberGraduation
. If the supplied reuse
object is non-null and
is of the appropriate class, then this method can returns reuse
without creating a
new graduation object. This method must set graduations's
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 appears in the graduation.maximum
- The maximal geophysics value to appears in the graduation.
public BufferedImage toImage()
public String toString()
toString
in class Component
public void addNotify()
addNotify
in class JComponent
public void removeNotify()
removeNotify
in class JComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |