com.alee.utils
Class GraphicsUtils

java.lang.Object
  extended by com.alee.utils.GraphicsUtils

public class GraphicsUtils
extends java.lang.Object

This class provides a set of utilities to work with Graphics2D.

Author:
Mikle Garin

Constructor Summary
GraphicsUtils()
           
 
Method Summary
static java.lang.Object disableAntialias(java.awt.Graphics g)
           
static java.lang.Object disableAntialias(java.awt.Graphics2D g2d)
           
static void drawShade(java.awt.Graphics2D g2d, java.awt.Shape shape, java.awt.Color shadeColor, int width)
          Draws web styled shade using specified shape
static void drawShade(java.awt.Graphics2D g2d, java.awt.Shape shape, java.awt.Color shadeColor, int width, boolean round)
           
static void drawShade(java.awt.Graphics2D g2d, java.awt.Shape shape, java.awt.Color shadeColor, int width, java.awt.Shape clip)
           
static void drawShade(java.awt.Graphics2D g2d, java.awt.Shape shape, java.awt.Color shadeColor, int width, java.awt.Shape clip, boolean round)
           
static void drawShade(java.awt.Graphics2D g2d, java.awt.Shape shape, ShadeType shadeType, java.awt.Color shadeColor, int width)
           
static void drawShade(java.awt.Graphics2D g2d, java.awt.Shape shape, ShadeType shadeType, java.awt.Color shadeColor, int width, boolean round)
           
static void drawShade(java.awt.Graphics2D g2d, java.awt.Shape shape, ShadeType shadeType, java.awt.Color shadeColor, int width, java.awt.Shape clip)
           
static void drawShade(java.awt.Graphics2D g2d, java.awt.Shape shape, ShadeType shadeType, java.awt.Color shadeColor, int width, java.awt.Shape clip, boolean round)
           
static java.awt.Stroke getStroke(int width)
           
static java.awt.Stroke getStroke(int width, int cap)
           
static java.awt.Stroke getStroke(int width, int cap, int join)
           
static java.util.Map getSystemTextHints()
           
static java.awt.Shape intersectClip(java.awt.Graphics2D g2d, java.awt.Shape clip)
          Setting clip Shape by taking old clip Shape into account
static java.awt.Shape intersectClip(java.awt.Graphics2D g2d, java.awt.Shape clip, boolean shouldSetup)
           
static void restoreAntialias(java.awt.Graphics2D g2d, java.lang.Object old)
           
static void restoreAntialias(java.awt.Graphics g, java.lang.Object old)
           
static void restoreClip(java.awt.Graphics g, java.awt.Shape clip)
           
static void restoreClip(java.awt.Graphics g, java.awt.Shape clip, boolean shouldRestore)
           
static void restoreComposite(java.awt.Graphics2D g2d, java.awt.Composite composite)
           
static void restoreComposite(java.awt.Graphics2D g2d, java.awt.Composite composite, boolean shouldRestore)
           
static void restoreFont(java.awt.Graphics g, java.awt.Font font)
           
static void restoreImageQuality(java.awt.Graphics2D g2d, java.lang.Object old)
           
static void restoreImageQuality(java.awt.Graphics g, java.lang.Object old)
           
static void restoreStroke(java.awt.Graphics2D g2d, java.awt.Stroke stroke)
           
static void restoreStroke(java.awt.Graphics2D g2d, java.awt.Stroke stroke, boolean shouldRestore)
           
static java.awt.Composite setupAlphaComposite(java.awt.Graphics2D g2d, java.awt.Composite composeWith, java.lang.Float alpha)
           
static java.awt.Composite setupAlphaComposite(java.awt.Graphics2D g2d, java.awt.Composite composeWith, java.lang.Float alpha, boolean shouldSetup)
           
static java.awt.Composite setupAlphaComposite(java.awt.Graphics2D g2d, java.lang.Float alpha)
          Setting AlphaComposite by taking old AlphaComposite settings into account
static java.awt.Composite setupAlphaComposite(java.awt.Graphics2D g2d, java.lang.Float alpha, boolean shouldSetup)
           
static java.lang.Object setupAntialias(java.awt.Graphics g)
          Setting antialias on
static java.lang.Object setupAntialias(java.awt.Graphics2D g2d)
           
static java.awt.Font setupFont(java.awt.Graphics g, java.awt.Font font)
          Setting font
static java.lang.Object setupImageQuality(java.awt.Graphics g)
          Setting image quality on
static java.lang.Object setupImageQuality(java.awt.Graphics2D g2d)
           
static java.awt.Stroke setupStroke(java.awt.Graphics2D g2d, java.awt.Stroke stroke)
          Setting new stroke
static java.awt.Stroke setupStroke(java.awt.Graphics2D g2d, java.awt.Stroke stroke, boolean shouldSetup)
           
static void setupSystemTextHints(java.awt.Graphics g)
           
static void setupSystemTextHints(java.awt.Graphics2D g2d)
           
static java.awt.Shape subtractClip(java.awt.Graphics g, java.awt.Shape clip)
           
static java.awt.Shape subtractClip(java.awt.Graphics g, java.awt.Shape clip, boolean shouldSetup)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphicsUtils

public GraphicsUtils()
Method Detail

setupAntialias

public static java.lang.Object setupAntialias(java.awt.Graphics g)
Setting antialias on


setupAntialias

public static java.lang.Object setupAntialias(java.awt.Graphics2D g2d)

disableAntialias

public static java.lang.Object disableAntialias(java.awt.Graphics g)

disableAntialias

public static java.lang.Object disableAntialias(java.awt.Graphics2D g2d)

restoreAntialias

