javax.swing.plaf.metal

Class MetalTabbedPaneUI

Implemented Interfaces:
SwingConstants

public class MetalTabbedPaneUI
extends BasicTabbedPaneUI

A UI delegate for the JTabbedPane component.

Nested Class Summary

class
MetalTabbedPaneUI.TabbedPaneLayout
A LayoutManager responsible for placing all the tabs and the visible component inside the JTabbedPane.

Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicTabbedPaneUI

BasicTabbedPaneUI.FocusHandler, BasicTabbedPaneUI.MouseHandler, BasicTabbedPaneUI.PropertyChangeHandler, BasicTabbedPaneUI.TabbedPaneLayout, 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

MetalTabbedPaneUI()
Constructs a new instance of MetalTabbedPaneUI.

Method Summary

protected LayoutManager
createLayoutManager()
Creates and returns an instance of MetalTabbedPaneUI.TabbedPaneLayout.
static ComponentUI
createUI(JComponent component)
Returns an instance of MetalTabbedPaneUI.
protected void
paintBottomTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)
Paints the border for a tab assuming that the tab position is at the bottom (MetalTabbedPaneUI).
protected void
paintLeftTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)
Paints the border for a tab assuming that the tab position is at the left (MetalTabbedPaneUI).
protected void
paintRightTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)
Paints the border for a tab assuming that the tab position is at the right (MetalTabbedPaneUI).
protected void
paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
Paints the background for a tab.
protected void
paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
Paints the border for a single tab.
protected void
paintTopTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)
Paints the border for a tab assuming that the tab position is at the top (MetalTabbedPaneUI).
protected boolean
shouldPadTabRun(int tabPlacement, int run)
Returns true if the tabs in the specified run should be padded to make the run fill the width/height of the JTabbedPane.

Methods inherited from class javax.swing.plaf.basic.BasicTabbedPaneUI

assureRectsCreated, calculateMaxTabHeight, calculateMaxTabWidth, calculateTabAreaHeight, calculateTabAreaWidth, calculateTabHeight, calculateTabWidth, createChangeListener, createFocusListener, createLayoutManager, createMouseListener, createPropertyChangeListener, createUI, expandTabRunsArray, getContentBorderInsets, getFontMetrics, getIconForTab, getMaximumSize, getMinimumSize, getNextTabIndex, getNextTabIndexInRun, getNextTabRun, getPreviousTabIndex, getPreviousTabIndexInRun, getPreviousTabRun, getRunForTab, getSelectedTabPadInsets, getTabAreaInsets, getTabBounds, getTabBounds, getTabInsets, getTabLabelShiftX, getTabLabelShiftY, getTabRunCount, getTabRunIndent, getTabRunOffset, getTabRunOverlay, getTextViewForTab, getVisibleComponent, installComponents, installDefaults, installKeyboardActions, installListeners, installUI, lastTabInRun, layoutLabel, navigateSelectedTab, paint, paintContentBorder, paintContentBorderBottomEdge, paintContentBorderLeftEdge, paintContentBorderRightEdge, paintContentBorderTopEdge, paintFocusIndicator, paintIcon, paintTab, paintTabArea, paintTabBackground, paintTabBorder, paintText, rotateInsets, selectAdjacentRunTab, selectNextTab, selectNextTabInRun, selectPreviousTab, selectPreviousTabInRun, setVisibleComponent, shouldPadTabRun, shouldRotateTabRuns, tabForCoordinate, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI

Methods inherited from class javax.swing.plaf.TabbedPaneUI

getTabBounds, getTabRunCount, tabForCoordinate

Methods inherited from class javax.swing.plaf.ComponentUI

contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize, installUI, paint, uninstallUI, update

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

MetalTabbedPaneUI

public MetalTabbedPaneUI()
Constructs a new instance of MetalTabbedPaneUI.

Method Details

createLayoutManager

protected LayoutManager createLayoutManager()
Creates and returns an instance of MetalTabbedPaneUI.TabbedPaneLayout.
Overrides:
createLayoutManager in interface BasicTabbedPaneUI

Returns:
A layout manager used by this UI delegate.


createUI

public static ComponentUI createUI(JComponent component)
Returns an instance of MetalTabbedPaneUI.
Overrides:
createUI in interface BasicTabbedPaneUI

Parameters:
component - the component for which we return an UI instance

Returns:
an instance of MetalTabbedPaneUI


paintBottomTabBorder

protected void paintBottomTabBorder(int tabIndex,
                                    Graphics g,
                                    int x,
                                    int y,
                                    int w,
                                    int h,
                                    int btm,
                                    int rght,
                                    boolean isSelected)
Paints the border for a tab assuming that the tab position is at the bottom (MetalTabbedPaneUI).

