com.sas.visuals
Class DrawingSupport

com.sas.visuals.DrawingSupport
All Implemented Interfaces:
VisualAspects

public class DrawingSupport
implements VisualAspects

This class contains static methods used for drawing.


Field Summary
 
Fields inherited from interface com.sas.visuals.VisualAspects
BDR_BUMP, BDR_BUTTON_NORMAL, BDR_BUTTON_PRESSED, BDR_BUTTON_SELECTED, BDR_DIP, BDR_FIELD_BORDER, BDR_FLAT, BDR_FLAT_BORDER, BDR_GROUP_BORDER, BDR_NONE, BDR_RAISED, BDR_RAISED_INNER, BDR_RAISED_OUTER, BDR_STATUSFIELD_BORDER, BDR_SUNKEN, BDR_SUNKEN_INNER, BDR_SUNKEN_OUTER, BDR_WINDOW_BORDER, BS_NONE, BS_NORMAL, BS_PRESSED, BS_ROUND_NORMAL, BS_ROUND_PRESSED, BS_ROUND_SELECTED, BS_ROUNDEDGE_NORMAL, BS_ROUNDEDGE_PRESSED, BS_ROUNDEDGE_SELECTED, BS_SELECTED, CENTER, CONTENTS_CENTER, CONTENTS_LEFT, CONTENTS_RIGHT, DEVELOPMENT, DOUBLE_BUFFERED, DT_CENTER, DT_LEFT, DT_OPAQUE, DT_RIGHT, DT_UNDERLINE, EAST, HORIZONTAL, NORTH, NORTH_EAST, NORTH_WEST, SHOW_IMAGE, SHOW_NONE, SHOW_TEXT, SOUTH, SOUTH_EAST, SOUTH_WEST, TEXT_CENTER, TEXT_EAST, TEXT_LEFT, TEXT_NORTH, TEXT_RIGHT, TEXT_SOUTH, TEXT_WEST, VERTICAL, WEST
 
Constructor Summary
DrawingSupport()
           
 
Method Summary
static java.applet.Applet appletFromComponent(java.awt.Component component)
          Gets the applet in which the component resides
static void clearRect(java.awt.Graphics g, java.awt.Rectangle rectangle)
          Clear the specified rectangle
static void draw3DRect(java.awt.Graphics g, java.awt.Rectangle rectangle, boolean raised)
          Draw a 3-D rectangle
static void draw3DRoundRect(java.awt.Graphics g, java.awt.Rectangle rectangle, int arcWidth, int arcHeight, int style)
          Draw a 3-D rectangle with rounded corners
static void drawArc(java.awt.Graphics g, java.awt.Rectangle rectangle, int startAngle, int arcAngle)
          Draw an arc
static void drawBasicBorderRect(java.awt.Graphics g, int x, int y, int width, int height, java.awt.Color c, java.awt.Color topLeft, java.awt.Color bottomRight)
          Draw a Windows95 basic window border
static void drawBasicBorderRect(java.awt.Graphics g, int x, int y, int width, int height, int style)
          Draw a Windows95 basic window border
static void drawBasicBorderRect(java.awt.Graphics g, java.awt.Rectangle rectangle, int style)
          Draw a Windows95 basic window border
static void drawBasicButtonBorderRect(java.awt.Graphics g, int x, int y, int width, int height, int style)
          Draw a Windows95 basic button border
static void drawBasicButtonBorderRect(java.awt.Graphics g, java.awt.Rectangle rectangle, int style)
          Draw a basic Windows95 button border
static void drawButtonBorderRect(java.awt.Graphics g, int x, int y, int width, int height, int style)
          Draw a Windows95 basic button border
static void drawButtonBorderRect(java.awt.Graphics g, java.awt.Rectangle rectangle, int style)
          Draw a Windows95 push button border
static void drawColoredBorderRect(java.awt.Graphics g, int x, int y, int width, int height, int style, java.awt.Color c)
          Draw a colored border
