Package net.infonode.tabbedpanel.theme
Class ShapedGradientTheme
java.lang.Object
net.infonode.tabbedpanel.theme.TabbedPanelTitledTabTheme
net.infonode.tabbedpanel.theme.ShapedGradientTheme
A theme with tabs with rounded edges, gradient backgrounds and support for
slopes on left/right side of tab.
- Since:
- ITP 1.2.0
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a default theme with sloped border on the right side of the tab and with colors based on the active look and feelShapedGradientTheme
(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 feelShapedGradientTheme
(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 colorsShapedGradientTheme
(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 -
Method Summary
Modifier and TypeMethodDescriptioncreateTabBorder
(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 borderGets the alternate highlight color provider used for tab area components gradient background and highlighted tab background (when no highlight color is specified)Gets the control background colorGets the dark control background color used for gradient for normal tab and disabled tabGets the highlight color providerGets the line color providergetName()
Gets the theme nameGets the TabbedPanelProperties for this themeGets the TitledTabProperties for this theme
-
Constructor Details
-
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 heightrightSlope
- 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 heightrightSlope
- leaning of right slope defined as right slope width divided by right slope heightlineColor
- color provider for the lineshighlightColor
- 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 heightrightSlope
- leaning of right slope defined as right slope width divided by right slope heightslopeHeight
- slope height in pixels, used when estimating slope widthlineColor
- color provider for the lineshighlightColor
- color provider for the highlighting, null for no highlighting
-
-
Method Details
-
getName
Gets the theme name- Specified by:
getName
in classTabbedPanelTitledTabTheme
- Returns:
- name for this theme
-
getTabbedPanelProperties
Gets the TabbedPanelProperties for this theme- Specified by:
getTabbedPanelProperties
in classTabbedPanelTitledTabTheme
- Returns:
- the TabbedPanelProperties
-
getTitledTabProperties
Gets the TitledTabProperties for this theme- Specified by:
getTitledTabProperties
in classTabbedPanelTitledTabTheme
- Returns:
- the TitledTabProperties
-
getLineColor
Gets the line color provider- Returns:
- the line color provider
-
getHighlightColor
Gets the highlight color provider- Returns:
- the highlight color provider, null if no highlight
-
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
Gets the control background color- Returns:
- the control background color provider
-
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 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 providerhighlightColor
- highlight color provider, null for no highlightleftSlope
- left sloperightSlope
- right slopebottomLeftRounded
- true if bottom left should be roundedtopLeftRounded
- true if top left should be roundedtopRightRounded
- true if top right should be roundedbottomRightRounded
- true if bottom right should be roundedisNormal
- true if this is a normal rendered borderhighlightBottomLeftRounded
- true if highlight has bottom left roundedraised
- raised- Returns:
- the created border
-