uic.themes
Class UICTabbedPaneUI

java.lang.Object
  extended byjavax.swing.plaf.ComponentUI
      extended byjavax.swing.plaf.TabbedPaneUI
          extended byjavax.swing.plaf.basic.BasicTabbedPaneUI
              extended byjavax.swing.plaf.metal.MetalTabbedPaneUI
                  extended byuic.themes.UICTabbedPaneUI
All Implemented Interfaces:
SwingConstants

public class UICTabbedPaneUI
extends MetalTabbedPaneUI

Scrollable tab ui that also works for jdk1.3


Nested Class Summary
 class UICTabbedPaneUI.MouseHandler
          This inner class is marked "public" due to a compiler bug.
 class UICTabbedPaneUI.TabSelectionHandler
           
 
Nested classes inherited from class javax.swing.plaf.metal.MetalTabbedPaneUI
MetalTabbedPaneUI.TabbedPaneLayout
 
Nested classes inherited from class javax.swing.plaf.basic.BasicTabbedPaneUI
BasicTabbedPaneUI.FocusHandler, BasicTabbedPaneUI.PropertyChangeHandler
 
Field Summary
protected  GeneralPath brokenFill
           
protected  GeneralPath brokenLine
           
protected  ActionListener[] buttonListeners
           
protected  BufferedImage gradientBackground
           
protected  BufferedImage gradientSelectedBackground
           
protected  int selectionExtraHeight
           
 
Fields inherited from class javax.swing.plaf.metal.MetalTabbedPaneUI
minTabWidth, selectColor, selectHighlight, tabAreaBackground
 
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
UICTabbedPaneUI()
           
 
Method Summary
protected  ChangeListener createChangeListener()
           
protected  LayoutManager createLayoutManager()
          Create a correct layout
protected  MouseListener createMouseListener()
          Override mouselistener to reimplement tab selection Only VISIBLE tabs can be selected
static ComponentUI createUI(JComponent comp)
           
protected  void ensureCurrentLayout()
           
protected  int getBrowseOffset()
           
 Dimension getButtonPreferredSize()
           
protected  FontMetrics getFontMetrics()
           
protected  Insets getTabAreaInsets(int tabPlacement)
          Update the insets of the tabs, using the space of the buttons
protected  int getTabPlacementOffset()
           
protected  int getVisibleOffset(int index)
           
protected  void installComponents()
          Add the browse buttons
protected  void installListeners()
          Add actions to the browse buttons
 void installUI(JComponent c)
           
 boolean isLastTabVisible()
           
 void paint(Graphics g, JComponent c)
          Override default paint to set the correct layout and to update the browse buttons (enable/disable and visible/not-visible)
protected  void paintFocusIndicator(Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect, boolean isSelected)
          Override paint focus, to draw a normal dashed line as focus
protected  void paintTab(Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect)
          Since this method is called from the superclass, do nothing when tab is not visible
protected  void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
          this function draws the border around each tab note that this function does now draw the background of the tab.
protected  void paintText(Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title, Rectangle textRect, boolean isSelected)
           
 void setLastTabVisible(boolean lastTabVisible)
           
protected  void setTabPlacementOffset(int offset)
           
protected  void uninstallComponents()
          Remove the browsebuttons
protected  void uninstallListeners()
          Remove the browsebutton listeners
 void uninstallUI(JComponent c)
           
 
Methods inherited from class javax.swing.plaf.metal.MetalTabbedPaneUI
calculateMaxTabHeight, getColorForGap, getTabLabelShiftX, getTabLabelShiftY, getTabRunOverlay, installDefaults, paintBottomTabBorder, paintContentBorderBottomEdge, paintContentBorderLeftEdge, paintContentBorderRightEdge, paintContentBorderTopEdge, paintHighlightBelowTab, paintLeftTabBorder, paintRightTabBorder, paintTabBackground, paintTopTabBorder, shouldFillGap, shouldPadTabRun, shouldRotateTabRuns, update
 
