com.jgoodies.looks.windows
Class WindowsTabbedPaneUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.TabbedPaneUI
          extended by javax.swing.plaf.basic.BasicTabbedPaneUI
              extended by com.sun.java.swing.plaf.windows.WindowsTabbedPaneUI
                  extended by com.jgoodies.looks.windows.WindowsTabbedPaneUI
All Implemented Interfaces:
javax.swing.SwingConstants

public final class WindowsTabbedPaneUI
extends com.sun.java.swing.plaf.windows.WindowsTabbedPaneUI

The JGoodies Windows L&F implementation of TabbedPaneUI.

The flat appearance is work in progress; currently it works only for a single line of tabs and paints distored tabs for multiple lines.

Version:
$Revision: 1.11 $
Author:
Karsten Lentzsch

Nested Class Summary
 
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
WindowsTabbedPaneUI()
           
 
Method Summary
protected  java.beans.PropertyChangeListener createPropertyChangeListener()
          Creates and answer a handler that listens to property changes.
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent x)
          Creates and answers the WindowsTabbedPaneUI.
protected  java.awt.Insets getContentBorderInsets(int tabPlacement)
           
protected  javax.swing.Icon getIconForTab(int tabIndex)
          Answers the icon for the tab with the specified index.
protected  java.awt.Insets getSelectedTabPadInsets(int tabPlacement)
           
protected  java.awt.Insets getTabAreaInsets(int tabPlacement)
           
protected  int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected)
           
protected  int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected)
           
 void installUI(javax.swing.JComponent c)
          Installs the UI.
protected  void layoutLabel(int tabPlacement, java.awt.FontMetrics metrics, int tabIndex, java.lang.String title, javax.swing.Icon icon, java.awt.Rectangle tabRect, java.awt.Rectangle iconRect, java.awt.Rectangle textRect, boolean isSelected)
          Copied here from super(super)class to avoid labels being centered on vertical tab runs if they consist of icon and text.