static void drawColoredBorderRect(java.awt.Graphics g, java.awt.Rectangle rectangle, int style, java.awt.Color c)
          Draw a colored border
static boolean drawDisabledImage(java.awt.Graphics g, java.awt.Image img, int x, int y, java.awt.image.ImageObserver observer)
          Draw an image with a disabled appearance
static boolean drawDisabledImage(java.awt.Graphics g, java.awt.Image img, int x, int y, java.awt.image.ImageObserver observer, boolean cache)
           
static void drawDisabledString(java.awt.Graphics g, java.lang.String[] text, int x, int y, int drawStringMask)
          Draw a vector of Strings with a disabled appearance
static void drawDisabledString(java.awt.Graphics g, java.lang.String[] text, int x, int y, int drawStringMask, java.awt.Color opaque)
          Draw a vector of Strings with a disabled appearance
static void drawDisabledString(java.awt.Graphics g, java.lang.String text, int x, int y)
          Draw a String with a disabled appearance
static void drawDisabledString(java.awt.Graphics g, java.lang.String text, int x, int y, int drawStringMask)
          Draw a vector of Strings with a disabled appearance
static void drawDisabledString(java.awt.Graphics g, java.lang.String text, int x, int y, int drawStringMask, java.awt.Color opaque)
          Draw a String with a disabled appearance
static void drawDottedLine(java.awt.Graphics g, int x1, int y1, int x2, int y2)
          Draws a dotted line between two points
static void drawDottedLine(java.awt.Graphics g, java.awt.Point point1, java.awt.Point point2)
          Draws a dotted line between two points
static void drawDottedRect(java.awt.Graphics g, int x, int y, int width, int height)
           
static void drawDottedRect(java.awt.Graphics g, int x, int y, int width, int height, boolean XOR)
           
static void drawDottedRect(java.awt.Graphics g, java.awt.Rectangle rectangle)
           
static void drawFieldBorderRect(java.awt.Graphics g, int x, int y, int width, int height)
          Draw a Windows95 field border
static void drawFieldBorderRect(java.awt.Graphics g, java.awt.Rectangle rectangle)
          Draw a Windows95 field border
static void drawFocusRect(java.awt.Graphics g, int x, int y, int width, int height)
          Draw a Windows95 focus rectangle
static void drawFocusRect(java.awt.Graphics g, java.awt.Rectangle rectangle)
          Draw a Windows95 focus rectangle
static void drawGroupBorderRect(java.awt.Graphics g, int x, int y, int width, int height)
          Draw a Windows95 grouping border
static void drawGroupBorderRect(java.awt.Graphics g, java.awt.Rectangle rectangle)
          Draw a Windows95 grouping border
static void drawLine(java.awt.Graphics g, java.awt.Point point1, java.awt.Point point2)
          Draws a line between two points
static boolean drawMixedImage(java.awt.Graphics g, java.awt.Image img, int x, int y, java.awt.Color c, java.awt.image.ImageObserver observer)
          Draw an image mixed with a specified color
static boolean drawMixedImage(java.awt.Graphics g, java.awt.Image img, int x, int y, java.awt.Color c, java.awt.image.ImageObserver observer, boolean cache)
           
static void drawRect(java.awt.Graphics g, java.awt.Rectangle rectangle)
          Draw the specified rectangle
static void drawRoundRect(java.awt.Graphics g, java.awt.Rectangle rectangle, int arcWidth, int arcHeight)
          Draw a rectangle with rounded corners
static void drawStatusFieldBorderRect(java.awt.Graphics g, int x, int y, int width, int height)
          Draw a Windows95 status field border
static void drawStatusFieldBorderRect(java.awt.Graphics g, java.awt.Rectangle rectangle)
          Draw a Windows95 status field border
static void drawString(java.awt.Graphics g, java.lang.String[] text, int x, int y, int drawStringMask)
          Draw a vector of Strings
