public class BounceGraphicsUtils extends Object
Constructor and Description |
---|
BounceGraphicsUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
drawLine(Graphics g,
FontMetrics fm,
Rectangle rect,
String text,
int hAlign,
int y,
int mnemonic)
Draws one of the lines on a multiline label/button.
|
static String[] |
layoutMultilineCompoundLabel(JComponent c,
FontMetrics fm,
String text,
Icon icon,
int verticalAlignment,
int horizontalAlignment,
int verticalTextPosition,
int horizontalTextPosition,
Rectangle viewR,
Rectangle iconR,
Rectangle textR,
int textIconGap,
int minLines,
int maxLines)
Lays out a multiline label/button with icon.
|
public static int drawLine(Graphics g, FontMetrics fm, Rectangle rect, String text, int hAlign, int y, int mnemonic)
g
- the Graphics context of the component.fm
- the font metrics.rect
- the rectangle that the text needs to be painted in.text
- the text that needs to be drawn.hAlign
- the horizontal alignment.y
- the y position of the text.mnemonic
- the mnemonic.public static String[] layoutMultilineCompoundLabel(JComponent c, FontMetrics fm, String text, Icon icon, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, Rectangle viewR, Rectangle iconR, Rectangle textR, int textIconGap, int minLines, int maxLines)
c
- the label component.fm
- the font metrics.text
- the label text.icon
- the label icon.verticalAlignment
- the vertical alignment.horizontalAlignment
- the horizontal alignment.verticalTextPosition
- the vertical text position.horizontalTextPosition
- the horizontal text position.viewR
- the viewing rectangle.iconR
- the icon rectangle.textR
- the text rectangle.textIconGap
- the gap between the text and the icon.minLines
- the minimum amount of lines to display.maxLines
- the maximum amount of lines to display.Copyright © 2002-2013 Edwin Dankert. All Rights Reserved.