org.bounce.plaf
Class BounceGraphicsUtils
java.lang.Object
org.bounce.plaf.BounceGraphicsUtils
public class BounceGraphicsUtils
- extends Object
The Graphic Utils for the Bounce package.
- Version:
- $Revision: 1.4 $, $Date: 2008/01/28 21:28:37 $
- Author:
- Edwin Dankert
Method Summary |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BounceGraphicsUtils
public BounceGraphicsUtils()
drawLine
public 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.
- Parameters:
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.
- Returns:
- the x starting position of the text
layoutMultilineCompoundLabel
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)
- Lays out a multiline label/button with icon.
- Parameters:
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.
- Returns:
- the newly layed out string.
Copyright © 2002-2011 Edwin Dankert. All Rights Reserved.