Package ucar.visad.display
Class TextDisplayable
java.lang.Object
ucar.visad.display.Displayable
ucar.visad.display.DisplayableData
ucar.visad.display.LineDrawing
ucar.visad.display.TextDisplayable
- Direct Known Subclasses:
LatLonLabels
,RingLabels
Super class for displaying text data
- Version:
- $Revision: 1.17 $
- Author:
- IDV Development Team
-
Nested Class Summary
Nested classes/interfaces inherited from class ucar.visad.display.DisplayableData
DisplayableData.DragAdapter
-
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, renderer, VISIBLE
Fields inherited from class ucar.visad.display.Displayable
DISPLAY, parent, SCALAR_MAP_SET
-
Constructor Summary
ConstructorsModifierConstructorDescriptionDefault constructorTextDisplayable
(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
Constructs from another instance.TextDisplayable
(ScalarType textType) Construct with the given name. -
Method Summary
Modifier and TypeMethodDescriptionClone thisDisplayable
so it can go into a different display.protected DataRenderer
Get the renderer for this TextDisplayablegetFont()
Get the font for labels.Get the font for labels.Get the currently used text justificationGet the formatting for text object if values.boolean
Get whether this is a screen locked display or notboolean
Get the sphere propertyfloat
Get the currently used text sizeReturn the currently used ScalarType for display.Get the currently used text vertical justificationvoid
setCharacterRotation
(double rotation) Set the character rotationvoid
setDisplayUnit
(Unit unit) Set the units for the displayed rangevoid
Set the Font for allvoid
setJustification
(TextControl.Justification justification) Set the justification for all labelsvoid
setNumberFormat
(NumberFormat format) Set the formatting for all labelsvoid
setRotation
(double rotation) Set the rotationvoid
setScreenLocked
(boolean locked) Set the screenlocked attributevoid
setSphere
(boolean sphere) Set the whether we're on a spherevoid
setTextSize
(float size) Set the size for all labelsvoid
setTextType
(ScalarType textType) Set the text type to use.void
setVerticalJustification
(TextControl.Justification verticalJustification) Set the vertical justification for all labelsvoid
setVisible
(boolean visible) Sets the visibility property.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, setDragAdapter, setManipulable, setPickable, setPointMode, setUseFastRendering, showme, toString
Methods inherited from class ucar.visad.display.Displayable
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, setColorPalette, setColorPalette, setColorUnit, setConstantPosition, setContourInfo, setDisplay, setDisplayActive, setDisplayInactive, setDisplayMaster, setOverrideAnimationSet, setOverrideAnimationSet, setParent, setRangeForColor, setRangeForColor, setScalarMapSet, setSelectedRange, setSelectedRange, setUseTimesInAnimation, toFront
-
Constructor Details
-
TextDisplayable
Default constructor- Throws:
VisADException
- necessary VisAD object couldn't be createdRemoteException
- remote error
-
TextDisplayable
Construct with the given name.- Parameters:
name
- name must contain no spaces.- Throws:
VisADException
- necessary VisAD object couldn't be createdRemoteException
- remote error
-
TextDisplayable
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 createdRemoteException
- remote error
-
TextDisplayable
Construct with the given name.- Parameters:
name
- name to identify this objecttextType
- type to map to Display.Text- Throws:
VisADException
- necessary VisAD object couldn't be createdRemoteException
- 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 objecttextType
- type to map to Display.TextscreenLocked
- true to use a screen locked renderer- Throws:
VisADException
- necessary VisAD object couldn't be createdRemoteException
- remote error
-
TextDisplayable
Constructs from another instance.- Parameters:
that
- The other instance.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
-
Method Details
-
setTextType
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
Return the currently used ScalarType for display.- Returns:
- the ScalarType
-
setNumberFormat
Set the formatting for all labels- Parameters:
format
- Number format- Throws:
RemoteException
- Java RMI errorVisADException
- VisAD error
-
setVisible
Sets the visibility property.- Overrides:
setVisible
in classDisplayableData
- Parameters:
visible
- Whether or not this instance should be displayed.- Throws:
RemoteException
- Java RMI failure.VisADException
- VisAD failure.
-
getNumberFormat
Get the formatting for text object if values. May be null (if not set)- Returns:
- format used for labeling
-
setScreenLocked
Set the screenlocked attribute- Parameters:
locked
- true to set screen locked- Throws:
RemoteException
- Java RMI errorVisADException
- VisAD error
-
getScreenLocked
public boolean getScreenLocked()Get whether this is a screen locked display or not- Returns:
- true if screen locked
-
setTextSize
Set the size for all labels- Parameters:
size
- size (1.0 default)- Throws:
RemoteException
- Java RMI errorVisADException
- VisAD error
-
getTextSize
public float getTextSize()Get the currently used text size- Returns:
- size of text
-
setSphere
Set the whether we're on a sphere- Parameters:
sphere
- true if sphere- Throws:
RemoteException
- Java RMI errorVisADException
- VisAD error
-
getSphere
public boolean getSphere()Get the sphere property- Returns:
- true if sphere
-
setJustification
public void setJustification(TextControl.Justification justification) throws VisADException, RemoteException Set the justification for all labels- Parameters:
justification
- The justification- Throws:
RemoteException
- Java RMI errorVisADException
- VisAD error
-
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 errorVisADException
- VisAD error
-
getverticalJustification
Get the currently used text vertical justification- Returns:
- justification
-
setFont
Set the Font for all- Parameters:
font
- font for text (Font or HersheyFont)- Throws:
RemoteException
- Java RMI errorVisADException
- VisAD error or not a valid font object
-
setRotation
Set the rotation- Parameters:
rotation
- rotation- Throws:
RemoteException
- Java RMI errorVisADException
- VisAD error
-
setCharacterRotation
Set the character rotation- Parameters:
rotation
- rotation- Throws:
RemoteException
- Java RMI errorVisADException
- VisAD error
-
getFont
Get the font for labels. May be null (if not set or using HersheyFont)- Returns:
- font used for labeling
-
getHersheyFont
Get the font for labels. May be null (if not set or using HersheyFont)- Returns:
- font used for labeling
-
setDisplayUnit
Set the units for the displayed range- Overrides:
setDisplayUnit
in classDisplayable
- Parameters:
unit
- Unit for display- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
cloneForDisplay
Clone thisDisplayable
so it can go into a different display.- Overrides:
cloneForDisplay
in classDisplayableData
- Returns:
- clone of this object
- Throws:
RemoteException
- Java RMI errorVisADException
- VisAD error
-
getDataRenderer
Get the renderer for this TextDisplayable- Overrides:
getDataRenderer
in classDisplayableData
- Returns:
- renderer
- Throws:
VisADException
- problem creating renderer
-