Quaqua 7.4.2 2011-07-05

ch.randelshofer.quaqua.color
Class TextureColor

java.lang.Object
  extended by java.awt.Color
      extended by ch.randelshofer.quaqua.color.PaintableColor
          extended by ch.randelshofer.quaqua.color.TextureColor
All Implemented Interfaces:
java.awt.Paint, java.awt.Transparency, java.io.Serializable
Direct Known Subclasses:
TextureColor.UIResource

public class TextureColor
extends PaintableColor

This class used to pass TexturePaint's 'through' the Swing API, so that users of our Look and Feel can work with TexturePaint's like with regular colors, but Quaqua UI components will paint using the texture instead of with the color.

Version:
$Id: TextureColor.java 361 2010-11-21 11:19:20Z wrandelshofer $
Author:
Werner Randelshofer
See Also:
Serialized Form

Nested Class Summary
static class TextureColor.UIResource
           
 
Field Summary
protected  java.awt.Image texture
           
 
Fields inherited from class java.awt.Color
black, BLACK, blue, BLUE, cyan, CYAN, DARK_GRAY, darkGray, gray, GRAY, green, GREEN, LIGHT_GRAY, lightGray, magenta, MAGENTA, orange, ORANGE, pink, PINK, red, RED, white, WHITE, yellow, YELLOW
 
Fields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT
 
Constructor Summary
TextureColor(int rgb)
          Creates a new instance.
TextureColor(int r, int g, int b)
           
TextureColor(int r, int g, int b, java.awt.Image texture)
           
TextureColor(int r, int g, int b, int a)
           
TextureColor(int r, int g, int b, int a, java.awt.Image texture)
           
TextureColor(int rgb, java.lang.String location)
           
 
Method Summary
 java.awt.Paint getPaint(java.awt.Component c, int x, int y, int width, int height)
           
 java.awt.image.BufferedImage getTexture()
           
 
Methods inherited from class ch.randelshofer.quaqua.color.PaintableColor
getPaint, getPaint, getPaint, getPaint, getRootPaneOffset
 
Methods inherited from class java.awt.Color
brighter, createContext, darker, decode, equals, getAlpha, getBlue, getColor, getColor, getColor, getColorComponents, getColorComponents, getColorSpace, getComponents, getComponents, getGreen, getHSBColor, getRed, getRGB, getRGBColorComponents, getRGBComponents, getTransparency, hashCode, HSBtoRGB, RGBtoHSB, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

texture

protected java.awt.Image texture
Constructor Detail

TextureColor

public TextureColor(int rgb)
Creates a new instance.


TextureColor

public TextureColor(int r,
                    int g,
                    int b)

TextureColor

public TextureColor(int r,
                    int g,
                    int b,
                    int a)

TextureColor

public TextureColor(int r,
                    int g,
                    int b,
                    java.awt.Image texture)

TextureColor

public TextureColor(int r,
                    int g,
                    int b,
                    int a,
                    java.awt.Image texture)

TextureColor

public TextureColor(int rgb,
                    java.lang.String location)
Method Detail

getTexture

public java.awt.image.BufferedImage getTexture()

getPaint

public java.awt.Paint getPaint(java.awt.Component c,
                               int x,
                               int y,
                               int width,
                               int height)
Specified by:
getPaint in class PaintableColor

Copyright 2003-2007 (c) Werner Randelshofer.
All rights reserved.