de.javasoft.plaf.synthetica.painter
Class SyntheticaAddonsPainter

java.lang.Object
  extended by de.javasoft.plaf.synthetica.painter.SyntheticaAddonsPainter

public class SyntheticaAddonsPainter
extends java.lang.Object

Base class for addon painters - provides empty methods only.

Version:
1.04, 30.09.2009

Nested Class Summary
static class Cacheable.ScaleType
           
 
Field Summary
static java.lang.String DOCKING_PAINTER
           
static java.lang.String FLEXDOCK_PAINTER
          Deprecated. use Docking_PAINTER instead
static java.lang.String HYPERLINK_PAINTER
           
protected static java.util.HashMap<java.lang.String,de.javasoft.plaf.synthetica.painter.SyntheticaComponentPainter> instances
           
static java.lang.String MONTH_VIEW_PAINTER
           
static java.lang.String MULTI_LEVEL_BAR_PAINTER
           
static java.lang.String STATUS_BAR_PAINTER
           
static java.lang.String SYSTEM_MONITOR_PAINTER
           
static java.lang.String TASK_PANE_PAINTER
           
static java.lang.String TITLED_PANEL_PAINTER
           
 
Constructor Summary
SyntheticaAddonsPainter()
           
 
Method Summary
protected  float calcRelativeArc(java.awt.Graphics2D g2, float arc, float offset)
          Helper method to calculate an arc relative to the given offset.
protected  float calcRelativeGradientPos(java.awt.Graphics2D g2, float pos, float offset)
          Helper method to calculate a relative gradient position in respect to the given offset.
protected static float calcRelativeLength(java.awt.Graphics2D g2, float length, float offset)
          Helper method to calculate a length in respect to the given offset.
protected  float calcRelativePos(java.awt.Graphics2D g2, float pos, float offset)
          Helper method to calculate a relative position in respect to the given offset.
protected  java.awt.Color createAlphaColor(java.awt.Color color, java.lang.Float alpha)
          Helper method to create a alpha color from a solid color.
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.
static SyntheticaAddonsPainter getInstance(java.lang.String painterUIKey)
           
protected static de.javasoft.plaf.synthetica.painter.SyntheticaComponentPainter getInstance(javax.swing.plaf.synth.SynthContext sc, java.lang.Class<?> syntheticaPainter, java.lang.String customPainterUIKey)
          Returns a painter instance.
