Package com.jgoodies.looks.plastic
Class PlasticTabbedPaneUI.AbstractRenderer
- java.lang.Object
-
- com.jgoodies.looks.plastic.PlasticTabbedPaneUI.AbstractRenderer
-
- Direct Known Subclasses:
PlasticTabbedPaneUI.BottomEmbeddedRenderer,PlasticTabbedPaneUI.BottomRenderer,PlasticTabbedPaneUI.LeftEmbeddedRenderer,PlasticTabbedPaneUI.LeftRenderer,PlasticTabbedPaneUI.RightEmbeddedRenderer,PlasticTabbedPaneUI.RightRenderer,PlasticTabbedPaneUI.TopEmbeddedRenderer,PlasticTabbedPaneUI.TopRenderer
- Enclosing class:
- PlasticTabbedPaneUI
private abstract static class PlasticTabbedPaneUI.AbstractRenderer extends java.lang.ObjectThis is the abstract superclass for all TabbedPane renderers. Those will be defined in the rest of this file
-
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.ColordarkShadowprotected static java.awt.InsetsEAST_INSETSprotected static java.awt.InsetsEMPTY_INSETSprotected java.awt.Colorfocusprotected java.awt.ColorlightHighlightprotected static java.awt.InsetsNORTH_INSETSprotected java.awt.ColorselectColorprotected java.awt.ColorselectHighlightprotected java.awt.ColorselectLightprotected java.awt.ColorshadowColorprotected static java.awt.InsetsSOUTH_INSETSprotected javax.swing.JTabbedPanetabPaneprotected inttabPlacementprotected static java.awt.InsetsWEST_INSETS
-
Constructor Summary
Constructors Modifier Constructor Description privateAbstractRenderer(javax.swing.JTabbedPane tabPane)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private static PlasticTabbedPaneUI.AbstractRenderercreateEmbeddedRenderer(javax.swing.JTabbedPane tabPane)private static PlasticTabbedPaneUI.AbstractRenderercreateRenderer(javax.swing.JTabbedPane tabPane)protected java.awt.InsetsgetContentBorderInsets(java.awt.Insets defaultInsets)protected java.awt.InsetsgetSelectedTabPadInsets()Returns additional the insets for the selected tab.protected java.awt.InsetsgetTabAreaInsets(java.awt.Insets defaultInsets)protected abstract java.awt.InsetsgetTabInsets(int tabIndex, java.awt.Insets tabInsets)Returns the insets for the given tab.protected intgetTabLabelShiftX(int tabIndex, boolean isSelected)Returns the amount by which the label should be shifted horizontally.protected intgetTabLabelShiftY(int tabIndex, boolean isSelected)Returns the amount by which the label should be shifted vertically.protected intgetTabRunIndent(int run)Returns the amount by which the run numberrunshould be indented.protected intgetTabRunOverlay(int tabRunOverlay)Returns the amount of overlap for two Runs.protected intgetTabsOverlay()Returns the amount of overlap for two tabs.private voidinitColors()protected booleanisFirstDisplayedTab(int tabIndex, int position, int paneBorder)protected voidpaintContentBorderBottomEdge(java.awt.Graphics g, int x, int y, int w, int h, boolean drawBroken, java.awt.Rectangle selRect, boolean isContentBorderPainted)Draws the bottom edge of the Border around the content area.protected voidpaintContentBorderLeftEdge(java.awt.Graphics g, int x, int y, int w, int h, boolean drawBroken, java.awt.Rectangle selRect, boolean isContentBorderPainted)Draws the left edge of the Border around the content area.protected voidpaintContentBorderRightEdge(java.awt.Graphics g, int x, int y, int w, int h, boolean drawBroken, java.awt.Rectangle selRect, boolean isContentBorderPainted)Draws the right edge of the Border around the content area.protected voidpaintContentBorderTopEdge(java.awt.Graphics g, int x, int y, int w, int h, boolean drawBroken, java.awt.Rectangle selRect, boolean isContentBorderPainted)Draws the top edge of the border around the content area.protected abstract voidpaintFocusIndicator(java.awt.Graphics g, java.awt.Rectangle[] rects, int tabIndex, java.awt.Rectangle iconRect, java.awt.Rectangle textRect, boolean isSelected)Draws the rectancle around the Tab label which indicates keyboard focus.protected abstract voidpaintTabBackground(java.awt.Graphics g, int tabIndex, int x, int y, int w, int h, boolean isSelected)Fills the background of the given tab to make sure overlap of tabs is handled correctly.protected abstract voidpaintTabBorder(java.awt.Graphics g, int tabIndex, int x, int y, int w, int h, boolean isSelected)Paints the border around the given tab.protected booleanshouldPadTabRun(int run, boolean aPriori)Returns if a run should be padded with empty space to take up as much room as the others.
-
-
-
Field Detail
-
EMPTY_INSETS
protected static final java.awt.Insets EMPTY_INSETS
-
NORTH_INSETS
protected static final java.awt.Insets NORTH_INSETS
-
WEST_INSETS
protected static final java.awt.Insets WEST_INSETS
-
SOUTH_INSETS
protected static final java.awt.Insets SOUTH_INSETS
-
EAST_INSETS
protected static final java.awt.Insets EAST_INSETS
-
tabPane
protected final javax.swing.JTabbedPane tabPane
-
tabPlacement
protected final int tabPlacement
-
shadowColor
protected java.awt.Color shadowColor
-
darkShadow
protected java.awt.Color darkShadow
-
selectColor
protected java.awt.Color selectColor
-
selectLight
protected java.awt.Color selectLight
-
selectHighlight
protected java.awt.Color selectHighlight
-
lightHighlight
protected java.awt.Color lightHighlight
-
focus
protected java.awt.Color focus
-
-
Method Detail
-
createRenderer
private static PlasticTabbedPaneUI.AbstractRenderer createRenderer(javax.swing.JTabbedPane tabPane)
-
createEmbeddedRenderer
private static PlasticTabbedPaneUI.AbstractRenderer createEmbeddedRenderer(javax.swing.JTabbedPane tabPane)
-
initColors
private void initColors()
-
isFirstDisplayedTab
protected boolean isFirstDisplayedTab(int tabIndex, int position, int paneBorder)
-
getTabAreaInsets
protected java.awt.Insets getTabAreaInsets(java.awt.Insets defaultInsets)
-
getContentBorderInsets
protected java.awt.Insets getContentBorderInsets(java.awt.Insets defaultInsets)
-
getTabLabelShiftX
protected int getTabLabelShiftX(int tabIndex, boolean isSelected)Returns the amount by which the label should be shifted horizontally.
-
getTabLabelShiftY
protected int getTabLabelShiftY(int tabIndex, boolean isSelected)Returns the amount by which the label should be shifted vertically.
-
getTabRunOverlay
protected int getTabRunOverlay(int tabRunOverlay)
Returns the amount of overlap for two Runs.
-
shouldPadTabRun
protected boolean shouldPadTabRun(int run, boolean aPriori)Returns if a run should be padded with empty space to take up as much room as the others.
-
getTabRunIndent
protected int getTabRunIndent(int run)
Returns the amount by which the run numberrunshould be indented. Add a few pixels for every run to make diagonal lines align.
-
getTabInsets
protected abstract java.awt.Insets getTabInsets(int tabIndex, java.awt.Insets tabInsets)Returns the insets for the given tab.
-
paintFocusIndicator
protected abstract void paintFocusIndicator(java.awt.Graphics g, java.awt.Rectangle[] rects, int tabIndex, java.awt.Rectangle iconRect, java.awt.Rectangle textRect, boolean isSelected)Draws the rectancle around the Tab label which indicates keyboard focus.
-
paintTabBackground
protected abstract void paintTabBackground(java.awt.Graphics g, int tabIndex, int x, int y, int w, int h, boolean isSelected)Fills the background of the given tab to make sure overlap of tabs is handled correctly.
-
paintTabBorder
protected abstract void paintTabBorder(java.awt.Graphics g, int tabIndex, int x, int y, int w, int h, boolean isSelected)Paints the border around the given tab.
-
getSelectedTabPadInsets
protected java.awt.Insets getSelectedTabPadInsets()
Returns additional the insets for the selected tab. This allows to "raise" The selected tab over the others
-
paintContentBorderTopEdge
protected void paintContentBorderTopEdge(java.awt.Graphics g, int x, int y, int w, int h, boolean drawBroken, java.awt.Rectangle selRect, boolean isContentBorderPainted)Draws the top edge of the border around the content area. Draw unbroken line for tabs are not on TOP override where appropriate.
-
paintContentBorderBottomEdge
protected void paintContentBorderBottomEdge(java.awt.Graphics g, int x, int y, int w, int h, boolean drawBroken, java.awt.Rectangle selRect, boolean isContentBorderPainted)Draws the bottom edge of the Border around the content area. Draw broken line if selected tab is visible and adjacent to content and TabPlacement is same as painted edge.
-
paintContentBorderLeftEdge
protected void paintContentBorderLeftEdge(java.awt.Graphics g, int x, int y, int w, int h, boolean drawBroken, java.awt.Rectangle selRect, boolean isContentBorderPainted)Draws the left edge of the Border around the content area. Draw broken line if selected tab is visible and adjacent to content and TabPlacement is same as painted edge
-
paintContentBorderRightEdge
protected void paintContentBorderRightEdge(java.awt.Graphics g, int x, int y, int w, int h, boolean drawBroken, java.awt.Rectangle selRect, boolean isContentBorderPainted)Draws the right edge of the Border around the content area. Draw broken line if selected tab is visible and adjacent to content and TabPlacement is same as painted edge
-
getTabsOverlay
protected int getTabsOverlay()
Returns the amount of overlap for two tabs.
-
-