public class LayerUtilities
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.awt.geom.Rectangle2D |
drawString(java.awt.Graphics2D graphics,
java.lang.String text,
double x,
double y,
boolean centerHorizontal,
boolean centerVertical,
java.awt.Color backgroundColor) |
static java.awt.geom.Rectangle2D |
drawString(java.awt.Graphics2D graphics,
java.lang.String text,
double x,
double y,
boolean centerHorizontal,
boolean centerVertical,
java.awt.Color backgroundColor,
java.awt.Color textColor) |
static float |
pixelsToUnits(java.awt.Graphics2D g,
int pixels,
boolean horizontal)
Transforms a number of pixels into a corresponding time or frequency span.
|
static java.awt.geom.Point2D |
pixelsToUnits(java.awt.Graphics2D g,
int x,
int y)
Transforms pixels to time and frequency.
|
static float |
unitsToPixels(java.awt.Graphics2D g,
float units,
boolean horizontal) |
public static java.awt.geom.Point2D pixelsToUnits(java.awt.Graphics2D g, int x, int y)
g
- The current graphics, with a meaningful transform applied to it.x
- The x coordinate, in pixels.y
- The y coordinate, in pixels.public static float pixelsToUnits(java.awt.Graphics2D g, int pixels, boolean horizontal)
g
- The current graphics, with a meaningful transform applied to it.pixels
- The number of pixelshorizontal
- Is it the horizontal or vertical axis?public static float unitsToPixels(java.awt.Graphics2D g, float units, boolean horizontal)
public static java.awt.geom.Rectangle2D drawString(java.awt.Graphics2D graphics, java.lang.String text, double x, double y, boolean centerHorizontal, boolean centerVertical, java.awt.Color backgroundColor)
public static java.awt.geom.Rectangle2D drawString(java.awt.Graphics2D graphics, java.lang.String text, double x, double y, boolean centerHorizontal, boolean centerVertical, java.awt.Color backgroundColor, java.awt.Color textColor)