protected static java.lang.String getPainterClassName(javax.swing.plaf.synth.SynthContext sc, java.lang.Class<?> syntheticaPainter, java.lang.String customPainterUIKey)
           
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 component background property or client properties "Synthetica.background" and "Synthetica.background.alpha".
 void paintDockingContentPaneBackground(javax.swing.JComponent c, SyntheticaState state, java.awt.Graphics g, int x, int y, int w, int h)
          Paints JYDocking content pane background.
 void paintDockingDockbarBackground(javax.swing.JComponent c, SyntheticaState state, java.awt.Graphics g, int x, int y, int w, int h, int placement)
          Paints the JYDocking dockbar background.
 void paintDockingDockbarLabelBackground(javax.swing.JComponent c, SyntheticaState state, java.awt.Graphics g, int x, int y, int w, int h, int placement)
          Paints the JYDocking dockbar label background.
 void paintDockingSlidePanelBackground(javax.swing.JComponent c, SyntheticaState state, java.awt.Graphics g, int x, int y, int w, int h, int placement)
          Paints the JYDocking dockbar slidePanel background.
 void paintDockingTitleBarBackground(javax.swing.JComponent c, SyntheticaState state, java.awt.Graphics g, int x, int y, int w, int h)
          Paints the JYDocking title bar background.
 void paintFlexdockTitleBarBackground(javax.swing.JComponent c, SyntheticaState state, java.awt.Graphics g, int x, int y, int w, int h)
          Paints the flexdock title bar background.
 void paintHyperlinkFocus(javax.swing.JComponent c, SyntheticaState state, java.awt.Graphics g, int x, int y, int w, int h)
          Hyperlink
 void paintMonthViewMonthBackground(javax.swing.JComponent c, SyntheticaState state, java.awt.Graphics g, int x, int y, int w, int h)
          MonthView
 void paintMultiLevelBar(javax.swing.JComponent c, SyntheticaState state, java.awt.Graphics g, int x, int y, int w, int h)
          MultiLevelBar
 void paintStatusBarBackground(javax.swing.JComponent c, SyntheticaState state, java.awt.Graphics g, int x, int y, int w, int h)
          Paints the status bar background.
 void paintSystemMonitorBackground(javax.swing.JComponent c, SyntheticaState state, java.awt.Graphics g, int x, int y, int w, int h)
           
 void paintSystemMonitorBorder(javax.swing.JComponent c, SyntheticaState state, java.awt.Graphics g, int x, int y, int w, int h)
          SystemMonitor
 void paintSystemMonitorForeground(javax.swing.JComponent c, SyntheticaState state, java.awt.Graphics g, int x, int y, int w, int h)
           
 void paintSystemMonitorSpotlight(javax.swing.JComponent c, SyntheticaState state, java.awt.Graphics g, int x, int y, int w, int h)
           
 void paintTaskPaneContainerBackground(javax.swing.JComponent c, SyntheticaState state, java.awt.Graphics g, int x, int y, int w, int h)
          Paints the taskPane container background.
 void paintTaskPaneExpandedControl(javax.swing.JComponent c, SyntheticaState state, boolean special, boolean expanded, java.awt.Graphics g, int x, int y, int w, int h)
           
 void paintTaskPaneFocus(javax.swing.JComponent c, SyntheticaState state, java.awt.Graphics g, int x, int y, int w, int h)
           
 void paintTaskPaneTitleBackground(javax.swing.JComponent c, SyntheticaState state, boolean special, boolean expanded, java.awt.Graphics g, int x, int y, int w, int h)
          Paints the taskPane title background.
 void paintTitledPanelBackground(javax.swing.JComponent c, SyntheticaState state, java.awt.Graphics g, int x, int y, int w, int h)
           
 void paintTitledPanelBorder(javax.swing.JComponent c, SyntheticaState state, java.awt.Graphics g, int x, int y, int w, int h)
          TitledPanel
 void paintTitledPanelTitleBackground(javax.swing.JComponent c, SyntheticaState state, java.awt.Graphics g, int x, int y, int w, int h)
           
 void paintTitledPanelTitleBorder(javax.swing.JComponent c, SyntheticaState state, java.awt.Graphics g, int x, int y, int w, int h)
           
protected  java.awt.Graphics2D prepareGraphics2D(javax.swing.plaf.synth.SynthContext sc, java.awt.Graphics g, int x, int y, boolean antiAlias)
          Prepare graphics for Java2D painting.
protected  java.awt.Graphics2D prepareGraphics2D(javax.swing.plaf.synth.SynthContext sc, java.awt.Graphics g, int x, int y, boolean antiAlias, boolean translateXY)
          Prepare graphics for Java2D painting.
protected  java.awt.Graphics2D prepareGraphics2D(javax.swing.plaf.synth.SynthContext sc, java.awt.Graphics g, int x, int y, boolean antiAlias, boolean translateXY, java.awt.BasicStroke stroke)
          Prepares/configures graphics object for 2D painting.
protected  java.awt.Graphics2D prepareGraphics2D(javax.swing.plaf.synth.SynthContext sc, java.awt.Graphics g, int x, int y, int w, int h, java.awt.BasicStroke stroke)
          Deprecated.  
protected  java.awt.Graphics2D prepareGraphics2D(javax.swing.plaf.synth.SynthContext sc, java.awt.Graphics g, int x, int y, int w, int h, boolean respectStrokeWidth)
          Deprecated.  
protected  void restoreGraphics2D(java.awt.Graphics2D g2)
          Restore the already prepared graphics object.
protected  float scaleArc(float arc)
          Returns a scaled arc.
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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOCKING_PAINTER

public static final java.lang.String DOCKING_PAINTER
See Also:
Constant Field Values

FLEXDOCK_PAINTER

public static final java.lang.String FLEXDOCK_PAINTER
Deprecated. use Docking_PAINTER instead
See Also:
Constant Field Values

HYPERLINK_PAINTER

