rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
Object s = ev.getSource(); if (tabPane != ev.getSource()) { ev.setSource(tabPane); tabPane.dispatchEvent(ev); ev.setSource(s); }
public void mouseMoved(MouseEvent ev) { int tabIndex = tabForCoordinate(tabPane, ev.getX(), ev.getY()); setRolloverTab(tabIndex); }
if (tabPane.isEnabled())
Object s = e.getSource(); if (tabPane != e.getSource()) { redispatchEvent(e); e.setSource(s); } int placement = tabPane.getTabPlacement(); if (s == incrButton) { if(!incrButton.isEnabled()) return; currentScrollLocation++; switch (placement) { case JTabbedPane.TOP: case JTabbedPane.BOTTOM: currentScrollOffset =...
public void mousePressed(MouseEvent e) { if (tabPane.isEnabled()) { int index = tabForCoordinate(tabPane, e.getX(), e.getY()); if (index >= 0 && tabPane.isEnabledAt(index)) { tabPane.setSelectedIndex(index); } } }
if (index >= 0 && tabPane.isEnabledAt(index))
if (!tabPane.isEnabledAt(index)) return; if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT && s == panel) { scrollTab(index, placement); tabPane.setSelectedIndex(index); tabPane.repaint(); } else
public void mousePressed(MouseEvent e) { if (tabPane.isEnabled()) { int index = tabForCoordinate(tabPane, e.getX(), e.getY()); if (index >= 0 && tabPane.isEnabledAt(index)) { tabPane.setSelectedIndex(index); } } }
paintTabArea(g, tabPane.getTabPlacement(), tabPane.getSelectedIndex());
int placement = tabPane.getTabPlacement(); g.setColor(highlight); if (placement == SwingUtilities.TOP || placement == SwingUtilities.BOTTOM) g.fillRect(currentScrollOffset, 0, tabAreaRect.width, tabAreaRect.height); else g.fillRect(0, currentScrollOffset, tabAreaRect.width, tabAreaRect.height); paintTabArea(g, placeme...
public void paint(Graphics g, JComponent c) { paintTabArea(g, tabPane.getTabPlacement(), tabPane.getSelectedIndex()); }
setUI((PanelUI) new ScrollingPanelUI());
setUI(new ScrollingPanelUI());
public void updateUI() { setUI((PanelUI) new ScrollingPanelUI()); }
if (tabPane.getTabLayoutPolicy() == JTabbedPane.WRAP_TAB_LAYOUT)
public void stateChanged(ChangeEvent e) { selectedRun = getRunForTab(tabPane.getTabCount(), tabPane.getSelectedIndex()); tabPane.revalidate(); tabPane.repaint(); }
for (int i = 0; i < tabPane.getTabCount(); i++)
int count = tabPane.getTabCount(); for (int i = 0; i < count; i++)
protected Dimension calculateSize(boolean minimum) { int tabPlacement = tabPane.getTabPlacement(); int width = 0; int height = 0; Component c; Dimension dims; // Find out the minimum/preferred size to display the largest child // of the tabbed pane. for (int i = 0; i < tab...
int min = calculateMaxTabWidth(tabPlacement); width = Math.max(min, width); int tabAreaHeight = preferredTabAreaHeight(tabPlacement,
width = Math.max(calculateMaxTabWidth(tabPlacement), width); height += preferredTabAreaHeight(tabPlacement,
protected Dimension calculateSize(boolean minimum) { int tabPlacement = tabPane.getTabPlacement(); int width = 0; int height = 0; Component c; Dimension dims; // Find out the minimum/preferred size to display the largest child // of the tabbed pane. for (int i = 0; i < tab...
height += tabAreaHeight;
protected Dimension calculateSize(boolean minimum) { int tabPlacement = tabPane.getTabPlacement(); int width = 0; int height = 0; Component c; Dimension dims; // Find out the minimum/preferred size to display the largest child // of the tabbed pane. for (int i = 0; i < tab...
int min = calculateMaxTabHeight(tabPlacement); height = Math.max(min, height); int tabAreaWidth = preferredTabAreaWidth(tabPlacement,
height = Math.max(calculateMaxTabHeight(tabPlacement), height); width += preferredTabAreaWidth(tabPlacement,
protected Dimension calculateSize(boolean minimum) { int tabPlacement = tabPane.getTabPlacement(); int width = 0; int height = 0; Component c; Dimension dims; // Find out the minimum/preferred size to display the largest child // of the tabbed pane. for (int i = 0; i < tab...
width += tabAreaWidth;
protected Dimension calculateSize(boolean minimum) { int tabPlacement = tabPane.getTabPlacement(); int width = 0; int height = 0; Component c; Dimension dims; // Find out the minimum/preferred size to display the largest child // of the tabbed pane. for (int i = 0; i < tab...
x = size.width - (insets.right + tabAreaInsets.right) - maxTabWidth;
x = size.width - (insets.right + tabAreaInsets.right) - maxTabWidth - 1;
protected void calculateTabRects(int tabPlacement, int tabCount) { Insets insets = tabPane.getInsets(); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Dimension size = tabPane.getSize(); // The coordinates of the upper left corner of the tab area. int x; int y; //...
- maxTabHeight;
- maxTabHeight - 1;
protected void calculateTabRects(int tabPlacement, int tabCount) { Insets insets = tabPane.getInsets(); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Dimension size = tabPane.getSize(); // The coordinates of the upper left corner of the tab area. int x; int y; //...
else start = x;
protected void calculateTabRects(int tabPlacement, int tabCount) { Insets insets = tabPane.getInsets(); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Dimension size = tabPane.getSize(); // The coordinates of the upper left corner of the tab area. int x; int y; //...
if (runCount == 1) return;
protected void calculateTabRects(int tabPlacement, int tabCount) { Insets insets = tabPane.getInsets(); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Dimension size = tabPane.getSize(); // The coordinates of the upper left corner of the tab area. int x; int y; //...
Component selectedComponent = tabPane.getComponentAt(selectedIndex);
Component selectedComponent = null; if (selectedIndex >= 0) selectedComponent = tabPane.getComponentAt(selectedIndex);
public void layoutContainer(Container parent) { calculateLayoutInfo(); int tabPlacement = tabPane.getTabPlacement(); Insets insets = tabPane.getInsets(); int selectedIndex = tabPane.getSelectedIndex(); Component selectedComponent = tabPane.getComponentAt(selectedIndex); // The RI do...
return calculateSize(false);
return calculateSize(true);
public Dimension minimumLayoutSize(Container parent) { return calculateSize(false); }
Insets tabAreaInsets = getTabAreaInsets(tabPlacement);
protected void normalizeTabRuns(int tabPlacement, int tabCount, int start, int max) { Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingUtilities.TOP || tabPlacement == SwingUtilities.BOTTOM) { // We should only d...
int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currX = tabAreaInsets.left;
int first = tabRuns[i]; int last = lastTabInRun(tabCount, i); int currX = start;
protected void normalizeTabRuns(int tabPlacement, int tabCount, int start, int max) { Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingUtilities.TOP || tabPlacement == SwingUtilities.BOTTOM) { // We should only d...
int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currY = tabAreaInsets.top;
int first = tabRuns[i]; int last = lastTabInRun(tabCount, i); int currY = start;
protected void normalizeTabRuns(int tabPlacement, int tabCount, int start, int max) { Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingUtilities.TOP || tabPlacement == SwingUtilities.BOTTOM) { // We should only d...
if (runCount == 1 || selectedRun == 1 || selectedRun == -1)
if (runCount == 1 || selectedRun == 0 || selectedRun == -1)
protected void rotateTabRuns(int tabPlacement, int selectedRun) { if (runCount == 1 || selectedRun == 1 || selectedRun == -1) return; int[] newTabRuns = new int[tabRuns.length]; int currentRun = selectedRun; int i = 1; do { newTabRuns[i] = tabRuns[currentRun]; ...
int i = 1;
int i = 0;
protected void rotateTabRuns(int tabPlacement, int selectedRun) { if (runCount == 1 || selectedRun == 1 || selectedRun == -1) return; int[] newTabRuns = new int[tabRuns.length]; int currentRun = selectedRun; int i = 1; do { newTabRuns[i] = tabRuns[currentRun]; ...
if (runCount > 1) newTabRuns[0] = tabRuns[currentRun];
protected void rotateTabRuns(int tabPlacement, int selectedRun) { if (runCount == 1 || selectedRun == 1 || selectedRun == -1) return; int[] newTabRuns = new int[tabRuns.length]; int currentRun = selectedRun; int i = 1; do { newTabRuns[i] = tabRuns[currentRun]; ...
int runs = 1; int start = 0; int top = 0;
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); i...
start = tabAreaInsets.left + insets.left;
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); i...
int runWidth = start; top = insets.top + tabAreaInsets.top;
int runWidth = tabAreaInsets.left + insets.left; int top = insets.top + tabAreaInsets.top;
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); i...
rects[i] = new Rectangle(runWidth, top, width, maxHeight);
rects[i].setBounds(runWidth, top, width, maxHeight);
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); i...
tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom;
tabAreaRect.height = maxTabHeight + tabAreaInsets.top + tabAreaInsets.bottom;
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); i...
start = tabAreaInsets.top + insets.top; int runHeight = start;
int runHeight = tabAreaInsets.top + insets.top;;
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); i...
top = insets.left + tabAreaInsets.left;
int left = insets.left + tabAreaInsets.left;
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); i...
rects[i] = new Rectangle(top, runHeight, maxWidth, height);
rects[i].setBounds(left, runHeight, maxWidth, height);
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); i...
tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right;
tabAreaRect.width = maxTabWidth + tabAreaInsets.left + tabAreaInsets.right;
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); i...
runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray();
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); i...
padSelectedTab(tabPlacement, tabPane.getSelectedIndex());
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); i...
Point p = null;
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.setVisible(false); decrButton.setVisible(false); if (...
incrButton.setVisible(false); decrButton.setVisible(false);
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.setVisible(false); decrButton.setVisible(false); if (...
tabAreaRect.height);
decrDims.height);
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.setVisible(false); decrButton.setVisible(false); if (...
decrDims.width, tabAreaRect.height);
incrDims.width, incrDims.height); } else { decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y + tabAreaRect.height - decrDims.height, decrDims.width, decrDims.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y + tabAreaR...
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.setVisible(false); decrButton.setVisible(false); if (...
tabAreaRect.width, decrDims.height);
decrDims.width, decrDims.height);
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.setVisible(false); decrButton.setVisible(false); if (...
- incrDims.height, tabAreaRect.width,
- incrDims.height, incrDims.width,
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.setVisible(false); decrButton.setVisible(false); if (...
int tabC = tabPane.getTabCount() - 1; if (tabCount > 0) { int w = Math.max(rects[tabC].width + rects[tabC].x, tabAreaRect.width); int h = Math.max(rects[tabC].height, tabAreaRect.height); p = findPointForIndex(currentScrollLocation); panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p);
updateViewPosition();
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.setVisible(false); decrButton.setVisible(false); if (...
return super.calculateSize(true);
return super.calculateSize(false);
public Dimension preferredLayoutSize(Container parent) { return super.calculateSize(true); }
int width = 0;
int width = insets.bottom + insets.right + 3;
protected int calculateTabWidth(int tabPlacement, int tabIndex, FontMetrics metrics) { Icon icon = getIconForTab(tabIndex); Insets insets = getTabInsets(tabPlacement, tabIndex); int width = 0; if (icon != null) { Rectangle vr = new Rectangle(); Rectangl...
Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); layoutLabel(tabPlacement, getFontMetrics(), tabIndex, tabPane.getTitleAt(tabIndex), icon, vr, ir, tr, tabIndex == tabPane.getSelectedIndex()); width = tr.union(ir).width;
width += icon.getIconWidth() + textIconGap;
protected int calculateTabWidth(int tabPlacement, int tabIndex, FontMetrics metrics) { Icon icon = getIconForTab(tabIndex); Insets insets = getTabInsets(tabPlacement, tabIndex); int width = 0; if (icon != null) { Rectangle vr = new Rectangle(); Rectangl...
width = metrics.stringWidth(tabPane.getTitleAt(tabIndex)); width += insets.left + insets.right;
{ String label = tabPane.getTitleAt(tabIndex); width += metrics.stringWidth(label); }
protected int calculateTabWidth(int tabPlacement, int tabIndex, FontMetrics metrics) { Icon icon = getIconForTab(tabIndex); Insets insets = getTabInsets(tabPlacement, tabIndex); int width = 0; if (icon != null) { Rectangle vr = new Rectangle(); Rectangl...
panel = new ScrollingPanel(); viewport.setView(panel);
protected LayoutManager createLayoutManager() { if (tabPane.getTabLayoutPolicy() == JTabbedPane.WRAP_TAB_LAYOUT) return new TabbedPaneLayout(); else { incrButton = createIncreaseButton(); decrButton = createDecreaseButton(); viewport = new ScrollingViewport(); viewport.set...
currentScrollLocation = 0; decrButton.setEnabled(false); panel.addMouseListener(mouseListener); incrButton.addMouseListener(mouseListener); decrButton.addMouseListener(mouseListener); viewport.setBackground(Color.LIGHT_GRAY);
protected LayoutManager createLayoutManager() { if (tabPane.getTabLayoutPolicy() == JTabbedPane.WRAP_TAB_LAYOUT) return new TabbedPaneLayout(); else { incrButton = createIncreaseButton(); decrButton = createDecreaseButton(); viewport = new ScrollingViewport(); viewport.set...
if (index == lastTabInRun(tabCount, run) + 1) index = lastTabInRun(tabCount, getPreviousTabRun(run)) + 1; return getNextTabIndex(base);
if (base == lastTabInRun(tabCount, run)) index = (run > 0) ? lastTabInRun(tabCount, getPreviousTabRun(run)) + 1 : 0; return index;
protected int getNextTabIndexInRun(int tabCount, int base) { int index = getNextTabIndex(base); int run = getRunForTab(tabCount, base); if (index == lastTabInRun(tabCount, run) + 1) index = lastTabInRun(tabCount, getPreviousTabRun(run)) + 1; return getNextTabIndex(base); }
return getPreviousTabIndex(base);
return index;
protected int getPreviousTabIndexInRun(int tabCount, int base) { int index = getPreviousTabIndex(base); int run = getRunForTab(tabCount, base); if (index == lastTabInRun(tabCount, getPreviousTabRun(run))) index = lastTabInRun(tabCount, run); return getPreviousTabIndex(base); }
return 1;
return 0;
protected int getRunForTab(int tabCount, int tabIndex) { if (runCount == 1 && tabIndex < tabCount && tabIndex >= 0) return 1; for (int i = 0; i < runCount; i++) { int first = lastTabInRun(tabCount, getPreviousTabRun(i)) + 1; if (first == tabCount) first = 0; int last = l...
if (pane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Rectangle r = new Rectangle(rects[i]); switch(pane.getTabPlacement()) { case SwingConstants.TOP: case SwingConstants.BOTTOM: r.x -= currentScrollOffset; break; default: r.y -= currentScrollOffset; } return r; }
public Rectangle getTabBounds(JTabbedPane pane, int i) { // Need to re-layout container if tab does not exist. if (i >= rects.length) layoutManager.layoutContainer(pane); return rects[i]; }
return 0;
switch (tabPlacement) { default: case SwingUtilities.TOP: case SwingUtilities.BOTTOM: return 1; case SwingUtilities.LEFT: return (isSelected) ? -1 : 1; case SwingUtilities.RIGHT: return (isSelected) ? 1 : -1; }
protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected) { // No reason to shift. return 0; }
switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT:
protected int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected) { // No reason to shift. return 0; }
}
protected int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected) { // No reason to shift. return 0; }
highlight = UIManager.getColor("TabbedPane.highlight"); lightHighlight = UIManager.getColor("TabbedPane.lightHighlight");
lightHighlight = UIManager.getColor("TabbedPane.highlight"); highlight = UIManager.getColor("TabbedPane.light");
protected void installDefaults() { LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font"); tabPane.setOpaque(false); highlight = UIManager.getColor("TabbedPane.highlight"); ligh...
selectedTabPadInsets = UIManager.getInsets("TabbedPane.tabbedPaneTabPadInsets");
selectedTabPadInsets = UIManager.getInsets("TabbedPane.selectedTabPadInsets");
protected void installDefaults() { LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font"); tabPane.setOpaque(false); highlight = UIManager.getColor("TabbedPane.highlight"); ligh...
contentBorderInsets = UIManager.getInsets("TabbedPane.tabbedPaneContentBorderInsets");
contentBorderInsets = UIManager.getInsets("TabbedPane.contentBorderInsets");
protected void installDefaults() { LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font"); tabPane.setOpaque(false); highlight = UIManager.getColor("TabbedPane.highlight"); ligh...
selectedColor = UIManager.getColor("TabbedPane.contentAreaColor"); if (selectedColor == null) selectedColor = UIManager.getColor("control");
protected void installDefaults() { LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font"); tabPane.setOpaque(false); highlight = UIManager.getColor("TabbedPane.highlight"); ligh...
throws NotImplementedException
protected void installKeyboardActions() throws NotImplementedException { // FIXME: Implement. }
InputMap keyMap = (InputMap) UIManager.get("TabbedPane.focusInputMap"); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, keyMap); keyMap = (InputMap) UIManager.get("TabbedPane.ancestorInputMap"); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, keyMap); Actio...
protected void installKeyboardActions() throws NotImplementedException { // FIXME: Implement. }
SwingUtilities.layoutCompoundLabel(metrics, title, icon,
textRect.x = 0; textRect.y = 0; textRect.width = 0; textRect.height = 0; iconRect.x = 0; iconRect.y = 0; iconRect.width = 0; iconRect.height = 0; SwingUtilities.layoutCompoundLabel(tabPane, metrics, title, icon,
protected void layoutLabel(int tabPlacement, FontMetrics metrics, int tabIndex, String title, Icon icon, Rectangle tabRect, Rectangle iconRect, Rectangle textRect, boolean isSelected) { SwingUtilities.layoutCompoundLabel(metrics, ...
(tabPlacement == SwingConstants.RIGHT) ? true : false);
(tabPlacement == SwingConstants.TOP) ? direction == SwingConstants.NORTH : direction == SwingConstants.SOUTH);
protected void navigateSelectedTab(int direction) { int tabPlacement = tabPane.getTabPlacement(); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (direction == SwingConstants.WEST) selectPreviousTabInRun(tabPane.getSelectedIndex()); else ...
(tabPlacement == SwingConstants.RIGHT) ? true : false);
(tabPlacement == SwingConstants.LEFT) ? direction == SwingConstants.WEST : direction == SwingConstants.EAST);
protected void navigateSelectedTab(int direction) { int tabPlacement = tabPane.getTabPlacement(); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (direction == SwingConstants.WEST) selectPreviousTabInRun(tabPane.getSelectedIndex()); else ...
paintTabArea(g, tabPane.getTabPlacement(), tabPane.getSelectedIndex()); paintContentBorder(g, tabPane.getTabPlacement(), tabPane.getSelectedIndex());
{ g.setColor(highlight); g.fillRect(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); paintTabArea(g, tabPlacement, index); } paintContentBorder(g, tabPlacement, index);
public void paint(Graphics g, JComponent c) { if (!tabPane.isValid()) tabPane.validate(); if (tabPane.getTabCount() == 0) return; if (tabPane.getTabLayoutPolicy() == JTabbedPane.WRAP_TAB_LAYOUT) paintTabArea(g, tabPane.getTabPlacement(), tabPane.getSelectedIndex()); paintContentBorder(g, t...
Insets tabAreaInsets = getTabAreaInsets(tabPlacement);
protected void paintContentBorder(Graphics g, int tabPlacement, int selectedIndex) { int width = tabPane.getWidth(); int height = tabPane.getHeight(); Insets insets = tabPane.getInsets(); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); // Calculate coordinates...
int startgap = rects[selectedIndex].x; int endgap = rects[selectedIndex].x + rects[selectedIndex].width;
int startgap = rects[selectedIndex].x - currentScrollOffset; int endgap = rects[selectedIndex].x + rects[selectedIndex].width - currentScrollOffset;
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].x; int endgap = rects[selectedI...
int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT)
if (tabPlacement == SwingConstants.BOTTOM && startgap >= 0)
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].x; int endgap = rects[selectedI...
Point p = findPointForIndex(currentScrollLocation); diff = p.x; }
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].x; int endgap = rects[selectedI...
g.drawLine(x + 1, y + h - 1, startgap - diff, y + h - 1); g.drawLine(endgap - diff, y + h - 1, x + w - 1, y + h - 1);
g.drawLine(x + 1, y + h - 2, startgap, y + h - 2); g.drawLine(endgap, y + h - 2, x + w - 2, y + h - 2);
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].x; int endgap = rects[selectedI...
g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h);
g.drawLine(x, y + h - 1, startgap , y + h - 1); g.drawLine(endgap, y + h - 1, x + w - 1, y + h - 1); g.setColor(selectedColor); g.drawLine(startgap, y + h - 1, endgap - 1, y + h - 1); g.drawLine(startgap, y + h - 2, endgap - 1, y + h - 2);
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].x; int endgap = rects[selectedI...
g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1);
g.drawLine(x + 1, y + h - 2, x + w - 1, y + h - 2);
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].x; int endgap = rects[selectedI...
g.drawLine(x, y + h, x + w, y + h);
g.drawLine(x, y + h - 1, x + w - 1, y + h - 1);
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].x; int endgap = rects[selectedI...
g.setColor(selectedColor); g.drawLine(x + 1, y + h - 3, x + w - 2, y + h - 3);
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].x; int endgap = rects[selectedI...
int startgap = rects[selectedIndex].y; int endgap = rects[selectedIndex].y + rects[selectedIndex].height;
int startgap = rects[selectedIndex].y - currentScrollOffset; int endgap = rects[selectedIndex].y + rects[selectedIndex].height - currentScrollOffset;
protected void paintContentBorderLeftEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); g.setColor(lightHighlight); int startgap = rects[selectedIndex].y; int...
int diff = 0;
if (tabPlacement == SwingConstants.LEFT && startgap >= 0) { g.drawLine(x, y, x, startgap); g.drawLine(x, endgap, x, y + h - 1);
protected void paintContentBorderLeftEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); g.setColor(lightHighlight); int startgap = rects[selectedIndex].y; int...
if (tabPlacement == SwingConstants.LEFT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.drawLine(x, y, x, startgap - diff); g.drawLine(x, endgap - diff, x, y + h);
g.setColor(selectedColor); g.drawLine(x, startgap, x, endgap - 1);
protected void paintContentBorderLeftEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); g.setColor(lightHighlight); int startgap = rects[selectedIndex].y; int...
g.drawLine(x, y, x, y + h);
g.drawLine(x, y, x, y + h - 1); g.setColor(selectedColor); g.drawLine(x + 1, y + 1, x + 1, y + h - 4);
protected void paintContentBorderLeftEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); g.setColor(lightHighlight); int startgap = rects[selectedIndex].y; int...
int startgap = rects[selectedIndex].y; int endgap = rects[selectedIndex].y + rects[selectedIndex].height;
int startgap = rects[selectedIndex].y - currentScrollOffset; int endgap = rects[selectedIndex].y + rects[selectedIndex].height - currentScrollOffset;
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].y; int endgap = rects[selectedInde...
int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT)
if (tabPlacement == SwingConstants.RIGHT && startgap >= 0)
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].y; int endgap = rects[selectedInde...
Point p = findPointForIndex(currentScrollLocation); diff = p.y; }
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].y; int endgap = rects[selectedInde...
g.drawLine(x + w - 1, y + 1, x + w - 1, startgap - diff); g.drawLine(x + w - 1, endgap - diff, x + w - 1, y + h - 1);
g.drawLine(x + w - 2, y + 1, x + w - 2, startgap); g.drawLine(x + w - 2, endgap, x + w - 2, y + h - 2);
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].y; int endgap = rects[selectedInde...
g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h);
g.drawLine(x + w - 1, y, x + w - 1, startgap); g.drawLine(x + w - 1, endgap, x + w - 1, y + h - 2); g.setColor(selectedColor); g.drawLine(x + w - 2, startgap, x + w - 2, endgap - 1); g.drawLine(x + w - 1, startgap, x + w - 1, endgap - 1);
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].y; int endgap = rects[selectedInde...
g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1);
g.drawLine(x + w - 2, y + 1, x + w - 2, y + h - 2);
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].y; int endgap = rects[selectedInde...
g.drawLine(x + w, y, x + w, y + h);
g.drawLine(x + w - 1, y, x + w - 1, y + h - 2);
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].y; int endgap = rects[selectedInde...
g.setColor(selectedColor); g.drawLine(x + w - 3, y + 1, x + w - 3, y + h - 4);
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].y; int endgap = rects[selectedInde...
int startgap = rects[selectedIndex].x; int endgap = rects[selectedIndex].x + rects[selectedIndex].width;
int startgap = rects[selectedIndex].x - currentScrollOffset; int endgap = rects[selectedIndex].x + rects[selectedIndex].width - currentScrollOffset;
protected void paintContentBorderTopEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); g.setColor(lightHighlight); int startgap = rects[selectedIndex].x; int en...
int diff = 0;
if (tabPlacement == SwingConstants.TOP && startgap >= 0) { g.drawLine(x, y, startgap, y); g.drawLine(endgap, y, x + w - 1, y);
protected void paintContentBorderTopEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); g.setColor(lightHighlight); int startgap = rects[selectedIndex].x; int en...
if (tabPlacement == SwingConstants.TOP) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.drawLine(x, y, startgap - diff, y); g.drawLine(endgap - diff, y, x + w, y);
g.setColor(selectedColor); g.drawLine(startgap, y, endgap - 1, y);
protected void paintContentBorderTopEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); g.setColor(lightHighlight); int startgap = rects[selectedIndex].x; int en...
g.setColor(selectedColor); g.drawLine(x, y + 1, x + w - 1, y + 1); g.drawLine(x, y + 2, x + w - 1, y + 2);
protected void paintContentBorderTopEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); g.setColor(lightHighlight); int startgap = rects[selectedIndex].x; int en...
Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); boolean isScroll = tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT;
protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex) { Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); boolean isScroll = tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT; // Please note: the ordering of the painting is important. // we WANT to pai...
paintTab(g, tabPlacement, rects, j, ir, tr);
paintTab(g, tabPlacement, rects, j, tempIconRect, tempTextRect);
protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex) { Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); boolean isScroll = tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT; // Please note: the ordering of the painting is important. // we WANT to pai...
paintTab(g, tabPlacement, rects, selectedIndex, ir, tr);
paintTab(g, tabPlacement, rects, selectedIndex, tempIconRect, tempTextRect);
protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex) { Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); boolean isScroll = tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT; // Please note: the ordering of the painting is important. // we WANT to pai...
g.setColor(Color.LIGHT_GRAY);
g.setColor(selectedColor);
protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (isSelected) g.setColor(Color.LIGHT_GRAY); else { Color bg = t...
bg = Color.GRAY;
bg = Color.LIGHT_GRAY;
protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (isSelected) g.setColor(Color.LIGHT_GRAY); else { Color bg = t...
g.fillRect(x, y, w, h);
switch (tabPlacement) { case SwingConstants.TOP: g.fillRect(x + 1, y + 1, w - 1, h - 1); break; case SwingConstants.BOTTOM: g.fillRect(x, y, w - 1, h - 1); break; case SwingConstants.LEFT: g.fillRect(x + 1, y + 1, w - 1, h - 2); break; case SwingConstants.RIGHT: g.fillRect(x, y + 1, w - 1, h - 2); break; }
protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (isSelected) g.setColor(Color.LIGHT_GRAY); else { Color bg = t...
if (! isSelected || tabPlacement != SwingConstants.TOP)
switch (tabPlacement)
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x ...
g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1);
g.drawLine(x + w - 2, y + 2, x + w - 2, y + h);
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x ...
g.drawLine(x, y + h, x + w, y + h); }
g.drawLine(x + w - 1, y + 2, x + w - 1, y + h); g.drawLine(x + w - 2, y + 1, x + w - 1, y + 2); g.setColor(lightHighlight); g.drawLine(x, y + 3, x, y + h); g.drawLine(x + 3, y, x + w - 3, y); g.drawLine(x, y + 2, x + 2, y); break; case SwingConstants.LEFT: g.setColor(lightHighlight); g.drawLine(x + 3, y, x +...
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x ...
if (! isSelected || tabPlacement != SwingConstants.LEFT) {
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x ...
g.drawLine(x + w, y, x + w, y + h);
g.drawLine(x + 2, y + h - 1, x + w - 1, y + h - 1);
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x ...