|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsun.swing.plaf.synth.SynthIcon
de.javasoft.plaf.synthetica.painter.SyntheticaBasicIconPainter
public class SyntheticaBasicIconPainter
A basic class to paint Java2D icons.
| Nested Class Summary | |
|---|---|
static class |
Cacheable.ScaleType
|
| Constructor Summary | |
|---|---|
SyntheticaBasicIconPainter()
Constructor for 16x16 pixel icon. |
|
SyntheticaBasicIconPainter(javax.swing.plaf.synth.SynthContext sc,
int width,
int height)
Constructor. |
|
| Method Summary | |
|---|---|
protected java.awt.geom.Rectangle2D.Float |
calc2DBounds(java.awt.Graphics2D g2,
float w,
float h)
Calculates outer shape bounds in respect of the stroke width. |
protected java.awt.Paint |
createLinearGradientPaint(float startX,
float startY,
float endX,
float endY,
float[] fractions,
java.awt.Color[] colors)
Convenient method to create a LinearGradientPaint for Java 1.5 and Java 6. |
protected java.awt.BasicStroke |
createStroke(javax.swing.plaf.synth.SynthContext sc)
Creates the stroke used for Java2D painting. |
int |
getCacheHash(javax.swing.plaf.synth.SynthContext sc,
int w,
int h,
int meta,
java.lang.String id)
Returns a cache hash value which is used by SyntheticaSoftCache. |
java.awt.Insets |
getCacheScaleInsets(javax.swing.plaf.synth.SynthContext sc,
java.lang.String id)
Returns the insets in case of 9 square scaling is used. |
Cacheable.ScaleType |
getCacheScaleType(java.lang.String id)
Returns the scaling type which will be used for scaling. |
int |
getIconHeight()
|
int |
getIconHeight(javax.swing.plaf.synth.SynthContext sc)
|
int |
getIconWidth()
|
int |
getIconWidth(javax.swing.plaf.synth.SynthContext sc)
|
protected float |
getScale()
Returns the current scale factor. |
protected java.awt.Color |
getSyntheticaBackgroundColor(javax.swing.JComponent c)
Helper method to create the Synthetica background color with alpha value provided by client properties "Synthetica.background" and "Synthetica.background.alpha". |
void |
paint2D(javax.swing.plaf.synth.SynthContext sc,
java.awt.Graphics2D g2,
float x,
float y,
float w,
float h)
Paint non-scaled icon with Java2D. |
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y)
|
void |
paintIcon(javax.swing.plaf.synth.SynthContext sc,
java.awt.Graphics g,
int x,
int y,
int w,
int h)
|
protected static java.awt.Shape |
subtractStroke(java.awt.Graphics2D g2,
java.awt.Shape s)
Helper method to subtract the stroke from the given shape. |
| Methods inherited from class sun.swing.plaf.synth.SynthIcon |
|---|
getIconHeight, getIconWidth, paintIcon |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SyntheticaBasicIconPainter()
public SyntheticaBasicIconPainter(javax.swing.plaf.synth.SynthContext sc,
int width,
int height)
sc - SynthContext - can be null.width - The icon width.height - The icon height.| Method Detail |
|---|
protected float getScale()
protected java.awt.BasicStroke createStroke(javax.swing.plaf.synth.SynthContext sc)
public int getIconHeight()
getIconHeight in interface javax.swing.Iconpublic int getIconWidth()
getIconWidth in interface javax.swing.Icon
public void paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y)
paintIcon in interface javax.swing.Icon
public void paintIcon(javax.swing.plaf.synth.SynthContext sc,
java.awt.Graphics g,
int x,
int y,
int w,
int h)
public void paint2D(javax.swing.plaf.synth.SynthContext sc,
java.awt.Graphics2D g2,
float x,
float y,
float w,
float h)
calc2DBounds(Graphics2D, float, float)
can be used to calculate x,y,w,h in respect of the stroke line width.
sc - SynthContext - can be null.g2 - Graphics.x - Original non-scaled X-position. If paint2D(SynthContext, Graphics2D, float, float, float, float)
isn't overridden the X-position can be ignored because point of origin is translated to X,Y by the default implementation.y - Original non-scaled Y-position. If paint2D(SynthContext, Graphics2D, float, float, float, float)
isn't overridden the Y-position can be ignored because point of origin is translated to X,Y by the default implementation.w - Non-scaled width-1.h - Non-scaled height-1.calc2DBounds(Graphics2D, float, float)
protected java.awt.geom.Rectangle2D.Float calc2DBounds(java.awt.Graphics2D g2,
float w,
float h)
w - Non-scaled width-1.h - Non-scaled height-1.
protected static java.awt.Shape subtractStroke(java.awt.Graphics2D g2,
java.awt.Shape s)
g2 - Graphics.s - The shape.
protected java.awt.Color getSyntheticaBackgroundColor(javax.swing.JComponent c)
c - The relevant JComponent.
protected java.awt.Paint createLinearGradientPaint(float startX,
float startY,
float endX,
float endY,
float[] fractions,
java.awt.Color[] colors)
SyntheticaLookAndFeel.createLinearGradientPaint(float, float, float, float, float[], Color[])
public int getCacheHash(javax.swing.plaf.synth.SynthContext sc,
int w,
int h,
int meta,
java.lang.String id)
sc - The synth contextw - The paint widthh - The paint heightmeta - A context related meta valueid - Usually the relevant painter method name
public Cacheable.ScaleType getCacheScaleType(java.lang.String id)
id - Usually the relevant painter method name
public java.awt.Insets getCacheScaleInsets(javax.swing.plaf.synth.SynthContext sc,
java.lang.String id)
sc - The synth contextid - Usually the relevant painter method name
public int getIconWidth(javax.swing.plaf.synth.SynthContext sc)
getIconWidth in class sun.swing.plaf.synth.SynthIconpublic int getIconHeight(javax.swing.plaf.synth.SynthContext sc)
getIconHeight in class sun.swing.plaf.synth.SynthIcon
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||