public class TextSymbol extends MetSymbol
Modifier and Type | Field and Description |
---|---|
static java.lang.String[] |
FONT_SIZES
Array of default font sizes used for incrementing/decrementing
fonts.
|
protected java.lang.String |
numberFormatString
Format string for numbers.
|
ATTR_PARAMID, canvas, propertiesDialog
ATTR_RECTTYPE, bounds, CIRCLE, FCIRCLE, FRECTANGLE, FROUNDRECT, RECTANGLE, ROUNDRECT, TYPE_CIRCLE, TYPE_RECT, TYPE_RRECT
ATTR_BGCOLOR, ATTR_CHILDREN, ATTR_CLASS, ATTR_COLOR, ATTR_FILL, ATTR_HEIGHT, ATTR_IMAGE, ATTR_LINEWIDTH, ATTR_PARENT, ATTR_PTS, ATTR_STRETCHY, ATTR_TEXT, ATTR_TYPE, ATTR_WIDTH, baseline, H_SEL_WIDTH, highlightColor, idToGlyph, MIN_DISTANCE_TO_STRETCH, PT_CENTER, PT_H_LEFT, PT_H_MIDDLE, PT_H_RIGHT, PT_LL, PT_LM, PT_LR, PT_ML, PT_MM, PT_MR, PT_P1, PT_P2, PT_PREFIX, PT_UL, PT_UM, PT_UR, PT_V_LOWER, PT_V_MIDDLE, PT_V_UPPER, RECTPOINTNAMES, RECTPOINTS, SEL_WIDTH, TAG_GLYPH, underline, url
Constructor and Description |
---|
TextSymbol()
Default constructor.
|
TextSymbol(DisplayCanvas canvas,
int x,
int y)
Construct a TextSymbol to use on the canvas specified at the
position specified.
|
TextSymbol(DisplayCanvas canvas,
int x,
int y,
java.lang.String param,
java.lang.String paramDesc)
Construct a TextSymbol to use on the canvas specified at the
position specified.
|
TextSymbol(int x,
int y)
Construct a TextSymbol at the position specified.
|
TextSymbol(int x,
int y,
java.lang.String param,
java.lang.String paramDesc)
Construct a TextSymbol at the position specified.
|
TextSymbol(java.lang.String param,
java.lang.String paramDesc)
Construct a TextSymbol with the name specified.
|
Modifier and Type | Method and Description |
---|---|
void |
decrFontSize()
Decrease the font size by one step in the fontSizes array.
|
void |
draw(java.awt.Graphics2D g,
int x,
int y,
int width,
int height)
Draw this object to the graphics device.
|
java.lang.String |
format(double d)
Format a double values
|
java.lang.String |
format(float d)
Format a float
|
java.lang.String |
format(visad.Real d)
Format a Real
|
java.lang.String |
formatNumber(double d)
Format a number using the format pattern set for this instance.
|
int |
getCurrFontNo()
Get the current font number
|
java.awt.Font |
getFont()
Get the currently used font.
|
static java.awt.Font[] |
getFontList()
Get a list of fonts to use with this object.
|
java.awt.FontMetrics |
getFontMetrics()
Get the metrics of the current font.
|
int |
getFontSize()
Get the current font size.
|
java.lang.String |
getLabel()
Get the label to show the user what I am in the properties
|
java.lang.String |
getNumberFormatString()
Get the format pattern for numeric values.
|
java.lang.Object |
getParamValue(int index)
Get the parameter value for the index specified.
|
java.lang.String |
getValue()
Get the string representation for the value of this object.
|
protected java.lang.String |
getValueString()
Get the value string
|
void |
incrFontSize()
Increase the font size by one step in the FONT_SIZES array.
|
protected java.awt.Font |
makeDefaultFont()
Make a font from the size and using the default.
|
void |
setCurrFontNo(int index)
Set the index into the array of font sizes.
|
void |
setFont(java.awt.Font font)
Set the font to use when displaying this symbol.
|
void |
setFontSize(int size)
Set the font size.
|
void |
setNumberFormatString(java.lang.String s)
Set the format pattern for numeric values.
|
void |
setParamValue(int index,
java.lang.Object v)
Set the parameter value for the index specified.
|
void |
setValue(double d)
Set the value for this object.
|
void |
setValue(java.lang.String s)
Set the value for this object.
|
java.lang.String |
toString()
String representation of this object.
|
addPropertyTabs, applyProperties, clone, cloneMe, closePropertiesDialog, decrSize, doAlignmentMenu, doAllObs, draw, getActive, getBounds, getColorMappings, getColorParam, getColorTable, getColorTableParam, getColorTableRange, getColorTableUnit, getColorTableUnitName, getDesc, getDisplayUnit, getDisplayUnitName, getMissing, getName, getParam, getParamDescs, getParamIds, getRectPoint, getRotateInfo, getRotateXInfo, getRotateYInfo, getRotateZInfo, getScale, getScaleDataRange, getScaleParam, getScaleRange, getScaleUnit, getScaleUnitName, getXOffset, getYOffset, incrSize, initialize, initPropertyComponents, makeShapes, makeShapes, paint, paintSelection, rotateOnEarth, setActive, setAttr, setColorMappings, setColorParam, setColorTable, setColorTableParam, setColorTableRange, setColorTableUnitName, setDisplayUnitName, setMissing, setOffset, setParamDescs, setParamIds, setRectPoint, setRotateDataRange, setRotateParam, setRotateRange, setRotateUnitName, setRotateXInfo, setRotateYInfo, setRotateZInfo, setScale, setScaleDataRange, setScaleParam, setScaleRange, setScaleUnitName, setTheDisplayUnit, shouldBeColored, shouldOffsetShape, shouldScaleShape, shouldShowColorTableGui, shouldShowRotateGui, shouldShowScaleGui, showDisplayUnitInProperties, showPropertiesDialog
distance, getBottom, getBounds, getEqualSides, getLeft, getPoint, getPositionAttr, getStretchPoint, getSymetricReshape, getTop, moveBy, moveTo, setPoints, setSize, setType, stretchTo
boundsChanged, canStretch, distance, doRemove, flipY, getAttrs, getBackground, getBackground, getBeingCreated, getCreateCommand, getCursor, getFilled, getForeground, getId, getLineWidth, getMoveCommand, getPersistent, getPointOnRect, getPointOnRect, getRectPointName, getRepaintBounds, getStretchPoint, getStretchy, getXml, initDone, makeAttr, notifyChange, paintHighlight, paintSelectionPoints, pickable, processAttrs, setBackground, setBeingCreated, setFilled, setForeground, setId, setLineWidth, setParent, setStretchy, stretchTo, stretchTo, toRect, transformOutput, transformOutput, transformOutputX, transformOutputY
protected java.lang.String numberFormatString
public static final java.lang.String[] FONT_SIZES
incrFontSize()
,
decrFontSize()
public TextSymbol()
public TextSymbol(int x, int y)
x
- x position on the canvasy
- y position on the canvaspublic TextSymbol(DisplayCanvas canvas, int x, int y)
canvas
- canvas to draw on.x
- x position on the canvasy
- y position on the canvaspublic TextSymbol(java.lang.String param, java.lang.String paramDesc)
param
- parameter to displayparamDesc
- description of the parameter (i.e., long name)public TextSymbol(int x, int y, java.lang.String param, java.lang.String paramDesc)
x
- x position on the canvasy
- y position on the canvasparam
- parameter to displayparamDesc
- description of the parameter (i.e., long name)public TextSymbol(DisplayCanvas canvas, int x, int y, java.lang.String param, java.lang.String paramDesc)
canvas
- canvas to draw on.x
- x position on the canvasy
- y position on the canvasparam
- parameter to displayparamDesc
- description of the parameter (i.e., long name)public java.lang.String getLabel()
public void setFont(java.awt.Font font)
font
- font to use.public java.awt.Font getFont()
null
public void incrFontSize()
public void decrFontSize()
public static java.awt.Font[] getFontList()
public void setCurrFontNo(int index)
index
- index into the FONT_SIZES
arraypublic int getCurrFontNo()
FONT_SIZES
array.public java.awt.FontMetrics getFontMetrics()
public void setFontSize(int size)
size
- point size of font.public int getFontSize()
protected java.lang.String getValueString()
public java.lang.String getNumberFormatString()
DecimalFormat
public void setNumberFormatString(java.lang.String s)
s
- formatting pattern string.DecimalFormat
public java.lang.String formatNumber(double d)
d
- double to formatsetNumberFormatString(String)
public java.lang.String format(visad.Real d)
d
- the Realpublic java.lang.String format(double d)
d
- the doublepublic java.lang.String format(float d)
d
- floatpublic java.lang.String getValue()
public void setValue(double d)
d
- valuepublic void setValue(java.lang.String s)
s
- String representation of the value for this object.public java.lang.Object getParamValue(int index)
getParamValue
in class MetSymbol
index
- index of the parameter (ignored for this instance)public void setParamValue(int index, java.lang.Object v)
setParamValue
in class MetSymbol
index
- index of the parameter (ignored for this instance)v
- Object
that this should representpublic void draw(java.awt.Graphics2D g, int x, int y, int width, int height)
public java.lang.String toString()
protected java.awt.Font makeDefaultFont()