de.muntjak.tinylookandfeel
Class TinyTabbedPaneUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.TabbedPaneUI
          extended by javax.swing.plaf.basic.BasicTabbedPaneUI
              extended by de.muntjak.tinylookandfeel.TinyTabbedPaneUI
All Implemented Interfaces:
javax.swing.SwingConstants

public class TinyTabbedPaneUI
extends javax.swing.plaf.basic.BasicTabbedPaneUI

TinyTabbedPaneUI


Nested Class Summary
 class TinyTabbedPaneUI.TinyMouseHandler
           
protected  class TinyTabbedPaneUI.TinyTabbedPaneLayout
           
 
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicTabbedPaneUI
javax.swing.plaf.basic.BasicTabbedPaneUI.FocusHandler, javax.swing.plaf.basic.BasicTabbedPaneUI.MouseHandler, javax.swing.plaf.basic.BasicTabbedPaneUI.PropertyChangeHandler, javax.swing.plaf.basic.BasicTabbedPaneUI.TabbedPaneLayout, javax.swing.plaf.basic.BasicTabbedPaneUI.TabSelectionHandler
 
Field Summary
 
Fields inherited from class javax.swing.plaf.basic.BasicTabbedPaneUI
calcRect, contentBorderInsets, darkShadow, downKey, focus, focusListener, highlight, leftKey, lightHighlight, maxTabHeight, maxTabWidth, mouseListener, propertyChangeListener, rects, rightKey, runCount, selectedRun, selectedTabPadInsets, shadow, tabAreaInsets, tabChangeListener, tabInsets, tabPane, tabRunOverlay, tabRuns, textIconGap, upKey
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Constructor Summary
TinyTabbedPaneUI()
           
 
Method Summary
protected  java.awt.LayoutManager createLayoutManager()
          Overridden so we can enable/disable tab rotating using TinyTabbedPaneLayout.
protected  java.awt.event.MouseListener createMouseListener()
           
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
          Creates the UI delegate for the given component.
protected  int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected)
           
protected  int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected)
           
protected  void installDefaults()
           
protected  void installListeners()
           
protected  void paintContentBorder(java.awt.Graphics g, int tabPlacement, int selectedIndex)
          Paints the border of a given tab.
protected  void paintFocusIndicator(java.awt.Graphics g, int tabPlacement, java.awt.Rectangle[] rects, int tabIndex, java.awt.Rectangle iconRect, java.awt.Rectangle textRect, boolean isSelected)
           
protected  void paintTabBackground(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
          Paints the backround of a given tab.
protected  void paintTabBorder(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
          Draws the border around each tab.
protected  void paintText(java.awt.Graphics g, int tabPlacement, java.awt.Font font, java.awt.FontMetrics metrics, int tabIndex, java.lang.String title, java.awt.Rectangle textRect, boolean isSelected)
           
 void update(java.awt.Graphics g, javax.swing.JComponent c)
          Paint the border and then call paint().
 
Methods inherited from class javax.swing.plaf.basic.BasicTabbedPaneUI
assureRectsCreated, calculateMaxTabHeight, calculateMaxTabWidth, calculateTabAreaHeight, calculateTabAreaWidth, calculateTabHeight, calculateTabWidth, createChangeListener, createFocusListener, createPropertyChangeListener, createScrollButton, expandTabRunsArray, getBaseline, getBaseline, getBaselineOffset, getBaselineResizeBehavior, getContentBorderInsets, getFocusIndex, getFontMetrics, getIconForTab, getMaximumSize, getMinimumSize, getNextTabIndex, getNextTabIndexInRun, getNextTabRun, getPreviousTabIndex, getPreviousTabIndexInRun, getPreviousTabRun, getRolloverTab, getRunForTab, getSelectedTabPadInsets, getTabAreaInsets, getTabBounds, getTabBounds, getTabInsets, getTabRunCount, getTabRunIndent, getTabRunOffset, getTabRunOverlay, getTextViewForTab, getVisibleComponent, installComponents, installKeyboardActions, installUI, lastTabInRun, layoutLabel, navigateSelectedTab, paint, paintContentBorderBottomEdge, paintContentBorderLeftEdge, paintContentBorderRightEdge, paintContentBorderTopEdge, paintIcon, paintTab, paintTabArea, rotateInsets, selectAdjacentRunTab, selectNextTab, selectNextTabInRun, selectPreviousTab, selectPreviousTabInRun, setRolloverTab, setVisibleComponent, shouldPadTabRun, shouldRotateTabRuns, tabForCoordinate, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getPreferredSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TinyTabbedPaneUI

public TinyTabbedPaneUI()
Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
Creates the UI delegate for the given component.

Parameters:
c - The component to create its UI delegate.
Returns:
The UI delegate for the given component.

installListeners

protected void installListeners()
Overrides:
installListeners in class javax.swing.plaf.basic.BasicTabbedPaneUI

createMouseListener

protected java.awt.event.MouseListener createMouseListener()
Overrides:
createMouseListener in class javax.swing.plaf.basic.BasicTabbedPaneUI

installDefaults

protected void installDefaults()
Overrides:
installDefaults in class javax.swing.plaf.basic.BasicTabbedPaneUI

createLayoutManager

protected java.awt.LayoutManager createLayoutManager()
Overridden so we can enable/disable tab rotating using TinyTabbedPaneLayout. Invoked by installUI to create a layout manager object to manage the JTabbedPane.

Overrides:
createLayoutManager in class javax.swing.plaf.basic.BasicTabbedPaneUI
Returns:
a layout manager object
See Also:
TinyTabbedPaneUI.TinyTabbedPaneLayout, JTabbedPane.getTabLayoutPolicy()

paintTabBackground

protected void paintTabBackground(java.awt.Graphics g,
                                  int tabPlacement,
                                  int tabIndex,
                                  int x,
                                  int y,
                                  int w,
                                  int h,
                                  boolean isSelected)
Paints the backround of a given tab.

Overrides:
paintTabBackground in class javax.swing.plaf.basic.BasicTabbedPaneUI
Parameters:
g - The graphics context.
tabPlacement - The placement of the tab to paint.
tabIndex - The index of the tab to paint.
x - The x coordinate of the top left corner.
y - The y coordinate of the top left corner.
w - The width.
h - The height.
isSelected - True if the tab to paint is selected otherwise false.

paintContentBorder

protected void paintContentBorder(java.awt.Graphics g,
                                  int tabPlacement,
                                  int selectedIndex)
Paints the border of a given tab.

Overrides:
paintContentBorder in class javax.swing.plaf.basic.BasicTabbedPaneUI
Parameters:
g - The graphics context.
tabPlacement - The placement of the tab to paint.
selectedIndex - The index of the selected tab.

paintFocusIndicator

protected void paintFocusIndicator(java.awt.Graphics g,
                                   int tabPlacement,
                                   java.awt.Rectangle[] rects,
                                   int tabIndex,
                                   java.awt.Rectangle iconRect,
                                   java.awt.Rectangle textRect,
                                   boolean isSelected)
Overrides:
paintFocusIndicator in class javax.swing.plaf.basic.BasicTabbedPaneUI
See Also:
BasicTabbedPaneUI.paintFocusIndicator(Graphics, int, Rectangle[], int, Rectangle, Rectangle, boolean)

paintTabBorder

protected void paintTabBorder(java.awt.Graphics g,
                              int tabPlacement,
                              int tabIndex,
                              int x,
                              int y,
                              int w,
                              int h,
                              boolean isSelected)
Draws the border around each tab.

Overrides:
paintTabBorder in class javax.swing.plaf.basic.BasicTabbedPaneUI
Parameters:
g - The graphics context.
tabPlacement - The placement of the tabs.
tabIndex - The index of the tab to paint.
x - The x coordinate of the top left corner.
y - The y coordinate of the top left corner.
w - The width.
h - The height.
isSelected - True if the tab to paint is selected otherwise false.

update

public void update(java.awt.Graphics g,
                   javax.swing.JComponent c)
Paint the border and then call paint().

Overrides:
update in class javax.swing.plaf.ComponentUI

getTabLabelShiftX

protected int getTabLabelShiftX(int tabPlacement,
                                int tabIndex,
                                boolean isSelected)
Overrides:
getTabLabelShiftX in class javax.swing.plaf.basic.BasicTabbedPaneUI

getTabLabelShiftY

protected int getTabLabelShiftY(int tabPlacement,
                                int tabIndex,
                                boolean isSelected)
Overrides:
getTabLabelShiftY in class javax.swing.plaf.basic.BasicTabbedPaneUI

paintText

protected void paintText(java.awt.Graphics g,
                         int tabPlacement,
                         java.awt.Font font,
                         java.awt.FontMetrics metrics,
                         int tabIndex,
                         java.lang.String title,
                         java.awt.Rectangle textRect,
                         boolean isSelected)
Overrides:
paintText in class javax.swing.plaf.basic.BasicTabbedPaneUI