CoffeeTable.Grid
Class GridUtils

java.lang.Object
  |
  +--CoffeeTable.Grid.GridUtils

public class GridUtils
extends java.lang.Object

GridUtils is a utility class containing drawing routines used by the GridPanel. These static methods have been moved here from GridPanel class.

Version:
2.1.3 of October 1, 1999 Copyright © 1996-1999 3Magic

Constructor Summary
GridUtils()
           
 
Method Summary
static void drawJustString(java.awt.Graphics g, java.lang.String aString, java.awt.Rectangle aRect, int justification, java.awt.FontMetrics aFontMetrics, int baseLine)
          Draw the string using the specified justification style.
static void drawJustString(java.awt.Graphics g, java.lang.String aString, java.awt.Rectangle aRect, int justification, java.awt.FontMetrics aFontMetrics, int baseLine, boolean underline)
          Draw the string using the specified justification style.
static void drawString(java.awt.Graphics g, java.lang.String aString, java.awt.Rectangle aRect, int justification, java.awt.FontMetrics aFontMetrics)
          Draw a String in the specified rectangle.
static void drawString(java.awt.Graphics g, java.lang.String aString, java.awt.Rectangle aRect, int justification, java.awt.FontMetrics aFontMetrics, boolean underline)
          Draw a String in the specified rectangle.
static void drawText(java.awt.Graphics g, java.lang.String aString, java.awt.Rectangle aRect, int justification, java.awt.FontMetrics aFontMetrics)
          Draw the string using the specified justification style, with word wrapping.
static void drawText(java.awt.Graphics g, java.lang.String aString, java.awt.Rectangle aRect, int justification, java.awt.FontMetrics aFontMetrics, boolean underline)
          Draw the string using the specified justification style, with word wrapping.
static void drawTruncString(java.awt.Graphics g, java.lang.String aString, java.awt.Rectangle aRect, int justification, java.awt.FontMetrics aFontMetrics, int baseLine)
          Draw the string using the specified justification style, truncating the string if necessary.
static void drawTruncString(java.awt.Graphics g, java.lang.String aString, java.awt.Rectangle aRect, int justification, java.awt.FontMetrics aFontMetrics, int baseLine, boolean underline)
          Draw the string using the specified justification style, truncating the string if necessary.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridUtils

public GridUtils()
Method Detail

drawJustString

public static final void drawJustString(java.awt.Graphics g,
                                        java.lang.String aString,
                                        java.awt.Rectangle aRect,
                                        int justification,
                                        java.awt.FontMetrics aFontMetrics,
                                        int baseLine,
                                        boolean underline)
Draw the string using the specified justification style. This method draws the string in the provided Rectangle (aligned from the top) using the specified justification style. You need to set your clipping rectangle, the Font and the Color etc. before calling this method.
Parameters:
g - the Graphics object
aString - the String to be drawn
aRect - the Rectangle in which to draw the string
justification - the justification style (JUST_LEFT, JUST_CENTER, JUST_RIGHT)
aFontMetrics - the FontMetrics record for the Font being used
baseLine - the baseLine for the text
underline - true to draw the text underlined

drawJustString

public static final void drawJustString(java.awt.Graphics g,
                                        java.lang.String aString,
                                        java.awt.Rectangle aRect,
                                        int justification,
                                        java.awt.FontMetrics aFontMetrics,
                                        int baseLine)
Draw the string using the specified justification style. This method draws the string in the provided Rectangle (aligned from the top) using the specified justification style. You need to set your clipping rectangle, the Font and the Color etc. before calling this method.
Parameters:
g - the Graphics object
aString - the String to be drawn
aRect - the Rectangle in which to draw the string
justification - the justification style (JUST_LEFT, JUST_CENTER, JUST_RIGHT)
aFontMetrics - the FontMetrics record for the Font being used
baseLine - the baseLine for the text

drawText

public static final void drawText(java.awt.Graphics g,
                                  java.lang.String aString,
                                  java.awt.Rectangle aRect,
                                  int justification,
                                  java.awt.FontMetrics aFontMetrics,
                                  boolean underline)
