ucar.visad.display
Class ScaleLabels

java.lang.Object
  extended by ucar.visad.display.Displayable
      extended by ucar.visad.display.DisplayableData
          extended by ucar.visad.display.LineDrawing
              extended by ucar.visad.display.ScaleLabels

public class ScaleLabels
extends LineDrawing

Provides support for labeling the scale of an axis.

Version:
$Revision: 1.9 $
Author:
Steven R. Emmerson

Field Summary
 
Fields inherited from class ucar.visad.display.LineDrawing
COLOR, LINE_STYLE, LINE_WIDTH, POINT_SIZE
 
Fields inherited from class ucar.visad.display.DisplayableData
MANIPULABLE, VISIBLE
 
Fields inherited from class ucar.visad.display.Displayable
DISPLAY, parent, SCALAR_MAP_SET
 
Constructor Summary
protected ScaleLabels(ScaleLabels that)
          Constructs from another instance.
  ScaleLabels(String name, RealType realType)
          Constructs from a name and a axis RealType.
 
Method Summary
 void addScalarMaps(LocalDisplay display)
          Adds the non-spatial ScalarMap-s of this instance to a VisAD display.
 Displayable cloneForDisplay()
          Returns a clone of this instance suitable for another VisAD display.
 void set(Gridded1DSet set)
          Sets the labels from a set of values.
protected  void setAlignment(TextControl control)
          Sets the alignment of text in a TextControl according to the alignment property.
 void setFormat(NumberFormat format)
          Sets the format of the labels.
protected  void setLabels()
          Sets the labels from internal information.
 void setLabelValues(float[] values)
          Sets the labels from an array of values.
 void setPositionValues(float[] positionValues)
          Sets the position of the labels from an array of positions.
 void setSize(double size)
          Sets the size of the labels.
protected  void setSize(TextControl control)
          Sets the size of text in a TextControl according to the size property.
 void setXAlignment(float alignment)
          Sets the X-alignment of the labels.
 
Methods inherited from class ucar.visad.display.LineDrawing
getColor, getLineStyle, getLineWidth, getPointSize, setColor, setHSV, setHSV, setLineStyle, setLineWidth, setPointSize, setRGB, setRGB, setRGBA, setRGBA
 
Methods inherited from class ucar.visad.display.DisplayableData
addAction, dataChange, destroy, getActive, getAnimationSet, getData, getDataRenderer, getName, hasData, hasDataObject, isManipulable, isPickable, myAddConstantMaps, myAddDataReferences, myRemoveDataReferences, removeAction, setActive, setData, setDataReference, setManipulable, setPickable, setPointMode, setUseFastRendering, setVisible, toString
 
Methods inherited from class ucar.visad.display.Displayable
addConstantMap, addConstantMaps, addDataReferences, addPropertyChangeListener, addPropertyChangeListener, addRefsInvoked, addScalarMap, addScalarMaps, applyColorUnit, applyDisplayUnit, checkUnit, combineConstantMaps, firePropertyChange, firePropertyChange, fireScalarMapSetChange, getColorUnit, getConstantMaps, getDisplay, getDisplayMaster, getDisplayUnit, getPointMode, getScalarMap, getScalarMap, getScalarMap, getScalarMapSet, getUseFastRendering, getUseTimesInAnimation, getVisible, isActive, isUnitCompatible, isVisible, logException, removeConstantMap, removeDataReferences, removePropertyChangeListener, removePropertyChangeListener, removeScalarMap, replaceScalarMap, setAdjustFlow, setColorPalette, setColorPalette, setColorUnit, setConstantPosition, setContourInfo, setDisplay, setDisplayActive, setDisplayInactive, setDisplayMaster, setDisplayUnit, setOverrideAnimationSet, setOverrideAnimationSet, setParent, setRangeForColor, setRangeForColor, setScalarMapSet, setSelectedRange, setSelectedRange, setUseTimesInAnimation, toFront
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScaleLabels

public ScaleLabels(String name,
                   RealType realType)
            throws RemoteException,
                   VisADException
Constructs from a name and a axis RealType.

Parameters:
name - The name for this instance.
realType - The type of the axis.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

ScaleLabels

protected ScaleLabels(ScaleLabels that)
               throws RemoteException,
                      VisADException
Constructs from another instance.

Parameters:
that - The other instance.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.
Method Detail

setSize

public void setSize(double size)
             throws VisADException,
                    RemoteException
Sets the size of the labels. method.

Parameters:
size - The size of the labels (1 = normal).
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.
See Also:
setSize(TextControl)

setSize

protected void setSize(TextControl control)
                throws VisADException,
                       RemoteException
Sets the size of text in a TextControl according to the size property.

Parameters:
control - The TextControl.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setXAlignment

public void setXAlignment(float alignment)
                   throws VisADException,
                          RemoteException
Sets the X-alignment of the labels.

Parameters:
alignment - The X-alignment of the labels. One of Component.CENTER_ALIGNMENT, Component.RIGHT_ALIGNMENT, or Component.LEFT_ALIGNMENT.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.
See Also:
setAlignment(TextControl)

setAlignment

protected void setAlignment(TextControl control)
                     throws VisADException,
                            RemoteException
Sets the alignment of text in a TextControl according to the alignment property.

Parameters:
control - The TextControl.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setFormat

public void setFormat(NumberFormat format)
               throws RemoteException,
                      VisADException
Sets the format of the labels.

Parameters:
format - The format of the labels.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.
See Also:
NumberFormat

set

public void set(Gridded1DSet set)
         throws RemoteException,
                VisADException
Sets the labels from a set of values.

Parameters:
set - The set of values.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setLabelValues

public void setLabelValues(float[] values)
                    throws VisADException,
                           RemoteException
Sets the labels from an array of values.

Parameters:
values - The array of values.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setLabels

protected void setLabels()
                  throws VisADException,
                         RemoteException
Sets the labels from internal information.

Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setPositionValues

public void setPositionValues(float[] positionValues)
                       throws VisADException,
                              RemoteException
Sets the position of the labels from an array of positions.

Parameters:
positionValues - The position for the labels along the axis.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

addScalarMaps

public void addScalarMaps(LocalDisplay display)
                   throws VisADException,
                          RemoteException
Adds the non-spatial ScalarMap-s of this instance to a VisAD display.

Parameters:
display - The VisAD display.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

cloneForDisplay

public Displayable cloneForDisplay()
                            throws RemoteException,
                                   VisADException
Returns a clone of this instance suitable for another VisAD display. Underlying data objects are not cloned.

Overrides:
cloneForDisplay in class DisplayableData
Returns:
A semi-deep clone of this instance.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.