ucar.visad.display
Class TextDisplayable

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.TextDisplayable
Direct Known Subclasses:
RingLabels

public class TextDisplayable
extends LineDrawing

Super class for displaying text data

Version:
$Revision: 1.17 $
Author:
IDV Development Team

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
  TextDisplayable()
          Default constructor
  TextDisplayable(ScalarType textType)
          Construct with the given name.
  TextDisplayable(String name)
          Construct with the given name.
  TextDisplayable(String name, ScalarType textType)
          Construct with the given name.
  TextDisplayable(String name, ScalarType textType, boolean screenLocked)
          Construct with the given name.
protected TextDisplayable(TextDisplayable that)
          Constructs from another instance.
 
Method Summary
 Displayable cloneForDisplay()
          Clone this Displayable so it can go into a different display.
protected  DataRenderer getDataRenderer()
          Get the renderer for this TextDisplayable
 Font getFont()
          Get the font for labels.
 HersheyFont getHersheyFont()
          Get the font for labels.
 TextControl.Justification getJustification()
          Get the currently used text justification
 NumberFormat getNumberFormat()
          Get the formatting for text object if values.
 boolean getScreenLocked()
          Get whether this is a screen locked display or not
 float getTextSize()
          Get the currently used text size
 ScalarType getTextType()
          Return the currently used ScalarType for display.
 TextControl.Justification getverticalJustification()
          Get the currently used text vertical justification
 void setCharacterRotation(double rotation)
          Set the character rotation
 void setDisplayUnit(Unit unit)
          Set the units for the displayed range
 void setFont(Object font)
          Set the Font for all
 void setJustification(TextControl.Justification justification)
          Set the justification for all labels
 void setNumberFormat(NumberFormat format)
          Set the formatting for all labels
 void setRotation(double rotation)
          Set the rotation
 void setScreenLocked(boolean locked)
          Set the screenlocked attribute
 void setTextSize(float size)
          Set the size for all labels
 void setTextType(ScalarType textType)
          Set the text type to use.
 void setVerticalJustification(TextControl.Justification verticalJustification)
          Set the vertical justification for all 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, 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, 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

TextDisplayable

public TextDisplayable()
                throws VisADException,
                       RemoteException
Default constructor

Throws:
VisADException - necessary VisAD object couldn't be created
RemoteException - remote error

TextDisplayable

public TextDisplayable(String name)
                throws VisADException,
                       RemoteException
Construct with the given name.

Parameters:
name - name must contain no spaces.
Throws:
VisADException - necessary VisAD object couldn't be created
RemoteException - remote error

TextDisplayable

public TextDisplayable(ScalarType textType)
                throws VisADException,
                       RemoteException
Construct with the given name.

Parameters:
textType - type to map to Display.Text may not be null
Throws:
VisADException - necessary VisAD object couldn't be created
RemoteException - remote error

TextDisplayable

public TextDisplayable(String name,
                       ScalarType textType)
                throws VisADException,
                       RemoteException
Construct with the given name.

Parameters:
name - name to identify this object
textType - type to map to Display.Text
Throws:
VisADException - necessary VisAD object couldn't be created
RemoteException - remote error

TextDisplayable

public TextDisplayable(String name,
                       ScalarType textType,
                       boolean screenLocked)
                throws VisADException,
                       RemoteException
Construct with the given name.

Parameters:
name - name to identify this object
textType - type to map to Display.Text
screenLocked - true to use a screen locked renderer
Throws:
VisADException - necessary VisAD object couldn't be created
RemoteException - remote error

TextDisplayable

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

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

setTextType

public void setTextType(ScalarType textType)
                 throws RemoteException,
                        VisADException
Set the text type to use.

Parameters:
textType - RealType or TextType to map to Display.Text
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

getTextType

public ScalarType getTextType()
Return the currently used ScalarType for display.

Returns:
the ScalarType

setNumberFormat

public void setNumberFormat(NumberFormat format)
                     throws VisADException,
                            RemoteException
Set the formatting for all labels

Parameters:
format - Number format
Throws:
RemoteException - Java RMI error
VisADException - VisAD error

getNumberFormat

public NumberFormat getNumberFormat()
Get the formatting for text object if values. May be null (if not set)

Returns:
format used for labeling

setScreenLocked

public void setScreenLocked(boolean locked)
                     throws VisADException,
                            RemoteException
Set the screenlocked attribute

Parameters:
locked - true to set screen locked
Throws:
RemoteException - Java RMI error
VisADException - VisAD error

getScreenLocked

public boolean getScreenLocked()
Get whether this is a screen locked display or not

Returns:
true if screen locked

setTextSize

public void setTextSize(float size)
                 throws VisADException,
                        RemoteException
Set the size for all labels

Parameters:
size - size (1.0 default)
Throws:
RemoteException - Java RMI error
VisADException - VisAD error

getTextSize

public float getTextSize()
Get the currently used text size

Returns:
size of text

setJustification

public void setJustification(TextControl.Justification justification)
                      throws VisADException,
                             RemoteException
Set the justification for all labels

Parameters:
justification - The justification
Throws:
RemoteException - Java RMI error
VisADException - VisAD error

getJustification

public TextControl.Justification getJustification()
Get the currently used text justification

Returns:
justification

setVerticalJustification

public void setVerticalJustification(TextControl.Justification verticalJustification)
                              throws VisADException,
                                     RemoteException
Set the vertical justification for all labels

Parameters:
verticalJustification - The justification
Throws:
RemoteException - Java RMI error
VisADException - VisAD error

getverticalJustification

public TextControl.Justification getverticalJustification()
Get the currently used text vertical justification

Returns:
justification

setFont

public void setFont(Object font)
             throws VisADException,
                    RemoteException
Set the Font for all

Parameters:
font - font for text (Font or HersheyFont)
Throws:
RemoteException - Java RMI error
VisADException - VisAD error or not a valid font object

setRotation

public void setRotation(double rotation)
                 throws VisADException,
                        RemoteException
Set the rotation

Parameters:
rotation - rotation
Throws:
RemoteException - Java RMI error
VisADException - VisAD error

setCharacterRotation

public void setCharacterRotation(double rotation)
                          throws VisADException,
                                 RemoteException
Set the character rotation

Parameters:
rotation - rotation
Throws:
RemoteException - Java RMI error
VisADException - VisAD error

getFont

public Font getFont()
Get the font for labels. May be null (if not set or using HersheyFont)

Returns:
font used for labeling

getHersheyFont

public HersheyFont getHersheyFont()
Get the font for labels. May be null (if not set or using HersheyFont)

Returns:
font used for labeling

setDisplayUnit

public void setDisplayUnit(Unit unit)
                    throws VisADException,
                           RemoteException
Set the units for the displayed range

Overrides:
setDisplayUnit in class Displayable
Parameters:
unit - Unit for display
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

cloneForDisplay

public Displayable cloneForDisplay()
                            throws RemoteException,
                                   VisADException
Clone this Displayable so it can go into a different display.

Overrides:
cloneForDisplay in class DisplayableData
Returns:
clone of this object
Throws:
RemoteException - Java RMI error
VisADException - VisAD error

getDataRenderer

protected DataRenderer getDataRenderer()
                                throws VisADException
Get the renderer for this TextDisplayable

Overrides:
getDataRenderer in class DisplayableData
Returns:
renderer
Throws:
VisADException - problem creating renderer