Parameters:
tabIndex - the tab index.
g - the graphics device.
x - the x-coordinate for the tab's bounding rectangle.
y - the y-coordinate for the tab's bounding rectangle.
w - the width for the tab's bounding rectangle.
h - the height for the tab's bounding rectangle.
btm - ???
rght - ???
isSelected - indicates whether the tab is selected.


paintLeftTabBorder

protected void paintLeftTabBorder(int tabIndex,
                                  Graphics g,
                                  int x,
                                  int y,
                                  int w,
                                  int h,
                                  int btm,
                                  int rght,
                                  boolean isSelected)
Paints the border for a tab assuming that the tab position is at the left (MetalTabbedPaneUI).

Parameters:
tabIndex - the tab index.
g - the graphics device.
x - the x-coordinate for the tab's bounding rectangle.
y - the y-coordinate for the tab's bounding rectangle.
w - the width for the tab's bounding rectangle.
h - the height for the tab's bounding rectangle.
btm - ???
rght - ???
isSelected - indicates whether the tab is selected.


paintRightTabBorder

protected void paintRightTabBorder(int tabIndex,
                                   Graphics g,
                                   int x,
                                   int y,
                                   int w,
                                   int h,
                                   int btm,
                                   int rght,
                                   boolean isSelected)
Paints the border for a tab assuming that the tab position is at the right (MetalTabbedPaneUI).

Parameters:
tabIndex - the tab index.
g - the graphics device.
x - the x-coordinate for the tab's bounding rectangle.
y - the y-coordinate for the tab's bounding rectangle.
w - the width for the tab's bounding rectangle.
h - the height for the tab's bounding rectangle.
btm - ???
rght - ???
isSelected - indicates whether the tab is selected.


paintTabBackground

protected void paintTabBackground(Graphics g,
                                  int tabPlacement,
                                  int tabIndex,
                                  int x,
                                  int y,
                                  int w,
                                  int h,
                                  boolean isSelected)
Paints the background for a tab. MetalTabbedPaneUI or MetalTabbedPaneUI).
Overrides:
paintTabBackground in interface BasicTabbedPaneUI

Parameters:
g - the graphics device.
tabPlacement - the tab placement (MetalTabbedPaneUI, MetalTabbedPaneUI,
tabIndex - the index of the tab to draw the border for.
x - the x-coordinate for the tab's bounding rectangle.
y - the y-coordinate for the tab's bounding rectangle.
w - the width for the tab's bounding rectangle.
h - the height for the tab's bounding rectangle.
isSelected - indicates whether or not the tab is selected.


paintTabBorder

protected void paintTabBorder(Graphics g,
                              int tabPlacement,
                              int tabIndex,
                              int x,
                              int y,
                              int w,
                              int h,
                              boolean isSelected)
Paints the border for a single tab. MetalTabbedPaneUI or MetalTabbedPaneUI).
Overrides:
paintTabBorder in interface BasicTabbedPaneUI

Parameters:
g - the graphics device.
tabPlacement - the tab placement (MetalTabbedPaneUI, MetalTabbedPaneUI,
tabIndex - the index of the tab to draw the border for.
x - the x-coordinate for the tab's bounding rectangle.
y - the y-coordinate for the tab's bounding rectangle.
w - the width for the tab's bounding rectangle.
h - the height for the tab's bounding rectangle.
isSelected - indicates whether or not the tab is selected.


paintTopTabBorder

protected void paintTopTabBorder(int tabIndex,
                                 Graphics g,
                                 int x,
                                 int y,
                                 int w,
                                 int h,
                                 int btm,
                                 int rght,
                                 boolean isSelected)
Paints the border for a tab assuming that the tab position is at the top (MetalTabbedPaneUI).

Parameters:
tabIndex - the tab index.
g - the graphics device.
x - the x-coordinate for the tab's bounding rectangle.
y - the y-coordinate for the tab's bounding rectangle.
w - the width for the tab's bounding rectangle.
h - the height for the tab's bounding rectangle.
btm - ???
rght - ???
isSelected - indicates whether the tab is selected.


shouldPadTabRun

protected boolean shouldPadTabRun(int tabPlacement,
                                  int run)
Returns true if the tabs in the specified run should be padded to make the run fill the width/height of the JTabbedPane. MetalTabbedPaneUI, MetalTabbedPaneUI, MetalTabbedPaneUI and MetalTabbedPaneUI).
Overrides:
shouldPadTabRun in interface BasicTabbedPaneUI

Parameters:
tabPlacement - the tab placement for the JTabbedPane (one of
run - the run index.

Returns:
A boolean.


MetalTabbedPaneUI.java Copyright (C) 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.