static void drawString(java.awt.Graphics g, java.lang.String[] text, int x, int y, int drawStringMask, java.awt.Color opaque)
          Draw a vector of Strings
static void drawString(java.awt.Graphics g, java.lang.String text, int x, int y, int drawStringMask)
          Draw a String
static void drawString(java.awt.Graphics g, java.lang.String text, int x, int y, int drawStringMask, java.awt.Color opaque)
          Draw a String
static boolean drawTransparentImage(java.awt.Graphics g, java.awt.Image img, int x, int y, java.awt.Color c, java.awt.image.ImageObserver observer)
           
static boolean drawTransparentImage(java.awt.Graphics g, java.awt.Image img, int x, int y, java.awt.Color c, java.awt.image.ImageObserver observer, boolean cache)
           
static void drawWindowBorderRect(java.awt.Graphics g, int x, int y, int width, int height)
          Draw a Windows95 window border
static void drawWindowBorderRect(java.awt.Graphics g, java.awt.Rectangle rectangle)
          Draw a Windows95 window border
static void fill3DRect(java.awt.Graphics g, java.awt.Rectangle rectangle, boolean raised)
          Fill a 3-D rectangle
static void fillArc(java.awt.Graphics g, java.awt.Rectangle rectangle, int startAngle, int arcAngle)
          Fill an arc
static void fillRect(java.awt.Graphics g, java.awt.Rectangle rectangle)
          Fill the specified rectangle
static void fillRoundRect(java.awt.Graphics g, java.awt.Rectangle rectangle, int arcWidth, int arcHeight)
          Fill a rectangle with rounded corners
static java.awt.Frame frameFromComponent(java.awt.Component component)
          Gets the frame in which a component resides
static java.awt.Dimension getImageSize(java.awt.Graphics g, java.awt.Image image, java.awt.Component component)
          Get the demension of a specified image
static int getStringAscent(java.awt.Graphics g)
          Get the ascent of an arbitrary String
static int getStringAscent(java.awt.Graphics g, java.awt.Font font)
          Get the ascent of an arbitrary String
static int getStringDescent(java.awt.Graphics g)
          Get the descent of an arbitrary String
static int getStringDescent(java.awt.Graphics g, java.awt.Font font)
          Get the descent of an arbitrary String
static java.awt.Dimension getStringSize(java.awt.Graphics g, java.lang.String text)
          Gets the dimension of a specified String
static java.awt.Dimension getStringSize(java.awt.Graphics g, java.lang.String[] text)
          Gets the dimension of a specified array of Strings
static java.awt.Dimension getStringSize(java.awt.Graphics g, java.lang.String[] text, java.awt.Font font)
          Gets the dimension of a specified array of Strings
static java.awt.Dimension getStringSize(java.awt.Graphics g, java.lang.String text, java.awt.Font font)
          Gets the dimension of a specified String
static java.awt.Point relativePoint(java.awt.Component srcComponent, java.awt.Component destComponent, java.awt.Point point)
          Returns a point relative to a srcComponent as a point relative destComponent
static java.awt.Point screenPoint(java.awt.Component component, java.awt.Point point)
          Returns a point relative to the screen coordinates
 

Constructor Detail

DrawingSupport

public DrawingSupport()
Method Detail

drawDottedLine

public static final void drawDottedLine(java.awt.Graphics g,
                                        int x1,
                                        int y1,
                                        int x2,
                                        int y2)
Draws a dotted line between two points.

Parameters:
g - the Graphics to use
x1 - the first x coordinate
y1 - the first y coordinate
x2 - the second x coordinate
y2 - the second y coordinate

drawDottedLine

public static final void drawDottedLine(java.awt.Graphics g,
                                        java.awt.Point point1,
                                        java.awt.Point point2)
Draws a dotted line between two points.

Parameters:
g - the Graphics to use
point1 - the first point
point2 - the second point

