Package smile.plot.swing
Class Label
java.lang.Object
smile.plot.swing.Shape
smile.plot.swing.Label
Label is a single line text.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Label
of
(double... coordinates) Creates a black label with coordinates as text.static Label
Creates a black label centered at the coordinates.static Label
of
(String text, double[] coordinates, double horizontalReference, double verticalReference, double rotation) Creates a black label with system default font.void
Draws the shape.
-
Constructor Details
-
Label
public Label(String text, double[] coordinates, double horizontalReference, double verticalReference, double rotation, Font font, Color color) Constructor.- Parameters:
text
- the label text.coordinates
- the label location.horizontalReference
- the horizontal reference position of coordinates respected to dimension of text.verticalReference
- the vertical reference position of coordinates respected to dimension of text.rotation
- the rotation angel of text.font
- the label font.color
- the label color.
-
-
Method Details
-
paint
Description copied from class:Shape
Draws the shape. -
of
Creates a black label centered at the coordinates.- Parameters:
text
- the label text.coordinates
- the label coordinates.- Returns:
- the label.
-
of
Creates a black label with coordinates as text.- Parameters:
coordinates
- the label coordinates.- Returns:
- the label.
-
of
public static Label of(String text, double[] coordinates, double horizontalReference, double verticalReference, double rotation) Creates a black label with system default font.- Parameters:
text
- the label text.coordinates
- the label coordinates.horizontalReference
- the horizontal reference position of coordinates respected to dimension of text.verticalReference
- the vertical reference position of coordinates respected to dimension of text.rotation
- the rotation angel of text.- Returns:
- the label.
-