|
|
|
@ -25,6 +25,7 @@ import java.awt.event.ContainerListener;
|
|
|
|
|
import java.awt.event.FocusAdapter; |
|
|
|
|
import java.awt.event.FocusEvent; |
|
|
|
|
import java.awt.event.FocusListener; |
|
|
|
|
import java.awt.event.InputEvent; |
|
|
|
|
import java.awt.event.MouseAdapter; |
|
|
|
|
import java.awt.event.MouseEvent; |
|
|
|
|
import java.awt.event.MouseListener; |
|
|
|
@ -48,33 +49,57 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
// Instance variables initialized at installation
|
|
|
|
|
|
|
|
|
|
/** The tab pane */ |
|
|
|
|
/** |
|
|
|
|
* The tab pane |
|
|
|
|
*/ |
|
|
|
|
protected JTabbedPane tabPane; |
|
|
|
|
|
|
|
|
|
/** Highlight color */ |
|
|
|
|
/** |
|
|
|
|
* Highlight color |
|
|
|
|
*/ |
|
|
|
|
protected Color highlight; |
|
|
|
|
/** Light highlight color */ |
|
|
|
|
/** |
|
|
|
|
* Light highlight color |
|
|
|
|
*/ |
|
|
|
|
protected Color lightHighlight; |
|
|
|
|
/** Shadow color */ |
|
|
|
|
/** |
|
|
|
|
* Shadow color |
|
|
|
|
*/ |
|
|
|
|
protected Color shadow; |
|
|
|
|
/** Dark shadow color */ |
|
|
|
|
/** |
|
|
|
|
* Dark shadow color |
|
|
|
|
*/ |
|
|
|
|
protected Color darkShadow; |
|
|
|
|
/** Focus color */ |
|
|
|
|
/** |
|
|
|
|
* Focus color |
|
|
|
|
*/ |
|
|
|
|
protected Color focus; |
|
|
|
|
protected Color selectedColor; |
|
|
|
|
|
|
|
|
|
/** Text icon gap */ |
|
|
|
|
/** |
|
|
|
|
* Text icon gap |
|
|
|
|
*/ |
|
|
|
|
protected int textIconGap; |
|
|
|
|
/** Tab run overlay */ |
|
|
|
|
/** |
|
|
|
|
* Tab run overlay |
|
|
|
|
*/ |
|
|
|
|
protected int tabRunOverlay; |
|
|
|
|
|
|
|
|
|
/** Tab insets */ |
|
|
|
|
/** |
|
|
|
|
* Tab insets |
|
|
|
|
*/ |
|
|
|
|
protected Insets tabInsets; |
|
|
|
|
/** Selected tab insets */ |
|
|
|
|
/** |
|
|
|
|
* Selected tab insets |
|
|
|
|
*/ |
|
|
|
|
protected Insets selectedTabPadInsets; |
|
|
|
|
/** Tab area insets */ |
|
|
|
|
/** |
|
|
|
|
* Tab area insets |
|
|
|
|
*/ |
|
|
|
|
protected Insets tabAreaInsets; |
|
|
|
|
/** Content border insets */ |
|
|
|
|
/** |
|
|
|
|
* Content border insets |
|
|
|
|
*/ |
|
|
|
|
protected Insets contentBorderInsets; |
|
|
|
|
protected boolean tabsOverlapBorder; |
|
|
|
|
protected boolean tabsOpaque = true; |
|
|
|
@ -123,28 +148,48 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Transient variables (recalculated each time TabbedPane is layed out)
|
|
|
|
|
/** Tab runs */ |
|
|
|
|
/** |
|
|
|
|
* Tab runs |
|
|
|
|
*/ |
|
|
|
|
protected int[] tabRuns = new int[10]; |
|
|
|
|
/** Run count */ |
|
|
|
|
/** |
|
|
|
|
* Run count |
|
|
|
|
*/ |
|
|
|
|
protected int runCount = 0; |
|
|
|
|
/** Selected run */ |
|
|
|
|
/** |
|
|
|
|
* Selected run |
|
|
|
|
*/ |
|
|
|
|
protected int selectedRun = -1; |
|
|
|
|
/** Tab rects */ |
|
|
|
|
/** |
|
|
|
|
* Tab rects |
|
|
|
|
*/ |
|
|
|
|
protected Rectangle[] rects = new Rectangle[0]; |
|
|
|
|
/** Maximum tab height */ |
|
|
|
|
/** |
|
|
|
|
* Maximum tab height |
|
|
|
|
*/ |
|
|
|
|
protected int maxTabHeight; |
|
|
|
|
/** Maximum tab width */ |
|
|
|
|
/** |
|
|
|
|
* Maximum tab width |
|
|
|
|
*/ |
|
|
|
|
protected int maxTabWidth; |
|
|
|
|
|
|
|
|
|
// Listeners
|
|
|
|
|
|
|
|
|
|
/** Tab change listener */ |
|
|
|
|
/** |
|
|
|
|
* Tab change listener |
|
|
|
|
*/ |
|
|
|
|
protected ChangeListener tabChangeListener; |
|
|
|
|
/** Property change listener */ |
|
|
|
|
/** |
|
|
|
|
* Property change listener |
|
|
|
|
*/ |
|
|
|
|
protected PropertyChangeListener propertyChangeListener; |
|
|
|
|
/** Mouse change listener */ |
|
|
|
|
/** |
|
|
|
|
* Mouse change listener |
|
|
|
|
*/ |
|
|
|
|
protected MouseListener mouseListener; |
|
|
|
|
/** Focus change listener */ |
|
|
|
|
/** |
|
|
|
|
* Focus change listener |
|
|
|
|
*/ |
|
|
|
|
protected FocusListener focusListener; |
|
|
|
|
|
|
|
|
|
// Private instance data
|
|
|
|
@ -204,6 +249,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Create a UI. |
|
|
|
|
* |
|
|
|
|
* @param c a component |
|
|
|
|
* @return a UI |
|
|
|
|
*/ |
|
|
|
@ -259,7 +305,6 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
* the <code>JTabbedPane</code>. |
|
|
|
|
* |
|
|
|
|
* @return a layout manager object |
|
|
|
|
* |
|
|
|
|
* @see TabbedPaneLayout |
|
|
|
|
* @see javax.swing.JTabbedPane#getTabLayoutPolicy |
|
|
|
|
*/ |
|
|
|
@ -324,10 +369,10 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
* @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 |
|
|
|
|
* @see javax.swing.JTabbedPane#setTabPlacement |
|
|
|
|
* @see javax.swing.SwingConstants |
|
|
|
|
* @since 1.5 |
|
|
|
|
*/ |
|
|
|
|
protected JButton createScrollButton(int direction) { |
|
|
|
@ -479,6 +524,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Creates a mouse listener. |
|
|
|
|
* |
|
|
|
|
* @return a mouse listener |
|
|
|
|
*/ |
|
|
|
|
protected MouseListener createMouseListener() { |
|
|
|
@ -487,6 +533,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Creates a focus listener. |
|
|
|
|
* |
|
|
|
|
* @return a focus listener |
|
|
|
|
*/ |
|
|
|
|
protected FocusListener createFocusListener() { |
|
|
|
@ -495,6 +542,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Creates a change listener. |
|
|
|
|
* |
|
|
|
|
* @return a change listener |
|
|
|
|
*/ |
|
|
|
|
protected ChangeListener createChangeListener() { |
|
|
|
@ -503,6 +551,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Creates a property change listener. |
|
|
|
|
* |
|
|
|
|
* @return a property change listener |
|
|
|
|
*/ |
|
|
|
|
protected PropertyChangeListener createPropertyChangeListener() { |
|
|
|
@ -538,8 +587,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
if (condition == JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) { |
|
|
|
|
return (InputMap) DefaultLookup.get(tabPane, this, |
|
|
|
|
"TabbedPane.ancestorInputMap"); |
|
|
|
|
} |
|
|
|
|
else if (condition == JComponent.WHEN_FOCUSED) { |
|
|
|
|
} else if (condition == JComponent.WHEN_FOCUSED) { |
|
|
|
|
return (InputMap) DefaultLookup.get(tabPane, this, |
|
|
|
|
"TabbedPane.focusInputMap"); |
|
|
|
|
} |
|
|
|
@ -598,9 +646,8 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
} |
|
|
|
|
mnemonicInputMap.put(KeyStroke.getKeyStroke(mnemonic, DarkUIUtil.getFocusAcceleratorKeyMask()), |
|
|
|
|
"setSelectedIndex"); |
|
|
|
|
mnemonicInputMap.put(KeyStroke.getKeyStroke(mnemonic, |
|
|
|
|
SwingUtilities2.setAltGraphMask( |
|
|
|
|
DarkUIUtil.getFocusAcceleratorKeyMask())), |
|
|
|
|
mnemonicInputMap.put(KeyStroke.getKeyStroke(mnemonic, InputEvent.ALT_GRAPH_DOWN_MASK |
|
|
|
|
| DarkUIUtil.getFocusAcceleratorKeyMask()), |
|
|
|
|
"setSelectedIndex"); |
|
|
|
|
mnemonicToIndexMap.put(Integer.valueOf(mnemonic), Integer.valueOf(index)); |
|
|
|
|
} |
|
|
|
@ -723,10 +770,10 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
* 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 |
|
|
|
|
* @throws IndexOutOfBoundsException if index is out of range |
|
|
|
|
* (index < 0 || index >= tab count) |
|
|
|
|
* @since 1.6 |
|
|
|
|
*/ |
|
|
|
|
protected int getBaseline(int tab) { |
|
|
|
@ -744,8 +791,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
int cellHeight = maxTabHeight - tabInsets.top - tabInsets.bottom; |
|
|
|
|
return c.getBaseline(pref.width, pref.height) + |
|
|
|
|
(cellHeight - pref.height) / 2 + tabInsets.top; |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
} else { |
|
|
|
|
View view = getTextViewForTab(tab); |
|
|
|
|
if (view != null) { |
|
|
|
|
int viewHeight = (int) view.getPreferredSpan(View.Y_AXIS); |
|
|
|
@ -777,15 +823,13 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
case JTabbedPane.TOP: |
|
|
|
|
if (tabPane.getTabCount() > 1) { |
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
} else { |
|
|
|
|
return -1; |
|
|
|
|
} |
|
|
|
|
case JTabbedPane.BOTTOM: |
|
|
|
|
if (tabPane.getTabCount() > 1) { |
|
|
|
|
return -1; |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
} else { |
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
default: // RIGHT|LEFT
|
|
|
|
@ -816,8 +860,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
} else { |
|
|
|
|
// left/right, tabs may be different sizes.
|
|
|
|
|
FontMetrics fontMetrics = getFontMetrics(); |
|
|
|
|
int fontHeight = fontMetrics.getHeight(); |
|
|
|
@ -870,7 +913,6 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
* @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 |
|
|
|
|
*/ |
|
|
|
|
protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex) { |
|
|
|
@ -901,6 +943,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Paints a tab. |
|
|
|
|
* |
|
|
|
|
* @param g the graphics |
|
|
|
|
* @param tabPlacement the tab placement |
|
|
|
|
* @param rects rectangles |
|
|
|
@ -1078,6 +1121,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Laysout a label. |
|
|
|
|
* |
|
|
|
|
* @param tabPlacement the tab placement |
|
|
|
|
* @param metrics the font metric |
|
|
|
|
* @param tabIndex the tab index |
|
|
|
@ -1123,6 +1167,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Paints an icon. |
|
|
|
|
* |
|
|
|
|
* @param g the graphics |
|
|
|
|
* @param tabPlacement the tab placement |
|
|
|
|
* @param tabIndex the tab index |
|
|
|
@ -1144,6 +1189,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Paints text. |
|
|
|
|
* |
|
|
|
|
* @param g the graphics |
|
|
|
|
* @param tabPlacement the tab placement |
|
|
|
|
* @param font the font |
|
|
|
@ -1198,6 +1244,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the tab label shift x. |
|
|
|
|
* |
|
|
|
|
* @param tabPlacement the tab placement |
|
|
|
|
* @param tabIndex the tab index |
|
|
|
|
* @param isSelected selection status |
|
|
|
@ -1223,6 +1270,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the tab label shift y. |
|
|
|
|
* |
|
|
|
|
* @param tabPlacement the tab placement |
|
|
|
|
* @param tabIndex the tab index |
|
|
|
|
* @param isSelected selection status |
|
|
|
@ -1247,6 +1295,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Paints the focus indicator. |
|
|
|
|
* |
|
|
|
|
* @param g the graphics |
|
|
|
|
* @param tabPlacement the tab placement |
|
|
|
|
* @param rects rectangles |
|
|
|
@ -1370,6 +1419,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Paints the tab background. |
|
|
|
|
* |
|
|
|
|
* @param g the graphics context in which to paint |
|
|
|
|
* @param tabPlacement the placement (left, right, bottom, top) of the tab |
|
|
|
|
* @param tabIndex the index of the tab with respect to other tabs |
|
|
|
@ -1404,6 +1454,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Paints the content border. |
|
|
|
|
* |
|
|
|
|
* @param g the graphics context in which to paint |
|
|
|
|
* @param tabPlacement the placement (left, right, bottom, top) of the tab |
|
|
|
|
* @param selectedIndex the tab index of the selected component |
|
|
|
@ -1453,11 +1504,9 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
Color color = UIManager.getColor("TabbedPane.contentAreaColor"); |
|
|
|
|
if (color != null) { |
|
|
|
|
g.setColor(color); |
|
|
|
|
} |
|
|
|
|
else if ( selectedColor == null || selectedIndex == -1 ) { |
|
|
|
|
} else if (selectedColor == null || selectedIndex == -1) { |
|
|
|
|
g.setColor(tabPane.getBackground()); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
} else { |
|
|
|
|
g.setColor(selectedColor); |
|
|
|
|
} |
|
|
|
|
g.fillRect(x, y, w, h); |
|
|
|
@ -1472,6 +1521,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Paints the content border top edge. |
|
|
|
|
* |
|
|
|
|
* @param g the graphics context in which to paint |
|
|
|
|
* @param tabPlacement the placement (left, right, bottom, top) of the tab |
|
|
|
|
* @param selectedIndex the tab index of the selected component |
|
|
|
@ -1511,6 +1561,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Paints the content border left edge. |
|
|
|
|
* |
|
|
|
|
* @param g the graphics context in which to paint |
|
|
|
|
* @param tabPlacement the placement (left, right, bottom, top) of the tab |
|
|
|
|
* @param selectedIndex the tab index of the selected component |
|
|
|
@ -1547,6 +1598,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Paints the content border bottom edge. |
|
|
|
|
* |
|
|
|
|
* @param g the graphics context in which to paint |
|
|
|
|
* @param tabPlacement the placement (left, right, bottom, top) of the tab |
|
|
|
|
* @param selectedIndex the tab index of the selected component |
|
|
|
@ -1590,6 +1642,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Paints the content border right edge. |
|
|
|
|
* |
|
|
|
|
* @param g the graphics context in which to paint |
|
|
|
|
* @param tabPlacement the placement (left, right, bottom, top) of the tab |
|
|
|
|
* @param selectedIndex the tab index of the selected component |
|
|
|
@ -1718,7 +1771,6 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
* @param tabIndex the index of the tab |
|
|
|
|
* @param dest the rectangle where the result should be placed |
|
|
|
|
* @return the resulting rectangle |
|
|
|
|
* |
|
|
|
|
* @since 1.4 |
|
|
|
|
*/ |
|
|
|
|
protected Rectangle getTabBounds(int tabIndex, Rectangle dest) { |
|
|
|
@ -1760,8 +1812,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
if (useX) { |
|
|
|
|
minLoc = rects[current].x; |
|
|
|
|
maxLoc = minLoc + rects[current].width; |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
} else { |
|
|
|
|
minLoc = rects[current].y; |
|
|
|
|
maxLoc = minLoc + rects[current].height; |
|
|
|
|
} |
|
|
|
@ -1770,14 +1821,12 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
if (min == max) { |
|
|
|
|
return Math.max(0, current - 1); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if (want >= maxLoc) { |
|
|
|
|
} else if (want >= maxLoc) { |
|
|
|
|
min = current; |
|
|
|
|
if (max - min <= 1) { |
|
|
|
|
return Math.max(current + 1, tabCount - 1); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
} else { |
|
|
|
|
return current; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1801,6 +1850,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the visible component. |
|
|
|
|
* |
|
|
|
|
* @return the visible component |
|
|
|
|
*/ |
|
|
|
|
protected Component getVisibleComponent() { |
|
|
|
@ -1809,6 +1859,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Sets the visible component. |
|
|
|
|
* |
|
|
|
|
* @param component the component |
|
|
|
|
*/ |
|
|
|
|
protected void setVisibleComponent(Component component) { |
|
|
|
@ -1827,6 +1878,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Assure the rectangles are created. |
|
|
|
|
* |
|
|
|
|
* @param tabCount the tab count |
|
|
|
|
*/ |
|
|
|
|
protected void assureRectsCreated(int tabCount) { |
|
|
|
@ -1855,6 +1907,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the run for a tab. |
|
|
|
|
* |
|
|
|
|
* @param tabCount the tab count |
|
|
|
|
* @param tabIndex the tab index. |
|
|
|
|
* @return the run for a tab |
|
|
|
@ -1872,6 +1925,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the last tab in a run. |
|
|
|
|
* |
|
|
|
|
* @param tabCount the tab count |
|
|
|
|
* @param run the run |
|
|
|
|
* @return the last tab in a run |
|
|
|
@ -1889,6 +1943,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the tab run overlay. |
|
|
|
|
* |
|
|
|
|
* @param tabPlacement the placement (left, right, bottom, top) of the tab |
|
|
|
|
* @return the tab run overlay |
|
|
|
|
*/ |
|
|
|
@ -1898,6 +1953,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the tab run indent. |
|
|
|
|
* |
|
|
|
|
* @param tabPlacement the placement (left, right, bottom, top) of the tab |
|
|
|
|
* @param run the tab run |
|
|
|
|
* @return the tab run indent |
|
|
|
@ -1908,6 +1964,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns whether or not the tab run should be padded. |
|
|
|
|
* |
|
|
|
|
* @param tabPlacement the placement (left, right, bottom, top) of the tab |
|
|
|
|
* @param run the tab run |
|
|
|
|
* @return whether or not the tab run should be padded |
|
|
|
@ -1918,6 +1975,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns whether or not the tab run should be rotated. |
|
|
|
|
* |
|
|
|
|
* @param tabPlacement the placement (left, right, bottom, top) of the tab |
|
|
|
|
* @return whether or not the tab run should be rotated |
|
|
|
|
*/ |
|
|
|
@ -1927,6 +1985,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the icon for a tab. |
|
|
|
|
* |
|
|
|
|
* @param tabIndex the index of the tab |
|
|
|
|
* @return the icon for a tab |
|
|
|
|
*/ |
|
|
|
@ -1943,7 +2002,6 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
* @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 |
|
|
|
|
*/ |
|
|
|
|
protected View getTextViewForTab(int tabIndex) { |
|
|
|
@ -1955,6 +2013,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Calculates the tab height. |
|
|
|
|
* |
|
|
|
|
* @param tabPlacement the placement (left, right, bottom, top) of the tab |
|
|
|
|
* @param tabIndex the index of the tab with respect to other tabs |
|
|
|
|
* @param fontHeight the font height |
|
|
|
@ -1987,6 +2046,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Calculates the maximum tab height. |
|
|
|
|
* |
|
|
|
|
* @param tabPlacement the placement (left, right, bottom, top) of the tab |
|
|
|
|
* @return the maximum tab height |
|
|
|
|
*/ |
|
|
|
@ -2003,6 +2063,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Calculates the tab width. |
|
|
|
|
* |
|
|
|
|
* @param tabPlacement the placement (left, right, bottom, top) of the tab |
|
|
|
|
* @param tabIndex the index of the tab with respect to other tabs |
|
|
|
|
* @param metrics the font metrics |
|
|
|
@ -2034,6 +2095,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Calculates the maximum tab width. |
|
|
|
|
* |
|
|
|
|
* @param tabPlacement the placement (left, right, bottom, top) of the tab |
|
|
|
|
* @return the maximum tab width |
|
|
|
|
*/ |
|
|
|
@ -2049,6 +2111,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Calculates the tab area height. |
|
|
|
|
* |
|
|
|
|
* @param tabPlacement the placement (left, right, bottom, top) of the tab |
|
|
|
|
* @param horizRunCount horizontal run count |
|
|
|
|
* @param maxTabHeight maximum tab height |
|
|
|
@ -2065,6 +2128,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Calculates the tab area width. |
|
|
|
|
* |
|
|
|
|
* @param tabPlacement the placement (left, right, bottom, top) of the tab |
|
|
|
|
* @param vertRunCount vertical run count |
|
|
|
|
* @param maxTabWidth maximum tab width |
|
|
|
@ -2081,6 +2145,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the tab insets. |
|
|
|
|
* |
|
|
|
|
* @param tabPlacement the placement (left, right, bottom, top) of the tab |
|
|
|
|
* @param tabIndex the tab index |
|
|
|
|
* @return the tab insets |
|
|
|
@ -2091,6 +2156,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the selected tab pad insets. |
|
|
|
|
* |
|
|
|
|
* @param tabPlacement the placement (left, right, bottom, top) of the tab |
|
|
|
|
* @return the selected tab pad insets |
|
|
|
|
*/ |
|
|
|
@ -2101,6 +2167,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the tab area insets. |
|
|
|
|
* |
|
|
|
|
* @param tabPlacement the placement (left, right, bottom, top) of the tab |
|
|
|
|
* @return the pad area insets |
|
|
|
|
*/ |
|
|
|
@ -2111,6 +2178,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the content border insets. |
|
|
|
|
* |
|
|
|
|
* @param tabPlacement the placement (left, right, bottom, top) of the tab |
|
|
|
|
* @return the content border insets |
|
|
|
|
*/ |
|
|
|
@ -2120,6 +2188,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the font metrics. |
|
|
|
|
* |
|
|
|
|
* @return the font metrics |
|
|
|
|
*/ |
|
|
|
|
protected FontMetrics getFontMetrics() { |
|
|
|
@ -2132,6 +2201,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Navigate the selected tab. |
|
|
|
|
* |
|
|
|
|
* @param direction the direction |
|
|
|
|
*/ |
|
|
|
|
protected void navigateSelectedTab(int direction) { |
|
|
|
@ -2214,6 +2284,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Select the next tab in the run. |
|
|
|
|
* |
|
|
|
|
* @param current the current tab |
|
|
|
|
*/ |
|
|
|
|
protected void selectNextTabInRun(int current) { |
|
|
|
@ -2228,6 +2299,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Select the previous tab in the run. |
|
|
|
|
* |
|
|
|
|
* @param current the current tab |
|
|
|
|
*/ |
|
|
|
|
protected void selectPreviousTabInRun(int current) { |
|
|
|
@ -2242,6 +2314,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Select the next tab. |
|
|
|
|
* |
|
|
|
|
* @param current the current tab |
|
|
|
|
*/ |
|
|
|
|
protected void selectNextTab(int current) { |
|
|
|
@ -2255,6 +2328,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Select the previous tab. |
|
|
|
|
* |
|
|
|
|
* @param current the current tab |
|
|
|
|
*/ |
|
|
|
|
protected void selectPreviousTab(int current) { |
|
|
|
@ -2268,6 +2342,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Selects an adjacent run of tabs. |
|
|
|
|
* |
|
|
|
|
* @param tabPlacement the placement (left, right, bottom, top) of the tab |
|
|
|
|
* @param tabIndex the index of the tab with respect to other tabs |
|
|
|
|
* @param offset selection offset |
|
|
|
@ -2314,8 +2389,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
repaintTab(focusIndex); |
|
|
|
|
focusIndex = index; |
|
|
|
|
repaintTab(focusIndex); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
} else { |
|
|
|
|
focusIndex = index; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -2352,6 +2426,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the tab run offset. |
|
|
|
|
* |
|
|
|
|
* @param tabPlacement the placement (left, right, bottom, top) of the tab |
|
|
|
|
* @param tabCount the tab count |
|
|
|
|
* @param tabIndex the index of the tab with respect to other tabs |
|
|
|
@ -2426,6 +2501,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the previous tab index. |
|
|
|
|
* |
|
|
|
|
* @param base the base |
|
|
|
|
* @return the previous tab index |
|
|
|
|
*/ |
|
|
|
@ -2436,6 +2512,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the next tab index. |
|
|
|
|
* |
|
|
|
|
* @param base the base |
|
|
|
|
* @return the next tab index |
|
|
|
|
*/ |
|
|
|
@ -2445,6 +2522,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the next tab index in the run. |
|
|
|
|
* |
|
|
|
|
* @param tabCount the tab count |
|
|
|
|
* @param base the base |
|
|
|
|
* @return the next tab index in the run |
|
|
|
@ -2463,6 +2541,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the previous tab index in the run. |
|
|
|
|
* |
|
|
|
|
* @param tabCount the tab count |
|
|
|
|
* @param base the base |
|
|
|
|
* @return the previous tab index in the run |
|
|
|
@ -2481,6 +2560,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the previous tab run. |
|
|
|
|
* |
|
|
|
|
* @param baseRun the base run |
|
|
|
|
* @return the previous tab run |
|
|
|
|
*/ |
|
|
|
@ -2491,6 +2571,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the next tab run. |
|
|
|
|
* |
|
|
|
|
* @param baseRun the base run |
|
|
|
|
* @return the next tab run |
|
|
|
|
*/ |
|
|
|
@ -2500,6 +2581,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Rotates the insets. |
|
|
|
|
* |
|
|
|
|
* @param topInsets the top insets |
|
|
|
|
* @param targetInsets the target insets |
|
|
|
|
* @param targetPlacement the target placement |
|
|
|
@ -2565,52 +2647,44 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
String key = getName(); |
|
|
|
|
JTabbedPane pane = (JTabbedPane) e.getSource(); |
|
|
|
|
DarkTabbedPaneUIBridge ui = (DarkTabbedPaneUIBridge) DarkUIUtil.getUIOfType(pane.getUI(), DarkTabbedPaneUIBridge.class); |
|
|
|
|
DarkTabbedPaneUIBridge ui = (DarkTabbedPaneUIBridge) DarkUIUtil |
|
|
|
|
.getUIOfType(pane.getUI(), |
|
|
|
|
DarkTabbedPaneUIBridge.class); |
|
|
|
|
|
|
|
|
|
if (ui == null) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (key == NEXT) { |
|
|
|
|
ui.navigateSelectedTab(SwingConstants.NEXT); |
|
|
|
|
} |
|
|
|
|
else if (key == PREVIOUS) { |
|
|
|
|
} else if (key == PREVIOUS) { |
|
|
|
|
ui.navigateSelectedTab(SwingConstants.PREVIOUS); |
|
|
|
|
} |
|
|
|
|
else if (key == RIGHT) { |
|
|
|
|
} else if (key == RIGHT) { |
|
|
|
|
ui.navigateSelectedTab(SwingConstants.EAST); |
|
|
|
|
} |
|
|
|
|
else if (key == LEFT) { |
|
|
|
|
} else if (key == LEFT) { |
|
|
|
|
ui.navigateSelectedTab(SwingConstants.WEST); |
|
|
|
|
} |
|
|
|
|
else if (key == UP) { |
|
|
|
|
} else if (key == UP) { |
|
|
|
|
ui.navigateSelectedTab(SwingConstants.NORTH); |
|
|
|
|
} |
|
|
|
|
else if (key == DOWN) { |
|
|
|
|
} else if (key == DOWN) { |
|
|
|
|
ui.navigateSelectedTab(SwingConstants.SOUTH); |
|
|
|
|
} |
|
|
|
|
else if (key == PAGE_UP) { |
|
|
|
|
} else if (key == PAGE_UP) { |
|
|
|
|
int tabPlacement = pane.getTabPlacement(); |
|
|
|
|
if (tabPlacement == TOP || tabPlacement == BOTTOM) { |
|
|
|
|
ui.navigateSelectedTab(SwingConstants.WEST); |
|
|
|
|
} else { |
|
|
|
|
ui.navigateSelectedTab(SwingConstants.NORTH); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if (key == PAGE_DOWN) { |
|
|
|
|
} else if (key == PAGE_DOWN) { |
|
|
|
|
int tabPlacement = pane.getTabPlacement(); |
|
|
|
|
if (tabPlacement == TOP || tabPlacement == BOTTOM) { |
|
|
|
|
ui.navigateSelectedTab(SwingConstants.EAST); |
|
|
|
|
} else { |
|
|
|
|
ui.navigateSelectedTab(SwingConstants.SOUTH); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if (key == REQUEST_FOCUS) { |
|
|
|
|
} else if (key == REQUEST_FOCUS) { |
|
|
|
|
pane.requestFocus(); |
|
|
|
|
} |
|
|
|
|
else if (key == REQUEST_FOCUS_FOR_VISIBLE) { |
|
|
|
|
} else if (key == REQUEST_FOCUS_FOR_VISIBLE) { |
|
|
|
|
ui.requestFocusForVisibleComponent(); |
|
|
|
|
} |
|
|
|
|
else if (key == SET_SELECTED) { |
|
|
|
|
} else if (key == SET_SELECTED) { |
|
|
|
|
String command = e.getActionCommand(); |
|
|
|
|
|
|
|
|
|
if (command != null && command.length() > 0) { |
|
|
|
@ -2623,19 +2697,16 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
pane.setSelectedIndex(index.intValue()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if (key == SELECT_FOCUSED) { |
|
|
|
|
} else if (key == SELECT_FOCUSED) { |
|
|
|
|
int focusIndex = ui.getFocusIndex(); |
|
|
|
|
if (focusIndex != -1) { |
|
|
|
|
pane.setSelectedIndex(focusIndex); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if (key == SCROLL_FORWARD) { |
|
|
|
|
} else if (key == SCROLL_FORWARD) { |
|
|
|
|
if (ui.scrollableTabLayoutEnabled()) { |
|
|
|
|
ui.tabScroller.scrollForward(pane.getTabPlacement()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if (key == SCROLL_BACKWARD) { |
|
|
|
|
} else if (key == SCROLL_BACKWARD) { |
|
|
|
|
if (ui.scrollableTabLayoutEnabled()) { |
|
|
|
|
ui.tabScroller.scrollBackward(pane.getTabPlacement()); |
|
|
|
|
} |
|
|
|
@ -2649,9 +2720,11 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
*/ |
|
|
|
|
public class TabbedPaneLayout implements LayoutManager { |
|
|
|
|
|
|
|
|
|
public void addLayoutComponent(String name, Component comp) {} |
|
|
|
|
public void addLayoutComponent(String name, Component comp) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void removeLayoutComponent(Component comp) {} |
|
|
|
|
public void removeLayoutComponent(Component comp) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Dimension preferredLayoutSize(Container parent) { |
|
|
|
|
return calculateSize(false); |
|
|
|
@ -2663,6 +2736,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the calculated size. |
|
|
|
|
* |
|
|
|
|
* @param minimum use the minimum size or preferred size |
|
|
|
|
* @return the calculated size |
|
|
|
|
*/ |
|
|
|
@ -2722,6 +2796,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the preferred tab area height. |
|
|
|
|
* |
|
|
|
|
* @param tabPlacement the tab placement |
|
|
|
|
* @param width the width |
|
|
|
|
* @return the preferred tab area height |
|
|
|
@ -2752,6 +2827,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the preferred tab area width. |
|
|
|
|
* |
|
|
|
|
* @param tabPlacement the tab placement |
|
|
|
|
* @param height the height |
|
|
|
|
* @return the preferred tab area widty |
|
|
|
@ -2781,7 +2857,9 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
return total; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** {@inheritDoc} */ |
|
|
|
|
/** |
|
|
|
|
* {@inheritDoc} |
|
|
|
|
*/ |
|
|
|
|
@SuppressWarnings("deprecation") |
|
|
|
|
public void layoutContainer(Container parent) { |
|
|
|
|
/* Some of the code in this method deals with changing the |
|
|
|
@ -2948,6 +3026,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Calculate the tab rectangles. |
|
|
|
|
* |
|
|
|
|
* @param tabPlacement the tab placement |
|
|
|
|
* @param tabCount the tab count |
|
|
|
|
*/ |
|
|
|
@ -3138,6 +3217,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Rotates the run-index array so that the selected run is run[0]. |
|
|
|
|
* |
|
|
|
|
* @param tabPlacement the tab placement |
|
|
|
|
* @param selectedRun the selected run |
|
|
|
|
*/ |
|
|
|
@ -3153,6 +3233,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Normalizes the tab runs. |
|
|
|
|
* |
|
|
|
|
* @param tabPlacement the tab placement |
|
|
|
|
* @param tabCount the tab count |
|
|
|
|
* @param start the start |
|
|
|
@ -3228,6 +3309,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Pads the tab run. |
|
|
|
|
* |
|
|
|
|
* @param tabPlacement the tab placement |
|
|
|
|
* @param start the start |
|
|
|
|
* @param end the end |
|
|
|
@ -3266,6 +3348,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Pads selected tab. |
|
|
|
|
* |
|
|
|
|
* @param tabPlacement the tab placement |
|
|
|
|
* @param selectedIndex the selected index |
|
|
|
|
*/ |
|
|
|
@ -3855,8 +3938,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
|
|
|
|
|
if (e.getSource() == scrollForwardButton) { |
|
|
|
|
actionKey = "scrollTabsForwardAction"; |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
} else { |
|
|
|
|
actionKey = "scrollTabsBackwardAction"; |
|
|
|
|
} |
|
|
|
|
Action action = map.get(actionKey); |
|
|
|
@ -3904,6 +3986,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
} |
|
|
|
|
setBackground(bgColor); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void paintComponent(Graphics g) { |
|
|
|
|
super.paintComponent(g); |
|
|
|
|
DarkTabbedPaneUIBridge.this.paintTabArea(g, tabPane.getTabPlacement(), |
|
|
|
@ -3952,11 +4035,9 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
if (name == "mnemonicAt") { |
|
|
|
|
updateMnemonics(); |
|
|
|
|
pane.repaint(); |
|
|
|
|
} |
|
|
|
|
else if (name == "displayedMnemonicIndexAt") { |
|
|
|
|
} else if (name == "displayedMnemonicIndexAt") { |
|
|
|
|
pane.repaint(); |
|
|
|
|
} |
|
|
|
|
else if (name =="indexForTitle") { |
|
|
|
|
} else if (name == "indexForTitle") { |
|
|
|
|
calculatedBaseline = false; |
|
|
|
|
Integer index = (Integer) e.getNewValue(); |
|
|
|
|
updateHtmlViews(index, false); |
|
|
|
@ -4079,8 +4160,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
// This will trigger the focusIndex to change by way
|
|
|
|
|
// of stateChanged.
|
|
|
|
|
tabPane.setSelectedIndex(tabIndex); |
|
|
|
|
} |
|
|
|
|
else if (tabPane.isRequestFocusEnabled()) { |
|
|
|
|
} else if (tabPane.isRequestFocusEnabled()) { |
|
|
|
|
// Clicking on selected tab, try and give the tabbedpane
|
|
|
|
|
// focus. Repaint will occur in focusGained.
|
|
|
|
|
tabPane.requestFocus(); |
|
|
|
@ -4104,6 +4184,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
public void focusGained(FocusEvent e) { |
|
|
|
|
setFocusIndex(tabPane.getSelectedIndex(), true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void focusLost(FocusEvent e) { |
|
|
|
|
repaintTab(focusIndex); |
|
|
|
|
} |
|
|
|
@ -4151,6 +4232,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
isRunsDirty = true; |
|
|
|
|
updateHtmlViews(tp.indexOfComponent(child), true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void componentRemoved(ContainerEvent e) { |
|
|
|
|
JTabbedPane tp = (JTabbedPane) e.getContainer(); |
|
|
|
|
Component child = e.getChild(); |
|
|
|
@ -4233,6 +4315,7 @@ public class DarkTabbedPaneUIBridge extends TabbedPaneUI implements SwingConstan
|
|
|
|
|
public void focusGained(FocusEvent e) { |
|
|
|
|
getHandler().focusGained(e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void focusLost(FocusEvent e) { |
|
|
|
|
getHandler().focusLost(e); |
|
|
|
|
} |
|
|
|
|