Methods inherited from class javax.swing.plaf.basic.BasicTabbedPaneUI
assureRectsCreated, calculateMaxTabWidth, calculateTabAreaHeight, calculateTabAreaWidth, calculateTabHeight, calculateTabWidth, createFocusListener, createPropertyChangeListener, expandTabRunsArray, getContentBorderInsets, getIconForTab, getMaximumSize, getMinimumSize, getNextTabIndex, getNextTabIndexInRun, getNextTabRun, getPreferredSize, getPreviousTabIndex, getPreviousTabIndexInRun, getPreviousTabRun, getRunForTab, getSelectedTabPadInsets, getTabBounds, getTabBounds, getTabInsets, getTabRunCount, getTabRunIndent, getTabRunOffset, getTextViewForTab, getVisibleComponent, installKeyboardActions, lastTabInRun, layoutLabel, navigateSelectedTab, paintContentBorder, paintIcon, paintTabArea, rotateInsets, selectAdjacentRunTab, selectNextTab, selectNextTabInRun, selectPreviousTab, selectPreviousTabInRun, setVisibleComponent, shouldRotateTabRuns, tabForCoordinate, uninstallDefaults, uninstallKeyboardActions
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

brokenLine

protected GeneralPath brokenLine

brokenFill

protected GeneralPath brokenFill

gradientBackground

protected BufferedImage gradientBackground

gradientSelectedBackground

protected BufferedImage gradientSelectedBackground

selectionExtraHeight

protected int selectionExtraHeight

buttonListeners

protected ActionListener[] buttonListeners
Constructor Detail

UICTabbedPaneUI

public UICTabbedPaneUI()
Method Detail

createUI

public static ComponentUI createUI(JComponent comp)

installUI

public void installUI(JComponent c)

uninstallUI

public void uninstallUI(JComponent c)

createMouseListener

protected MouseListener createMouseListener()
Override mouselistener to reimplement tab selection Only VISIBLE tabs can be selected


createChangeListener

protected ChangeListener createChangeListener()

createLayoutManager

protected LayoutManager createLayoutManager()
Create a correct layout


installComponents

protected void installComponents()
Add the browse buttons


uninstallComponents

protected void uninstallComponents()
Remove the browsebuttons


installListeners

protected void installListeners()
Add actions to the browse buttons


getTabPlacementOffset

protected int getTabPlacementOffset()

setTabPlacementOffset

protected void setTabPlacementOffset(int offset)

getBrowseOffset

protected int getBrowseOffset()

uninstallListeners

protected void uninstallListeners()
Remove the browsebutton listeners


paint

public void paint(Graphics g,
                  JComponent c)
Override default paint to set the correct layout and to update the browse buttons (enable/disable and visible/not-visible)


getTabAreaInsets

protected Insets getTabAreaInsets(int tabPlacement)
Update the insets of the tabs, using the space of the buttons


ensureCurrentLayout

protected void ensureCurrentLayout()

getFontMetrics

protected FontMetrics getFontMetrics()

getVisibleOffset

protected int getVisibleOffset(int index)

setLastTabVisible

public void setLastTabVisible(boolean lastTabVisible)

isLastTabVisible

public boolean isLastTabVisible()

getButtonPreferredSize

public Dimension getButtonPreferredSize()

paintTab

protected void paintTab(Graphics g,
                        int tabPlacement,
                        Rectangle[] rects,
                        int tabIndex,
                        Rectangle iconRect,
                        Rectangle textRect)
Since this method is called from the superclass, do nothing when tab is not visible


paintFocusIndicator

protected void paintFocusIndicator(Graphics g,
                                   int tabPlacement,
                                   Rectangle[] rects,
                                   int tabIndex,
                                   Rectangle iconRect,
                                   Rectangle textRect,
                                   boolean isSelected)
Override paint focus, to draw a normal dashed line as focus


paintTabBorder

protected void paintTabBorder(Graphics g,
                              int tabPlacement,
                              int tabIndex,
                              int x,
                              int y,
                              int w,
                              int h,
                              boolean isSelected)
this function draws the border around each tab note that this function does now draw the background of the tab. that is done elsewhere


paintText

protected void paintText(Graphics g,
                         int tabPlacement,
                         Font font,
                         FontMetrics metrics,
                         int tabIndex,
                         String title,
                         Rectangle textRect,
                         boolean isSelected)


Copyright © 2002,2003 Thomas Zander Available under the Free Apache licence