|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.plaf.synth.SynthGraphicsUtils
org.jdesktop.swingx.plaf.nimbus.NimbusGraphicsUtils
public class NimbusGraphicsUtils
NimbusGraphicsUtils - extends SynthGraphicsUtils to force all Synth painted text to be antialiased and provides some static helper methods.
| Constructor Summary | |
|---|---|
NimbusGraphicsUtils()
|
|
| Method Summary | |
|---|---|
static java.awt.image.BufferedImage |
createColorMaskImage(java.awt.image.BufferedImage alpha,
java.awt.Color c)
Creates and returns a new color image filled with color c and with alpha channel alpha. |
static java.awt.image.BufferedImage |
createCompatibleTranslucentImage(int width,
int height)
Returns a new translucent compatible image of the specified width and height. |
static java.awt.image.BufferedImage |
getAlphaMask(java.awt.image.BufferedImage srcImg,
int dstWidth,
int dstHeight)
Extract the alpha channel from a image as a greyscale image |
static java.awt.Color |
getMidWebColor(java.lang.String c1,
java.lang.String c2)
Get a Color that is 50% inbetween the two web colors given. |
static java.awt.RenderingHints |
getRenderingHints(java.awt.Graphics2D g2d,
java.util.Map<?,?> hintsToSave,
java.awt.RenderingHints savedHints)
Get rendering hints from a Graphics instance. |
static java.awt.image.Kernel[] |
getSeparateGaussianKernel(int radius)
Generate a pair of 1D Gaussian kernels |
static java.awt.Color |
getWebColor(java.lang.String c)
Get a Color object from a web color string of the form "FF00AB" or "#FF00AB". |
static java.awt.image.BufferedImage |
loadImage(java.lang.String imgName)
Load an image using ImageIO from resource in org.jdesktop.swingx.plaf.nimbus.images. |
void |
paintText(javax.swing.plaf.synth.SynthContext ss,
java.awt.Graphics g,
java.lang.String text,
int x,
int y,
int mnemonicIndex)
Overrides paintText in SynthGraphicsUtils to force all Synth painted text to be antialiased |
| Methods inherited from class javax.swing.plaf.synth.SynthGraphicsUtils |
|---|
computeStringWidth, drawLine, drawLine, getMaximumCharHeight, getMaximumSize, getMinimumSize, getPreferredSize, layoutText, paintText, paintText |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NimbusGraphicsUtils()
| Method Detail |
|---|
public static java.awt.RenderingHints getRenderingHints(java.awt.Graphics2D g2d,
java.util.Map<?,?> hintsToSave,
java.awt.RenderingHints savedHints)
g2d - the graphics surfacehintsToSave - the list of rendering hints to set on the graphicssavedHints - a set where to save the previous rendering hints, might be null
public void paintText(javax.swing.plaf.synth.SynthContext ss,
java.awt.Graphics g,
java.lang.String text,
int x,
int y,
int mnemonicIndex)
paintText in class javax.swing.plaf.synth.SynthGraphicsUtilspublic static java.awt.image.BufferedImage loadImage(java.lang.String imgName)
imgName - The name of the image to load, eg. "border.png"
public static java.awt.Color getWebColor(java.lang.String c)
c - The color string
public static java.awt.Color getMidWebColor(java.lang.String c1,
java.lang.String c2)
c1 - The first color stringc2 - The second color string
public static java.awt.image.BufferedImage createCompatibleTranslucentImage(int width,
int height)
Returns a new translucent compatible image of the specified width and height.
width - the width of the new imageheight - the height of the new image
BufferedImage of the
specified width and height
public static java.awt.image.BufferedImage getAlphaMask(java.awt.image.BufferedImage srcImg,
int dstWidth,
int dstHeight)
srcImg - the source imagedstWidth - The width of the destintaion, allows padding to be added to alphadstHeight - The height of the destintaion, allows padding to be added to alpha
srcImg in the center
public static java.awt.image.BufferedImage createColorMaskImage(java.awt.image.BufferedImage alpha,
java.awt.Color c)
c and with alpha channel alpha.
alpha - The alpha channel for the new imagec - The fill color
c and with alpha channel alphapublic static java.awt.image.Kernel[] getSeparateGaussianKernel(int radius)
radius - the blur radius
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||