public class Util extends Object
Constructor and Description |
---|
Util() |
Modifier and Type | Method and Description |
---|---|
static void |
drawVerticalString(Graphics g,
String text,
Font font,
int x,
int y)
Draws a string vertically, turned 90 degrees counter-clockwise.
|
static int |
maxStringPixelWidth(String[] strings,
FontMetrics fm) |
static int |
stringPixelWidth(String text,
FontMetrics fm) |
public static void drawVerticalString(Graphics g, String text, Font font, int x, int y)
g
- the graphics context on which to drawtext
- the string to drawfont
- the font to usex
- the x coordinate where you want to place the baseline of the text.y
- the y coordinate where you want to place the first letter of the text.public static int maxStringPixelWidth(String[] strings, FontMetrics fm)
strings
- an array of strings whose pixels widths to comparefm
- FontMetrics object for the Component or Graphics.strings
array.public static int stringPixelWidth(String text, FontMetrics fm)
text
- the string whose pixel width is to be measuredfm
- FontMetrics object for the Component or Graphics.Copyright © 2003–2023 UBC Michael Smith Laboratories. All rights reserved.