ucar.unidata.idv.control.drawing
Class TextGlyph

java.lang.Object
  extended by ucar.unidata.idv.control.drawing.DrawingGlyph
      extended by ucar.unidata.idv.control.drawing.TextGlyph

public class TextGlyph
extends DrawingGlyph

Class TextGlyph Draws text

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

Field Summary
static String ATTR_FONT
          xml attr names
static String ATTR_FONTFACE
          xml attr names
static String ATTR_FONTSIZE
          xml attr names
static String ATTR_FONTSTRING
          xml attr names
static String ATTR_JUSTIFICATION
          xml attr names
static String ATTR_MARKER
          xml attr names
static String ATTR_MARKERSCALE
          xml attr names
static String ATTR_SHOWMARKER
          xml attr names
static String JUST_BOTTOM
          Justification name
static String JUST_CENTER
          Justification name
static String JUST_LEFT
          Justification name
static String JUST_RIGHT
          Justification name
static String JUST_TOP
          Justification name
protected  double markerScale
          marker scale
protected  String markerType
          marker type
protected  boolean showMarker
          Show the marker
 
Fields inherited from class ucar.unidata.idv.control.drawing.DrawingGlyph
actualPoints, ATTR_COLOR, ATTR_COORDTYPE, ATTR_FILLED, ATTR_FULLLATLON, ATTR_LINEWIDTH, ATTR_NAME, ATTR_PICKABLE, ATTR_POINTS, ATTR_TEXT, ATTR_TIMES, ATTR_ZPOSITION, control, COORD_LABELS, COORD_LATLON, COORD_LATLONALT, COORD_NONE, COORD_TYPENAMES, COORD_TYPES, COORD_XY, COORD_XYZ, coordType, firstMoveEarthLocation, firstMoveLocation, IDX_ALT, IDX_LAT, IDX_LON, IDX_X, IDX_Y, IDX_Z, parentDisplayable, points, propDialog, propertiesUp, PT_X, PT_Y, PT_Z, selectionDisplayable, stretchIndex, tabbedPane, TAG_ARROW, TAG_FRONT, TAG_HIGH, TAG_IMAGE, TAG_LOW, TAG_MOVIE, TAG_POLYGON, TAG_SHAPE, TAG_SYMBOL, TAG_TEXT, uniqueCnt, zPosition
 
Constructor Summary
TextGlyph()
          ctor
TextGlyph(DrawingControl control, DisplayEvent event, String text)
          ctor
 
Method Summary
protected  void addAttributes(Element e)
          Populate the xml node with attrs
protected  boolean applyProperties(Hashtable compMap)
          Handle the property apply.
 String getExtraDescription()
          Get the extra descripition used in the JTable listing
 Font getFont()
          Get the Font property.
 String getHorizontalJustification()
          Get the Justification property.
 int getHtmlWidth()
          Get the HtmlWidth property.
 double getMarkerScale()
          Get the MarkerScale property.
 String getMarkerType()
          Get the MarkerType property.
protected  void getPropertiesComponents(List comps, Hashtable compMap)
          Make the properties widgetsF
 boolean getShowMarker()
          Get the ShowMarker property.
 String getTagName()
          The tag to use in the xml
 String getText()
          Get the Text property.
 String getTypeName()
          Get the name of this glyph type
 String getVerticalJustification()
          Get the VerticalJustification property.
 DrawingGlyph handleCreation(DisplayEvent event)
          Initialize after creation
 DrawingGlyph handleMouseMoved(DisplayEvent event)
          Handle event
 DrawingGlyph handleMousePressed(DisplayEvent event)
          Handle event
protected  boolean initFinalInner()
          Do the final initialization
 boolean initFromUser(DrawingControl control, DisplayEvent event)
          User created me.
 void initFromXml(DrawingControl control, Element node)
          Xml created me
 boolean mousePressed(DisplayEvent event)
          Handle the event
 void projectionChanged()
          Projection changed.
 void setBeenRemoved(boolean value)
          Has this glyph been removed
 void setFont(Font value)
          Set the Font property.
 void setHorizontalJustification(String value)
          Set the Justification property.
 void setHtmlWidth(int value)
          Set the HtmlWidth property.
 void setMarkerScale(double value)
          Set the MarkerScale property.
 void setMarkerType(String value)
          Set the MarkerType property.
 void setShowMarker(boolean value)
          Set the ShowMarker property.
 void setText(String value)
          Set the Text property.
 void setVerticalJustification(String value)
          Set the VerticalJustification property.
 void updateLocation()
          Handle glyph moved
 void viewpointChanged()
          Viewpoint changed.
 
