/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* Copy of javax.swing.plaf.basic.BasicTabbedPaneUI because the original
* does not have enough private methods marked as protected.
*
* This copy is from 1.6.0_04 as of 2008-02-02.
*/
// Instance variables initialized at installation
protected int textIconGap;
protected int tabRunOverlay;
private boolean tabsOverlapBorder;
private boolean tabsOpaque = true;
private boolean contentOpaque = true;
/**
* As of Java 2 platform v1.3 this previously undocumented field is no
* longer used.
* Key bindings are now defined by the LookAndFeel, please refer to
* the key bindings specification for further details.
*
* @deprecated As of Java 2 platform v1.3.
*/
/**
* As of Java 2 platform v1.3 this previously undocumented field is no
* longer used.
* Key bindings are now defined by the LookAndFeel, please refer to
* the key bindings specification for further details.
*
* @deprecated As of Java 2 platform v1.3.
*/
/**
* As of Java 2 platform v1.3 this previously undocumented field is no
* longer used.
* Key bindings are now defined by the LookAndFeel, please refer to
* the key bindings specification for further details.
*
* @deprecated As of Java 2 platform v1.3.
*/
/**
* As of Java 2 platform v1.3 this previously undocumented field is no
* longer used.
* Key bindings are now defined by the LookAndFeel, please refer to
* the key bindings specification for further details.
*
* @deprecated As of Java 2 platform v1.3.
*/
// Transient variables (recalculated each time TabbedPane is layed out)
protected int maxTabHeight;
protected int maxTabWidth;
// Listeners
// Private instance data
// PENDING(api): See comment for ContainerHandler
/**
* InputMap used for mnemonics. Only non-null if the JTabbedPane has
* mnemonics associated with it. Lazily created in initMnemonics.
*/
// For use when tabLayoutPolicy = SCROLL_TAB_LAYOUT
/**
* A rectangle used for general layout calculations in order
* to avoid constructing many new Rectangles on the fly.
*/
/**
* Tab that has focus.
*/
private int focusIndex;
/**
* Combined listeners.
*/
/**
* Index of the tab the mouse is over.
*/
private int rolloverTabIndex;
/**
* pane and set to false when layout happens. If true it indicates that
* tabRuns is not valid and shouldn't be used.
*/
private boolean isRunsDirty;
private boolean calculatedBaseline;
private int baseline;
// UI creation
return new AquaTabbedPaneCopyFromBasicUI();
}
// MACOSX adding accessor for superclass
return tabPane.getTabComponentAt(i);
}
// END MACOSX
}
// UI Installation/De-installation
this.tabPane = (JTabbedPane)c;
calculatedBaseline = false;
rolloverTabIndex = -1;
focusIndex = -1;
c.setLayout(createLayoutManager());
}
}
/**
* Invoked by <code>installUI</code> to create
* a layout manager object to manage
* the <code>JTabbedPane</code>.
*
* @return a layout manager object
*
* @see TabbedPaneLayout
* @see javax.swing.JTabbedPane#getTabLayoutPolicy
*/
return new TabbedPaneScrollLayout();
} else { /* WRAP_TAB_LAYOUT */
return new TabbedPaneLayout();
}
}
/* In an attempt to preserve backward compatibility for programs
* which have extended BasicTabbedPaneUI to do their own layout, the
* UI uses the installed layoutManager (and not tabLayoutPolicy) to
* determine if scrollTabLayout is enabled.
*/
boolean scrollableTabLayoutEnabled() {
}
/**
* Creates and installs any required subcomponents for the JTabbedPane.
* Invoked by installUI.
*
* @since 1.4
*/
protected void installComponents() {
if (scrollableTabLayoutEnabled()) {
if (tabScroller == null) {
}
}
}
private void installTabContainer() {
if (tabComponent != null) {
if (tabContainer == null) {
tabContainer = new TabContainer();
}
}
}
if (tabContainer == null) {
return;
}
if (scrollableTabLayoutEnabled()) {
} else {
}
}
/**
* Creates and returns a JButton that will provide the user
* with a way to scroll the tabs in a particular direction. The
* returned JButton must be instance of UIResource.
*
* @param direction One of the SwingConstants constants:
* SOUTH, NORTH, EAST or WEST
* @return Widget for user to
* @see javax.swing.JTabbedPane#setTabPlacement
* @see javax.swing.SwingConstants
* @throws IllegalArgumentException if direction is not one of
* NORTH, SOUTH, EAST or WEST
* @since 1.5
*/
}
return new ScrollableTabButton(direction);
}
/**
* Removes any installed subcomponents from the JTabbedPane.
* Invoked by uninstallUI.
*
* @since 1.4
*/
protected void uninstallComponents() {
if (scrollableTabLayoutEnabled()) {
tabScroller = null;
}
}
private void uninstallTabContainer() {
if (tabContainer == null) {
return;
}
// Remove all the tabComponents, making sure not to notify
// the tabbedpane.
tabContainer.notifyTabbedPane = false;
if (scrollableTabLayoutEnabled()) {
} else {
}
tabContainer = null;
}
protected void installDefaults() {
LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font");
}
}
protected void uninstallDefaults() {
darkShadow = null;
}
protected void installListeners() {
}
}
}
}
}
}
protected void uninstallListeners() {
if (mouseListener != null) {
}
if (focusListener != null) {
}
}
if (tabChangeListener != null) {
}
if (propertyChangeListener != null) {
}
}
return getHandler();
}
return getHandler();
}
return getHandler();
}
return getHandler();
}
}
return handler;
}
protected void installKeyboardActions() {
LazyActionMap.installLazyActionMap(tabPane, AquaTabbedPaneCopyFromBasicUI.class, "TabbedPane.actionMap");
}
}
return null;
}
protected void uninstallKeyboardActions() {
}
/**
* Reloads the mnemonics. This should be invoked when a memonic changes,
*/
private void updateMnemonics() {
if (mnemonic > 0) {
}
}
}
/**
* Resets the mnemonics bindings to an empty state.
*/
private void resetMnemonics() {
if (mnemonicToIndexMap != null) {
}
}
/**
* Adds the specified mnemonic at the specified index.
*/
if (mnemonicToIndexMap == null) {
}
// [2165820] Mac OS X change: mnemonics need to be triggered with ctrl-option, not just option.
mnemonicInputMap.put(KeyStroke.getKeyStroke(mnemonic, Event.ALT_MASK | Event.CTRL_MASK), "setSelectedIndex");
}
/**
* Installs the state needed for mnemonics.
*/
private void initMnemonics() {
mnemonicInputMap.setParent(SwingUtilities.getUIInputMap(tabPane, JComponent.WHEN_IN_FOCUSED_WINDOW));
}
/**
* Sets the tab the mouse is over by location. This is a cover method
* for <code>setRolloverTab(tabForCoordinate(x, y, false))</code>.
*/
private void setRolloverTab(final int x, final int y) {
// NOTE:
// This calls in with false otherwise it could trigger a validate,
// which should NOT happen if the user is only dragging the
// mouse around.
}
/**
* Sets the tab the mouse is currently over to <code>index</code>.
* <code>index</code> will be -1 if the mouse is no longer over any
* tab. No checking is done to ensure the passed in index identifies a
* valid tab.
*
* @param index Index of the tab the mouse is over.
* @since 1.5
*/
}
/**
* Returns the tab the mouse is currently over, or {@code -1} if the mouse is no
* longer over any tab.
*
* @return the tab the mouse is currently over, or {@code -1} if the mouse is no
* longer over any tab
* @since 1.5
*/
protected int getRolloverTab() {
return rolloverTabIndex;
}
// Default to LayoutManager's minimumLayoutSize
return null;
}
// Default to LayoutManager's maximumLayoutSize
return null;
}
/**
* Returns the baseline.
*
* @throws NullPointerException {@inheritDoc}
* @throws IllegalArgumentException {@inheritDoc}
* @see javax.swing.JComponent#getBaseline(int, int)
* @since 1.6
*/
int baseline = calculateBaselineIfNecessary();
if (baseline != -1) {
switch (placement) {
case SwingConstants.TOP:
return baseline;
case SwingConstants.BOTTOM:
return baseline;
case SwingConstants.LEFT:
case SwingConstants.RIGHT:
return baseline;
}
}
return -1;
}
/**
* Returns an enum indicating how the baseline of the component
* changes as the size changes.
*
* @throws NullPointerException {@inheritDoc}
* @see javax.swing.JComponent#getBaseline(int, int)
* @since 1.6
*/
super.getBaselineResizeBehavior(c);
switch (tabPane.getTabPlacement()) {
case SwingConstants.LEFT:
case SwingConstants.RIGHT:
case SwingConstants.TOP:
case SwingConstants.BOTTOM:
}
}
/**
* Returns the baseline for the specified tab.
*
* @param tab index of tab to get baseline for
* @exception IndexOutOfBoundsException if index is out of range
* (index < 0 || index >= tab count)
* @return baseline or a value < 0 indicating there is no reasonable
* baseline
* @since 1.6
*/
final int offset = getBaselineOffset();
if (offset != 0) {
// The offset is not applied to the tab component, and so
// in general we can't get good alignment like with components
// in the tab.
return -1;
}
} else {
final int baseline = BasicHTML.getHTMLBaseline(view, (int)view.getPreferredSpan(View.X_AXIS), viewHeight);
if (baseline >= 0) {
}
return -1;
}
}
}
/**
* Returns the amount the baseline is offset by. This is typically
* the same as <code>getTabLabelShiftY</code>.
*
* @return amount to offset the baseline by
* @since 1.6
*/
protected int getBaselineOffset() {
switch (tabPane.getTabPlacement()) {
case SwingConstants.TOP:
return 1;
} else {
return -1;
}
case SwingConstants.BOTTOM:
return -1;
} else {
return 1;
}
default: // RIGHT|LEFT
return (maxTabHeight % 2);
}
}
private int calculateBaselineIfNecessary() {
if (!calculatedBaseline) {
calculatedBaseline = true;
baseline = -1;
}
}
return baseline;
}
private void calculateBaseline() {
if (isHorizontalTabPlacement()) {
for (int i = 1; i < tabCount; i++) {
if (getBaseline(i) != baseline) {
baseline = -1;
break;
}
}
} else {
for (int i = 1; i < tabCount; i++) {
// assume different baseline
baseline = -1;
break;
}
}
}
}
// UI Rendering
// Paint content border and tab area
if (tabsOverlapBorder) {
}
// If scrollable tabs are enabled, the tab area will be
// painted by the scrollable tab panel instead.
//
if (!scrollableTabLayoutEnabled()) { // WRAP_TAB_LAYOUT
}
if (!tabsOverlapBorder) {
}
}
/**
* Paints the tabs in the tab area.
* Invoked by paint().
* The graphics parameter must be a valid <code>Graphics</code>
* object. Tab placement may be either:
* <code>JTabbedPane.TOP</code>, <code>JTabbedPane.BOTTOM</code>,
* <code>JTabbedPane.LEFT</code>, or <code>JTabbedPane.RIGHT</code>.
* The selected index must be a valid tabbed pane tab index (0 to
* tab count - 1, inclusive) or -1 if no tab is currently selected.
* The handling of invalid parameters is unspecified.
*
* @param g the graphics object to use for rendering
* @param tabPlacement the placement for the tabs within the JTabbedPane
* @param selectedIndex the tab index of the selected component
*
* @since 1.4
*/
// Paint tabRuns of tabs from back to front
}
}
}
// Paint selected tab if its in the front run
// since it may overlap other tabs
}
}
protected void paintTab(final Graphics g, final int tabPlacement, final Rectangle[] rects, final int tabIndex, final Rectangle iconRect, final Rectangle textRect) {
paintTabBackground(g, tabPlacement, tabIndex, tabRect.x, tabRect.y, tabRect.width, tabRect.height, isSelected);
}
paintTabBorder(g, tabPlacement, tabIndex, tabRect.x, tabRect.y, tabRect.width, tabRect.height, isSelected);
if (scrollableTabLayoutEnabled() && tabScroller.croppedEdge.isParamsSet() && tabScroller.croppedEdge.getTabIndex() == tabIndex && isHorizontalTabPlacement()) {
final int availTextWidth = tabScroller.croppedEdge.getCropline() - (textRect.x - tabRect.x) - tabScroller.croppedEdge.getCroppedSideWidth();
}
}
}
private boolean isHorizontalTabPlacement() {
}
/* This method will create and return a polygon shape for the given tab rectangle
* which has been cropped at the specified cropline with a torn edge visual.
* e.g. A "File" tab which has cropped been cropped just after the "i":
* -------------
* | ..... |
* | . |
* | ... . |
* | . . |
* | . . |
* | . . |
* --------------
*
* The x, y arrays below define the pattern used to create a "torn" edge
* segment which is repeated to fill the edge of the tab.
* For tabs placed on TOP and BOTTOM, this righthand torn edge is created by
* line segments which are defined by coordinates obtained by
* subtracting xCropLen[i] from (tab.x + tab.width) and adding yCroplen[i]
* to (tab.y).
* For tabs placed on LEFT or RIGHT, the bottom torn edge is created by
* subtracting xCropLen[i] from (tab.y + tab.height) and adding yCropLen[i]
* to (tab.x).
*/
private static Polygon createCroppedTabShape(final int tabPlacement, final Rectangle tabRect, final int cropline) {
int rlen = 0;
int start = 0;
int end = 0;
int ostart = 0;
switch (tabPlacement) {
case LEFT:
case RIGHT:
break;
case TOP:
case BOTTOM:
default:
}
rcnt++;
}
int pcnt = 0;
for (int i = 0; i < rcnt; i++) {
pcnt++;
break;
}
pcnt++;
}
}
} else { // LEFT or RIGHT
}
}
/* If tabLayoutPolicy == SCROLL_TAB_LAYOUT, this method will paint an edge
* indicating the tab is cropped in the viewport display
*/
int x, y;
switch (tabPane.getTabPlacement()) {
case LEFT:
case RIGHT:
y = cropline;
int xx = x;
}
xx += CROP_SEGMENT;
}
break;
case TOP:
case BOTTOM:
default:
x = cropline;
int yy = y;
}
yy += CROP_SEGMENT;
}
}
}
protected void layoutLabel(final int tabPlacement, final FontMetrics metrics, final int tabIndex, final String title, final Icon icon, final Rectangle tabRect, final Rectangle iconRect, final Rectangle textRect, final boolean isSelected) {
if (v != null) {
}
SwingUtilities.layoutCompoundLabel(tabPane, metrics, title, icon, SwingConstants.CENTER, SwingConstants.CENTER, SwingConstants.CENTER, SwingConstants.TRAILING, tabRect, iconRect, textRect, textIconGap);
}
protected void paintIcon(final Graphics g, final int tabPlacement, final int tabIndex, final Icon icon, final Rectangle iconRect, final boolean isSelected) {
}
}
protected void paintText(final Graphics g, final int tabPlacement, final Font font, final FontMetrics metrics, final int tabIndex, final String title, final Rectangle textRect, final boolean isSelected) {
if (v != null) {
// html
} else {
// plain text
if (selectedFG != null) {
fg = selectedFG;
}
}
SwingUtilities2.drawStringUnderlineCharAt(tabPane, g, title, mnemIndex, textRect.x, textRect.y + metrics.getAscent());
} else { // tab disabled
SwingUtilities2.drawStringUnderlineCharAt(tabPane, g, title, mnemIndex, textRect.x, textRect.y + metrics.getAscent());
SwingUtilities2.drawStringUnderlineCharAt(tabPane, g, title, mnemIndex, textRect.x - 1, textRect.y + metrics.getAscent() - 1);
}
}
}
protected int getTabLabelShiftX(final int tabPlacement, final int tabIndex, final boolean isSelected) {
int nudge = 0;
switch (tabPlacement) {
case LEFT:
break;
case RIGHT:
break;
case BOTTOM:
case TOP:
default:
}
return nudge;
}
protected int getTabLabelShiftY(final int tabPlacement, final int tabIndex, final boolean isSelected) {
int nudge = 0;
switch (tabPlacement) {
case BOTTOM:
break;
case LEFT:
case RIGHT:
break;
case TOP:
default:
;
}
return nudge;
}
protected void paintFocusIndicator(final Graphics g, final int tabPlacement, final Rectangle[] rects, final int tabIndex, final Rectangle iconRect, final Rectangle textRect, final boolean isSelected) {
int x, y, w, h;
switch (tabPlacement) {
case LEFT:
x = tabRect.x + 3;
y = tabRect.y + 3;
break;
case RIGHT:
x = tabRect.x + 2;
y = tabRect.y + 3;
break;
case BOTTOM:
x = tabRect.x + 3;
y = tabRect.y + 2;
break;
case TOP:
default:
x = tabRect.x + 3;
y = tabRect.y + 3;
}
BasicGraphicsUtils.drawDashedRect(g, x, y, w, h);
}
}
/**
* this function draws the border around each tab
* note that this function does now draw the background of the tab.
* that is done elsewhere
*/
protected void paintTabBorder(final Graphics g, final int tabPlacement, final int tabIndex, final int x, final int y, final int w, final int h, final boolean isSelected) {
switch (tabPlacement) {
case LEFT:
g.setColor(darkShadow);
break;
case RIGHT:
g.setColor(darkShadow);
break;
case BOTTOM:
g.setColor(darkShadow);
break;
case TOP:
default:
g.setColor(darkShadow);
}
}
protected void paintTabBackground(final Graphics g, final int tabPlacement, final int tabIndex, final int x, final int y, final int w, final int h, boolean isSelected) {
g.setColor(!isSelected || selectedColor == null ? tabPane.getBackgroundAt(tabIndex) : selectedColor);
switch (tabPlacement) {
case LEFT:
break;
case RIGHT:
break;
case BOTTOM:
break;
case TOP:
default:
}
}
protected void paintContentBorder(final Graphics g, final int tabPlacement, final int selectedIndex) {
switch (tabPlacement) {
case LEFT:
if (tabsOverlapBorder) {
x -= tabAreaInsets.right;
}
break;
case RIGHT:
if (tabsOverlapBorder) {
w += tabAreaInsets.left;
}
break;
case BOTTOM:
if (tabsOverlapBorder) {
h += tabAreaInsets.top;
}
break;
case TOP:
default:
if (tabsOverlapBorder) {
y -= tabAreaInsets.bottom;
}
}
// Fill region behind content area
} else {
}
g.fillRect(x, y, w, h);
}
}
protected void paintContentBorderTopEdge(final Graphics g, final int tabPlacement, final int selectedIndex, final int x, final int y, final int w, final int h) {
// Draw unbroken line if tabs are not on TOP, OR
// selected tab is not in run adjacent to content, OR
// selected tab is not visible (SCROLL_TAB_LAYOUT)
//
if (tabPlacement != TOP || selectedIndex < 0 || (selRect.y + selRect.height + 1 < y) || (selRect.x < x || selRect.x > x + w)) {
g.drawLine(x, y, x + w - 2, y);
} else {
// Break line to show visual connection to selected tab
} else {
}
}
}
protected void paintContentBorderLeftEdge(final Graphics g, final int tabPlacement, final int selectedIndex, final int x, final int y, final int w, final int h) {
// Draw unbroken line if tabs are not on LEFT, OR
// selected tab is not in run adjacent to content, OR
// selected tab is not visible (SCROLL_TAB_LAYOUT)
//
if (tabPlacement != LEFT || selectedIndex < 0 || (selRect.x + selRect.width + 1 < x) || (selRect.y < y || selRect.y > y + h)) {
g.drawLine(x, y, x, y + h - 2);
} else {
// Break line to show visual connection to selected tab
}
}
}
protected void paintContentBorderBottomEdge(final Graphics g, final int tabPlacement, final int selectedIndex, final int x, final int y, final int w, final int h) {
// Draw unbroken line if tabs are not on BOTTOM, OR
// selected tab is not in run adjacent to content, OR
// selected tab is not visible (SCROLL_TAB_LAYOUT)
//
if (tabPlacement != BOTTOM || selectedIndex < 0 || (selRect.y - 1 > h) || (selRect.x < x || selRect.x > x + w)) {
g.setColor(darkShadow);
} else {
// Break line to show visual connection to selected tab
g.setColor(darkShadow);
g.setColor(darkShadow);
}
}
}
protected void paintContentBorderRightEdge(final Graphics g, final int tabPlacement, final int selectedIndex, final int x, final int y, final int w, final int h) {
// Draw unbroken line if tabs are not on RIGHT, OR
// selected tab is not in run adjacent to content, OR
// selected tab is not visible (SCROLL_TAB_LAYOUT)
//
if (tabPlacement != RIGHT || selectedIndex < 0 || (selRect.x - 1 > w) || (selRect.y < y || selRect.y > y + h)) {
g.setColor(darkShadow);
} else {
// Break line to show visual connection to selected tab
g.setColor(darkShadow);
g.setColor(darkShadow);
}
}
}
protected void ensureCurrentLayout() {
}
/* If tabPane doesn't have a peer yet, the validate() call will
* silently fail. We handle that by forcing a layout if tabPane
* is still invalid. See bug 4237677.
*/
}
}
// TabbedPaneUI methods
/**
* Returns the bounds of the specified tab index. The bounds are
* with respect to the JTabbedPane's coordinate space.
*/
return getTabBounds(i, tabRect);
}
return runCount;
}
/**
* Returns the tab index which intersects the specified point
* in the JTabbedPane's coordinate space.
*/
return tabForCoordinate(pane, x, y, true);
}
private int tabForCoordinate(final JTabbedPane pane, final int x, final int y, final boolean validateIfNecessary) {
if (validateIfNecessary) {
}
if (isRunsDirty) {
// We didn't recalculate the layout, runs and tabCount may not
// line up, bail.
return -1;
}
if (scrollableTabLayoutEnabled()) {
translatePointToTabPanel(x, y, p);
return -1;
}
}
for (int i = 0; i < tabCount; i++) {
return i;
}
}
return -1;
}
/**
* Returns the bounds of the specified tab in the coordinate space
* of the JTabbedPane component. This is required because the tab rects
* are by default defined in the coordinate space of the component where
* they are rendered, which could be the JTabbedPane
* (for WRAP_TAB_LAYOUT) or a ScrollableTabPanel (SCROLL_TAB_LAYOUT).
* This method should be used whenever the tab rectangle must be relative
* to the JTabbedPane itself and the result should be placed in a
* designated Rectangle object (rather than instantiating and returning
* a new Rectangle each time). The tab index parameter must be a valid
* tabbed pane tab index (0 to tab count - 1, inclusive). The destination
* rectangle parameter must be a valid <code>Rectangle</code> instance.
* The handling of invalid parameters is unspecified.
*
* @param tabIndex the index of the tab
* @param dest the rectangle where the result should be placed
* @return the resulting rectangle
*
* @since 1.4
*/
if (scrollableTabLayoutEnabled()) { // SCROLL_TAB_LAYOUT
// Need to translate coordinates based on viewport location &
// view position
} else { // WRAP_TAB_LAYOUT
}
return dest;
}
/**
* Returns the index of the tab closest to the passed in location, note
* that the returned tab may not contain the location x,y.
*/
private int getClosestTab(final int x, final int y) {
int min = 0;
int minLoc;
int maxLoc;
if (useX) {
} else {
}
}
}
} else {
return current;
}
}
return min;
}
/**
* Returns a point which is translated from the specified point in the
* JTabbedPane's coordinate space to the coordinate space of the
* ScrollableTabPanel. This is used for SCROLL_TAB_LAYOUT ONLY.
*/
return dest;
}
// BasicTabbedPaneUI methods
return visibleComponent;
}
if (visibleComponent != null && visibleComponent != component && visibleComponent.getParent() == tabPane && visibleComponent.isVisible()) {
visibleComponent.setVisible(false);
}
component.setVisible(true);
}
}
if (tabCount != rectArrayLen) {
}
}
}
protected void expandTabRunsArray() {
}
for (int i = 0; i < runCount; i++) {
return i;
}
}
return 0;
}
if (runCount == 1) {
return tabCount - 1;
}
return tabCount - 1;
}
}
return tabRunOverlay;
}
return 0;
}
return runCount > 1;
}
return true;
}
return (!tabPane.isEnabled() || !tabPane.isEnabledAt(tabIndex)) ? tabPane.getDisabledIconAt(tabIndex) : tabPane.getIconAt(tabIndex);
}
/**
* Returns the text View object required to render stylized text (HTML) for
* the specified tab or null if no specialized text rendering is needed
* for this tab. This is provided to support html rendering inside tabs.
*
* @param tabIndex the index of the tab
* @return the text view to render the tab's text or null if no
* specialized rendering is required
*
* @since 1.4
*/
}
return null;
}
protected int calculateTabHeight(final int tabPlacement, final int tabIndex, final int fontHeight) {
int height = 0;
if (c != null) {
} else {
if (v != null) {
// html
} else {
// plain text
height += fontHeight;
}
}
}
return height;
}
int result = 0;
for (int i = 0; i < tabCount; i++) {
}
return result;
}
protected int calculateTabWidth(final int tabPlacement, final int tabIndex, final FontMetrics metrics) {
if (tabComponent != null) {
} else {
}
if (v != null) {
// html
} else {
// plain text
}
}
return width;
}
int result = 0;
for (int i = 0; i < tabCount; i++) {
}
return result;
}
protected int calculateTabAreaHeight(final int tabPlacement, final int horizRunCount, final int maxTabHeight) {
return (horizRunCount > 0 ? horizRunCount * (maxTabHeight - tabRunOverlay) + tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom : 0);
}
protected int calculateTabAreaWidth(final int tabPlacement, final int vertRunCount, final int maxTabWidth) {
return (vertRunCount > 0 ? vertRunCount * (maxTabWidth - tabRunOverlay) + tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right : 0);
}
return tabInsets;
}
return currentPadInsets;
}
return currentTabAreaInsets;
}
return contentBorderInsets;
}
}
// Tab Navigation methods
final int current = DefaultLookup.getBoolean(tabPane, this, "TabbedPane.selectionFollowsFocus", true) ? tabPane.getSelectedIndex() : getFocusIndex();
// If we have no tabs then don't navigate.
if (tabCount <= 0) {
return;
}
int offset;
switch (tabPlacement) {
case LEFT:
case RIGHT:
switch (direction) {
case NEXT:
break;
case PREVIOUS:
break;
case NORTH:
break;
case SOUTH:
break;
case WEST:
break;
case EAST:
break;
default:
}
break;
case BOTTOM:
case TOP:
default:
switch (direction) {
case NEXT:
break;
case PREVIOUS:
break;
case NORTH:
break;
case SOUTH:
break;
case EAST:
if (leftToRight) {
} else {
}
break;
case WEST:
if (leftToRight) {
} else {
}
break;
default:
}
}
}
}
}
}
}
}
}
}
}
if (runCount < 2) {
return;
}
int newIndex;
switch (tabPlacement) {
case LEFT:
case RIGHT:
break;
case BOTTOM:
case TOP:
default:
}
if (newIndex != -1) {
}
}
}
} else {
// Just move focus (not selection)
setFocusIndex(index, true);
}
}
if (repaint && !isRunsDirty) {
focusIndex = index;
} else {
focusIndex = index;
}
}
/**
* Repaints the specified tab.
*/
// If we're not valid that means we will shortly be validated and
// painted, which means we don't have to do anything here.
}
}
/**
* Makes sure the focusIndex is valid.
*/
private void validateFocusIndex() {
}
}
/**
* Returns the index of the tab that has focus.
*
* @return index of tab that has focus
* @since 1.5
*/
protected int getFocusIndex() {
return focusIndex;
}
protected int getTabRunOffset(final int tabPlacement, final int tabCount, final int tabIndex, final boolean forward) {
int offset;
switch (tabPlacement) {
case LEFT: {
if (run == 0) {
offset = (forward ? -(calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth) - maxTabWidth) : -maxTabWidth);
offset = (forward ? maxTabWidth : calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth) - maxTabWidth);
} else {
}
break;
}
case RIGHT: {
if (run == 0) {
offset = (forward ? maxTabWidth : calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth) - maxTabWidth);
offset = (forward ? -(calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth) - maxTabWidth) : -maxTabWidth);
} else {
}
break;
}
case BOTTOM: {
if (run == 0) {
offset = (forward ? maxTabHeight : calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight) - maxTabHeight);
offset = (forward ? -(calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight) - maxTabHeight) : -maxTabHeight);
} else {
}
break;
}
case TOP:
default: {
if (run == 0) {
offset = (forward ? -(calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight) - maxTabHeight) : -maxTabHeight);
offset = (forward ? maxTabHeight : calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight) - maxTabHeight);
} else {
}
}
}
return offset;
}
}
}
if (runCount < 2) {
return getNextTabIndex(base);
}
return tabRuns[currentRun];
}
return next;
}
if (runCount < 2) {
return getPreviousTabIndex(base);
}
}
return getPreviousTabIndex(base);
}
}
}
protected static void rotateInsets(final Insets topInsets, final Insets targetInsets, final int targetPlacement) {
switch (targetPlacement) {
case LEFT:
break;
case BOTTOM:
break;
case RIGHT:
break;
case TOP:
default:
}
}
// REMIND(aim,7/29/98): This method should be made
// protected in the next release where
// API changes are allowed
boolean requestFocusForVisibleComponent() {
}
super(key);
}
return ui;
}
return null;
}
final AquaTabbedPaneCopyFromBasicUI ui = (AquaTabbedPaneCopyFromBasicUI)getUIOfType(pane.getUI(), AquaTabbedPaneCopyFromBasicUI.class);
return;
}
} else {
}
} else {
}
} else if (key == REQUEST_FOCUS) {
pane.requestFocus();
} else if (key == REQUEST_FOCUS_FOR_VISIBLE) {
} else if (key == SET_SELECTED) {
}
}
}
} else if (key == SELECT_FOCUSED) {
if (focusIndex != -1) {
}
} else if (key == SCROLL_FORWARD) {
if (ui.scrollableTabLayoutEnabled()) {
}
} else if (key == SCROLL_BACKWARD) {
if (ui.scrollableTabLayoutEnabled()) {
}
}
}
}
/**
* This class should be treated as a "protected" inner class.
* Instantiate it only within subclasses of BasicTabbedPaneUI.
*/
// MACOSX adding accessor for superclass
return tabContainer;
}
// END MACOSX
return calculateSize(false);
}
return calculateSize(true);
}
int height = 0;
int width = 0;
int cWidth = 0;
int cHeight = 0;
// Determine minimum size required to display largest
// child in each dimension
//
}
}
}
// Add content border insets to minimum size
int tabExtent = 0;
// Calculate how much space the tabs will need, based on the
// minimum size required to display largest child + content border
//
switch (tabPlacement) {
case LEFT:
case RIGHT:
break;
case TOP:
case BOTTOM:
default:
}
return new Dimension(width + insets.left + insets.right + contentInsets.left + contentInsets.right, height + insets.bottom + insets.top + contentInsets.top + contentInsets.bottom);
}
int total = 0;
if (tabCount > 0) {
int rows = 1;
int x = 0;
for (int i = 0; i < tabCount; i++) {
rows++;
x = 0;
}
x += tabWidth;
}
}
return total;
}
int total = 0;
if (tabCount > 0) {
int columns = 1;
int y = 0;
for (int i = 0; i < tabCount; i++) {
columns++;
y = 0;
}
y += tabHeight;
}
}
return total;
}
/* Some of the code in this method deals with changing the
* visibility of components to hide and show the contents for the
* selected tab. This is older code that has since been duplicated
* in JTabbedPane.fireStateChanged(), so as to allow visibility
* changes to happen sooner (see the note there). This code remains
* for backward compatibility as there are some cases, such as
* subclasses that don't fireStateChanged() where it may be used.
* Any changes here need to be kept in synch with
* JTabbedPane.fireStateChanged().
*/
setRolloverTab(-1);
if (selectedIndex < 0) {
if (visibleComponent != null) {
// The last tab was removed, so remove the component
}
} else {
}
int totalTabWidth = 0;
int totalTabHeight = 0;
boolean shouldChangeFocus = false;
// In order to allow programs to use a single component
// as the display for multiple tabs, we will not change
// the visible compnent if the currently selected tab
// has a null component. This is a bit dicey, as we don't
// explicitly state we support this in the spec, but since
// programs are now depending on this, we're making it work.
//
if (selectedComponent != null) {
shouldChangeFocus = true;
}
}
}
if (numChildren > 0) {
switch (tabPlacement) {
case LEFT:
break;
case RIGHT:
break;
case BOTTOM:
break;
case TOP:
default:
}
cw = bounds.width - totalTabWidth - insets.left - insets.right - contentInsets.left - contentInsets.right;
ch = bounds.height - totalTabHeight - insets.top - insets.bottom - contentInsets.top - contentInsets.bottom;
for (int i = 0; i < numChildren; i++) {
if (child == tabContainer) {
final int tabContainerWidth = totalTabWidth == 0 ? bounds.width : totalTabWidth + insets.left + insets.right + contentInsets.left + contentInsets.right;
final int tabContainerHeight = totalTabHeight == 0 ? bounds.height : totalTabHeight + insets.top + insets.bottom + contentInsets.top + contentInsets.bottom;
int tabContainerX = 0;
int tabContainerY = 0;
if (tabPlacement == BOTTOM) {
} else if (tabPlacement == RIGHT) {
}
} else {
}
}
}
if (shouldChangeFocus) {
if (!requestFocusForVisibleComponent()) {
}
}
}
public void calculateLayoutInfo() {
isRunsDirty = false;
}
protected void layoutTabComponents() {
if (tabContainer == null) {
return;
}
if (scrollableTabLayoutEnabled()) {
}
if (c == null) {
continue;
}
getTabBounds(i, rect);
// centralize component
c.setBounds(x + getTabLabelShiftX(tabPlacement, i, isSeleceted), y + getTabLabelShiftY(tabPlacement, i, isSeleceted), preferredSize.width, preferredSize.height);
}
}
int tabRunOverlay;
int i, j;
int x, y;
int returnAt;
//
// Calculate bounds within which a tab run must fit
//
switch (tabPlacement) {
case LEFT:
break;
case RIGHT:
break;
case BOTTOM:
break;
case TOP:
default:
break;
}
runCount = 0;
selectedRun = -1;
if (tabCount == 0) {
return;
}
// Run through tabs and partition them into runs
for (i = 0; i < tabCount; i++) {
if (!verticalTabRuns) {
// Tabs on TOP or BOTTOM....
if (i > 0) {
} else {
runCount = 1;
maxTabWidth = 0;
rect.x = x;
}
// Never move a TAB down a run if it is in the first column.
// Even if there isn't enough room, moving it to a fresh
// line won't help.
}
runCount++;
rect.x = x;
}
// Initialize y position in case there's just one run
rect.y = y;
} else {
// Tabs on LEFT or RIGHT...
if (i > 0) {
} else {
runCount = 1;
maxTabHeight = 0;
rect.y = y;
}
// Never move a TAB over a run if it is in the first run.
// Even if there isn't enough room, moving it to a fresh
// column won't help.
}
runCount++;
rect.y = y;
}
// Initialize x position in case there's just one column
rect.x = x;
}
if (i == selectedIndex) {
}
}
if (runCount > 1) {
// Re-distribute tabs in case last run has leftover space
// Rotate run array so that selected run is first
if (shouldRotateTabRuns(tabPlacement)) {
}
}
// Step through runs from back to front to calculate
// tab y locations and to pad runs appropriately
if (!verticalTabRuns) {
rect.y = y;
}
if (shouldPadTabRun(tabPlacement, i)) {
}
if (tabPlacement == BOTTOM) {
y -= (maxTabHeight - tabRunOverlay);
} else {
y += (maxTabHeight - tabRunOverlay);
}
} else {
rect.x = x;
}
if (shouldPadTabRun(tabPlacement, i)) {
}
if (tabPlacement == RIGHT) {
x -= (maxTabWidth - tabRunOverlay);
} else {
x += (maxTabWidth - tabRunOverlay);
}
}
}
// Pad the selected tab so that it appears raised in front
// if right to left and tab placement on the top or
// the bottom, flip x positions and adjust by widths
if (!leftToRight && !verticalTabRuns) {
for (i = 0; i < tabCount; i++) {
}
}
}
/*
* Rotates the run-index array so that the selected run is run[0]
*/
for (int i = 0; i < selectedRun; i++) {
for (int j = 1; j < runCount; j++) {
}
}
}
protected void normalizeTabRuns(final int tabPlacement, final int tabCount, final int start, final int max) {
boolean keepAdjusting = true;
double weight = 1.25;
// At this point the tab runs are packed to fit as many
// tabs as possible, which can leave the last run with a lot
// of extra space (resulting in very fat tabs on the last run).
// So we'll attempt to distribute this extra space more evenly
// across the runs in order to make the runs look more consistent.
//
// Starting with the last run, determine whether the last tab in
// the previous run would fit (generously) in this run; if so,
// move tab to current run and shift tabs accordingly. Cycle
// through remaining runs using the same algorithm.
//
while (keepAdjusting) {
int end;
int prevLastLen;
if (!verticalTabRuns) {
} else {
}
// Check if the run has enough extra space to fit the last tab
// from the previous row...
// Insert tab from previous row and shift rest over
if (!verticalTabRuns) {
} else {
}
if (!verticalTabRuns) {
} else {
}
}
// no more room left in last run, so we're done!
keepAdjusting = false;
}
// check previous run next...
run -= 1;
} else {
// check last run again...but require a higher ratio
// of extraspace-to-tabsize because we don't want to
// end up with too many tabs on the last run!
weight += .25;
}
}
}
if (j > start) {
}
}
} else {
if (j > start) {
}
}
}
}
if (selectedIndex >= 0) {
if (!scrollableTabLayoutEnabled()) { // WRAP_TAB_LAYOUT
// do not expand selected tab more then necessary
if (top > 0) {
}
if (bottom > 0) {
}
} else {
if (left > 0) {
}
if (right > 0) {
}
}
}
}
}
}
return calculateMaxTabHeight(tabPlacement);
}
return calculateMaxTabWidth(tabPlacement);
}
/* Some of the code in this method deals with changing the
* visibility of components to hide and show the contents for the
* selected tab. This is older code that has since been duplicated
* in JTabbedPane.fireStateChanged(), so as to allow visibility
* changes to happen sooner (see the note there). This code remains
* for backward compatibility as there are some cases, such as
* subclasses that don't fireStateChanged() where it may be used.
* Any changes here need to be kept in synch with
* JTabbedPane.fireStateChanged().
*/
setRolloverTab(-1);
if (selectedIndex < 0) {
if (visibleComponent != null) {
// The last tab was removed, so remove the component
}
} else {
}
return;
}
boolean shouldChangeFocus = false;
// In order to allow programs to use a single component
// as the display for multiple tabs, we will not change
// the visible compnent if the currently selected tab
// has a null component. This is a bit dicey, as we don't
// explicitly state we support this in the spec, but since
// programs are now depending on this, we're making it work.
//
if (selectedComponent != null) {
shouldChangeFocus = true;
}
}
}
if (numChildren > 0) {
switch (tabPlacement) {
case LEFT:
// calculate tab area bounds
// calculate content area bounds
break;
case RIGHT:
// calculate tab area bounds
// calculate content area bounds
break;
case BOTTOM:
// calculate tab area bounds
// calculate content area bounds
break;
case TOP:
default:
// calculate tab area bounds
// calculate content area bounds
}
for (int i = 0; i < numChildren; i++) {
switch (tabPlacement) {
case LEFT:
case RIGHT:
if (totalTabHeight > th) {
// Allow space for scrollbuttons
// Scrolled to the end, so ensure the viewport size is
// such that the scroll offset aligns with a tab
}
}
break;
case BOTTOM:
case TOP:
default:
if (totalTabWidth > tw) {
// Need to allow space for scrollbuttons
// Scrolled to the end, so ensure the viewport size is
// such that the scroll offset aligns with a tab
}
}
}
} else if (tabScroller != null && (child == tabScroller.scrollForwardButton || child == tabScroller.scrollBackwardButton)) {
int bx = 0;
int by = 0;
boolean visible = false;
switch (tabPlacement) {
case LEFT:
case RIGHT:
if (totalTabHeight > th) {
visible = true;
by = (child == tabScroller.scrollForwardButton) ? bounds.height - insets.bottom - bsize.height : bounds.height - insets.bottom - 2 * bsize.height;
}
break;
case BOTTOM:
case TOP:
default:
if (totalTabWidth > tw) {
visible = true;
bx = (child == tabScroller.scrollForwardButton) ? bounds.width - insets.left - bsize.width : bounds.width - insets.left - 2 * bsize.width;
}
}
if (visible) {
}
} else {
// All content children...
}
}
super.layoutTabComponents();
if (shouldChangeFocus) {
if (!requestFocusForVisibleComponent()) {
}
}
}
}
private void layoutCroppedEdge() {
int cropline;
switch (tabPane.getTabPlacement()) {
case LEFT:
case RIGHT:
}
break;
case TOP:
case BOTTOM:
default:
}
}
}
}
int i;
final int x = tabAreaInsets.left;
final int y = tabAreaInsets.top;
int totalWidth = 0;
int totalHeight = 0;
//
// Calculate bounds within which a tab run must fit
//
switch (tabPlacement) {
case LEFT:
case RIGHT:
break;
case BOTTOM:
case TOP:
default:
}
runCount = 0;
selectedRun = -1;
if (tabCount == 0) {
return;
}
selectedRun = 0;
runCount = 1;
// Run through tabs and lay them out in a single run
for (i = 0; i < tabCount; i++) {
if (!verticalTabRuns) {
// Tabs on TOP or BOTTOM....
if (i > 0) {
} else {
maxTabWidth = 0;
rect.x = x;
}
rect.y = y;
} else {
// Tabs on LEFT or RIGHT...
if (i > 0) {
} else {
maxTabHeight = 0;
rect.y = y;
}
rect.x = x;
}
}
if (tabsOverlapBorder) {
// Pad the selected tab so that it appears raised in front
}
// if right to left and tab placement on the top or
// the bottom, flip x positions and adjust by widths
if (!leftToRight && !verticalTabRuns) {
for (i = 0; i < tabCount; i++) {
}
}
}
}
public int leadingTabIndex;
viewport = new ScrollableTabViewport();
tabPanel = new ScrollableTabPanel();
viewport.addChangeListener(this);
croppedEdge = new CroppedEdge();
}
/**
* Recreates the scroll buttons and adds them to the TabbedPane.
*/
void createButtons() {
if (scrollForwardButton != null) {
}
} else { // tabPlacement = LEFT || RIGHT
}
}
return; // no room left to scroll
}
} else { // tabPlacement == LEFT || tabPlacement == RIGHT
return;
}
}
}
if (leadingTabIndex == 0) {
return; // no room left to scroll
}
}
switch (tabPlacement) {
case TOP:
case BOTTOM:
// We've scrolled to the end, so adjust the viewport size
// to ensure the view position remains aligned on a tab boundary
}
break;
case LEFT:
case RIGHT:
// We've scrolled to the end, so adjust the viewport size
// to ensure the view position remains aligned on a tab boundary
}
}
}
updateView();
}
private void updateView() {
// If the tab isn't right aligned, adjust it.
switch (tabPlacement) {
case TOP:
case BOTTOM:
}
break;
case LEFT:
case RIGHT:
}
break;
}
}
switch (tabPlacement) {
case LEFT:
scrollForwardButton.setEnabled(leadingTabIndex < tabCount - 1 && viewSize.height - viewRect.y > viewRect.height);
break;
case RIGHT:
scrollForwardButton.setEnabled(leadingTabIndex < tabCount - 1 && viewSize.height - viewRect.y > viewRect.height);
break;
case BOTTOM:
scrollForwardButton.setEnabled(leadingTabIndex < tabCount - 1 && viewSize.width - viewRect.x > viewRect.width);
break;
case TOP:
default:
scrollForwardButton.setEnabled(leadingTabIndex < tabCount - 1 && viewSize.width - viewRect.x > viewRect.width);
}
}
/**
* ActionListener for the scroll buttons.
*/
if (e.getSource() == scrollForwardButton) {
actionKey = "scrollTabsForwardAction";
} else {
actionKey = "scrollTabsBackwardAction";
}
action.actionPerformed(new ActionEvent(tabPane, ActionEvent.ACTION_PERFORMED, null, e.getWhen(), e.getModifiers()));
}
}
}
return new String("viewport.viewSize=" + viewport.getViewSize() + "\n" + "viewport.viewRectangle=" + viewport.getViewRect() + "\n" + "leadingTabIndex=" + leadingTabIndex + "\n" + "tabViewPosition=" + tabViewPosition);
}
}
public ScrollableTabViewport() {
super();
setName("TabbedPane.scrollableViewport");
}
}
}
public ScrollableTabPanel() {
super(null);
}
}
super.paintComponent(g);
AquaTabbedPaneCopyFromBasicUI.this.paintTabArea(g, tabPane.getTabPlacement(), tabPane.getSelectedIndex());
}
}
public void doLayout() {
if (getComponentCount() > 0) {
}
}
}
private class ScrollableTabButton extends javax.swing.plaf.basic.BasicArrowButton implements UIResource, SwingConstants {
super(direction, UIManager.getColor("TabbedPane.selected"), UIManager.getColor("TabbedPane.shadow"), UIManager.getColor("TabbedPane.darkShadow"), UIManager.getColor("TabbedPane.highlight"));
}
}
// Controller: event listeners
private class Handler implements ChangeListener, ContainerListener, FocusListener, MouseListener, MouseMotionListener, PropertyChangeListener {
//
// PropertyChangeListener
//
final boolean isScrollLayout = scrollableTabLayoutEnabled();
if (name == "mnemonicAt") {
} else if (name == "displayedMnemonicIndexAt") {
} else if (name == "indexForTitle") {
calculatedBaseline = false;
} else if (name == "tabLayoutPolicy") {
calculatedBaseline = false;
} else if (name == "tabPlacement") {
if (scrollableTabLayoutEnabled()) {
}
calculatedBaseline = false;
} else if (name == "indexForTabComponent") {
if (tabContainer != null) {
}
if (c != null) {
if (tabContainer == null) {
} else {
tabContainer.add(c);
}
}
calculatedBaseline = false;
} else if (name == "indexForNullComponent") {
isRunsDirty = true;
} else if (name == "font") {
calculatedBaseline = false;
}
}
//
// ChangeListener
//
if (scrollableTabLayoutEnabled()) {
}
}
}
//
// MouseListener
//
}
setRolloverTab(-1);
}
return;
}
// Clicking on unselected tab, change selection, do NOT
// request focus.
// This will trigger the focusIndex to change by way
// of stateChanged.
} else if (tabPane.isRequestFocusEnabled()) {
// Clicking on selected tab, try and give the tabbedpane
// focus. Repaint will occur in focusGained.
}
}
}
//
// MouseMotionListener
//
}
//
// FocusListener
//
}
}
//
// ContainerListener
//
/* GES 2/3/99:
The container listener code was added to support HTML
rendering of tab titles.
Ideally, we would be able to listen for property changes
when a tab is added or its text modified. At the moment
there are no such events because the Beans spec doesn't
allow 'indexed' property changes (i.e. tab 2's text changed
from A to B).
In order to get around this, we listen for tabs to be added
or removed by listening for the container events. we then
queue up a runnable (so the component has a chance to complete
the add) which checks the tab title of the new component to see
if it requires HTML rendering.
The Views (one per tab title requiring HTML rendering) are
stored in the htmlViews Vector, which is only allocated after
the first time we run into an HTML tab. Note that this vector
is kept in step with the number of pages, and nulls are added
for those pages whose tab title do not require HTML rendering.
This makes it easy for the paint and layout code to tell
whether to invoke the HTML engine without having to check
the string during time-sensitive operations.
When we have added a way to listen for tab additions and
changes to tab text, this code should be removed and
replaced by something which uses that. */
if (child instanceof UIResource) {
return;
}
isRunsDirty = true;
}
if (isHTML) {
} else { // Vector already exists
}
} else { // Not HTML
} // else nada!
}
}
if (child instanceof UIResource) {
return;
}
// NOTE 4/15/2002 (joutwate):
// This fix is implemented using client properties since there is
// currently no IndexPropertyChangeEvent. Once
// IndexPropertyChangeEvents have been added this code should be
// modified to use it.
}
}
isRunsDirty = true;
}
}
/**
* This class should be treated as a "protected" inner class.
* Instantiate it only within subclasses of BasicTabbedPaneUI.
*/
// NOTE: This class exists only for backward compatability. All
// its functionality has been moved into Handler. If you need to add
// new functionality add it to the Handler, but make sure this
// class calls into the Handler.
getHandler().propertyChange(e);
}
}
/**
* This class should be treated as a "protected" inner class.
* Instantiate it only within subclasses of BasicTabbedPaneUI.
*/
// NOTE: This class exists only for backward compatability. All
// its functionality has been moved into Handler. If you need to add
// new functionality add it to the Handler, but make sure this
// class calls into the Handler.
getHandler().stateChanged(e);
}
}
/**
* This class should be treated as a "protected" inner class.
* Instantiate it only within subclasses of BasicTabbedPaneUI.
*/
// NOTE: This class exists only for backward compatability. All
// its functionality has been moved into Handler. If you need to add
// new functionality add it to the Handler, but make sure this
// class calls into the Handler.
getHandler().mousePressed(e);
}
}
/**
* This class should be treated as a "protected" inner class.
* Instantiate it only within subclasses of BasicTabbedPaneUI.
*/
// NOTE: This class exists only for backward compatability. All
// its functionality has been moved into Handler. If you need to add
// new functionality add it to the Handler, but make sure this
// class calls into the Handler.
getHandler().focusGained(e);
}
getHandler().focusLost(e);
}
}
if (count > 0) {
for (int i = 0; i < count; i++) {
} else {
}
}
}
return htmlViews;
}
private boolean notifyTabbedPane = true;
public TabContainer() {
super(null);
setOpaque(false);
}
}
}
private void removeUnusedTabComponents() {
for (final Component c : getComponents()) {
if (!(c instanceof UIResource)) {
if (index == -1) {
super.remove(c);
}
}
}
}
public boolean isOptimizedDrawingEnabled() {
}
public void doLayout() {
// We layout tabComponents in JTabbedPane's layout manager
// and use this method as a hook for repainting tabs
// to update tabs area e.g. when the size of tabComponent was changed
if (scrollableTabLayoutEnabled()) {
} else {
}
}
}
private int tabIndex;
private int cropline;
public CroppedEdge() {
setOpaque(false);
}
}
}
public void resetParams() {
tabContainer.remove(this);
}
}
public boolean isParamsSet() {
}
public int getTabIndex() {
return tabIndex;
}
public int getCropline() {
return cropline;
}
public int getCroppedSideWidth() {
return 3;
}
return bg;
}
}
}
super.paintComponent(g);
if (isParamsSet() && g instanceof Graphics2D) {
}
}
}
/**
* An ActionMap that populates its contents as necessary. The
* contents are populated by invoking the <code>loadActionMap</code>
* method on the passed in Object.
*
* @version 1.6, 11/17/05
* @author Scott Violet
*/
/**
* Object to invoke <code>loadActionMap</code> on. This may be
* a Class object.
*/
/**
* Installs an ActionMap that will be populated by invoking the
* <code>loadActionMap</code> method on the specified Class
* when necessary.
* <p>
* This should be used if the ActionMap can be shared.
*
* @param c JComponent to install the ActionMap on.
* @param loaderClass Class object that gets loadActionMap invoked
* on.
* @param defaultsKey Key to use to defaults table to check for
* existing map and what resulting Map will be registered on.
*/
static void installLazyActionMap(final JComponent c, final Class<AquaTabbedPaneCopyFromBasicUI> loaderClass, final String defaultsKey) {
}
}
/**
* Returns an ActionMap that will be populated by invoking the
* <code>loadActionMap</code> method on the specified Class
* when necessary.
* <p>
* This should be used if the ActionMap can be shared.
*
* @param c JComponent to install the ActionMap on.
* @param loaderClass Class object that gets loadActionMap invoked
* on.
* @param defaultsKey Key to use to defaults table to check for
* existing map and what resulting Map will be registered on.
*/
static ActionMap getActionMap(final Class<AquaTabbedPaneCopyFromBasicUI> loaderClass, final String defaultsKey) {
}
return map;
}
}
}
}
}
}
public void clear() {
super.clear();
}
return super.keys();
}
public int size() {
return super.size();
}
return super.allKeys();
}
}
private void loadIfNecessary() {
try {
final java.lang.reflect.Method method = klass.getDeclaredMethod("loadActionMap", new Class[] { LazyActionMap.class });
} catch (final NoSuchMethodException nsme) {
assert false : "LazyActionMap unable to load actions " + klass;
} catch (final IllegalAccessException iae) {
assert false : "LazyActionMap unable to load actions " + iae;
} catch (final InvocationTargetException ite) {
assert false : "LazyActionMap unable to load actions " + ite;
} catch (final IllegalArgumentException iae) {
assert false : "LazyActionMap unable to load actions " + iae;
}
}
}
}
}