Get Bounce at SourceForge.net. Fast secure and Free Open Source software downloads

org.bounce.plaf
Class BounceGraphicsUtils

java.lang.Object
  extended by org.bounce.plaf.BounceGraphicsUtils

public class BounceGraphicsUtils
extends java.lang.Object

The Graphic Utils for the Bounce package.

Version:
$Revision: 1.4 $, $Date: 2008/01/28 21:28:37 $
Author:
Edwin Dankert

Constructor Summary
BounceGraphicsUtils()
           
 
Method Summary
static int drawLine(java.awt.Graphics g, java.awt.FontMetrics fm, java.awt.Rectangle rect, java.lang.String text, int hAlign, int y, int mnemonic)
          Draws one of the lines on a multiline label/button.
static java.lang.String[] layoutMultilineCompoundLabel(javax.swing.JComponent c, java.awt.FontMetrics fm, java.lang.String text, javax.swing.Icon icon, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, java.awt.Rectangle viewR, java.awt.Rectangle iconR, java.awt.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
 

Constructor Detail

BounceGraphicsUtils

public BounceGraphicsUtils()
Method Detail

drawLine

public static int drawLine(java.awt.Graphics g,
                           java.awt.FontMetrics fm,
                           java.awt.Rectangle rect,
                           java.lang.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 java.lang.String[] layoutMultilineCompoundLabel(javax.swing.JComponent c,
                                                              java.awt.FontMetrics fm,
                                                              java.lang.String text,
                                                              javax.swing.Icon icon,
                                                              int verticalAlignment,
                                                              int horizontalAlignment,
                                                              int verticalTextPosition,
                                                              int horizontalTextPosition,
                                                              java.awt.Rectangle viewR,
                                                              java.awt.Rectangle iconR,
                                                              java.awt.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.

Get Bounce at SourceForge.net. Fast secure and Free Open Source software downloads

Copyright 2002-2002-2009 Edwin Dankert. All Rights Reserved.