smile.plot
Class Label
- java.lang.Object
-
- smile.plot.Shape
-
- smile.plot.Label
-
public class Label extends Shape
Label is a single line text.
-
-
Constructor Summary
Constructors Constructor and Description Label(double... coord)Constructor.Label(java.lang.String text, double[] coord)Constructor.Label(java.lang.String text, double rotation, double[] coord)Constructor.Label(java.lang.String text, double horizontalReference, double verticalReference, double[] coord)Constructor.Label(java.lang.String text, double horizontalReference, double verticalReference, double rotation, double[] coord)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static java.lang.StringcoordToString(double... c)Convert coordinate to a string.double[]getCoordinate()Returns the coordinates of label.java.awt.FontgetFont()Returns the font of label.doublegetRotation()Returns the rotation angel of label.java.lang.StringgetText()Returns the text of label.voidpaint(Graphics g)Draw the component with given graphics object.LabelsetCoordinate(double... coord)Set the coordinate of label.LabelsetFont(java.awt.Font font)Set the font of label.LabelsetRotation(double angle)Set the rotation angel of label.LabelsetText(java.lang.String text)Set the text of label.
-
-
-
Constructor Detail
-
Label
public Label(java.lang.String text, double[] coord)Constructor.
-
Label
public Label(java.lang.String text, double rotation, double[] coord)Constructor.
-
Label
public Label(java.lang.String text, double horizontalReference, double verticalReference, double[] coord)Constructor.
-
Label
public Label(java.lang.String text, double horizontalReference, double verticalReference, double rotation, double[] coord)Constructor. The reference position of coordinates respected to dimension of text. (0.5, 0.5) is center, (0, 0) is lower left, (0, 1) is upper left, etc.
-
Label
public Label(double... coord)
Constructor. Use coordinates as text.
-
-
Method Detail
-
setText
public Label setText(java.lang.String text)
Set the text of label.
-
getText
public java.lang.String getText()
Returns the text of label.
-
setCoordinate
public Label setCoordinate(double... coord)
Set the coordinate of label.
-
getCoordinate
public double[] getCoordinate()
Returns the coordinates of label.
-
setRotation
public Label setRotation(double angle)
Set the rotation angel of label.
-
getRotation
public double getRotation()
Returns the rotation angel of label.
-
setFont
public Label setFont(java.awt.Font font)
Set the font of label.
-
getFont
public java.awt.Font getFont()
Returns the font of label.
-
paint
public void paint(Graphics g)
Description copied from class:ShapeDraw the component with given graphics object.
-
coordToString
public static java.lang.String coordToString(double... c)
Convert coordinate to a string.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG