|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.mlf.metouia.MetouiaGradients
This class represents the basic gradient used through the Metouia look & feel and presents some helpful static method for drawing standard gradients.
Field Summary |
Fields inherited from interface java.awt.Transparency |
BITMASK, OPAQUE, TRANSLUCENT |
Constructor Summary | |
MetouiaGradients(java.awt.Color start,
java.awt.Color end,
boolean isVertical,
boolean isAscending)
Creates a new Metouia gradient. |
Method Summary | |
java.awt.PaintContext |
createContext(java.awt.image.ColorModel cm,
java.awt.Rectangle r,
java.awt.geom.Rectangle2D r2d,
java.awt.geom.AffineTransform xform,
java.awt.RenderingHints hints)
Creates and returns a PaintContext used to generate the color pattern. |
static void |
drawGradient(java.awt.Graphics g,
java.awt.Color start,
java.awt.Color end,
java.awt.Rectangle rectangle,
boolean isVertical,
boolean isAscending)
Draws a gradient on the given rectangle. |
static void |
drawHighlight(java.awt.Graphics graphics,
java.awt.Rectangle rectangle,
boolean isVertical,
boolean isAscending)
Draws a highlight gradient on the given rectangle. |
static void |
drawHorizontalHighlight(java.awt.Graphics g,
java.awt.Component c)
Draws a horizontal highlight on the given component. |
static void |
drawHorizontalShadow(java.awt.Graphics g,
java.awt.Component c)
Draws a horizontal shadow on the given component. |
static void |
drawShadow(java.awt.Graphics graphics,
java.awt.Rectangle rectangle,
boolean isVertical,
boolean isAscending)
Draws a shadow gradient on the given rectangle. |
static void |
drawVerticalHighlight(java.awt.Graphics g,
java.awt.Component c)
Draws a vertical highlight on the given component. |
static void |
drawVerticalShadow(java.awt.Graphics g,
java.awt.Component c)
Draws a vertical shadow on the given component. |
int |
getTransparency()
Gets the transparency of this gradient. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MetouiaGradients(java.awt.Color start, java.awt.Color end, boolean isVertical, boolean isAscending)
start
- The start color of the gradient.end
- The end color of the gradient.isVertical
- If the gradient should be vertical or horizontal.isAscending
- If the gradient's transparency should be ascending.Method Detail |
public java.awt.PaintContext createContext(java.awt.image.ColorModel cm, java.awt.Rectangle r, java.awt.geom.Rectangle2D r2d, java.awt.geom.AffineTransform xform, java.awt.RenderingHints hints)
createContext
in interface java.awt.Paint
cm
- The ColorModel that receives the Paint
data.
This is used only as a hint.r
- The device space bounding box of the graphics primitive being
rendered.r2d
- The user space bounding box of the graphics primitive being
rendered.xform
- The AffineTransform from user space into device space.hints
- The hint that the context object uses to choose between
rendering alternatives.
PaintContext
for generating color patterns.public int getTransparency()
getTransparency
in interface java.awt.Transparency
TRANSLUCENT
id the end and start colors have an alpha
channel otherwise OPAQUE
.public static final void drawGradient(java.awt.Graphics g, java.awt.Color start, java.awt.Color end, java.awt.Rectangle rectangle, boolean isVertical, boolean isAscending)
g
- The graphics context.start
- The start color of the gradient.end
- The end color of the gradient.rectangle
- The rectagle on which the gradient will be painted.isVertical
- If the gradient should be vertical or horizontal.isAscending
- If the gradient's transparency should be ascending.public static final void drawHighlight(java.awt.Graphics graphics, java.awt.Rectangle rectangle, boolean isVertical, boolean isAscending)
graphics
- The graphics context.rectangle
- The rectagle on which the gradient will be painted.isVertical
- If the gradient should be vertical or horizontal.isAscending
- If the gradient's transparency should be ascending.public static final void drawShadow(java.awt.Graphics graphics, java.awt.Rectangle rectangle, boolean isVertical, boolean isAscending)
graphics
- The graphics context.rectangle
- The rectagle on which the gradient will be painted.isVertical
- If the gradient should be vertical or horizontal.isAscending
- If the gradient's transparency should be ascending.public static final void drawHorizontalHighlight(java.awt.Graphics g, java.awt.Component c)
g
- The graphics context.c
- The component ob wich the gradient will be painted.public static final void drawHorizontalShadow(java.awt.Graphics g, java.awt.Component c)
g
- The graphics context.c
- The component ob wich the gradient will be painted.public static final void drawVerticalHighlight(java.awt.Graphics g, java.awt.Component c)
g
- The graphics context.c
- The component ob wich the gradient will be painted.public static final void drawVerticalShadow(java.awt.Graphics g, java.awt.Component c)
g
- The graphics context.c
- The component ob wich the gradient will be painted.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |