| Overview | Package | Class | Tree | Index | Help | NetCharts Pro (Applets) 7.0 | ||
| PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||
java.lang.Object | +--netcharts.graphics.NFLabel
Within an HTML file, the following parameters (as supported by NFParam) can be used to specify the attributes of a label:
Color - Color of text. See NFColor for values.
"FontName" - Font name for label.
FontSize - Numeric font size
Angle - Numeric angle of rotation (in degrees). For non-zero angles, the label will be rotated counter-clockwise.
| Field Summary | |
| static int | CENTER
Multi-line align center |
| static int | LEFT
Multi-line align left |
| static int | RIGHT
Multi-line align right |
| Constructor Summary | |
| NFLabel()
Create a new label using all defaults. | |
| NFLabel(java.awt.Component comp,
java.awt.Graphics g,
java.lang.String lbl,
java.awt.Font font,
java.awt.Color color,
int x,
int y,
double angle,
NFRegion region)
Create a new label with the given font and color, centered at the given location. | |
| NFLabel(java.awt.Component comp,
java.awt.Graphics g,
java.lang.String lbl,
int x,
int y)
Create a new label centered at (x, y), using the default font (TimesRoman-14), color (BLACK) and region (NONE). | |
| NFLabel(NFLabel label)
Create a new label from the attributes of the given label. | |
| Method Summary | |
| void | draw()
Draw the label using all current attributes. |
| void | draw(java.applet.Applet app,
java.awt.Graphics g)
Draw the label using all current attributes, in the given graphics context. |
| void | draw(java.awt.Component comp,
java.awt.Graphics g)
Draw the label using all current attributes, in the given graphics context. |
| void | draw(java.awt.Component comp,
java.awt.Graphics g,
NFLabel top,
NFLabel bottom)
Draw the label using all current attributes, in the given graphics context. |
| void | draw(java.awt.Component comp,
java.awt.Graphics g,
java.lang.String lbl,
java.awt.Font font,
java.awt.Color color,
double x,
double y,
int justify,
double angle,
NFRegion region)
Draw the given label, in the given graphics context, using the given font and color, centered at (x, y), on top of the given region. |
| void | draw(double x,
double y)
Draw the current label, centered on (x, y) using the current attributes. |
| void | draw(java.awt.Graphics g)
Draw the label using all current attributes, in the given graphics context. |
| void | draw(java.awt.Graphics g,
double x,
double y)
Draw the current label, centered on (x, y) using the current attributes, in the given graphics context. |
| void | draw(java.awt.Graphics g,
double x,
double y,
java.awt.Font font,
java.awt.Color color)
Draw the given label, centered on (x, y) using the current attributes. |
| void | draw(java.awt.Graphics g,
double x,
double y,
java.lang.String lbl)
Draw the current label, centered on (x, y) using the current attributes, in the given graphics context. |
| void | draw(NFRegion region)
Draw the current label with the given underlying region. |
| void | draw(java.lang.String lbl)
Draw the given label, using the current attributes. |
| void | draw(java.lang.String lbl,
double x,
double y)
Draw the given label, centered on (x, y) using the current attributes. |
| void | draw(java.lang.String lbl,
double x,
double y,
int justify)
Draw the given label, centered on (x, y) using the current attributes. |
| NFActiveLabel | getActiveLabel()
Get the ActiveLabel displayed over this label |
| java.awt.Dimension | getBounds(java.awt.Graphics g)
Returns a bounding box for the current label, including any associated region and any angle of rotation. |
| java.awt.Dimension | getBounds(java.awt.Graphics g,
java.awt.Dimension d,
NFRegionBorder b)
Returns a bounding box for the current label, including any associated region and any angle of rotation. |
| java.awt.geom.Rectangle2D | getClipRectangle()
Returns the current clip rectangle setting |
| java.awt.Color | getColor()
Get the color. |
| int | getDecoration()
Get the text decoration. |
| boolean | getExtendedWidth()
Get the extend label width flag. |
| int | getExternalJustify()
Get the external label justification. |
| java.awt.Font | getFont()
Get the font. |
| int | getGap()
Returns the current pixel spacing between lines and around the edge of the label. |
| int | getJustify()
Get the internal label justification. |
| java.lang.String | getLabel()
Get the label string. |
| java.awt.geom.Rectangle2D | getParentBounds()
Returns the bounding box for the label to be displayed in. |
| NFRegion | getRegion()
Get the underlying region. |
| double | getX()
Get the center position for the string. |
| double | getY()
Get the center position for the string. |
| static void | loadParams(NFLabel label,
java.util.Vector v,
int offset)
Load the attributes from the given vector into the given label object, starting at the given offset. |
| static void | loadParams(NFLabel label,
java.util.Vector v,
int offset,
boolean justify)
Load the attributes from the given vector into the given label object, starting at the given offset. |
| static void | loadParams(NFLabel label,
java.util.Vector v,
int offset,
boolean justify,
boolean externalJustify)
Load the attributes from the given vector into the given label object, starting at the given offset. |
| static void | loadParams(NFLabel label,
java.util.Vector v,
int offset,
boolean angle,
boolean justify,
boolean externalJustify)
Load the attributes from the given vector into the given label object, starting at the given offset. |
| static void | loadParams(NFLabel label,
java.util.Vector v,
int offset,
boolean angle,
boolean justify,
boolean externalJustify,
boolean extend)
Load the attributes from the given vector into the given label object, starting at the given offset. |
| static NFLabel | loadParams(NFParam p,
java.lang.Object val)
Build a label using the value vector provided by the parser. |
| static NFLabel | loadParams(NFParam p,
java.lang.Object val,
boolean justify)
Build a label using the value vector provided by the parser. |
| static NFLabel | loadParams(NFParam p,
java.lang.Object val,
int offset)
Build a label object, using the attributes stored in the given vector, starting at the given offset. |
| static NFLabel | loadParams(NFParam p,
java.lang.Object val,
int offset,
boolean justify)
Build a label object, using the attributes stored in the given vector, starting at the given offset. |
| static NFLabel | loadParams(NFParam p,
java.lang.Object val,
int offset,
boolean justify,
boolean externalJustify)
Build a label object, using the attributes stored in the given vector, starting at the given offset. |
| static NFLabel | loadParams(NFParam p,
java.lang.Object val,
int offset,
boolean angle,
boolean justify,
boolean externalJustify)
Build a label object, using the attributes stored in the given vector, starting at the given offset. |
| static NFLabel | loadParams(NFParam p,
java.lang.Object val,
int offset,
boolean angle,
boolean justify,
boolean externalJustify,
boolean extend)
Build a label object, using the attributes stored in the given vector, starting at the given offset. |
| void | loadParams(NFParam p,
java.lang.String name)
Load the parameter with the given name into the current label |
| void | loadParams(java.util.Vector v)
Load the attributes from the given vector into the current label object |
| void | setActiveLabel(NFActiveLabel l)
Set the ActiveLabel displayed over this label |
| void | setAngle(double angle)
Set the label rotation. |
| void | setBackgroundPos(java.awt.Rectangle rect,
int orientation)
Set the background position for the string. |
| void | setClipRectangle(java.awt.geom.Rectangle2D r)
Sets a bounding box for the label to be displayed in. |
| void | setColor(java.awt.Color color)
Set the color. |
| void | setComponent(java.awt.Component comp)
Set the component to use for label rotation. |
| void | setDecoration(int decoration)
Set the text decoration. |
| void | setExtendedWidth(boolean eWidth)
Set the label background width extension flag. |
| void | setExternalJustify(int ejustify)
Set the external label justification. |
| void | setFont(java.awt.Font font)
Set the font. |
| void | setGap(int gap)
Sets the pixel spacing between lines and around the edge of the label. |
| void | setGraphics(java.awt.Graphics g)
Set the graphics context. |
| void | setJustify(int justify)
Set the internal label justification. |
| void | setLabel(java.lang.String lbl)
Set the label string. |
| void | setParentBounds(java.awt.geom.Rectangle2D r)
Sets a bounding box for the label to be displayed in. |
| void | setPos(double x,
double y)
Set the center position for the string. |
| void | setRegion(NFRegion region)
Set the underlying region. |
| void | setScale(double scale)
Sets the scale factor to be used when drawing labels. |
| Field Detail |
public static final int LEFT
public static final int CENTER
public static final int RIGHT
| Constructor Detail |
public NFLabel(java.awt.Component comp,
java.awt.Graphics g,
java.lang.String lbl,
java.awt.Font font,
java.awt.Color color,
int x,
int y,
double angle,
NFRegion region)
comp
- The component to use for Label rotation.
g
- The Graphics to draw on.
lbl
- The text of the label.
font
- The font of the label.
color
- The font color of the label.
x
- The X coordinate of the label.
y
- The Y coordinate of the label.
angle
- The angle to rotate the label by.
region
- The region to use as the label's background.
public NFLabel(java.awt.Component comp,
java.awt.Graphics g,
java.lang.String lbl,
int x,
int y)
comp
- The component to use for Label rotation.
g
- The Graphics to draw on.
lbl
- The text of the label.
x
- The X coordinate of the label.
y
- The Y coordinate of the label.public NFLabel()
public NFLabel(NFLabel label)
label
- The label to copy attributes from.| Method Detail |
public void setComponent(java.awt.Component comp)
comp
- The component.public void setGraphics(java.awt.Graphics g)
g
- The Graphics.public void setJustify(int justify)
justify
- LEFT, RIGHT, or CENTER.public int getJustify()
public void setExtendedWidth(boolean eWidth)
ON,
- OFF.public void setExternalJustify(int ejustify)
justify
- LEFT, RIGHT, CENTER, BOTTOM or TOP.public boolean getExtendedWidth()
public int getExternalJustify()
public void setLabel(java.lang.String lbl)
lbl
- The text of the label.public void setAngle(double angle)
angle
- The angle of rotation.public java.lang.String getLabel()
public void setScale(double scale)
scale
- The scale factor.public void setFont(java.awt.Font font)
font
- The font to set.public java.awt.Font getFont()
public void setColor(java.awt.Color color)
color
- The font color.public java.awt.Color getColor()
public void setDecoration(int decoration)
decoration
- An int with DECORATION constants or'ed together.public int getDecoration()
public void setBackgroundPos(java.awt.Rectangle rect,
int orientation)
rect
- The Background rect area.
orientation
- The position of the label (TOP/BOTTOM/LEFT/RIGHT).
public void setPos(double x,
double y)
x
- The X coordinate.
y
- The Y coordinate.public double getX()
public double getY()
public void setRegion(NFRegion region)
region
- The background region.public NFRegion getRegion()
public void setGap(int gap)
gap
- The gap to use.public int getGap()
public java.awt.geom.Rectangle2D getParentBounds()
public void setParentBounds(java.awt.geom.Rectangle2D r)
r
- The bounding box.public void setClipRectangle(java.awt.geom.Rectangle2D r)
r
- The clipping box.public java.awt.geom.Rectangle2D getClipRectangle()
public java.awt.Dimension getBounds(java.awt.Graphics g)
g
- The Graphics to use to retreive font metrics information.
public java.awt.Dimension getBounds(java.awt.Graphics g,
java.awt.Dimension d,
NFRegionBorder b)
The values are returned in the given object, instead of creating a new object. If <d> is null, then a new object is created anyway.
If <b> is non-null, it will be used as temp storage while determining the label bounds, instead of creating a new object.
g
- The Graphics to use to retreive font metrics information.
d
- The Dimension to store the result in.
b
- The border surrounding the background region.public void draw()
public void draw(java.awt.Graphics g)
g
- The Graphics to draw on.
public void draw(java.awt.Component comp,
java.awt.Graphics g,
NFLabel top,
NFLabel bottom)
comp
- The Component to use for label rotation.
g
- The Graphics to draw on.
public void draw(java.awt.Component comp,
java.awt.Graphics g)
comp
- The Component to use for label rotation.
g
- The Graphics to draw on.
public void draw(java.applet.Applet app,
java.awt.Graphics g)
app
- Applet used for label rotation.
g
- The Graphics to draw on.public void draw(java.lang.String lbl)
lbl
- The text of the label.
public void draw(java.lang.String lbl,
double x,
double y)
lbl
- The text of the label.
x
- The X coordinate of the label.
y
- The Y coordinate of the label.
public void draw(java.awt.Graphics g,
double x,
double y,
java.awt.Font font,
java.awt.Color color)
g
- The Graphics to draw on.
x
- The X coordinate of the label.
y
- The Y coordinate of the label.
font
- The font of the label.
color
- The color of the label text.
public void draw(java.lang.String lbl,
double x,
double y,
int justify)
lbl
- The text of the label.
x
- The X coordinate of the label.
y
- The Y coordinate of the label.
justify
- The justification of the label.
public void draw(double x,
double y)
x
- The X coordinate of the label.
y
- The Y coordinate of the label.
public void draw(java.awt.Graphics g,
double x,
double y)
g
- The Graphics to draw on.
x
- The X coordinate of the label.
y
- The Y coordinate of the label.
public void draw(java.awt.Graphics g,
double x,
double y,
java.lang.String lbl)
g
- The Graphics to draw on.
lbl
- The text of the label.
x
- The X coordinate of the label.
y
- The Y coordinate of the label.public void draw(NFRegion region)
region
- The background region of the label.
public void draw(java.awt.Component comp,
java.awt.Graphics g,
java.lang.String lbl,
java.awt.Font font,
java.awt.Color color,
double x,
double y,
int justify,
double angle,
NFRegion region)
comp
- The Component to use for label rotation.
g
- The Graphics to draw on.
lbl
- The text of the label.
font
- The font of the label.
color
- The color of the label text.
x
- The X coordinate of the label.
y
- The Y coordinate of the label.
angle
- The angle to rotate the label.
region
- The background region of the label.
public static NFLabel loadParams(NFParam p,
java.lang.Object val)
p
- The NFParam object to load parameters from.
val
- The value of the parameter to load.
public static NFLabel loadParams(NFParam p,
java.lang.Object val,
boolean justify)
p
- The NFParam object to load parameters from.
val
- The value of the parameter to load.
justify
- Whether to try to parse a justification.
public static NFLabel loadParams(NFParam p,
java.lang.Object val,
int offset)
p
- The NFParam object to load parameters from.
val
- The value of the parameter to load.
offset
- The offset of the label parameters in the given value.
public static NFLabel loadParams(NFParam p,
java.lang.Object val,
int offset,
boolean justify)
p
- The NFParam object to load parameters from.
val
- The value of the parameter to load.
offset
- The offset of the label parameters in the given value.
justify
- Whether to try to parse a justification.
public static NFLabel loadParams(NFParam p,
java.lang.Object val,
int offset,
boolean justify,
boolean externalJustify)
p
- The NFParam object to load parameters from.
val
- The value of the parameter to load.
offset
- The offset of the label parameters in the given value.
justify
- Whether to try to parse a justification.
externalJustify
- Whether to try to parse an external justification.
public static NFLabel loadParams(NFParam p,
java.lang.Object val,
int offset,
boolean angle,
boolean justify,
boolean externalJustify)
p
- The NFParam object to load parameters from.
val
- The value of the parameter to load.
offset
- The offset of the label parameters in the given value.
angle
- Whether to try to parse the angle
justify
- Whether to try to parse a justification.
externalJustify
- Whether to try to parse an external justification.
public static NFLabel loadParams(NFParam p,
java.lang.Object val,
int offset,
boolean angle,
boolean justify,
boolean externalJustify,
boolean extend)
p
- The NFParam object to load parameters from.
val
- The value of the parameter to load.
offset
- The offset of the label parameters in the given value.
angle
- Whether to try to parse the angle
justify
- Whether to try to parse a justification.
externalJustify
- Whether to try to parse an external justification.
extend
- Whether to try to parse an extend.
public static void loadParams(NFLabel label,
java.util.Vector v,
int offset)
label
- The NFLabel to modify.
v
- The value of the parameter to load.
offset
- The offset of the label parameters in the given value.
public static void loadParams(NFLabel label,
java.util.Vector v,
int offset,
boolean justify)
label
- The NFLabel to modify.
v
- The value of the parameter to load.
offset
- The offset of the label parameters in the given value.
justify
- Whether to try to parse a justification.
public static void loadParams(NFLabel label,
java.util.Vector v,
int offset,
boolean justify,
boolean externalJustify)
label
- The NFLabel to modify.
v
- The value of the parameter to load.
offset
- The offset of the label parameters in the given value.
justify
- Whether to try to parse a justification.
externalJustify
- Whether to try to parse an external justification.
public static void loadParams(NFLabel label,
java.util.Vector v,
int offset,
boolean angle,
boolean justify,
boolean externalJustify)
label
- The NFLabel to modify.
v
- The value of the parameter to load.
offset
- The offset of the label parameters in the given value.
angle
- Whether to try to parse the angle
justify
- Whether to try to parse a justification.
externalJustify
- Whether to try to parse an external justification.
public static void loadParams(NFLabel label,
java.util.Vector v,
int offset,
boolean angle,
boolean justify,
boolean externalJustify,
boolean extend)
label
- The NFLabel to modify.
v
- The value of the parameter to load.
offset
- The offset of the label parameters in the given value.
angle
- Whether to try to parse the angle
justify
- Whether to try to parse a justification.
externalJustify
- Whether to try to parse an external justification.
extend
- Whether to try to parse an extend.
public void loadParams(NFParam p,
java.lang.String name)
throws java.lang.Exception
p
- The NFParam object to load parameters from.
name
- The parameter name.public void loadParams(java.util.Vector v)
v
- The value of the parameter to load.public void setActiveLabel(NFActiveLabel l)
l
- The ActiveLabel to set.public NFActiveLabel getActiveLabel()
| Overview | Package | Class | Tree | Index | Help | |||
| PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||
| Visual Mining, Inc. | Copyright © Visual Mining, Inc. 1996 - 2010 |
Last Modified: Jun 29, 2010 |