All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.GraphicsUtils

java.lang.Object
   |
   +----com.sun.java.swing.GraphicsUtils

public class GraphicsUtils
extends Object
implements SwingConstants

Constructor Index

 o GraphicsUtils()

Method Index

 o computeStringWidth(FontMetrics, String)
 o layoutCompoundLabel(FontMetrics, String, Icon, int, int, int, int, Rectangle, Rectangle, Rectangle, int)
Compute and return the location of the icons origin, the location of origin of the text baseline, and a possibly clipped version of the compound labels string.
 o layoutMenuItem(FontMetrics, String, Icon, Icon, Icon, int, int, int, int, Rectangle, Rectangle, Rectangle, Rectangle, Rectangle, int, int)
Compute and return the location of the icons origin, the location of origin of the text baseline, and a possibly clipped version of the compound labels string.
 o paintComponent(Graphics, Component, Container, int, int, int, int)
Paint a component c on an abitrary graphics g in the specified rectangle.
 o paintComponent(Graphics, Component, Container, Rectangle)

Constructors

 o GraphicsUtils
 public GraphicsUtils()

Methods

 o computeStringWidth
 public static int computeStringWidth(FontMetrics fm,
                                      String str)
 o layoutCompoundLabel
 public static String layoutCompoundLabel(FontMetrics fm,
                                          String text,
                                          Icon icon,
                                          int verticalAlignment,
                                          int horizontalAlignment,
                                          int verticalTextPosition,
                                          int horizontalTextPosition,
                                          Rectangle viewR,
                                          Rectangle iconR,
                                          Rectangle textR,
                                          int textIconGap)
Compute and return the location of the icons origin, the location of origin of the text baseline, and a possibly clipped version of the compound labels string. Locations are computed relative to the viewR rectangle.

 o layoutMenuItem
 public static String layoutMenuItem(FontMetrics fm,
                                     String text,
                                     Icon icon,
                                     Icon checkIcon,
                                     Icon arrowIcon,
                                     int verticalAlignment,
                                     int horizontalAlignment,
                                     int verticalTextPosition,
                                     int horizontalTextPosition,
                                     Rectangle viewR,
                                     Rectangle iconR,
                                     Rectangle textR,
                                     Rectangle checkIconR,
                                     Rectangle arrowIconR,
                                     int textIconGap,
                                     int menuItemGap)
Compute and return the location of the icons origin, the location of origin of the text baseline, and a possibly clipped version of the compound labels string. Locations are computed relative to the viewR rectangle.

 o paintComponent
 public static void paintComponent(Graphics g,
                                   Component c,
                                   Container p,
                                   int x,
                                   int y,
                                   int w,
                                   int h)
Paint a component c on an abitrary graphics g in the specified rectangle. The component is reparented to a private container (whose parent becomes p) which prevents c.validate() and and c.repaint() calls from propogating up the tree. The intermediate container has no other effect.

 o paintComponent
 public static void paintComponent(Graphics g,
                                   Component c,
                                   Container p,
                                   Rectangle r)

All Packages  Class Hierarchy  This Package  Previous  Next  Index