drawLine

public static final void drawLine(java.awt.Graphics g,
                                  java.awt.Point point1,
                                  java.awt.Point point2)
Draws a line between two points.

Parameters:
g - the Graphics to use
point1 - the first point
point2 - the second point

fillRect

public static final void fillRect(java.awt.Graphics g,
                                  java.awt.Rectangle rectangle)
Fill the specified rectangle

Parameters:
g - the Graphics to use
rectangle - the rectangle to fill

drawRect

public static final void drawRect(java.awt.Graphics g,
                                  java.awt.Rectangle rectangle)
Draw the specified rectangle.

Parameters:
g - the Graphics to use
rectangle - the rectangle to draw

clearRect

public static final void clearRect(java.awt.Graphics g,
                                   java.awt.Rectangle rectangle)
Clear the specified rectangle.

Parameters:
g - the Graphics to use
rectangle - the rectangle to clear

drawRoundRect

public static final void drawRoundRect(java.awt.Graphics g,
                                       java.awt.Rectangle rectangle,
                                       int arcWidth,
                                       int arcHeight)
Draw a rectangle with rounded corners.

Parameters:
g - the Graphics to use
rectangle - the bounding rectangle
arcWidth - the width of the arc
arcHeight - the height of the arc

fillRoundRect

public static final void fillRoundRect(java.awt.Graphics g,
                                       java.awt.Rectangle rectangle,
                                       int arcWidth,
                                       int arcHeight)
Fill a rectangle with rounded corners.

Parameters:
g - the Graphics to use
rectangle - the bounding rectangle
arcWidth - the width of the arc
arcHeight - the height of the arc

draw3DRoundRect

public static final void draw3DRoundRect(java.awt.Graphics g,
                                         java.awt.Rectangle rectangle,
                                         int arcWidth,
                                         int arcHeight,
                                         int style)
Draw a 3-D rectangle with rounded corners.

Parameters:
g - the Graphics to use
rectangle - the bounding rectangle
arcWidth - the width of the arc
arcHeight - the height of the arc
style - the border style to use

draw3DRect

public static final void draw3DRect(java.awt.Graphics g,
                                    java.awt.Rectangle rectangle,
                                    boolean raised)
Draw a 3-D rectangle.

Parameters:
g - the Graphics to use
rectangle - the rectangle to draw
rasied - the state of the rectangle

fill3DRect

public static final void fill3DRect(java.awt.Graphics g,
                                    java.awt.Rectangle rectangle,
                                    boolean raised)
Fill a 3-D rectangle.

Parameters:
g - the Graphics to use
rectangle - the rectangle to fill
rasied - the state of the rectangle

drawArc

public static final void drawArc(java.awt.Graphics g,
                                 java.awt.Rectangle rectangle,
                                 int startAngle,
                                 int arcAngle)
Draw an arc.

Parameters:
g - the Graphics to use
rectangle - the bounding rectangle
startAngle - the starting angle
arcAngle - the angle to draw

fillArc

public static final void fillArc(java.awt.Graphics g,
                                 java.awt.Rectangle rectangle,
                                 int startAngle,
                                 int arcAngle)
Fill an arc.

Parameters:
g - the Graphics to use
rectangle - the bounding rectangle
startAngle - the starting angle
arcAngle - the angle to fill

drawBasicBorderRect

public static final void drawBasicBorderRect(java.awt.Graphics g,
                                             java.awt.Rectangle rectangle,
                                             int style)
Draw a Windows95 basic window border.

Parameters:
g - the Graphics to use
rectangle - the bounding rectangle
style - the border style to use

drawBasicBorderRect

public static final void drawBasicBorderRect(java.awt.Graphics g,
                                             int x,
                                             int y,
                                             int width,
                                             int height,
                                             int style)
Draw a Windows95 basic window border.

Parameters:
g - the Graphics to use
x - the x coordinate
y - the y coordinate
width - the width of the bounding region
height - the height of the bounding region
style - the border style to use