public static final java.lang.String HYPERLINK_PAINTER
See Also:
Constant Field Values

MONTH_VIEW_PAINTER

public static final java.lang.String MONTH_VIEW_PAINTER
See Also:
Constant Field Values

MULTI_LEVEL_BAR_PAINTER

public static final java.lang.String MULTI_LEVEL_BAR_PAINTER
See Also:
Constant Field Values

STATUS_BAR_PAINTER

public static final java.lang.String STATUS_BAR_PAINTER
See Also:
Constant Field Values

SYSTEM_MONITOR_PAINTER

public static final java.lang.String SYSTEM_MONITOR_PAINTER
See Also:
Constant Field Values

TASK_PANE_PAINTER

public static final java.lang.String TASK_PANE_PAINTER
See Also:
Constant Field Values

TITLED_PANEL_PAINTER

public static final java.lang.String TITLED_PANEL_PAINTER
See Also:
Constant Field Values

instances

protected static java.util.HashMap<java.lang.String,de.javasoft.plaf.synthetica.painter.SyntheticaComponentPainter> instances
Constructor Detail

SyntheticaAddonsPainter

public SyntheticaAddonsPainter()
Method Detail

getInstance

public static SyntheticaAddonsPainter getInstance(java.lang.String painterUIKey)

paintDockingTitleBarBackground

public void paintDockingTitleBarBackground(javax.swing.JComponent c,
                                           SyntheticaState state,
                                           java.awt.Graphics g,
                                           int x,
                                           int y,
                                           int w,
                                           int h)
Paints the JYDocking title bar background. The method is intended to be used by third parties.

Parameters:
c - The relevant component
state - Current component state
g - Graphics used for rendering
x - The x position
y - The y position
w - The width
h - The height

paintDockingContentPaneBackground

public void paintDockingContentPaneBackground(javax.swing.JComponent c,
                                              SyntheticaState state,
                                              java.awt.Graphics g,
                                              int x,
                                              int y,
                                              int w,
                                              int h)
Paints JYDocking content pane background. The method is intended to be used by third parties.

Parameters:
c - The relevant component
state - Current component state
g - Graphics used for rendering
x - The x position
y - The y position
w - The width
h - The height

paintDockingDockbarBackground

public void paintDockingDockbarBackground(javax.swing.JComponent c,
                                          SyntheticaState state,
                                          java.awt.Graphics g,
                                          int x,
                                          int y,
                                          int w,
                                          int h,
                                          int placement)
Paints the JYDocking dockbar background. The method is intended to be used by third parties.

Parameters:
c - The relevant component
state - Current component state
g - Graphics used for rendering
x - The x position
y - The y position
w - The width
h - The height
placement - The placement - SwingConstants.LEFT, SwingConstants.RIGHT, SwingConstants.BOTTOM

paintDockingSlidePanelBackground

public void paintDockingSlidePanelBackground(javax.swing.JComponent c,
                                             SyntheticaState state,
                                             java.awt.Graphics g,
                                             int x,
                                             int y,
                                             int w,
                                             int h,
                                             int placement)
Paints the JYDocking dockbar slidePanel background. The method is intended to be used by third parties.

Parameters:
c - The relevant component
state - Current component state
g - Graphics used for rendering
x - The x position
y - The y position
w - The width
h - The height
placement - The placement - SwingConstants.LEFT, SwingConstants.RIGHT, SwingConstants.BOTTOM

paintDockingDockbarLabelBackground

public void paintDockingDockbarLabelBackground(javax.swing.JComponent c,
                                               SyntheticaState state,
                                               java.awt.Graphics g,
                                               int x,
                                               int y,
                                               int w,
                                               int h,
                                               int placement)
Paints the JYDocking dockbar label background. The method is intended to be used by third parties.

Parameters:
c - The relevant component
state - Current component state
g - Graphics used for rendering
x - The x position
y - The y position
w - The width
h - The height
placement - The placement - SwingConstants.LEFT, SwingConstants.RIGHT, SwingConstants.BOTTOM

paintFlexdockTitleBarBackground

public void paintFlexdockTitleBarBackground(javax.swing.JComponent c,
                                            SyntheticaState state,
                                            java.awt.Graphics g,
                                            int x,
                                            int y,
                                            int w,
                                            int h)
