uic.themes
Class UICTabbedPaneUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.TabbedPaneUI
          extended by javax.swing.plaf.basic.BasicTabbedPaneUI
              extended by javax.swing.plaf.metal.MetalTabbedPaneUI
                  extended by uic.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/interfaces inherited from class javax.swing.plaf.metal.MetalTabbedPaneUI
MetalTabbedPaneUI.TabbedPaneLayout
 
Nested classes/interfaces 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, createScrollButton, expandTabRunsArray, getContentBorderInsets, getFocusIndex, getIconForTab, getMaximumSize, getMinimumSize, getNextTabIndex, getNextTabIndexInRun, getNextTabRun, getPreviousTabIndex, getPreviousTabIndexInRun, getPreviousTabRun, getRolloverTab, getRunForTab, getSelectedTabPadInsets, getTabBounds, getTabBounds, getTabInsets, getTabRunCount, getTabRunIndent, getTabRunOffset, getTextViewForTab, getVisibleComponent, installKeyboardActions, lastTabInRun, layoutLabel, navigateSelectedTab, paintContentBorder, paintIcon, paintTabArea, rotateInsets, selectAdjacentRunTab, selectNextTab, selectNextTabInRun, selectPreviousTab, selectPreviousTabInRun, setRolloverTab, setVisibleComponent, shouldRotateTabRuns, tabForCoordinate, uninstallDefaults, uninstallKeyboardActions
 
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
 

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)
Overrides:
installUI in class BasicTabbedPaneUI

uninstallUI

public void uninstallUI(JComponent c)
Overrides:
uninstallUI in class BasicTabbedPaneUI

createMouseListener

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

Overrides:
createMouseListener in class BasicTabbedPaneUI

createChangeListener

protected ChangeListener createChangeListener()
Overrides:
createChangeListener in class BasicTabbedPaneUI

createLayoutManager

protected LayoutManager createLayoutManager()
Create a correct layout

Overrides:
createLayoutManager in class MetalTabbedPaneUI

installComponents

protected void installComponents()
Add the browse buttons

Overrides:
installComponents in class BasicTabbedPaneUI

uninstallComponents

protected void uninstallComponents()
Remove the browsebuttons

Overrides:
uninstallComponents in class BasicTabbedPaneUI

installListeners

protected void installListeners()
Add actions to the browse buttons

Overrides:
installListeners in class BasicTabbedPaneUI

getTabPlacementOffset

protected int getTabPlacementOffset()

setTabPlacementOffset

protected void setTabPlacementOffset(int offset)

getBrowseOffset

protected int getBrowseOffset()

uninstallListeners

protected void uninstallListeners()
Remove the browsebutton listeners

Overrides:
uninstallListeners in class BasicTabbedPaneUI

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)

Overrides:
paint in class MetalTabbedPaneUI

getTabAreaInsets

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

Overrides:
getTabAreaInsets in class BasicTabbedPaneUI

ensureCurrentLayout

protected void ensureCurrentLayout()

getFontMetrics

protected FontMetrics getFontMetrics()
Overrides:
getFontMetrics in class BasicTabbedPaneUI

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

Overrides:
paintTab in class BasicTabbedPaneUI

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

Overrides:
paintFocusIndicator in class MetalTabbedPaneUI

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

Overrides:
paintTabBorder in class MetalTabbedPaneUI

paintText

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


Copyright © 2002-2004 Thomas Zander Available under the Free Apache licence