org.noos.xing.mydoggy.plaf.ui.util
Class GraphicsUtil

java.lang.Object
  extended by org.noos.xing.mydoggy.plaf.ui.util.GraphicsUtil

public class GraphicsUtil
extends Object

Author:
Angelo De Caro

Field Summary
static int BOTTOM_TO_UP_GRADIENT
           
static int FROM_CENTRE_GRADIENT_ON_X
           
static int FROM_CENTRE_GRADIENT_ON_Y
           
static int LEFT_TO_RIGHT_GRADIENT
           
static int RIGHT_TO_LEFT_GRADIENT
           
static int UP_TO_BOTTOM_GRADIENT
           
 
Constructor Summary
GraphicsUtil()
           
 
Method Summary
static String clippedText(String text, FontMetrics fm, int availTextWidth)
           
static void drawRect(Graphics g, int x, int y, int width, int height, int tickness)
           
static void drawRoundRect(Graphics g, int x, int y, int width, int height, int tickness, int arcWidth, int arcHeight)
           
static void fillRect(Graphics g, JComponent c, Color start, Color end)
           
static void fillRect(Graphics g, Rectangle r, BufferedImage image)
           
static void fillRect(Graphics g, Rectangle r, Color start, Color end)
           
static void fillRect(Graphics g, Rectangle r, Color start, Color end, Shape clip, int direction)
           
static void fillRect(Graphics g, Rectangle r, float x1, float y1, Color color1, float x2, float y2, Color color2, Shape clip)
           
static void fillRectTransparently(Graphics g, Rectangle r, Shape clip, int rule, float alpha)
           
static void fillRoundRect(Graphics g, int x, int y, int width, int height, int tickness, int arcWidth, int arcHeight, float alpha)
           
static GraphicsConfiguration getDefaultConfiguration()
           
static Image getImage(Component component, Icon icon)
           
static Color getInterpolatedColor(Color from, Color to, float percent)
           
static MutableColor getInterpolatedColor(MutableColor mutableColor, Color from, Color to, double percent)
           
static Color getLinearInterpolationColor(Color color, int distance)
           
static int normalizeColor(int c)
           
static BufferedImage rotate(BufferedImage image, double angle)
           
static Icon rotate(Icon icon, double angle)
           
static BufferedImage scale(BufferedImage image, int width, int height)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FROM_CENTRE_GRADIENT_ON_Y

public static final int FROM_CENTRE_GRADIENT_ON_Y
See Also:
Constant Field Values

FROM_CENTRE_GRADIENT_ON_X

public static final int FROM_CENTRE_GRADIENT_ON_X
See Also:
Constant Field Values

LEFT_TO_RIGHT_GRADIENT

public static final int LEFT_TO_RIGHT_GRADIENT
See Also:
Constant Field Values

RIGHT_TO_LEFT_GRADIENT

public static final int RIGHT_TO_LEFT_GRADIENT
See Also:
Constant Field Values

BOTTOM_TO_UP_GRADIENT

public static final int BOTTOM_TO_UP_GRADIENT
See Also:
Constant Field Values

UP_TO_BOTTOM_GRADIENT

public static final int UP_TO_BOTTOM_GRADIENT
See Also:
Constant Field Values
Constructor Detail

GraphicsUtil

public GraphicsUtil()
Method Detail

fillRect

public static void fillRect(Graphics g,
                            JComponent c,
                            Color start,
                            Color end)

fillRect

public static void fillRect(Graphics g,
                            Rectangle r,
                            Color start,
                            Color end)

fillRect

public static void fillRect(Graphics g,
                            Rectangle r,
                            Color start,
                            Color end,
                            Shape clip,
                            int direction)

fillRect

public static void fillRect(Graphics g,
                            Rectangle r,
                            float x1,
                            float y1,
                            Color color1,
                            float x2,
                            float y2,
                            Color color2,
                            Shape clip)

fillRect

public static void fillRect(Graphics g,
                            Rectangle r,
                            BufferedImage image)

fillRectTransparently

public static void fillRectTransparently(Graphics g,
                                         Rectangle r,
                                         Shape clip,
                                         int rule,
                                         float alpha)

drawRect

public static void drawRect(Graphics g,
                            int x,
                            int y,
                            int width,
                            int height,
                            int tickness)

drawRoundRect

public static void drawRoundRect(Graphics g,
                                 int x,
                                 int y,
                                 int width,
                                 int height,
                                 int tickness,
                                 int arcWidth,
                                 int arcHeight)

fillRoundRect

public static void fillRoundRect(Graphics g,
                                 int x,
                                 int y,
                                 int width,
                                 int height,
                                 int tickness,
                                 int arcWidth,
                                 int arcHeight,
                                 float alpha)

clippedText

public static String clippedText(String text,
                                 FontMetrics fm,
                                 int availTextWidth)

normalizeColor

public static int normalizeColor(int c)

getLinearInterpolationColor

public static Color getLinearInterpolationColor(Color color,
                                                int distance)

getInterpolatedColor

public static Color getInterpolatedColor(Color from,
                                         Color to,
                                         float percent)

getInterpolatedColor

public static MutableColor getInterpolatedColor(MutableColor mutableColor,
                                                Color from,
                                                Color to,
                                                double percent)

rotate

public static BufferedImage rotate(BufferedImage image,
                                   double angle)

rotate

public static Icon rotate(Icon icon,
                          double angle)

scale

public static BufferedImage scale(BufferedImage image,
                                  int width,
                                  int height)

getImage

public static Image getImage(Component component,
                             Icon icon)

getDefaultConfiguration

public static GraphicsConfiguration getDefaultConfiguration()


Copyright © 2012. All Rights Reserved.