drawColoredBorderRect

public static final void drawColoredBorderRect(java.awt.Graphics g,
                                               java.awt.Rectangle rectangle,
                                               int style,
                                               java.awt.Color c)
Draw a colored border.

Parameters:
g - the Graphics to use
rectangle - the bounding rectangle
style - the border style to use
c - the Color to use

drawColoredBorderRect

public static final void drawColoredBorderRect(java.awt.Graphics g,
                                               int x,
                                               int y,
                                               int width,
                                               int height,
                                               int style,
                                               java.awt.Color c)
Draw a colored border.

Parameters:
g - the Graphics to use
x - the x coordinate
y - the y coordinate
width - the width of the bounding region
height - the height of the bounding region
style - the border style to use
c - the Color to use

drawBasicBorderRect

public static final void drawBasicBorderRect(java.awt.Graphics g,
                                             int x,
                                             int y,
                                             int width,
                                             int height,
                                             java.awt.Color c,
                                             java.awt.Color topLeft,
                                             java.awt.Color bottomRight)
Draw a Windows95 basic window border.

Parameters:
g - the Graphics to use
x - the x coordinate
y - the y coordinate
width - the width of the bounding region
height - the height of the bounding region
c - the background color
topLeft - the top-left border color
bottomRight - the bottom-right border color

drawWindowBorderRect

public static final void drawWindowBorderRect(java.awt.Graphics g,
                                              java.awt.Rectangle rectangle)
Draw a Windows95 window border.

Parameters:
g - the Graphics to use
rectangle - the bounding region

drawWindowBorderRect

public static final void drawWindowBorderRect(java.awt.Graphics g,
                                              int x,
                                              int y,
                                              int width,
                                              int height)
Draw a Windows95 window border.

Parameters:
g - the Graphics to use
x - the x coordinate
y - the y coordinate
width - the width of the bounding region
height - the height of the bounding region

drawBasicButtonBorderRect

public static final void drawBasicButtonBorderRect(java.awt.Graphics g,
                                                   java.awt.Rectangle rectangle,
                                                   int style)
Draw a basic Windows95 button border.

Parameters:
g - the Graphics to use
rectangle - the bounding region
style - the border style to use

drawBasicButtonBorderRect

public static final void drawBasicButtonBorderRect(java.awt.Graphics g,
                                                   int x,
                                                   int y,
                                                   int width,
                                                   int height,
                                                   int style)
Draw a Windows95 basic button border.

Parameters:
g - the Graphics to use
x - the x coordinate
y - the y coordinate
width - the width of the bounding region
height - the height of the bounding region
style - the border style to use

drawButtonBorderRect

public static final void drawButtonBorderRect(java.awt.Graphics g,
                                              java.awt.Rectangle rectangle,
                                              int style)
Draw a Windows95 push button border.

Parameters:
g - the Graphics to use
rectangle - the bounding region
style - the border style to use (BS_PRESSED, BS_NORMAL, BS_SELECTED)

drawButtonBorderRect

public static final void drawButtonBorderRect(java.awt.Graphics g,
                                              int x,
                                              int y,
                                              int width,
                                              int height,
                                              int style)
Draw a Windows95 basic button border.

Parameters:
g - the Graphics to use
x - the x coordinate
y - the y coordinate
width - the width of the bounding region
height - the height of the bounding region
style - the border style to use (BS_PRESSED, BS_NORMAL, BS_SELECTED)

drawFieldBorderRect

public static final void drawFieldBorderRect(java.awt.Graphics g,
                                             java.awt.Rectangle rectangle)
Draw a Windows95 field border.

Parameters:
g - the Graphics to use
rectangle - the bounding rectangle

drawFieldBorderRect

public static final void drawFieldBorderRect(java.awt.Graphics g,
                                             int x,
                                             int y,
                                             int width,
                                             int height)