protected  void paintContentBorderBottomEdge(java.awt.Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
          Paints the bottom edge of the pane's content border.
protected  void paintContentBorderLeftEdge(java.awt.Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
          Paints the left Edge of the pane's content border.
protected  void paintContentBorderRightEdge(java.awt.Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
          Paints the right Edge of the pane's content border.
protected  void paintContentBorderTopEdge(java.awt.Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
          Paints the top edge of the pane's content border.
protected  void paintFocusIndicator(java.awt.Graphics g, int tabPlacement, java.awt.Rectangle[] rectangles, int tabIndex, java.awt.Rectangle iconRect, java.awt.Rectangle textRect, boolean isSelected)
           
protected  void paintTabBorder(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
          Paints the border for a single tab; it does not paint the tab's background.
protected  boolean shouldRotateTabRuns(int tabPlacement)
           
 
Methods inherited from class com.sun.java.swing.plaf.windows.WindowsTabbedPaneUI
installDefaults, paintContentBorder, paintTabBackground, setRolloverTab, uninstallDefaults
 
Methods inherited from class javax.swing.plaf.basic.BasicTabbedPaneUI
assureRectsCreated, calculateMaxTabHeight, calculateMaxTabWidth, calculateTabAreaHeight, calculateTabAreaWidth, calculateTabHeight, calculateTabWidth, createChangeListener, createFocusListener, createLayoutManager, createMouseListener, createScrollButton, expandTabRunsArray, getBaseline, getBaseline, getBaselineOffset, getBaselineResizeBehavior, getFocusIndex, getFontMetrics, getMaximumSize, getMinimumSize, getNextTabIndex, getNextTabIndexInRun, getNextTabRun, getPreviousTabIndex, getPreviousTabIndexInRun, getPreviousTabRun, getRolloverTab, getRunForTab, getTabBounds, getTabBounds, getTabInsets, getTabRunCount, getTabRunIndent, getTabRunOffset, getTabRunOverlay, getTextViewForTab, getVisibleComponent, installComponents, installKeyboardActions, installListeners, lastTabInRun, navigateSelectedTab, paint, paintIcon, paintTab, paintTabArea, paintText, rotateInsets, selectAdjacentRunTab, selectNextTab, selectNextTabInRun, selectPreviousTab, selectPreviousTabInRun, setVisibleComponent, shouldPadTabRun, tabForCoordinate, uninstallComponents, uninstallKeyboardActions, uninstallListeners, uninstallUI
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getPreferredSize, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WindowsTabbedPaneUI

public WindowsTabbedPaneUI()
Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent x)
Creates and answers the WindowsTabbedPaneUI.

See Also:
ComponentUI.createUI(JComponent)

installUI

public void installUI(javax.swing.JComponent c)
Installs the UI.

Overrides:
installUI in class javax.swing.plaf.basic.BasicTabbedPaneUI
See Also:
ComponentUI.installUI(JComponent)

createPropertyChangeListener

protected java.beans.PropertyChangeListener createPropertyChangeListener()
Creates and answer a handler that listens to property changes. Unlike the superclass BasicTabbedPane, the PlasticTabbedPaneUI uses an extended Handler.

Overrides:
createPropertyChangeListener in class javax.swing.plaf.basic.BasicTabbedPaneUI

getIconForTab

protected javax.swing.Icon getIconForTab(int tabIndex)
Answers the icon for the tab with the specified index. In case, we have globally switched of the use tab icons, we answer null if and only if we have a title.

Overrides:
getIconForTab in class javax.swing.plaf.basic.BasicTabbedPaneUI

getContentBorderInsets

protected java.awt.Insets getContentBorderInsets(int tabPlacement)
Overrides:
getContentBorderInsets in class javax.swing.plaf.basic.BasicTabbedPaneUI

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

getSelectedTabPadInsets

protected java.awt.Insets getSelectedTabPadInsets(int tabPlacement)
Overrides:
getSelectedTabPadInsets in class javax.swing.plaf.basic.BasicTabbedPaneUI

getTabAreaInsets

protected java.awt.Insets getTabAreaInsets(int tabPlacement)
Overrides:
getTabAreaInsets in class javax.swing.plaf.basic.BasicTabbedPaneUI

paintContentBorderTopEdge

protected void paintContentBorderTopEdge(java.awt.Graphics g,
                                         int tabPlacement,
                                         int selectedIndex,
                                         int x,
                                         int y,
                                         int w,
                                         int h)
Paints the top edge of the pane's content border.

Overrides:
paintContentBorderTopEdge in class javax.swing.plaf.basic.BasicTabbedPaneUI

paintContentBorderBottomEdge

protected void paintContentBorderBottomEdge(java.awt.Graphics g,
                                            int tabPlacement,
                                            int selectedIndex,
                                            int x,
                                            int y,
                                            int w,
                                            int h)
Paints the bottom edge of the pane's content border.

Overrides:
paintContentBorderBottomEdge in class javax.swing.plaf.basic.BasicTabbedPaneUI

paintContentBorderLeftEdge

protected void paintContentBorderLeftEdge(java.awt.Graphics g,
                                          int tabPlacement,
                                          int selectedIndex,
                                          int x,
                                          int y,
                                          int w,
                                          int h)
Paints the left Edge of the pane's content border.

Overrides:
paintContentBorderLeftEdge in class javax.swing.plaf.basic.BasicTabbedPaneUI

paintContentBorderRightEdge

protected void paintContentBorderRightEdge(java.awt.Graphics g,
                                           int tabPlacement,
                                           int selectedIndex,
                                           int x,
                                           int y,
                                           int w,
                                           int h)
Paints the right Edge of the pane's content border.

Overrides:
paintContentBorderRightEdge in class javax.swing.plaf.basic.BasicTabbedPaneUI

paintTabBorder

protected void paintTabBorder(java.awt.Graphics g,
                              int tabPlacement,
                              int tabIndex,
                              int x,
                              int y,
                              int w,
                              int h,
                              boolean isSelected)
Paints the border for a single tab; it does not paint the tab's background.

Overrides:
paintTabBorder in class com.sun.java.swing.plaf.windows.WindowsTabbedPaneUI

paintFocusIndicator

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

shouldRotateTabRuns

protected boolean shouldRotateTabRuns(int tabPlacement)
Overrides:
shouldRotateTabRuns in class javax.swing.plaf.basic.BasicTabbedPaneUI

layoutLabel

protected void layoutLabel(int tabPlacement,
                           java.awt.FontMetrics metrics,
                           int tabIndex,
                           java.lang.String title,
                           javax.swing.Icon icon,
                           java.awt.Rectangle tabRect,
                           java.awt.Rectangle iconRect,
                           java.awt.Rectangle textRect,
                           boolean isSelected)
Copied here from super(super)class to avoid labels being centered on vertical tab runs if they consist of icon and text.

Overrides:
layoutLabel in class javax.swing.plaf.basic.BasicTabbedPaneUI


Copyright © 2001-2012 JGoodies Karsten Lentzsch. All Rights Reserved.