|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.ui.drawing.Glyph
ucar.unidata.ui.drawing.RectangleGlyph
ucar.unidata.ui.symbol.MetSymbol
ucar.unidata.ui.symbol.TextSymbol
public class TextSymbol
A representation of a text MetSymbol.
| Field Summary | |
|---|---|
static String[] |
FONT_SIZES
Array of default font sizes used for incrementing/decrementing fonts. |
protected String |
numberFormatString
Format string for numbers. |
| Fields inherited from class ucar.unidata.ui.symbol.MetSymbol |
|---|
ATTR_PARAMID, canvas, propertiesDialog |
| Fields inherited from class ucar.unidata.ui.drawing.RectangleGlyph |
|---|
ATTR_RECTTYPE, bounds, CIRCLE, FCIRCLE, FRECTANGLE, FROUNDRECT, RECTANGLE, ROUNDRECT, TYPE_CIRCLE, TYPE_RECT, TYPE_RRECT |
| Fields inherited from class ucar.unidata.ui.drawing.Glyph |
|---|
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 Summary | |
|---|---|
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,
String param,
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,
String param,
String paramDesc)
Construct a TextSymbol at the position specified. |
|
TextSymbol(String param,
String paramDesc)
Construct a TextSymbol with the name specified. |
|
| Method Summary | |
|---|---|
void |
decrFontSize()
Decrease the font size by one step in the fontSizes array. |
void |
draw(Graphics2D g,
int x,
int y,
int width,
int height)
Draw this object to the graphics device. |
String |
format(double d)
Format a double values |
String |
format(float d)
Format a float |
String |
format(Real d)
Format a Real |
String |
formatNumber(double d)
Format a number using the format pattern set for this instance. |
int |
getCurrFontNo()
Get the current font number |
Font |
getFont()
Get the currently used font. |
static Font[] |
getFontList()
Get a list of fonts to use with this object. |
FontMetrics |
getFontMetrics()
Get the metrics of the current font. |
int |
getFontSize()
Get the current font size. |
String |
getLabel()
Get the label to show the user what I am in the properties |
String |
getNumberFormatString()
Get the format pattern for numeric values. |
Object |
getParamValue(int index)
Get the parameter value for the index specified. |
String |
getValue()
Get the string representation for the value of this object. |
protected String |
getValueString()
Get the value string |
void |
incrFontSize()
Increase the font size by one step in the FONT_SIZES array. |
protected 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(Font font)
Set the font to use when displaying this symbol. |
void |
setFontSize(int size)
Set the font size. |
void |
setNumberFormatString(String s)
Set the format pattern for numeric values. |
void |
setParamValue(int index,
Object v)
Set the parameter value for the index specified. |
void |
setValue(double d)
Set the value for this object. |
void |
setValue(String s)
Set the value for this object. |
String |
toString()
String representation of this object. |
| Methods inherited from class ucar.unidata.ui.drawing.RectangleGlyph |
|---|
distance, getBottom, getBounds, getEqualSides, getLeft, getPoint, getPositionAttr, getStretchPoint, getSymetricReshape, getTop, moveBy, moveTo, setPoints, setSize, setType, stretchTo |
| Methods inherited from class ucar.unidata.ui.drawing.Glyph |
|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected String numberFormatString
public static final String[] FONT_SIZES
incrFontSize(),
decrFontSize()| Constructor Detail |
|---|
public TextSymbol()
public TextSymbol(int x,
int y)
x - x position on the canvasy - y position on the canvas
public TextSymbol(DisplayCanvas canvas,
int x,
int y)
canvas - canvas to draw on.x - x position on the canvasy - y position on the canvas
public TextSymbol(String param,
String paramDesc)
param - parameter to displayparamDesc - description of the parameter (i.e., long name)
public TextSymbol(int x,
int y,
String param,
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,
String param,
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)| Method Detail |
|---|
public String getLabel()
getLabel in class MetSymbolpublic void setFont(Font font)
font - font to use.public Font getFont()
nullpublic void incrFontSize()
public void decrFontSize()
public static Font[] getFontList()
public void setCurrFontNo(int index)
index - index into the FONT_SIZES arraypublic int getCurrFontNo()
FONT_SIZES array.public FontMetrics getFontMetrics()
public void setFontSize(int size)
size - point size of font.public int getFontSize()
protected String getValueString()
public String getNumberFormatString()
DecimalFormatpublic void setNumberFormatString(String s)
s - formatting pattern string.DecimalFormatpublic String formatNumber(double d)
d - double to format
setNumberFormatString(String)public String format(Real d)
d - the Real
public String format(double d)
d - the double
public String format(float d)
d - float
public String getValue()
public void setValue(double d)
d - valuepublic void setValue(String s)
s - String representation of the value for this object.public Object getParamValue(int index)
getParamValue in class MetSymbolindex - index of the parameter (ignored for this instance)
public void setParamValue(int index,
Object v)
setParamValue in class MetSymbolindex - index of the parameter (ignored for this instance)v - Object that this should represent
public void draw(Graphics2D g,
int x,
int y,
int width,
int height)
draw in class MetSymbolg - Graphics objectx - x position of the objecty - y position of the objectwidth - width to drawheight - height to drawpublic String toString()
toString in class MetSymbolprotected Font makeDefaultFont()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||