Methods inherited from class ucar.unidata.idv.control.drawing.DrawingGlyph
addDisplayable, addTime, canShowArea, canShowDistance, checkTimeVisibility, checkVisibility, closestPoint, constrainedTo2D, distance, distanceBetween, distanceBetween, doInterpolatedStretch, doMove, doneBeingCreated, doStretch, evaluateJython, getArea, getBeenRemoved, getBeingCreated, getBoundingBox, getBoxPoint, getBoxPoint, getBoxPoint, getColor, getCoordType, getCreatedByUser, getDefaultZPosition, getDescription, getDisplayable, getDistance, getEditable, getElement, getFilled, getFixedAltitude, getFullLatLon, getLatLons, getName, getParent, getPickable, getPoint, getPoints, getPointValues, getPointValues, getPointValuesDouble, getPointValuesDouble, getSelectionPoints, getTimeField, getTimePropertiesComponents, getTimeValues, getVisibleFlag, getZPosition, handleKeyPressed, handleMouseDragged, handleMouseReleased, hide, initFinal, initFromBundle, initMove, initStretch, isInFlatSpace, isInLatLonSpace, isInXYSpace, isSelectable, isValid, isVisible, makePoint, moveTo, processPointStrings, removeDisplayable, setActualPoints, setColor, setColor, setCoordType, setCreatedByUser, setEditable, setFilled, setFullLatLon, setName, setPickable, setPoints, setProperties, setSelected, setTimeValues, setVisible, setVisibleFlag, setZPosition, shouldShowColorSelector, show, smoothCurve, squared, swap, swap, toLatLonAlt, toString, tryToFill
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

JUST_LEFT

public static final String JUST_LEFT
Justification name

See Also:
Constant Field Values

JUST_CENTER

public static final String JUST_CENTER
Justification name

See Also:
Constant Field Values

JUST_RIGHT

public static final String JUST_RIGHT
Justification name

See Also:
Constant Field Values

JUST_TOP

public static final String JUST_TOP
Justification name

See Also:
Constant Field Values

JUST_BOTTOM

public static final String JUST_BOTTOM
Justification name

See Also:
Constant Field Values

ATTR_MARKER

public static final String ATTR_MARKER
xml attr names

See Also:
Constant Field Values

ATTR_MARKERSCALE

public static final String ATTR_MARKERSCALE
xml attr names

See Also:
Constant Field Values

ATTR_SHOWMARKER

public static final String ATTR_SHOWMARKER
xml attr names

See Also:
Constant Field Values

ATTR_JUSTIFICATION

public static final String ATTR_JUSTIFICATION
xml attr names

See Also:
Constant Field Values

ATTR_FONTSIZE

public static final String ATTR_FONTSIZE
xml attr names

See Also:
Constant Field Values

ATTR_FONTFACE

public static final String ATTR_FONTFACE
xml attr names

See Also:
Constant Field Values

ATTR_FONTSTRING

public static final String ATTR_FONTSTRING
xml attr names

See Also:
Constant Field Values

ATTR_FONT

public static final String ATTR_FONT
xml attr names

See Also:
Constant Field Values

showMarker

protected boolean showMarker
Show the marker


markerScale

protected double markerScale
marker scale


markerType

protected String markerType
marker type

Constructor Detail

TextGlyph

public TextGlyph()
ctor


TextGlyph

public TextGlyph(DrawingControl control,
                 DisplayEvent event,
                 String text)
ctor

Parameters:
control - The control I'm in
event - The event when I was created
text - Initial text
Method Detail

getExtraDescription

public String getExtraDescription()
Get the extra descripition used in the JTable listing

Overrides:
getExtraDescription in class DrawingGlyph
Returns:
extra description

handleCreation

public DrawingGlyph handleCreation(DisplayEvent event)
                            throws VisADException,
                                   RemoteException
Initialize after creation

Overrides:
handleCreation in class DrawingGlyph
Parameters:
event - The event
Returns:
this
Throws:
RemoteException - On badness
VisADException - On badness

initFromUser

public boolean initFromUser(DrawingControl control,
                            DisplayEvent event)
                     throws VisADException,
                            RemoteException
User created me.

Overrides:
initFromUser in class DrawingGlyph
Parameters:
control - The control I'm in
event - The event
Returns:
ok
Throws:
RemoteException - On badness
VisADException - On badness

mousePressed

public boolean mousePressed(DisplayEvent event)
                     throws VisADException,
                            RemoteException
Handle the event

Overrides:
mousePressed in class DrawingGlyph
Parameters:
event - the event
Returns:
Did we handle this event
Throws:
RemoteException - On badness
VisADException - On badness

initFromXml

public void initFromXml(DrawingControl control,
                        Element node)
                 throws VisADException,
                        RemoteException
Xml created me

Overrides:
initFromXml in class DrawingGlyph
Parameters:
control - The control
node - The xml
Throws:
RemoteException - On badness
VisADException - On badness

getTagName

public String getTagName()
The tag to use in the xml

Specified by:
getTagName in class DrawingGlyph
Returns:
Xml tag name