Paints the flexdock title bar background. The method is intended to be used by third parties.

Parameters:
c - The relevant component
state - Current component state
g - Graphics used for rendering
x - The x position
y - The y position
w - The width
h - The height

paintHyperlinkFocus

public void paintHyperlinkFocus(javax.swing.JComponent c,
                                SyntheticaState state,
                                java.awt.Graphics g,
                                int x,
                                int y,
                                int w,
                                int h)
Hyperlink


paintMonthViewMonthBackground

public void paintMonthViewMonthBackground(javax.swing.JComponent c,
                                          SyntheticaState state,
                                          java.awt.Graphics g,
                                          int x,
                                          int y,
                                          int w,
                                          int h)
MonthView


paintMultiLevelBar

public void paintMultiLevelBar(javax.swing.JComponent c,
                               SyntheticaState state,
                               java.awt.Graphics g,
                               int x,
                               int y,
                               int w,
                               int h)
MultiLevelBar


paintStatusBarBackground

public void paintStatusBarBackground(javax.swing.JComponent c,
                                     SyntheticaState state,
                                     java.awt.Graphics g,
                                     int x,
                                     int y,
                                     int w,
                                     int h)
Paints the status bar background. The method is intended to be used by third parties.

Parameters:
c - The relevant component
state - Current component state
g - Graphics used for rendering
x - The x position
y - The y position
w - The width
h - The height

paintSystemMonitorBorder

public void paintSystemMonitorBorder(javax.swing.JComponent c,
                                     SyntheticaState state,
                                     java.awt.Graphics g,
                                     int x,
                                     int y,
                                     int w,
                                     int h)
SystemMonitor


paintSystemMonitorBackground

public void paintSystemMonitorBackground(javax.swing.JComponent c,
                                         SyntheticaState state,
                                         java.awt.Graphics g,
                                         int x,
                                         int y,
                                         int w,
                                         int h)

paintSystemMonitorForeground

public void paintSystemMonitorForeground(javax.swing.JComponent c,
                                         SyntheticaState state,
                                         java.awt.Graphics g,
                                         int x,
                                         int y,
                                         int w,
                                         int h)

paintSystemMonitorSpotlight

public void paintSystemMonitorSpotlight(javax.swing.JComponent c,
                                        SyntheticaState state,
                                        java.awt.Graphics g,
                                        int x,
                                        int y,
                                        int w,
                                        int h)

paintTaskPaneContainerBackground

public void paintTaskPaneContainerBackground(javax.swing.JComponent c,
                                             SyntheticaState state,
                                             java.awt.Graphics g,
                                             int x,
                                             int y,
                                             int w,
                                             int h)
Paints the taskPane container background. The method is intended to be used by third parties.

Parameters:
c - The relevant component
state - Current component state
g - Graphics used for rendering
x - The x position
y - The y position
w - The width
h - The height

paintTaskPaneTitleBackground

public void paintTaskPaneTitleBackground(javax.swing.JComponent c,
                                         SyntheticaState state,
                                         boolean special,
                                         boolean expanded,
                                         java.awt.Graphics g,
                                         int x,
                                         int y,
                                         int w,
                                         int h)
Paints the taskPane title background. The method is intended to be used by third parties.

Parameters:
c - The relevant component
state - Current component state
special - True means use emphasized look
expanded - True means task pane is expanded
g - Graphics used for rendering
x - The x position
y - The y position
w - The width
h - The height

paintTaskPaneExpandedControl

public void paintTaskPaneExpandedControl(javax.swing.JComponent c,
                                         SyntheticaState state,
                                         boolean special,
                                         boolean expanded,
                                         java.awt.Graphics g,
                                         int x,
                                         int y,
                                         int w,
                                         int h)

paintTaskPaneFocus

public void paintTaskPaneFocus(javax.swing.JComponent c,
                               SyntheticaState state,
                               java.awt.Graphics g,
                               int x,
                               int y,
                               int w,
                               int h)

paintTitledPanelBorder

public void paintTitledPanelBorder(javax.swing.JComponent c,
                                   SyntheticaState state,
                                   java.awt.Graphics g,
                                   int x,
                                   int y,
                                   int w,
                                   int h)