Draw the string using the specified justification style, with word wrapping. This method draws the string in the provided Rectangle (aligned from the top) using the specified justification style, while breaking the lines on spaces and new lines. If there is only one word in a line and it doesn't fit, then the word is automatically broken. You need to set your clipping rectangle, the Font and the Color etc. before calling this method.
Parameters:
g - the Graphics object
aString - the String to be drawn
aRect - the Rectangle in which to draw the string
justification - the justification style (JUST_LEFT, JUST_CENTER, JUST_RIGHT)
aFontMetrics - the FontMetrics record for the Font being used
underline - true to draw the text underlined

drawText

public static final void drawText(java.awt.Graphics g,
                                  java.lang.String aString,
                                  java.awt.Rectangle aRect,
                                  int justification,
                                  java.awt.FontMetrics aFontMetrics)
Draw the string using the specified justification style, with word wrapping. This method draws the string in the provided Rectangle (aligned from the top) using the specified justification style, while breaking the lines on spaces and new lines. If there is only one word in a line and it doesn't fit, then the word is automatically broken. You need to set your clipping rectangle, the Font and the Color etc. before calling this method.
Parameters:
g - the Graphics object
aString - the String to be drawn
aRect - the Rectangle in which to draw the string
justification - the justification style (JUST_LEFT, JUST_CENTER, JUST_RIGHT)
aFontMetrics - the FontMetrics record for the Font being used

drawTruncString

public static final void drawTruncString(java.awt.Graphics g,
                                         java.lang.String aString,
                                         java.awt.Rectangle aRect,
                                         int justification,
                                         java.awt.FontMetrics aFontMetrics,
                                         int baseLine,
                                         boolean underline)
Draw the string using the specified justification style, truncating the string if necessary. This rountine enures that the string fits the width of the passed in rectangle by truncating the string. If truncation occurs, this method ends the string with ellipsis.
Parameters:
g - the Graphics object
aString - the String to be drawn
aRect - the Rectangle in which to draw the string
justification - the justification style (JUST_LEFT, JUST_CENTER, JUST_RIGHT)
aFontMetrics - the FontMetrics record for the Font being used
baseLine - distance from the top of the Rect to the text baseline
underline - true to draw the text underlined

drawTruncString

public static final void drawTruncString(java.awt.Graphics g,
                                         java.lang.String aString,
                                         java.awt.Rectangle aRect,
                                         int justification,
                                         java.awt.FontMetrics aFontMetrics,
                                         int baseLine)
Draw the string using the specified justification style, truncating the string if necessary. This rountine enures that the string fits the width of the passed in rectangle by truncating the string. If truncation occurs, this method ends the string with ellipsis.
Parameters:
g - the Graphics object
aString - the String to be drawn
aRect - the Rectangle in which to draw the string
justification - the justification style (JUST_LEFT, JUST_CENTER, JUST_RIGHT)
aFontMetrics - the FontMetrics record for the Font being used
baseLine - distance from the top of the Rect to the text baseline

drawString

public static final void drawString(java.awt.Graphics g,
                                    java.lang.String aString,
                                    java.awt.Rectangle aRect,
                                    int justification,
                                    java.awt.FontMetrics aFontMetrics,
                                    boolean underline)
Draw a String in the specified rectangle. The default implementation of this method draws the string using the justification parameter to either word wrap or truncate if needed.
Parameters:
g - the specified Graphics object
aString - the String to be drawn
aRect - the Rectangle in which to draw the string
justification - the justification style (JUST_LEFT, JUST_CENTER, JUST_RIGHT with WORD_WRAP or TRUNC_STRING OR'd to it)
aFontMetrics - the FontMetrics record for the Font being used
underline - true to draw the text underlined

drawString

public static final void drawString(java.awt.Graphics g,
                                    java.lang.String aString,
                                    java.awt.Rectangle aRect,
                                    int justification,
                                    java.awt.FontMetrics aFontMetrics)
Draw a String in the specified rectangle. The default implementation of this method draws the string using the justification parameter to either word wrap or truncate if needed.
Parameters:
g - the specified Graphics object
aString - the String to be drawn
aRect - the Rectangle in which to draw the string
justification - the justification style (JUST_LEFT, JUST_CENTER, JUST_RIGHT with WORD_WRAP or TRUNC_STRING OR'd to it)
aFontMetrics - the FontMetrics record for the Font being used