net.infonode.tabbedpanel.theme
Class ShapedGradientTheme

java.lang.Object
  extended by net.infonode.tabbedpanel.theme.TabbedPanelTitledTabTheme
      extended by net.infonode.tabbedpanel.theme.ShapedGradientTheme

public class ShapedGradientTheme
extends TabbedPanelTitledTabTheme

A theme with tabs with rounded edges, gradient backgrounds and support for slopes on left/right side of tab.

Since:
ITP 1.2.0
Version:
$Revision: 1.14 $
Author:
$Author: jesper $

Nested Class Summary
private static class ShapedGradientTheme.TabBorder
           
 
Field Summary
private  ColorProvider alternateHighlight
           
private  ColorProvider controlColor
           
private static int CORNER_INSET
           
private  ColorProvider darkControlColor
           
private  ColorProvider highlightColor
           
private  int leftSlopeHeight
           
private  ColorProvider lineColor
           
private  int rightSlopeHeight
           
private  TabbedPanelProperties tabbedPanelProperties
           
private  TitledTabProperties titledTabProperties
           
 
Constructor Summary
ShapedGradientTheme()
          Creates a default theme with sloped border on the right side of the tab and with colors based on the active look and feel
ShapedGradientTheme(float leftSlope, float rightSlope)
          Creates a theme with the given slopes on the left and right side of the tab and with colors based on the active look and feel
ShapedGradientTheme(float leftSlope, float rightSlope, ColorProvider lineColor, ColorProvider highlightColor)
          Creates a theme with the given slopes on the left and right side of the tab and with the given colors
ShapedGradientTheme(float leftSlope, float rightSlope, int slopeHeight, ColorProvider lineColor, ColorProvider highlightColor)
          Creates a theme with the given slopes on the left and right side of the tab and with the given colors
 
Method Summary
 javax.swing.border.Border createTabBorder(ColorProvider lineColor, ColorProvider highlightColor, float leftSlope, float rightSlope, boolean bottomLeftRounded, boolean topLeftRounded, boolean topRightRounded, boolean bottomRightRounded, boolean isNormal, boolean highlightBottomLeftRounded, int raised)
          Creates a tab border
 ColorProvider getAlternateHighlightColor()
          Gets the alternate highlight color provider used for tab area components gradient background and highlighted tab background (when no highlight color is specified)
 ColorProvider getControlColor()
          Gets the control background color
 ColorProvider getDarkControlColor()
          Gets the dark control background color used for gradient for normal tab and disabled tab
 ColorProvider getHighlightColor()
          Gets the highlight color provider
 ColorProvider getLineColor()
          Gets the line color provider
 java.lang.String getName()
          Gets the theme name
 TabbedPanelProperties getTabbedPanelProperties()
          Gets the TabbedPanelProperties for this theme
 TitledTabProperties getTitledTabProperties()
          Gets the TitledTabProperties for this theme
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CORNER_INSET

private static final int CORNER_INSET
See Also:
Constant Field Values

highlightColor

private ColorProvider highlightColor

lineColor

private ColorProvider lineColor

controlColor

private ColorProvider controlColor

darkControlColor

private ColorProvider darkControlColor

alternateHighlight

private ColorProvider alternateHighlight

leftSlopeHeight

private int leftSlopeHeight

rightSlopeHeight

private int rightSlopeHeight

tabbedPanelProperties

private TabbedPanelProperties tabbedPanelProperties

titledTabProperties

private TitledTabProperties titledTabProperties
Constructor Detail

ShapedGradientTheme

public ShapedGradientTheme()
Creates a default theme with sloped border on the right side of the tab and with colors based on the active look and feel


ShapedGradientTheme

public ShapedGradientTheme(float leftSlope,
                           float rightSlope)
Creates a theme with the given slopes on the left and right side of the tab and with colors based on the active look and feel

Parameters:
leftSlope - leaning of left slope defined as left slope width divided by left slope height
rightSlope - leaning of right slope defined as right slope width divided by right slope height

ShapedGradientTheme

public ShapedGradientTheme(float leftSlope,
                           float rightSlope,
                           ColorProvider lineColor,
                           ColorProvider highlightColor)
Creates a theme with the given slopes on the left and right side of the tab and with the given colors

Parameters:
leftSlope - leaning of left slope defined as left slope width divided by left slope height
rightSlope - leaning of right slope defined as right slope width divided by right slope height
lineColor - color provider for the lines
highlightColor - color provider for the highlighting, null for no highlighting

ShapedGradientTheme

public ShapedGradientTheme(float leftSlope,
                           float rightSlope,
                           int slopeHeight,
                           ColorProvider lineColor,
                           ColorProvider highlightColor)
Creates a theme with the given slopes on the left and right side of the tab and with the given colors

Parameters:
leftSlope - leaning of left slope defined as left slope width divided by left slope height
rightSlope - leaning of right slope defined as right slope width divided by right slope height
slopeHeight - slope height in pixels, used when estimating slope width
lineColor - color provider for the lines
highlightColor - color provider for the highlighting, null for no highlighting
Method Detail

getName

public java.lang.String getName()
Gets the theme name

Specified by:
getName in class TabbedPanelTitledTabTheme
Returns:
name for this theme

getTabbedPanelProperties

public TabbedPanelProperties getTabbedPanelProperties()
Gets the TabbedPanelProperties for this theme

Specified by:
getTabbedPanelProperties in class TabbedPanelTitledTabTheme
Returns:
the TabbedPanelProperties

getTitledTabProperties

public TitledTabProperties getTitledTabProperties()
Gets the TitledTabProperties for this theme

Specified by:
getTitledTabProperties in class TabbedPanelTitledTabTheme
Returns:
the TitledTabProperties

getLineColor

public ColorProvider getLineColor()
Gets the line color provider

Returns:
the line color provider

getHighlightColor

public ColorProvider getHighlightColor()
Gets the highlight color provider

Returns:
the highlight color provider, null if no highlight

getAlternateHighlightColor

public ColorProvider getAlternateHighlightColor()
Gets the alternate highlight color provider used for tab area components gradient background and highlighted tab background (when no highlight color is specified)

Returns:
the alternate highlight color provider

getControlColor

public ColorProvider getControlColor()
Gets the control background color

Returns:
the control background color provider

getDarkControlColor

public ColorProvider getDarkControlColor()
Gets the dark control background color used for gradient for normal tab and disabled tab

Returns:
the dark control background color provider

createTabBorder

public javax.swing.border.Border createTabBorder(ColorProvider lineColor,
                                                 ColorProvider highlightColor,
                                                 float leftSlope,
                                                 float rightSlope,
                                                 boolean bottomLeftRounded,
                                                 boolean topLeftRounded,
                                                 boolean topRightRounded,
                                                 boolean bottomRightRounded,
                                                 boolean isNormal,
                                                 boolean highlightBottomLeftRounded,
                                                 int raised)
Creates a tab border

Parameters:
lineColor - line color provider
highlightColor - highlight color provider, null for no highlight
leftSlope - left slope
rightSlope - right slope
bottomLeftRounded - true if bottom left should be rounded
topLeftRounded - true if top left should be rounded
topRightRounded - true if top right should be rounded
bottomRightRounded - true if bottom right should be rounded
isNormal - true if this is a normal rendered border
highlightBottomLeftRounded - true if highlight has bottom left rounded
raised - raised
Returns:
the created border