TitledPanel


paintTitledPanelBackground

public void paintTitledPanelBackground(javax.swing.JComponent c,
                                       SyntheticaState state,
                                       java.awt.Graphics g,
                                       int x,
                                       int y,
                                       int w,
                                       int h)

paintTitledPanelTitleBorder

public void paintTitledPanelTitleBorder(javax.swing.JComponent c,
                                        SyntheticaState state,
                                        java.awt.Graphics g,
                                        int x,
                                        int y,
                                        int w,
                                        int h)

paintTitledPanelTitleBackground

public void paintTitledPanelTitleBackground(javax.swing.JComponent c,
                                            SyntheticaState state,
                                            java.awt.Graphics g,
                                            int x,
                                            int y,
                                            int w,
                                            int h)

getInstance

protected static de.javasoft.plaf.synthetica.painter.SyntheticaComponentPainter getInstance(javax.swing.plaf.synth.SynthContext sc,
                                                                                            java.lang.Class<?> syntheticaPainter,
                                                                                            java.lang.String customPainterUIKey)
Returns a painter instance.


getPainterClassName

protected static java.lang.String getPainterClassName(javax.swing.plaf.synth.SynthContext sc,
                                                      java.lang.Class<?> syntheticaPainter,
                                                      java.lang.String customPainterUIKey)

prepareGraphics2D

protected java.awt.Graphics2D prepareGraphics2D(javax.swing.plaf.synth.SynthContext sc,
                                                java.awt.Graphics g,
                                                int x,
                                                int y,
                                                boolean antiAlias,
                                                boolean translateXY,
                                                java.awt.BasicStroke stroke)
Prepares/configures graphics object for 2D painting.

Parameters:
sc - Synth context, can be null.
g - Graphics object.
x - Original X-position, if translateXY is true the point of origin is X,Y which means the paint method doesn't have to respect the X-position.
y - Original Y-position, if translateXY is true the point of origin is X,Y which means the paint method doesn't have to respect the Y-position.
antiAlias - True means anti-alias rendering hint will be set - it's recommended to enable anti-aliasing for borders (#draw(Shape s)) and for background fills (#fill(Shape s)) in case that the border is translucent.
translateXY - True, translate graphics to specified X,Y coordinates and respect stroke width - point of origin for painting is X,Y.
stroke - Stroke used for painting - can be null in this case (createStroke(SynthContext) will be used).
Returns:
Configured Graphics2D object.

prepareGraphics2D

protected java.awt.Graphics2D prepareGraphics2D(javax.swing.plaf.synth.SynthContext sc,
                                                java.awt.Graphics g,
                                                int x,
                                                int y,
                                                boolean antiAlias)
Prepare graphics for Java2D painting. Graphics will be translated to the specified X,Y coordinates - point of origin for painting is X,Y. Painter methods doesn't have to respect the X,Y-position.

See Also:
prepareGraphics2D(SynthContext, Graphics, int, int, boolean, boolean, BasicStroke), createStroke(SynthContext)

prepareGraphics2D

protected java.awt.Graphics2D prepareGraphics2D(javax.swing.plaf.synth.SynthContext sc,
                                                java.awt.Graphics g,
                                                int x,
                                                int y,
                                                boolean antiAlias,
                                                boolean translateXY)
Prepare graphics for Java2D painting.

See Also:
prepareGraphics2D(SynthContext, Graphics, int, int, boolean, boolean, BasicStroke), createStroke(SynthContext)

prepareGraphics2D

protected java.awt.Graphics2D prepareGraphics2D(javax.swing.plaf.synth.SynthContext sc,
                                                java.awt.Graphics g,
                                                int x,
                                                int y,
                                                int w,
                                                int h,
                                                java.awt.BasicStroke stroke)
Deprecated. 

Prepare graphics for Java2D painting.

See Also:
prepareGraphics2D(SynthContext, Graphics, int, int, boolean, boolean, BasicStroke)

prepareGraphics2D

protected java.awt.Graphics2D prepareGraphics2D(javax.swing.plaf.synth.SynthContext sc,
                                                java.awt.Graphics g,
                                                int x,
                                                int y,
                                                int w,
                                                int h,
                                                boolean respectStrokeWidth)