addAttributes

protected void addAttributes(Element e)
Populate the xml node with attrs

Overrides:
addAttributes in class DrawingGlyph
Parameters:
e - Xml node

setBeenRemoved

public void setBeenRemoved(boolean value)
Has this glyph been removed

Overrides:
setBeenRemoved in class DrawingGlyph
Parameters:
value - been removed

initFinalInner

protected boolean initFinalInner()
                          throws VisADException,
                                 RemoteException
Do the final initialization

Overrides:
initFinalInner in class DrawingGlyph
Returns:
Successful
Throws:
RemoteException - On badness
VisADException - On badness

handleMousePressed

public DrawingGlyph handleMousePressed(DisplayEvent event)
                                throws VisADException,
                                       RemoteException
Handle event

Overrides:
handleMousePressed in class DrawingGlyph
Parameters:
event - The event
Returns:
This or null
Throws:
RemoteException - When bad things happen
VisADException - When bad things happen

handleMouseMoved

public DrawingGlyph handleMouseMoved(DisplayEvent event)
                              throws VisADException,
                                     RemoteException
Handle event

Overrides:
handleMouseMoved in class DrawingGlyph
Parameters:
event - The event
Returns:
This or null
Throws:
RemoteException - When bad things happen
VisADException - When bad things happen

setFont

public void setFont(Font value)
Set the Font property.

Parameters:
value - The new value for Font

getFont

public Font getFont()
Get the Font property.

Returns:
The Font

applyProperties

protected boolean applyProperties(Hashtable compMap)
                           throws VisADException,
                                  RemoteException
Handle the property apply.

Overrides:
applyProperties in class DrawingGlyph
Parameters:
compMap - Holds property widgets
Returns:
success
Throws:
RemoteException - On badness
VisADException - On badness

viewpointChanged

public void viewpointChanged()
                      throws VisADException,
                             RemoteException
Viewpoint changed. Update the image if needed

Overrides:
viewpointChanged in class DrawingGlyph
Throws:
RemoteException - On badness
VisADException - On badness

projectionChanged

public void projectionChanged()
                       throws VisADException,
                              RemoteException
Projection changed. Update the image.

Overrides:
projectionChanged in class DrawingGlyph
Throws:
RemoteException - On badness
VisADException - On badness

getPropertiesComponents

protected void getPropertiesComponents(List comps,
                                       Hashtable compMap)
Make the properties widgetsF

Overrides:
getPropertiesComponents in class DrawingGlyph
Parameters:
comps - List of components
compMap - Map to hold name to widget

getTypeName

public String getTypeName()
Get the name of this glyph type

Specified by:
getTypeName in class DrawingGlyph
Returns:
The name

updateLocation

public void updateLocation()
                    throws VisADException,
                           RemoteException
Handle glyph moved

Overrides:
updateLocation in class DrawingGlyph
Throws:
RemoteException - On badness
VisADException - On badness

setText

public void setText(String value)
Set the Text property.

Parameters:
value - The new value for Text

getText

public String getText()
Get the Text property.

Returns:
The Text

setHorizontalJustification

public void setHorizontalJustification(String value)
Set the Justification property.

Parameters:
value - The new value for Justification

getHorizontalJustification

public String getHorizontalJustification()
Get the Justification property.

Returns:
The Justification

setVerticalJustification

public void setVerticalJustification(String value)
Set the VerticalJustification property.

Parameters:
value - The new value for VerticalJustification

getVerticalJustification

public String getVerticalJustification()
Get the VerticalJustification property.

Returns:
The VerticalJustification

setShowMarker

public void setShowMarker(boolean value)
                   throws VisADException,
                          RemoteException
Set the ShowMarker property.

Parameters:
value - The new value for ShowMarker
Throws:
RemoteException - On badness
VisADException - On badness

getShowMarker

public boolean getShowMarker()
Get the ShowMarker property.

Returns:
The ShowMarker

setMarkerType

public void setMarkerType(String value)
                   throws VisADException,
                          RemoteException
Set the MarkerType property.

Parameters:
value - The new value for MarkerType
Throws:
RemoteException - On badness
VisADException - On badness

getMarkerType

public String getMarkerType()
Get the MarkerType property.

Returns:
The MarkerType

setMarkerScale

public void setMarkerScale(double value)
                    throws VisADException,
                           RemoteException
Set the MarkerScale property.

Parameters:
value - The new value for MarkerScale
Throws:
RemoteException - On badness
VisADException - On badness

getMarkerScale

public double getMarkerScale()
Get the MarkerScale property.

Returns:
The MarkerScale

setHtmlWidth

public void setHtmlWidth(int value)
Set the HtmlWidth property.

Parameters:
value - The new value for HtmlWidth

getHtmlWidth

public int getHtmlWidth()
Get the HtmlWidth property.

Returns:
The HtmlWidth