public class ColorScale extends DisplayableData
DisplayableData.DragAdapter
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BOTTOM
Bottom Placement
|
static java.awt.Color |
DEFAULT_LABEL_COLOR
default color
|
static int |
HORIZONTAL_ORIENT
Key for displaying the scale horizonatally
|
static java.lang.String |
LEFT
Left Placement
|
static int |
PRIMARY
Key for primary labeling side
|
static java.lang.String |
RIGHT
Right Placement
|
static int |
SECONDARY
Key for secondary labeling side
|
static java.lang.String |
TOP
Top Placement
|
static int |
VERTICAL_ORIENT
Key for displaying the scale vertically
|
LINE_WIDTH, MANIPULABLE, renderer, VISIBLE
DISPLAY, parent, SCALAR_MAP_SET
Constructor and Description |
---|
ColorScale(ColorScaleInfo info)
Construct a new
ColorScale from the ColorScaleInfo |
ColorScale(java.lang.String name)
Construct a new
ColorScale with the given name
and default orientation. |
ColorScale(java.lang.String name,
int orient)
Construct a new
ColorScale with the given name
and orientation. |
ColorScale(java.lang.String name,
int orient,
double x,
double y)
Construct a new
ColorScale with the given name
and orientation and position. |
ColorScale(java.lang.String name,
int orient,
double x,
double y,
float[][] table)
Construct a new
ColorScale with the given name
and orientation and position, using the color table. |
ColorScale(java.lang.String name,
int orient,
float[][] table)
Construct a new
ColorScale with the given name
and orientation and color table. |
Modifier and Type | Method and Description |
---|---|
Displayable |
cloneForDisplay()
Returns a clone of this instance suitable for another VisAD display.
|
protected visad.DataRenderer |
getDataRenderer()
Get the renderer for this ColorScale
|
static int |
getDefaultOrient(java.lang.String place)
Get the default orientation for the given placement
|
static java.lang.String |
getDefaultPlace(int orient)
Get the default place for the given orientation
|
java.awt.Font |
getFont()
Get the font used for rendering the labels
|
java.awt.Color |
getLabelColor()
Get the color of the labels
|
int |
getLabelSide()
Get the color of the labels
|
boolean |
getLabelVisble()
Get the label visbility
|
int |
getOrientation()
Get the orientation of the ColorScale.
|
boolean |
getUseAlpha()
Gets the useAlpha property
|
static float |
getX(int orient,
java.lang.String placement)
Get the X position
|
static float |
getY(int orient,
java.lang.String placement)
Get the Y position
|
boolean |
isUnitVisible()
Checks if is unit visible.
|
void |
reDisplay()
Redisplay the colorbar using the defaults
|
void |
setColorPalette(float[][] colorPalette)
This method sets the color palette
according to the color table in argument;
pair this method with setRange(low,high) to get
a fixed association of color table and range of values.
|
void |
setColorScaleInfo(ColorScaleInfo info)
Set the parameters for this scale
|
void |
setFont(java.awt.Font font)
Set the font used for rendering the labels
|
void |
setFont(visad.util.HersheyFont font)
Set the font used for rendering the labels
|
void |
setLabelColor(java.awt.Color color)
Set the color of the labels.
|
void |
setLabelSide(int side)
Set the labeling side.
|
void |
setLabelVisible(boolean visible)
Set the visibility of the labels
|
void |
setOrientation(int orient)
Set the orientation of the ColorScale.
|
void |
setRangeForColor(double low,
double hi)
Set the range of values for the color table.
|
void |
setUnitVisible(boolean unitVisible)
Sets the unit visible.
|
void |
setUseAlpha(boolean useAlpha)
Sets the useAlpha property
|
void |
setUseFastRendering(boolean fastRender)
Set the flags for whether the Displayable uses it's methods
to render quickly (eg, not account for projection seams).
|
addAction, dataChange, destroy, getActive, getAnimationSet, getData, getLineWidth, getName, getPointSize, hasData, hasDataObject, isManipulable, isPickable, myAddConstantMaps, myAddDataReferences, myRemoveDataReferences, removeAction, setActive, setData, setDataReference, setDragAdapter, setLineWidth, setManipulable, setPickable, setPointMode, setPointSize, setVisible, showme, toString
addConstantMap, addConstantMaps, addDataReferences, addPropertyChangeListener, addPropertyChangeListener, addRefsInvoked, addScalarMap, addScalarMaps, applyColorUnit, applyDisplayUnit, checkUnit, combineConstantMaps, destroyDisplayable, firePropertyChange, firePropertyChange, fireScalarMapSetChange, getColorUnit, getConstantMaps, getDestroyed, getDisplay, getDisplayMaster, getDisplayUnit, getPointMode, getScalarMap, getScalarMap, getScalarMap, getScalarMapSet, getUseFastRendering, getUseTimesInAnimation, getVisible, isActive, isUnitCompatible, isVisible, logException, removeConstantMap, removeDataReferences, removePropertyChangeListener, removePropertyChangeListener, removeScalarMap, replaceScalarMap, setAdjustFlow, setColor, setColorPalette, setColorUnit, setConstantPosition, setContourInfo, setDisplay, setDisplayActive, setDisplayInactive, setDisplayMaster, setDisplayUnit, setOverrideAnimationSet, setOverrideAnimationSet, setParent, setRangeForColor, setScalarMapSet, setSelectedRange, setSelectedRange, setUseTimesInAnimation, toFront
public static final int VERTICAL_ORIENT
public static final int HORIZONTAL_ORIENT
public static final int PRIMARY
public static final int SECONDARY
public static final java.lang.String TOP
public static final java.lang.String BOTTOM
public static final java.lang.String LEFT
public static final java.lang.String RIGHT
public static final java.awt.Color DEFAULT_LABEL_COLOR
public ColorScale(java.lang.String name) throws visad.VisADException, java.rmi.RemoteException
ColorScale
with the given name
and default orientation.name
- name for this color scale object.java.rmi.RemoteException
- Java RMI errorvisad.VisADException
- problem creating VisAD objectpublic ColorScale(java.lang.String name, int orient) throws visad.VisADException, java.rmi.RemoteException
ColorScale
with the given name
and orientation.name
- name for this color scale object.orient
- orientation for this ColorScale
java.rmi.RemoteException
- Java RMI errorvisad.VisADException
- problem creating VisAD objectpublic ColorScale(java.lang.String name, int orient, float[][] table) throws visad.VisADException, java.rmi.RemoteException
ColorScale
with the given name
and orientation and color table.name
- name for this color scale object.orient
- orientation for this ColorScale
table
- color table that defines the imagejava.rmi.RemoteException
- Java RMI errorvisad.VisADException
- problem creating VisAD objectpublic ColorScale(java.lang.String name, int orient, double x, double y) throws visad.VisADException, java.rmi.RemoteException
ColorScale
with the given name
and orientation and position.name
- name for this color scale object.orient
- orientation for this ColorScale
x
- X position on the screen, % away from upper left cornery
- Y position on the screen, % away from upper left cornerjava.rmi.RemoteException
- Java RMI errorvisad.VisADException
- problem creating VisAD objectpublic ColorScale(java.lang.String name, int orient, double x, double y, float[][] table) throws visad.VisADException, java.rmi.RemoteException
ColorScale
with the given name
and orientation and position, using the color table.name
- name for this color scale object.orient
- orientation for this ColorScale
x
- X position on the screen, % away from upper left cornery
- Y position on the screen, % away from upper left cornertable
- color table that defines the imagejava.rmi.RemoteException
- Java RMI errorvisad.VisADException
- problem creating VisAD objectpublic ColorScale(ColorScaleInfo info) throws visad.VisADException, java.rmi.RemoteException
ColorScale
from the ColorScaleInfoinfo
- color scale infojava.rmi.RemoteException
- Java RMI errorvisad.VisADException
- problem creating VisAD objectpublic void setRangeForColor(double low, double hi) throws visad.VisADException, java.rmi.RemoteException
setRangeForColor
in class Displayable
low
- minimum valuehi
- maximum valuejava.rmi.RemoteException
- Java RMI errorvisad.VisADException
- problem creating VisAD objectpublic int getOrientation()
public void setOrientation(int orient) throws java.rmi.RemoteException, visad.VisADException
orient
- orientation (HORIZONTAL_ORIENT, VERTICAL_ORIENT)java.rmi.RemoteException
- Java RMI errorvisad.VisADException
- problem creating VisAD objectpublic void setColorScaleInfo(ColorScaleInfo info) throws java.rmi.RemoteException, visad.VisADException
info
- ColorScaleInfojava.rmi.RemoteException
- Java RMI errorvisad.VisADException
- problem creating VisAD objectpublic void setLabelColor(java.awt.Color color) throws java.rmi.RemoteException, visad.VisADException
color
- color for labelsjava.rmi.RemoteException
- Java RMI errorvisad.VisADException
- problem creating VisAD objectpublic java.awt.Color getLabelColor()
public void setLabelVisible(boolean visible) throws java.rmi.RemoteException, visad.VisADException
visible
- true to show labelsjava.rmi.RemoteException
- Java RMI errorvisad.VisADException
- problem creating VisAD objectpublic boolean getLabelVisble()
public boolean isUnitVisible()
public void setUnitVisible(boolean unitVisible)
unitVisible
- the new unit visiblepublic boolean getUseAlpha()
public void setUseAlpha(boolean useAlpha) throws java.rmi.RemoteException, visad.VisADException
useAlpha
- the useAlpha to setjava.rmi.RemoteException
- Java RMI errorvisad.VisADException
- problem creating VisAD objectpublic void setLabelSide(int side) throws java.rmi.RemoteException, visad.VisADException
side
- labeling side (PRIMARY, SECONDARY);java.rmi.RemoteException
- Java RMI errorvisad.VisADException
- problem creating VisAD objectpublic int getLabelSide()
public void setColorPalette(float[][] colorPalette) throws java.rmi.RemoteException, visad.VisADException
setColorPalette
in class Displayable
colorPalette
- the color table or color-alpha table desiredvisad.VisADException
- if a core VisAD failure occurs.java.rmi.RemoteException
- if a Java RMI failure occurs.public Displayable cloneForDisplay() throws java.rmi.RemoteException, visad.VisADException
cloneForDisplay
in class DisplayableData
visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.public void reDisplay()
protected visad.DataRenderer getDataRenderer() throws visad.VisADException
getDataRenderer
in class DisplayableData
visad.VisADException
- problem creating rendererpublic void setFont(java.awt.Font font)
font
- new font to usepublic void setFont(visad.util.HersheyFont font)
font
- new font to usepublic java.awt.Font getFont()
public void setUseFastRendering(boolean fastRender) throws visad.VisADException, java.rmi.RemoteException
setUseFastRendering
in class DisplayableData
fastRender
- Should the rendering be quick (and possibly
inaccurate)visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.public static java.lang.String getDefaultPlace(int orient)
orient
- orientationpublic static int getDefaultOrient(java.lang.String place)
place
- placementpublic static float getX(int orient, java.lang.String placement)
orient
- orientationplacement
- placementpublic static float getY(int orient, java.lang.String placement)
orient
- orientationplacement
- placement