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.Object
This 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.Color
darkShadow
protected static java.awt.Insets
EAST_INSETS
protected static java.awt.Insets
EMPTY_INSETS
protected java.awt.Color
focus
protected static java.awt.Insets
NORTH_INSETS
protected java.awt.Color
selectColor
protected java.awt.Color
selectHighlight
protected java.awt.Color
selectLight
protected java.awt.Color
shadowColor
protected static java.awt.Insets
SOUTH_INSETS
protected javax.swing.JTabbedPane
tabPane
protected static java.awt.Insets
WEST_INSETS
-
Constructor Summary
Constructors Modifier Constructor Description private
AbstractRenderer(javax.swing.JTabbedPane tabPane)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private static PlasticTabbedPaneUI.AbstractRenderer
createEmbeddedRenderer(javax.swing.JTabbedPane tabPane)
private static PlasticTabbedPaneUI.AbstractRenderer
createRenderer(javax.swing.JTabbedPane tabPane)
protected java.awt.Insets
getContentBorderInsets(java.awt.Insets defaultInsets)
protected java.awt.Insets
getSelectedTabPadInsets()
Returns additional the insets for the selected tab.protected java.awt.Insets
getTabAreaInsets(java.awt.Insets defaultInsets)
protected abstract java.awt.Insets
getTabInsets(int tabIndex, java.awt.Insets tabInsets)
Returns the insets for the given tab.protected int
getTabLabelShiftX(int tabIndex, boolean isSelected)
Returns the amount by which the label should be shifted horizontally.protected int
getTabLabelShiftY(int tabIndex, boolean isSelected)
Returns the amount by which the label should be shifted vertically.protected int
getTabRunIndent(int run)
Returns the amount by which the run numberrun
should be indented.protected int
getTabRunOverlay(int tabRunOverlay)
Returns the amount of overlap for two Runs.protected int
getTabsOverlay()
Returns the amount of overlap for two tabs.private void
initColors()
protected boolean
isFirstDisplayedTab(int tabIndex, int position, int paneBorder)
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.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.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.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.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.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.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.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.
-
-
-
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
-
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
-
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 numberrun
should 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.
-
-