Draw a Windows95 field border.

Parameters:
g - the Graphics to use
x - the x coordinate
y - the y coordinate
width - the width of the bounding region
height - the height of the bounding region

drawStatusFieldBorderRect

public static final void drawStatusFieldBorderRect(java.awt.Graphics g,
                                                   java.awt.Rectangle rectangle)
Draw a Windows95 status field border.

Parameters:
g - the Graphics to use
rectangle - the bounding rectangle

drawStatusFieldBorderRect

public static final void drawStatusFieldBorderRect(java.awt.Graphics g,
                                                   int x,
                                                   int y,
                                                   int width,
                                                   int height)
Draw a Windows95 status field border.

Parameters:
g - the Graphics to use
x - the x coordinate
y - the y coordinate
width - the width of the bounding region
height - the height of the bounding region

drawGroupBorderRect

public static final void drawGroupBorderRect(java.awt.Graphics g,
                                             java.awt.Rectangle rectangle)
Draw a Windows95 grouping border.

Parameters:
g - the Graphics to use
rectangle - the bounding rectangle

drawGroupBorderRect

public static final void drawGroupBorderRect(java.awt.Graphics g,
                                             int x,
                                             int y,
                                             int width,
                                             int height)
Draw a Windows95 grouping border.

Parameters:
g - the Graphics to use
x - the x coordinate
y - the y coordinate
width - the width of the bounding region
height - the height of the bounding region

drawFocusRect

public static final void drawFocusRect(java.awt.Graphics g,
                                       java.awt.Rectangle rectangle)
Draw a Windows95 focus rectangle.

Parameters:
g - the Graphics to use
rectangle - the bounding rectangle

drawDottedRect

public static final void drawDottedRect(java.awt.Graphics g,
                                        java.awt.Rectangle rectangle)

drawFocusRect

public static final void drawFocusRect(java.awt.Graphics g,
                                       int x,
                                       int y,
                                       int width,
                                       int height)
Draw a Windows95 focus rectangle.

Parameters:
g - the Graphics to use
x - the x coordinate
y - the y coordinate
width - the width of the bounding region
height - the height of the bounding region

drawDottedRect

public static final void drawDottedRect(java.awt.Graphics g,
                                        int x,
                                        int y,
                                        int width,
                                        int height)

drawDottedRect

public static final void drawDottedRect(java.awt.Graphics g,
                                        int x,
                                        int y,
                                        int width,
                                        int height,
                                        boolean XOR)

drawString

public static final void drawString(java.awt.Graphics g,
                                    java.lang.String[] text,
                                    int x,
                                    int y,
                                    int drawStringMask)
Draw a vector of Strings.

Parameters:
g - the Graphics to use
text - the array of Strings to draw
x - the x coordinate
y - the y coordinate
drawStringMask - the drawStringMask

drawString

public static final void drawString(java.awt.Graphics g,
                                    java.lang.String[] text,
                                    int x,
                                    int y,
                                    int drawStringMask,
                                    java.awt.Color opaque)
Draw a vector of Strings.

Parameters:
g - the Graphics to use
text - the array of Strings to draw
x - the x coordinate
y - the y coordinate
drawStringMask - the drawStringMask
opaque - the opaque color. This value is ignored unless drawStringMask contains the DT_OPAQUE mask

drawString

public static final void drawString(java.awt.Graphics g,
                                    java.lang.String text,
                                    int x,
                                    int y,
                                    int drawStringMask)
Draw a String.

Parameters:
g - the Graphics to use
text - the String to draw
x - the x coordinate
y - the y coordinate
drawStringMask - the drawStringMask

drawString

public static final void drawString(java.awt.Graphics g,
                                    java.lang.String text,
                                    int x,
                                    int y,
                                    int drawStringMask,
                                    java.awt.Color opaque)
Draw a String.

