getColorForGap
protected Color getColorForGap(int currentRun,
int x,
int y)
Returns the color for the gap.
currentRun
- - The current run to return the color forx
- - The x position of the current runy
- - The y position of the current run
- the color for the gap in the current run.
getTabLabelShiftX
protected int getTabLabelShiftX(int tabPlacement,
int index,
boolean isSelected)
This method returns how much the label for the tab should shift in the X
direction.
- getTabLabelShiftX in interface BasicTabbedPaneUI
tabPlacement
- The JTabbedPane's tab placement.isSelected
- Whether this tab is selected.
- The amount the label should shift by in the X direction.
getTabLabelShiftY
protected int getTabLabelShiftY(int tabPlacement,
int index,
boolean isSelected)
This method returns how much the label for the tab should shift in the Y
direction.
- getTabLabelShiftY in interface BasicTabbedPaneUI
tabPlacement
- The JTabbedPane's tab placement.isSelected
- Whether this tab is selected.
- The amount the label should shift by in the Y direction.
getTabRunOverlay
protected int getTabRunOverlay(int tabPlacement)
Returns the amount of overlay among the tabs. In
the Metal L&F the overlay for LEFT and RIGHT placement
is half of the maxTabHeight. For TOP and BOTTOM placement
the tabs do not overlay.
- getTabRunOverlay in interface BasicTabbedPaneUI
tabPlacement
- the placement
- the amount of overlay among the tabs
paintBottomTabBorder
protected void paintBottomTabBorder(int tabIndex,
Graphics g,
int x,
int y,
int w,
int h,
int btm,
int rght,
boolean isSelected)
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.
paintContentBorderBottomEdge
protected void paintContentBorderBottomEdge(Graphics g,
int tabPlacement,
int selectedIndex,
int x,
int y,
int w,
int h)
Paints the lower edge of the content border.
- paintContentBorderBottomEdge in interface BasicTabbedPaneUI
g
- the graphics to use for paintingtabPlacement
- the tab placementselectedIndex
- the index of the selected tabx
- the upper left coordinate of the content areay
- the upper left coordinate of the content areaw
- the width of the content areah
- the height of the content area
paintContentBorderLeftEdge
protected void paintContentBorderLeftEdge(Graphics g,
int tabPlacement,
int selectedIndex,
int x,
int y,
int w,
int h)
Paints the left edge of the content border.
- paintContentBorderLeftEdge in interface BasicTabbedPaneUI
g
- the graphics to use for paintingtabPlacement
- the tab placementselectedIndex
- the index of the selected tabx
- the upper left coordinate of the content areay
- the upper left coordinate of the content areaw
- the width of the content areah
- the height of the content area
paintContentBorderRightEdge
protected void paintContentBorderRightEdge(Graphics g,
int tabPlacement,
int selectedIndex,
int x,
int y,
int w,
int h)
Paints the right edge of the content border.
- paintContentBorderRightEdge in interface BasicTabbedPaneUI
g
- the graphics to use for paintingtabPlacement
- the tab placementselectedIndex
- the index of the selected tabx
- the upper left coordinate of the content areay
- the upper left coordinate of the content areaw
- the width of the content areah
- the height of the content area
paintContentBorderTopEdge
protected void paintContentBorderTopEdge(Graphics g,
int tabPlacement,
int selectedIndex,
int x,
int y,
int w,
int h)
Paints the upper edge of the content border.
- paintContentBorderTopEdge in interface BasicTabbedPaneUI
g
- the graphics to use for paintingtabPlacement
- the tab placementselectedIndex
- the index of the selected tabx
- the upper left coordinate of the content areay
- the upper left coordinate of the content areaw
- the width of the content areah
- the height of the content area
paintFocusIndicator
protected void paintFocusIndicator(Graphics g,
int tabPlacement,
Rectangle[] rects,
int tabIndex,
Rectangle iconRect,
Rectangle textRect,
boolean isSelected)
This method paints the focus rectangle around the selected tab.
- paintFocusIndicator in interface BasicTabbedPaneUI
g
- The Graphics object to paint with.tabPlacement
- The JTabbedPane's tab placement.rects
- The array of rectangles keeping track of size and position.tabIndex
- The tab index.iconRect
- The icon bounds.textRect
- The text bounds.isSelected
- Whether this tab is selected.
paintHighlightBelowTab
protected void paintHighlightBelowTab()
Paints the highlight below the tab, if there is one.
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
(
SwingConstants.LEFT
).
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)
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.
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.
- paintTabBorder in interface BasicTabbedPaneUI
g
- the graphics device.tabPlacement
- the tab placement (SwingConstants.TOP
, SwingConstants.LEFT
,
SwingConstants.BOTTOM
or SwingConstants.RIGHT
).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
(
SwingConstants.TOP
).
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
- the y coordinate of the bottom borderrght
- the x coordinate of the right borderisSelected
- indicates whether the tab is selected.
shouldFillGap
protected boolean shouldFillGap(int currentRun,
int tabIndex,
int x,
int y)
Returns true if the gap should be filled in.
currentRun
- - The current runtabIndex
- - The current tabx
- - The x position of the taby
- - The y position of the tab
- true if the gap at the current run should be filled
shouldRotateTabRuns
protected boolean shouldRotateTabRuns(int tabPlacement,
int selectedRun)
Returns true if we should rotate the tab runs.
tabPlacement
- - The current tab placement.selectedRun
- - The selected run.
- true if the tab runs should be rotated.
MetalTabbedPaneUI.java
Copyright (C) 2005, 2006 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.