public static void restoreAntialias(java.awt.Graphics g,
                                    java.lang.Object old)

restoreAntialias

public static void restoreAntialias(java.awt.Graphics2D g2d,
                                    java.lang.Object old)

getSystemTextHints

public static java.util.Map getSystemTextHints()

setupSystemTextHints

public static void setupSystemTextHints(java.awt.Graphics g)

setupSystemTextHints

public static void setupSystemTextHints(java.awt.Graphics2D g2d)

setupAlphaComposite

public static java.awt.Composite setupAlphaComposite(java.awt.Graphics2D g2d,
                                                     java.lang.Float alpha)
Setting AlphaComposite by taking old AlphaComposite settings into account


setupAlphaComposite

public static java.awt.Composite setupAlphaComposite(java.awt.Graphics2D g2d,
                                                     java.lang.Float alpha,
                                                     boolean shouldSetup)

setupAlphaComposite

public static java.awt.Composite setupAlphaComposite(java.awt.Graphics2D g2d,
                                                     java.awt.Composite composeWith,
                                                     java.lang.Float alpha)

setupAlphaComposite

public static java.awt.Composite setupAlphaComposite(java.awt.Graphics2D g2d,
                                                     java.awt.Composite composeWith,
                                                     java.lang.Float alpha,
                                                     boolean shouldSetup)

restoreComposite

public static void restoreComposite(java.awt.Graphics2D g2d,
                                    java.awt.Composite composite)

restoreComposite

public static void restoreComposite(java.awt.Graphics2D g2d,
                                    java.awt.Composite composite,
                                    boolean shouldRestore)

setupStroke

public static java.awt.Stroke setupStroke(java.awt.Graphics2D g2d,
                                          java.awt.Stroke stroke)
Setting new stroke


setupStroke

public static java.awt.Stroke setupStroke(java.awt.Graphics2D g2d,
                                          java.awt.Stroke stroke,
                                          boolean shouldSetup)

restoreStroke

public static void restoreStroke(java.awt.Graphics2D g2d,
                                 java.awt.Stroke stroke)

restoreStroke

public static void restoreStroke(java.awt.Graphics2D g2d,
                                 java.awt.Stroke stroke,
                                 boolean shouldRestore)

setupImageQuality

public static java.lang.Object setupImageQuality(java.awt.Graphics g)
Setting image quality on


setupImageQuality

public static java.lang.Object setupImageQuality(java.awt.Graphics2D g2d)

restoreImageQuality

public static void restoreImageQuality(java.awt.Graphics g,
                                       java.lang.Object old)

restoreImageQuality

public static void restoreImageQuality(java.awt.Graphics2D g2d,
                                       java.lang.Object old)

setupFont

public static java.awt.Font setupFont(java.awt.Graphics g,
                                      java.awt.Font font)
Setting font


restoreFont

public static void restoreFont(java.awt.Graphics g,
                               java.awt.Font font)

intersectClip

public static java.awt.Shape intersectClip(java.awt.Graphics2D g2d,
                                           java.awt.Shape clip)
Setting clip Shape by taking old clip Shape into account


intersectClip

public static java.awt.Shape intersectClip(java.awt.Graphics2D g2d,
                                           java.awt.Shape clip,
                                           boolean shouldSetup)

subtractClip

public static java.awt.Shape subtractClip(java.awt.Graphics g,
                                          java.awt.Shape clip)

subtractClip

public static java.awt.Shape subtractClip(java.awt.Graphics g,
                                          java.awt.Shape clip,
                                          boolean shouldSetup)

restoreClip

public static void restoreClip(java.awt.Graphics g,
                               java.awt.Shape clip)

restoreClip

public static void restoreClip(java.awt.Graphics g,
                               java.awt.Shape clip,
                               boolean shouldRestore)

getStroke

public static java.awt.Stroke getStroke(int width)

getStroke

public static java.awt.Stroke getStroke(int width,
                                        int cap)

getStroke

public static java.awt.Stroke getStroke(int width,
                                        int cap,
                                        int join)

drawShade

public static void drawShade(java.awt.Graphics2D g2d,
                             java.awt.Shape shape,
                             java.awt.Color shadeColor,
                             int width)
Draws web styled shade using specified shape


drawShade

public static void drawShade(java.awt.Graphics2D g2d,
                             java.awt.Shape shape,
                             ShadeType shadeType,
                             java.awt.Color shadeColor,
                             int width)

drawShade

public static void drawShade(java.awt.Graphics2D g2d,
                             java.awt.Shape shape,
                             java.awt.Color shadeColor,
                             int width,
                             java.awt.Shape clip)

drawShade

public static void drawShade(java.awt.Graphics2D g2d,
                             java.awt.Shape shape,
                             ShadeType shadeType,
                             java.awt.Color shadeColor,
                             int width,
                             java.awt.Shape clip)

drawShade

public static void drawShade(java.awt.Graphics2D g2d,
                             java.awt.Shape shape,
                             java.awt.Color shadeColor,
                             int width,
                             boolean round)

drawShade

public static void drawShade(java.awt.Graphics2D g2d,
                             java.awt.Shape shape,
                             ShadeType shadeType,
                             java.awt.Color shadeColor,
                             int width,
                             boolean round)

drawShade

public static void drawShade(java.awt.Graphics2D g2d,
                             java.awt.Shape shape,
                             java.awt.Color shadeColor,
                             int width,
                             java.awt.Shape clip,
                             boolean round)

drawShade

public static void drawShade(java.awt.Graphics2D g2d,
                             java.awt.Shape shape,
                             ShadeType shadeType,
                             java.awt.Color shadeColor,
                             int width,
                             java.awt.Shape clip,
                             boolean round)