Parameters:
g - the Graphics to use
text - the String to draw
x - the x coordinate
y - the y coordinate
drawStringMask - the drawStringMask
opaque - the opaque color. This value is ignored unless drawStringMask contains the DT_OPAQUE mask

drawDisabledString

public static final void drawDisabledString(java.awt.Graphics g,
                                            java.lang.String[] text,
                                            int x,
                                            int y,
                                            int drawStringMask)
Draw a vector of Strings with a disabled appearance.

Parameters:
g - the Graphics to use
text - the array of Strings to draw
x - the x coordinate
y - the y coordinate
drawStringMask - the drawStringMask

drawDisabledString

public static final void drawDisabledString(java.awt.Graphics g,
                                            java.lang.String[] text,
                                            int x,
                                            int y,
                                            int drawStringMask,
                                            java.awt.Color opaque)
Draw a vector of Strings with a disabled appearance.

Parameters:
g - the Graphics to use
text - the String to draw
x - the x coordinate
y - the y coordinate
drawStringMask - the drawStringMask
opaque - the opaque color. This value is ignored unless drawStringMask contains the DT_OPAQUE mask

drawDisabledString

public static final void drawDisabledString(java.awt.Graphics g,
                                            java.lang.String text,
                                            int x,
                                            int y)
Draw a String with a disabled appearance.

Parameters:
g - the Graphics to use
text - the String to draw
x - the x coordinate
y - the y coordinate

drawDisabledString

public static final void drawDisabledString(java.awt.Graphics g,
                                            java.lang.String text,
                                            int x,
                                            int y,
                                            int drawStringMask)
Draw a vector of Strings with a disabled appearance.

Parameters:
g - the Graphics to use
text - the array of Strings to draw
x - the x coordinate
y - the y coordinate
drawStringMask - the drawStringMask

drawDisabledString

public static final void drawDisabledString(java.awt.Graphics g,
                                            java.lang.String text,
                                            int x,
                                            int y,
                                            int drawStringMask,
                                            java.awt.Color opaque)
Draw a String with a disabled appearance.

Parameters:
g - the Graphics to use
text - the String to draw
x - the x coordinate
y - the y coordinate
drawStringMask - the drawStringMask
opaque - the opaque color. This value is ignored unless drawStringMask contains the DT_OPAQUE mask

drawDisabledImage

public static final boolean drawDisabledImage(java.awt.Graphics g,
                                              java.awt.Image img,
                                              int x,
                                              int y,
                                              java.awt.image.ImageObserver observer)
Draw an image with a disabled appearance.

Parameters:
g - the Graphics to use
img - the image to use
x - the x coordinate
y - the y coordinate
observer - the image observer

drawDisabledImage

public static final boolean drawDisabledImage(java.awt.Graphics g,
                                              java.awt.Image img,
                                              int x,
                                              int y,
                                              java.awt.image.ImageObserver observer,
                                              boolean cache)

drawMixedImage

public static final boolean drawMixedImage(java.awt.Graphics g,
                                           java.awt.Image img,
                                           int x,
                                           int y,
                                           java.awt.Color c,
                                           java.awt.image.ImageObserver observer)
Draw an image mixed with a specified color.

Parameters:
g - the Graphics to use
img - the image to use
x - the x coordinate
y - the y coordinate
c - the color to mix
observer - the image observer

drawMixedImage

public static final boolean drawMixedImage(java.awt.Graphics g,
                                           java.awt.Image img,
                                           int x,
                                           int y,
                                           java.awt.Color c,
                                           java.awt.image.ImageObserver observer,
                                           boolean cache)

drawTransparentImage

public static final boolean drawTransparentImage(java.awt.Graphics g,
                                                 java.awt.Image img,
                                                 int x,
                                                 int y,
                                                 java.awt.Color c,
                                                 java.awt.image.ImageObserver observer)

drawTransparentImage

