public static class DrawableObject.Label extends DrawableObject
DrawableObject.Image, DrawableObject.Label, DrawableObject.Shape, DrawableObject.TickLabel, DrawableObject.Transform
m_transform
Constructor and Description |
---|
DrawableObject.Label(int compType,
java.awt.Graphics2D g,
java.lang.String text,
java.awt.Font font,
java.awt.Color fontColor,
java.awt.Rectangle bounds,
java.lang.String labelType,
java.awt.geom.AffineTransform transform)
Constructor for creating an DrawableObject instance of Label
|
DrawableObject.Label(int compType,
java.awt.Graphics2D g,
java.lang.String text,
java.awt.Font font,
java.awt.Color fontColor,
java.awt.Rectangle bounds,
java.lang.String labelType,
java.awt.geom.AffineTransform transform,
double angle)
Constructor for creating an DrawableObject instance of Label
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(double x,
double y,
boolean useTruncated)
Perform an inclusion test on the object based on the given point
|
double |
getAngle()
Gets the text rotation angle for this label.
|
java.awt.Rectangle |
getBounds()
Gets the bounding rectangle for this label.
|
java.awt.Font |
getFont()
Gets the font for this label.
|
java.awt.Color |
getFontColor()
Gets the font color for this label.
|
java.awt.Graphics2D |
getGraphics()
Gets the graphics object for this label.
|
java.lang.String |
getLabelType()
Gets the type of this tick label.
|
java.lang.String |
getText()
Gets the text for this label.
|
java.awt.Rectangle |
getTruncatedBounds() |
java.lang.String |
getTruncatedText() |
void |
setTruncatedBounds(java.awt.Rectangle bounds) |
void |
setTruncatedText(java.lang.String text) |
getAffineTransform, getComponentIndex, getComponentType, getLabelDimensions, getLabelObject, getTickLabelObject, isSelected, isVisible, render, setSelected, setVisible
public DrawableObject.Label(int compType, java.awt.Graphics2D g, java.lang.String text, java.awt.Font font, java.awt.Color fontColor, java.awt.Rectangle bounds, java.lang.String labelType, java.awt.geom.AffineTransform transform)
transform
- Instance of AffineTransform
to apply
to this shape before rendering itlabelType
- Type of label; can be TOP_LABEL, BOTTOM_LABEL,
METRIC_LABEL_POSITION, ELEMENTA_TOPLABEL,
ELEMENTA_BOTTOMLABEL, ELEMENTB_TOPLABEL,
ELEMENTB_BOTTOMLABEL, INTERSECTIONAB_TOPLABEL,
and INTERSECTIONAB_BOTTOMLABEL from
GaugeAttributes
classbounds
- Rectangle in which this label should be drawnfontColor
- Color to use on drawing the text of this labelfont
- Font to use for this labeltext
- String value for this labelg
- Graphics2D instance to use for setup of this labelcompType
- Type of component to which this object belongs;
valid values are constants in the
GaugeConstants
class beginning with
ID_
public DrawableObject.Label(int compType, java.awt.Graphics2D g, java.lang.String text, java.awt.Font font, java.awt.Color fontColor, java.awt.Rectangle bounds, java.lang.String labelType, java.awt.geom.AffineTransform transform, double angle)
transform
- Instance of AffineTransform
to apply
to this shape before rendering itlabelType
- Type of label; can be TOP_LABEL, BOTTOM_LABEL,
METRIC_LABEL_POSITION, ELEMENTA_TOPLABEL,
ELEMENTA_BOTTOMLABEL, ELEMENTB_TOPLABEL,
ELEMENTB_BOTTOMLABEL, INTERSECTIONAB_TOPLABEL,
and INTERSECTIONAB_BOTTOMLABEL from
GaugeAttributes
classbounds
- Rectangle in which this label should be drawnfontColor
- Color to use on drawing the text of this labelfont
- Font to use for this labeltext
- String value for this labelg
- Graphics2D instance to use for setup of this labelcompType
- Type of component to which this object belongs;
valid values are constants in the
GaugeConstants
class beginning with
ID_
public boolean contains(double x, double y, boolean useTruncated)
contains
in class DrawableObject
useTruncated
- True
if the truncated rectangle
should be used, False
otherwisey
- Integer representing the Y location of the pointx
- Integer representing the X location of the pointTrue
if the point is contained within
this object, False
otherwisepublic java.awt.Graphics2D getGraphics()
Graphics2D
instance.Graphics2D
public java.lang.String getText()
String
instance.public java.awt.Font getFont()
Font
instance.Font
public java.awt.Color getFontColor()
Color
instance.Color
public double getAngle()
public java.awt.Rectangle getBounds()
Rectangle
instance.Rectangle
public java.lang.String getLabelType()
public java.lang.String getTruncatedText()
String
instance.public void setTruncatedText(java.lang.String text)
public java.awt.Rectangle getTruncatedBounds()
Rectangle
instance.Rectangle
public void setTruncatedBounds(java.awt.Rectangle bounds)