Deprecated. 

Prepare graphics for Java2D painting.

See Also:
prepareGraphics2D(SynthContext, Graphics, int, int, boolean, boolean, BasicStroke)

restoreGraphics2D

protected void restoreGraphics2D(java.awt.Graphics2D g2)
Restore the already prepared graphics object.


getScale

protected float getScale()
Returns the current scale factor.


createStroke

protected java.awt.BasicStroke createStroke(javax.swing.plaf.synth.SynthContext sc)
Creates the stroke used for Java2D painting.


scaleArc

protected float scaleArc(float arc)
Returns a scaled arc.

Parameters:
arc - The unscaled arc.
Returns:
The scaled arc.

calcRelativeArc

protected float calcRelativeArc(java.awt.Graphics2D g2,
                                float arc,
                                float offset)
Helper method to calculate an arc relative to the given offset. Note: Stroke width has to be equal to the scale factor

Parameters:
g2 - 2D graphics object.
arc - The base arc.
offset - The offset in pixel.
Returns:
The calculated arc.

calcRelativePos

protected float calcRelativePos(java.awt.Graphics2D g2,
                                float pos,
                                float offset)
Helper method to calculate a relative position in respect to the given offset. Note: Stroke width has to be equal to the scale factor

Parameters:
g2 - 2D graphics object.
pos - X/Y-position.
offset - The offset in pixel.
Returns:
The calculated position.

calcRelativeGradientPos

protected float calcRelativeGradientPos(java.awt.Graphics2D g2,
                                        float pos,
                                        float offset)
Helper method to calculate a relative gradient position in respect to the given offset. Note: Stroke width has to be equal to the scale factor

Parameters:
g2 - 2D graphics object.
pos - X/Y-position.
offset - The offset in pixel.
Returns:
The calculated position.

calcRelativeLength

protected static float calcRelativeLength(java.awt.Graphics2D g2,
                                          float length,
                                          float offset)
Helper method to calculate a length in respect to the given offset. Note: Stroke width has to be equal to the scale factor

Parameters:
g2 - 2D graphics object.
length - The length.
offset - The offset in pixel.
Returns:
The calculated length.

subtractStroke

protected static java.awt.Shape subtractStroke(java.awt.Graphics2D g2,
                                               java.awt.Shape s)
Helper method to subtract the stroke from the given shape.

Parameters:
g2 - Graphics.
s - The shape.
Returns:
The shape without stroke.

getSyntheticaBackgroundColor

protected java.awt.Color getSyntheticaBackgroundColor(javax.swing.JComponent c)
Helper method to create the Synthetica background color with alpha value provided by component background property or client properties "Synthetica.background" and "Synthetica.background.alpha". If no background color is set null will be returned.

Parameters:
c - The relevant JComponent.
Returns:
The background color including alpha value or null

createAlphaColor

protected java.awt.Color createAlphaColor(java.awt.Color color,
                                          java.lang.Float alpha)
Helper method to create a alpha color from a solid color. If color is null, null will be returned. If alpha value is null 0.1f will be used.

Parameters:
color - The color.
alpha - The alpha value - null means 0.1f
Returns:
The color including alpha value or null

createLinearGradientPaint

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.

See Also:
SyntheticaLookAndFeel.createLinearGradientPaint(float, float, float, float, float[], Color[])

getCacheHash

public 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. The hash value has to represent every single paint attribute which is used by the painter class which implements the Cacheable interface.

Parameters:
sc - The synth context
w - The paint width
h - The paint height
meta - A context related meta value
id - Usually the relevant painter method name
Returns:
The hash value or -1 for non-cacheable

getCacheScaleType

public Cacheable.ScaleType getCacheScaleType(java.lang.String id)
Returns the scaling type which will be used for scaling.

Parameters:
id - Usually the relevant painter method name
Returns:
The scaling type

getCacheScaleInsets

public 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.

Parameters:
sc - The synth context
id - Usually the relevant painter method name
Returns:
The image insets used for 9 square scaling


Copyright © 2004-2011 Jyloo Software. All Rights Reserved.