public static final boolean drawTransparentImage(java.awt.Graphics g,
                                                 java.awt.Image img,
                                                 int x,
                                                 int y,
                                                 java.awt.Color c,
                                                 java.awt.image.ImageObserver observer,
                                                 boolean cache)

getStringSize

public static final java.awt.Dimension getStringSize(java.awt.Graphics g,
                                                     java.lang.String[] text)
Gets the dimension of a specified array of Strings.

Parameters:
g - the Graphics to use
text - the array of Strings
Returns:
Dimension containing the size needed to draw the Strings

getStringSize

public static final java.awt.Dimension getStringSize(java.awt.Graphics g,
                                                     java.lang.String[] text,
                                                     java.awt.Font font)
Gets the dimension of a specified array of Strings.

Parameters:
g - the Graphics to use
text - the array of Strings
font - the font to use when rendering
Returns:
Dimension containing the size needed to draw the Strings

getStringSize

public static final java.awt.Dimension getStringSize(java.awt.Graphics g,
                                                     java.lang.String text)
Gets the dimension of a specified String.

Parameters:
g - the Graphics to use
text - the String
Returns:
Dimension containing the size needed to draw the String

getStringSize

public static final java.awt.Dimension getStringSize(java.awt.Graphics g,
                                                     java.lang.String text,
                                                     java.awt.Font font)
Gets the dimension of a specified String.

Parameters:
g - the Graphics to use
text - the String
font - the font to use when rendering
Returns:
Dimension containing the size needed to draw the String

getStringAscent

public static final int getStringAscent(java.awt.Graphics g)
Get the ascent of an arbitrary String.

Parameters:
g - the Graphics to use
Returns:
int containing the ascent value of a String

getStringDescent

public static final int getStringDescent(java.awt.Graphics g)
Get the descent of an arbitrary String.

Parameters:
g - the Graphics to use
Returns:
int containing the descent value of a String

getStringAscent

public static final int getStringAscent(java.awt.Graphics g,
                                        java.awt.Font font)
Get the ascent of an arbitrary String.

Parameters:
g - the Graphics to use
font - the font to use when rendering
Returns:
int containing the ascent value of a String

getStringDescent

public static final int getStringDescent(java.awt.Graphics g,
                                         java.awt.Font font)
Get the descent of an arbitrary String.

Parameters:
g - the Graphics to use
font - the font to use when rendering
Returns:
int containing the descent value of a String

getImageSize

public static final java.awt.Dimension getImageSize(java.awt.Graphics g,
                                                    java.awt.Image image,
                                                    java.awt.Component component)
                                             throws java.lang.NullPointerException
Get the demension of a specified image.

Parameters:
g - the Graphics to use
image - the image to use
component - the component where the image will be rendered
Returns:
Dimension containing the size needed for rendering the image
Throws:
java.lang.NullPointerException

appletFromComponent

public static java.applet.Applet appletFromComponent(java.awt.Component component)
Gets the applet in which the component resides.

Parameters:
component - the component that resides in an applet
Returns:
Applet where the component resides, null if not found

frameFromComponent

public static java.awt.Frame frameFromComponent(java.awt.Component component)
Gets the frame in which a component resides.

Parameters:
component - the component that resides in a frame
Returns:
Frame where the component resides, null if not found

relativePoint

public static java.awt.Point relativePoint(java.awt.Component srcComponent,
                                           java.awt.Component destComponent,
                                           java.awt.Point point)
Returns a point relative to a srcComponent as a point relative destComponent.

Parameters:
srcComponent - the source component
destComponent - the destination component
point - the point in question in the srcComponent coordinates
Returns:
Point be relative to the destComponent.

screenPoint

public static java.awt.Point screenPoint(java.awt.Component component,
                                         java.awt.Point point)
Returns a point relative to the screen coordinates.

Parameters:
component - the component where the point resides
point - the point in question relative to the component
Returns:
Point in screen coordinates



Copyright © 2009 SAS Institute Inc. All Rights Reserved.