bugged
stringlengths
6
599k
fixed
stringlengths
10
599k
__index_level_0__
int64
0
1.13M
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]; currentRun = getNextTabRun(currentRun); i++; } while (i < runCount); if (runCount > 1) newTabRuns[0] = tabRuns[currentRun]; tabRuns = newTabRuns; BasicTabbedPaneUI.this.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]; currentRun = getNextTabRun(currentRun); i++; } while (i < runCount); if (runCount > 1) newTabRuns[0] = tabRuns[currentRun]; tabRuns = newTabRuns; BasicTabbedPaneUI.this.selectedRun = 1; }
7,522
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(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); 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(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
7,523
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(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); 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(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
7,524
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(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); 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(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
7,525
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(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); 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(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i].setBounds(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
7,526
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(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); 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(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
7,527
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(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); 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(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
7,528
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(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); 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(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); int left = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
7,529
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(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); 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(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i].setBounds(left, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
7,530
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(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); 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(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
7,531
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(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); 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(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
7,532
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(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); 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(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); }
7,533
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 (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, tabAreaRect.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, tabAreaRect.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); 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); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.setVisible(false); decrButton.setVisible(false); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, tabAreaRect.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, tabAreaRect.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); 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); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
7,534
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 (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, tabAreaRect.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, tabAreaRect.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); 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); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
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 (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, tabAreaRect.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, tabAreaRect.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); 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); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
7,535
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 (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, tabAreaRect.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, tabAreaRect.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); 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); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
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 (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, decrDims.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, decrDims.width, decrDims.height); tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, tabAreaRect.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, tabAreaRect.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, decrDims.height); 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, decrDims.height); p = findPointForIndex(currentScrollLocation); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
7,536
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 (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, tabAreaRect.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, tabAreaRect.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); 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); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
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 (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, 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 + tabAreaRect.height - incrDims.height, incrDims.width, incrDims.height); } tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, tabAreaRect.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, tabAreaRect.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); 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); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
7,537
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 (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, tabAreaRect.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, tabAreaRect.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); 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); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
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 (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, decrDims.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, tabAreaRect.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); 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); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
7,538
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 (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, tabAreaRect.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, tabAreaRect.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); 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); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
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 (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, tabAreaRect.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, incrDims.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); 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); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
7,539
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 (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, tabAreaRect.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, tabAreaRect.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); 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); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
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 (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, tabAreaRect.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, tabAreaRect.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); 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); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
7,540
public Dimension preferredLayoutSize(Container parent) { return super.calculateSize(true); }
public Dimension preferredLayoutSize(Container parent) { return super.calculateSize(false); }
7,541
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(); 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; } else width = metrics.stringWidth(tabPane.getTitleAt(tabIndex)); width += insets.left + insets.right; return width; }
protected int calculateTabWidth(int tabPlacement, int tabIndex, FontMetrics metrics) { Icon icon = getIconForTab(tabIndex); Insets insets = getTabInsets(tabPlacement, tabIndex); int width = insets.bottom + insets.right + 3; if (icon != null) { 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; } else width = metrics.stringWidth(tabPane.getTitleAt(tabIndex)); width += insets.left + insets.right; return width; }
7,542
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(); 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; } else width = metrics.stringWidth(tabPane.getTitleAt(tabIndex)); width += insets.left + insets.right; return width; }
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(); 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; } else width = metrics.stringWidth(tabPane.getTitleAt(tabIndex)); width += insets.left + insets.right; return width; }
7,543
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(); 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; } else width = metrics.stringWidth(tabPane.getTitleAt(tabIndex)); width += insets.left + insets.right; return width; }
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(); 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; } else width = metrics.stringWidth(tabPane.getTitleAt(tabIndex)); width += insets.left + insets.right; return width; }
7,544
protected LayoutManager createLayoutManager() { if (tabPane.getTabLayoutPolicy() == JTabbedPane.WRAP_TAB_LAYOUT) return new TabbedPaneLayout(); else { incrButton = createIncreaseButton(); decrButton = createDecreaseButton(); viewport = new ScrollingViewport(); viewport.setLayout(null); panel = new ScrollingPanel(); viewport.setView(panel); tabPane.add(incrButton); tabPane.add(decrButton); tabPane.add(viewport); currentScrollLocation = 0; decrButton.setEnabled(false); panel.addMouseListener(mouseListener); incrButton.addMouseListener(mouseListener); decrButton.addMouseListener(mouseListener); viewport.setBackground(Color.LIGHT_GRAY); return new TabbedPaneScrollLayout(); } }
protected LayoutManager createLayoutManager() { if (tabPane.getTabLayoutPolicy() == JTabbedPane.WRAP_TAB_LAYOUT) return new TabbedPaneLayout(); else { incrButton = createIncreaseButton(); decrButton = createDecreaseButton(); viewport = new ScrollingViewport(); viewport.setLayout(null); panel = new ScrollingPanel(); viewport.setView(panel); tabPane.add(incrButton); tabPane.add(decrButton); tabPane.add(viewport); currentScrollLocation = 0; decrButton.setEnabled(false); panel.addMouseListener(mouseListener); incrButton.addMouseListener(mouseListener); decrButton.addMouseListener(mouseListener); viewport.setBackground(Color.LIGHT_GRAY); return new TabbedPaneScrollLayout(); } }
7,545
protected LayoutManager createLayoutManager() { if (tabPane.getTabLayoutPolicy() == JTabbedPane.WRAP_TAB_LAYOUT) return new TabbedPaneLayout(); else { incrButton = createIncreaseButton(); decrButton = createDecreaseButton(); viewport = new ScrollingViewport(); viewport.setLayout(null); panel = new ScrollingPanel(); viewport.setView(panel); tabPane.add(incrButton); tabPane.add(decrButton); tabPane.add(viewport); currentScrollLocation = 0; decrButton.setEnabled(false); panel.addMouseListener(mouseListener); incrButton.addMouseListener(mouseListener); decrButton.addMouseListener(mouseListener); viewport.setBackground(Color.LIGHT_GRAY); return new TabbedPaneScrollLayout(); } }
protected LayoutManager createLayoutManager() { if (tabPane.getTabLayoutPolicy() == JTabbedPane.WRAP_TAB_LAYOUT) return new TabbedPaneLayout(); else { incrButton = createIncreaseButton(); decrButton = createDecreaseButton(); viewport = new ScrollingViewport(); viewport.setLayout(null); panel = new ScrollingPanel(); viewport.setView(panel); tabPane.add(incrButton); tabPane.add(decrButton); tabPane.add(viewport); currentScrollLocation = 0; decrButton.setEnabled(false); panel.addMouseListener(mouseListener); incrButton.addMouseListener(mouseListener); decrButton.addMouseListener(mouseListener); viewport.setBackground(Color.LIGHT_GRAY); return new TabbedPaneScrollLayout(); } }
7,546
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); }
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); }
7,547
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); }
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 index; }
7,548
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 = lastTabInRun(tabCount, i); if (last >= tabIndex && first <= tabIndex) return i; } return -1; }
protected int getRunForTab(int tabCount, int tabIndex) { if (runCount == 1 && tabIndex < tabCount && tabIndex >= 0) return 0; for (int i = 0; i < runCount; i++) { int first = lastTabInRun(tabCount, getPreviousTabRun(i)) + 1; if (first == tabCount) first = 0; int last = lastTabInRun(tabCount, i); if (last >= tabIndex && first <= tabIndex) return i; } return -1; }
7,549
protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected) { // No reason to shift. return 0; }
protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected) { // No reason to shift. 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; } }
7,551
protected void installDefaults() { LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font"); tabPane.setOpaque(false); highlight = UIManager.getColor("TabbedPane.highlight"); lightHighlight = UIManager.getColor("TabbedPane.lightHighlight"); shadow = UIManager.getColor("TabbedPane.shadow"); darkShadow = UIManager.getColor("TabbedPane.darkShadow"); focus = UIManager.getColor("TabbedPane.focus"); textIconGap = UIManager.getInt("TabbedPane.textIconGap"); tabRunOverlay = UIManager.getInt("TabbedPane.tabRunOverlay"); tabInsets = UIManager.getInsets("TabbedPane.tabInsets"); selectedTabPadInsets = UIManager.getInsets("TabbedPane.tabbedPaneTabPadInsets"); tabAreaInsets = UIManager.getInsets("TabbedPane.tabAreaInsets"); contentBorderInsets = UIManager.getInsets("TabbedPane.tabbedPaneContentBorderInsets"); tabsOpaque = UIManager.getBoolean("TabbedPane.tabsOpaque"); calcRect = new Rectangle(); tabRuns = new int[10]; tabAreaRect = new Rectangle(); contentRect = new Rectangle(); }
protected void installDefaults() { LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font"); tabPane.setOpaque(false); highlight = UIManager.getColor("TabbedPane.highlight"); lightHighlight = UIManager.getColor("TabbedPane.lightHighlight"); shadow = UIManager.getColor("TabbedPane.shadow"); darkShadow = UIManager.getColor("TabbedPane.darkShadow"); focus = UIManager.getColor("TabbedPane.focus"); textIconGap = UIManager.getInt("TabbedPane.textIconGap"); tabRunOverlay = UIManager.getInt("TabbedPane.tabRunOverlay"); tabInsets = UIManager.getInsets("TabbedPane.tabInsets"); selectedTabPadInsets = UIManager.getInsets("TabbedPane.tabbedPaneTabPadInsets"); tabAreaInsets = UIManager.getInsets("TabbedPane.tabAreaInsets"); contentBorderInsets = UIManager.getInsets("TabbedPane.tabbedPaneContentBorderInsets"); tabsOpaque = UIManager.getBoolean("TabbedPane.tabsOpaque"); calcRect = new Rectangle(); tabRuns = new int[10]; tabAreaRect = new Rectangle(); contentRect = new Rectangle(); }
7,554
protected void installDefaults() { LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font"); tabPane.setOpaque(false); highlight = UIManager.getColor("TabbedPane.highlight"); lightHighlight = UIManager.getColor("TabbedPane.lightHighlight"); shadow = UIManager.getColor("TabbedPane.shadow"); darkShadow = UIManager.getColor("TabbedPane.darkShadow"); focus = UIManager.getColor("TabbedPane.focus"); textIconGap = UIManager.getInt("TabbedPane.textIconGap"); tabRunOverlay = UIManager.getInt("TabbedPane.tabRunOverlay"); tabInsets = UIManager.getInsets("TabbedPane.tabInsets"); selectedTabPadInsets = UIManager.getInsets("TabbedPane.tabbedPaneTabPadInsets"); tabAreaInsets = UIManager.getInsets("TabbedPane.tabAreaInsets"); contentBorderInsets = UIManager.getInsets("TabbedPane.tabbedPaneContentBorderInsets"); tabsOpaque = UIManager.getBoolean("TabbedPane.tabsOpaque"); calcRect = new Rectangle(); tabRuns = new int[10]; tabAreaRect = new Rectangle(); contentRect = new Rectangle(); }
protected void installDefaults() { LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font"); tabPane.setOpaque(false); highlight = UIManager.getColor("TabbedPane.highlight"); lightHighlight = UIManager.getColor("TabbedPane.lightHighlight"); shadow = UIManager.getColor("TabbedPane.shadow"); darkShadow = UIManager.getColor("TabbedPane.darkShadow"); focus = UIManager.getColor("TabbedPane.focus"); textIconGap = UIManager.getInt("TabbedPane.textIconGap"); tabRunOverlay = UIManager.getInt("TabbedPane.tabRunOverlay"); tabInsets = UIManager.getInsets("TabbedPane.tabInsets"); selectedTabPadInsets = UIManager.getInsets("TabbedPane.selectedTabPadInsets"); tabAreaInsets = UIManager.getInsets("TabbedPane.tabAreaInsets"); contentBorderInsets = UIManager.getInsets("TabbedPane.tabbedPaneContentBorderInsets"); tabsOpaque = UIManager.getBoolean("TabbedPane.tabsOpaque"); calcRect = new Rectangle(); tabRuns = new int[10]; tabAreaRect = new Rectangle(); contentRect = new Rectangle(); }
7,555
protected void installDefaults() { LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font"); tabPane.setOpaque(false); highlight = UIManager.getColor("TabbedPane.highlight"); lightHighlight = UIManager.getColor("TabbedPane.lightHighlight"); shadow = UIManager.getColor("TabbedPane.shadow"); darkShadow = UIManager.getColor("TabbedPane.darkShadow"); focus = UIManager.getColor("TabbedPane.focus"); textIconGap = UIManager.getInt("TabbedPane.textIconGap"); tabRunOverlay = UIManager.getInt("TabbedPane.tabRunOverlay"); tabInsets = UIManager.getInsets("TabbedPane.tabInsets"); selectedTabPadInsets = UIManager.getInsets("TabbedPane.tabbedPaneTabPadInsets"); tabAreaInsets = UIManager.getInsets("TabbedPane.tabAreaInsets"); contentBorderInsets = UIManager.getInsets("TabbedPane.tabbedPaneContentBorderInsets"); tabsOpaque = UIManager.getBoolean("TabbedPane.tabsOpaque"); calcRect = new Rectangle(); tabRuns = new int[10]; tabAreaRect = new Rectangle(); contentRect = new Rectangle(); }
protected void installDefaults() { LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font"); tabPane.setOpaque(false); highlight = UIManager.getColor("TabbedPane.highlight"); lightHighlight = UIManager.getColor("TabbedPane.lightHighlight"); shadow = UIManager.getColor("TabbedPane.shadow"); darkShadow = UIManager.getColor("TabbedPane.darkShadow"); focus = UIManager.getColor("TabbedPane.focus"); textIconGap = UIManager.getInt("TabbedPane.textIconGap"); tabRunOverlay = UIManager.getInt("TabbedPane.tabRunOverlay"); tabInsets = UIManager.getInsets("TabbedPane.tabInsets"); selectedTabPadInsets = UIManager.getInsets("TabbedPane.tabbedPaneTabPadInsets"); tabAreaInsets = UIManager.getInsets("TabbedPane.tabAreaInsets"); contentBorderInsets = UIManager.getInsets("TabbedPane.contentBorderInsets"); tabsOpaque = UIManager.getBoolean("TabbedPane.tabsOpaque"); calcRect = new Rectangle(); tabRuns = new int[10]; tabAreaRect = new Rectangle(); contentRect = new Rectangle(); }
7,556
protected void installKeyboardActions() throws NotImplementedException { // FIXME: Implement. }
protected void installKeyboardActions() { // FIXME: Implement. }
7,558
protected void layoutLabel(int tabPlacement, FontMetrics metrics, int tabIndex, String title, Icon icon, Rectangle tabRect, Rectangle iconRect, Rectangle textRect, boolean isSelected) { SwingUtilities.layoutCompoundLabel(metrics, title, icon, SwingConstants.CENTER, SwingConstants.CENTER, SwingConstants.CENTER, SwingConstants.RIGHT, tabRect, iconRect, textRect, textIconGap); int shiftX = getTabLabelShiftX(tabPlacement, tabIndex, isSelected); int shiftY = getTabLabelShiftY(tabPlacement, tabIndex, isSelected); iconRect.x += shiftX; iconRect.y += shiftY; textRect.x += shiftX; textRect.y += shiftY; }
protected void layoutLabel(int tabPlacement, FontMetrics metrics, int tabIndex, String title, Icon icon, Rectangle tabRect, Rectangle iconRect, Rectangle textRect, boolean isSelected) { 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, SwingConstants.CENTER, SwingConstants.CENTER, SwingConstants.CENTER, SwingConstants.RIGHT, tabRect, iconRect, textRect, textIconGap); int shiftX = getTabLabelShiftX(tabPlacement, tabIndex, isSelected); int shiftY = getTabLabelShiftY(tabPlacement, tabIndex, isSelected); iconRect.x += shiftX; iconRect.y += shiftY; textRect.x += shiftX; textRect.y += shiftY; }
7,560
protected void navigateSelectedTab(int direction) { int tabPlacement = tabPane.getTabPlacement(); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (direction == SwingConstants.WEST) selectPreviousTabInRun(tabPane.getSelectedIndex()); else if (direction == SwingConstants.EAST) selectNextTabInRun(tabPane.getSelectedIndex()); else { int offset = getTabRunOffset(tabPlacement, tabPane.getTabCount(), tabPane.getSelectedIndex(), (tabPlacement == SwingConstants.RIGHT) ? true : false); selectAdjacentRunTab(tabPlacement, tabPane.getSelectedIndex(), offset); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (direction == SwingConstants.NORTH) selectPreviousTabInRun(tabPane.getSelectedIndex()); else if (direction == SwingConstants.SOUTH) selectNextTabInRun(tabPane.getSelectedIndex()); else { int offset = getTabRunOffset(tabPlacement, tabPane.getTabCount(), tabPane.getSelectedIndex(), (tabPlacement == SwingConstants.RIGHT) ? true : false); selectAdjacentRunTab(tabPlacement, tabPane.getSelectedIndex(), offset); } } }
protected void navigateSelectedTab(int direction) { int tabPlacement = tabPane.getTabPlacement(); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (direction == SwingConstants.WEST) selectPreviousTabInRun(tabPane.getSelectedIndex()); else if (direction == SwingConstants.EAST) selectNextTabInRun(tabPane.getSelectedIndex()); else { int offset = getTabRunOffset(tabPlacement, tabPane.getTabCount(), tabPane.getSelectedIndex(), (tabPlacement == SwingConstants.RIGHT) ? true : false); selectAdjacentRunTab(tabPlacement, tabPane.getSelectedIndex(), offset); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (direction == SwingConstants.NORTH) selectPreviousTabInRun(tabPane.getSelectedIndex()); else if (direction == SwingConstants.SOUTH) selectNextTabInRun(tabPane.getSelectedIndex()); else { int offset = getTabRunOffset(tabPlacement, tabPane.getTabCount(), tabPane.getSelectedIndex(), (tabPlacement == SwingConstants.RIGHT) ? true : false); selectAdjacentRunTab(tabPlacement, tabPane.getSelectedIndex(), offset); } } }
7,561
protected void navigateSelectedTab(int direction) { int tabPlacement = tabPane.getTabPlacement(); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (direction == SwingConstants.WEST) selectPreviousTabInRun(tabPane.getSelectedIndex()); else if (direction == SwingConstants.EAST) selectNextTabInRun(tabPane.getSelectedIndex()); else { int offset = getTabRunOffset(tabPlacement, tabPane.getTabCount(), tabPane.getSelectedIndex(), (tabPlacement == SwingConstants.RIGHT) ? true : false); selectAdjacentRunTab(tabPlacement, tabPane.getSelectedIndex(), offset); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (direction == SwingConstants.NORTH) selectPreviousTabInRun(tabPane.getSelectedIndex()); else if (direction == SwingConstants.SOUTH) selectNextTabInRun(tabPane.getSelectedIndex()); else { int offset = getTabRunOffset(tabPlacement, tabPane.getTabCount(), tabPane.getSelectedIndex(), (tabPlacement == SwingConstants.RIGHT) ? true : false); selectAdjacentRunTab(tabPlacement, tabPane.getSelectedIndex(), offset); } } }
protected void navigateSelectedTab(int direction) { int tabPlacement = tabPane.getTabPlacement(); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (direction == SwingConstants.WEST) selectPreviousTabInRun(tabPane.getSelectedIndex()); else if (direction == SwingConstants.EAST) selectNextTabInRun(tabPane.getSelectedIndex()); else { int offset = getTabRunOffset(tabPlacement, tabPane.getTabCount(), tabPane.getSelectedIndex(), (tabPlacement == SwingConstants.RIGHT) ? true : false); selectAdjacentRunTab(tabPlacement, tabPane.getSelectedIndex(), offset); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (direction == SwingConstants.NORTH) selectPreviousTabInRun(tabPane.getSelectedIndex()); else if (direction == SwingConstants.SOUTH) selectNextTabInRun(tabPane.getSelectedIndex()); else { int offset = getTabRunOffset(tabPlacement, tabPane.getTabCount(), tabPane.getSelectedIndex(), (tabPlacement == SwingConstants.RIGHT) ? true : false); selectAdjacentRunTab(tabPlacement, tabPane.getSelectedIndex(), offset); } } }
7,562
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, tabPane.getTabPlacement(), tabPane.getSelectedIndex()); }
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, tabPane.getTabPlacement(), tabPane.getSelectedIndex()); }
7,563
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 of content area. int x = insets.left; int y = insets.top; int w = width - insets.left - insets.right; int h = height - insets.top - insets.bottom; switch (tabPlacement) { case LEFT: x += calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth); w -= x - insets.left; break; case RIGHT: w -= calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth); break; case BOTTOM: h -= calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight); break; case TOP: default: y += calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight); h -= y - insets.top; } // Fill background if necessary. if (tabPane.isOpaque()) { Color bg = UIManager.getColor("TabbedPane.contentAreaColor"); g.setColor(bg); g.fillRect(x, y, w, h); } // Paint border. paintContentBorderTopEdge(g, tabPlacement, selectedIndex, x, y, w, h); paintContentBorderLeftEdge(g, tabPlacement, selectedIndex, x, y, w, h); paintContentBorderBottomEdge(g, tabPlacement, selectedIndex, x, y, w, h); paintContentBorderRightEdge(g, tabPlacement, selectedIndex, x, y, w, h); }
protected void paintContentBorder(Graphics g, int tabPlacement, int selectedIndex) { int width = tabPane.getWidth(); int height = tabPane.getHeight(); Insets insets = tabPane.getInsets(); // Calculate coordinates of content area. int x = insets.left; int y = insets.top; int w = width - insets.left - insets.right; int h = height - insets.top - insets.bottom; switch (tabPlacement) { case LEFT: x += calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth); w -= x - insets.left; break; case RIGHT: w -= calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth); break; case BOTTOM: h -= calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight); break; case TOP: default: y += calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight); h -= y - insets.top; } // Fill background if necessary. if (tabPane.isOpaque()) { Color bg = UIManager.getColor("TabbedPane.contentAreaColor"); g.setColor(bg); g.fillRect(x, y, w, h); } // Paint border. paintContentBorderTopEdge(g, tabPlacement, selectedIndex, x, y, w, h); paintContentBorderLeftEdge(g, tabPlacement, selectedIndex, x, y, w, h); paintContentBorderBottomEdge(g, tabPlacement, selectedIndex, x, y, w, h); paintContentBorderRightEdge(g, tabPlacement, selectedIndex, x, y, w, h); }
7,564
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[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } g.setColor(saved); }
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[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } g.setColor(saved); }
7,565
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[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } g.setColor(saved); }
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[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } g.setColor(saved); }
7,566
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[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } g.setColor(saved); }
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[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } g.setColor(saved); }
7,567
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[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } g.setColor(saved); }
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[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } g.setColor(saved); }
7,568
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[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } g.setColor(saved); }
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[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } g.setColor(saved); }
7,569
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[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } g.setColor(saved); }
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[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 2, x + w - 1, y + h - 2); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } g.setColor(saved); }
7,570
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[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } g.setColor(saved); }
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[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h - 1, x + w - 1, y + h - 1); } g.setColor(saved); }
7,571
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 endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; 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); } else g.drawLine(x, y, x, y + h); g.setColor(saved); }
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 endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; 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); } else g.drawLine(x, y, x, y + h); g.setColor(saved); }
7,573
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 endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; 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); } else g.drawLine(x, y, x, y + h); g.setColor(saved); }
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 endgap = rects[selectedIndex].y + rects[selectedIndex].height; if (tabPlacement == SwingConstants.LEFT && startgap >= 0) { g.drawLine(x, y, x, startgap); g.drawLine(x, endgap, x, y + h - 1); 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); } else g.drawLine(x, y, x, y + h); g.setColor(saved); }
7,574
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 endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; 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); } else g.drawLine(x, y, x, y + h); g.setColor(saved); }
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 endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; 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); } else g.drawLine(x, y, x, y + h); g.setColor(saved); }
7,575
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 endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; 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); } else g.drawLine(x, y, x, y + h); g.setColor(saved); }
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 endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; 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); } else g.drawLine(x, y, x, y + h - 1); g.setColor(selectedColor); g.drawLine(x + 1, y + 1, x + 1, y + h - 4); g.setColor(saved); }
7,576
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[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); } g.setColor(saved); }
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[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); } g.setColor(saved); }
7,577
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[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); } g.setColor(saved); }
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[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); } g.setColor(saved); }
7,578
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[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); } g.setColor(saved); }
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[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); } g.setColor(saved); }
7,579
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[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); } g.setColor(saved); }
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[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); } g.setColor(saved); }
7,580
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[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); } g.setColor(saved); }
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[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); } g.setColor(saved); }
7,581
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[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); } g.setColor(saved); }
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[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 2, y + 1, x + w - 2, y + h - 2); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); } g.setColor(saved); }
7,582
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[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); } g.setColor(saved); }
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[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); 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.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w - 1, y, x + w - 1, y + h - 2); } g.setColor(saved); }
7,583
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 endgap = rects[selectedIndex].x + rects[selectedIndex].width; int diff = 0; 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); } else g.drawLine(x, y, x + w, y); g.setColor(saved); }
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 endgap = rects[selectedIndex].x + rects[selectedIndex].width; int diff = 0; 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); } else g.drawLine(x, y, x + w, y); g.setColor(saved); }
7,585
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 endgap = rects[selectedIndex].x + rects[selectedIndex].width; int diff = 0; 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); } else g.drawLine(x, y, x + w, y); g.setColor(saved); }
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 endgap = rects[selectedIndex].x + rects[selectedIndex].width; if (tabPlacement == SwingConstants.TOP && startgap >= 0) { g.drawLine(x, y, startgap, y); g.drawLine(endgap, y, x + w - 1, y); 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); } else g.drawLine(x, y, x + w, y); g.setColor(saved); }
7,586
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 endgap = rects[selectedIndex].x + rects[selectedIndex].width; int diff = 0; 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); } else g.drawLine(x, y, x + w, y); g.setColor(saved); }
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 endgap = rects[selectedIndex].x + rects[selectedIndex].width; int diff = 0; 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); } else g.drawLine(x, y, x + w, y); g.setColor(saved); }
7,587
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 paint the outermost run first and then work our way in. int tabCount = tabPane.getTabCount(); for (int i = runCount - 1; i >= 0; --i) { int start = tabRuns[i]; int next; if (i == runCount - 1) next = tabRuns[0]; else next = tabRuns[i + 1]; int end = next != 0 ? next - 1 : tabCount - 1; for (int j = start; j <= end; ++j) { if (j != selectedIndex) { paintTab(g, tabPlacement, rects, j, ir, tr); } } } // Paint selected tab in front of every other tab. if (selectedIndex >= 0) paintTab(g, tabPlacement, rects, selectedIndex, ir, tr); }
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 paint the outermost run first and then work our way in. int tabCount = tabPane.getTabCount(); for (int i = runCount - 1; i >= 0; --i) { int start = tabRuns[i]; int next; if (i == runCount - 1) next = tabRuns[0]; else next = tabRuns[i + 1]; int end = next != 0 ? next - 1 : tabCount - 1; for (int j = start; j <= end; ++j) { if (j != selectedIndex) { paintTab(g, tabPlacement, rects, j, ir, tr); } } } // Paint selected tab in front of every other tab. if (selectedIndex >= 0) paintTab(g, tabPlacement, rects, selectedIndex, ir, tr); }
7,589
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 paint the outermost run first and then work our way in. int tabCount = tabPane.getTabCount(); for (int i = runCount - 1; i >= 0; --i) { int start = tabRuns[i]; int next; if (i == runCount - 1) next = tabRuns[0]; else next = tabRuns[i + 1]; int end = next != 0 ? next - 1 : tabCount - 1; for (int j = start; j <= end; ++j) { if (j != selectedIndex) { paintTab(g, tabPlacement, rects, j, ir, tr); } } } // Paint selected tab in front of every other tab. if (selectedIndex >= 0) paintTab(g, tabPlacement, rects, selectedIndex, ir, tr); }
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 paint the outermost run first and then work our way in. int tabCount = tabPane.getTabCount(); for (int i = runCount - 1; i >= 0; --i) { int start = tabRuns[i]; int next; if (i == runCount - 1) next = tabRuns[0]; else next = tabRuns[i + 1]; int end = next != 0 ? next - 1 : tabCount - 1; for (int j = start; j <= end; ++j) { if (j != selectedIndex) { paintTab(g, tabPlacement, rects, j, tempIconRect, tempTextRect); } } } // Paint selected tab in front of every other tab. if (selectedIndex >= 0) paintTab(g, tabPlacement, rects, selectedIndex, ir, tr); }
7,590
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 paint the outermost run first and then work our way in. int tabCount = tabPane.getTabCount(); for (int i = runCount - 1; i >= 0; --i) { int start = tabRuns[i]; int next; if (i == runCount - 1) next = tabRuns[0]; else next = tabRuns[i + 1]; int end = next != 0 ? next - 1 : tabCount - 1; for (int j = start; j <= end; ++j) { if (j != selectedIndex) { paintTab(g, tabPlacement, rects, j, ir, tr); } } } // Paint selected tab in front of every other tab. if (selectedIndex >= 0) paintTab(g, tabPlacement, rects, selectedIndex, ir, tr); }
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 paint the outermost run first and then work our way in. int tabCount = tabPane.getTabCount(); for (int i = runCount - 1; i >= 0; --i) { int start = tabRuns[i]; int next; if (i == runCount - 1) next = tabRuns[0]; else next = tabRuns[i + 1]; int end = next != 0 ? next - 1 : tabCount - 1; for (int j = start; j <= end; ++j) { if (j != selectedIndex) { paintTab(g, tabPlacement, rects, j, ir, tr); } } } // Paint selected tab in front of every other tab. if (selectedIndex >= 0) paintTab(g, tabPlacement, rects, selectedIndex, tempIconRect, tempTextRect); }
7,591
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 = tabPane.getBackgroundAt(tabIndex); if (bg == null) bg = Color.GRAY; g.setColor(bg); } g.fillRect(x, y, w, h); g.setColor(saved); }
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(selectedColor); else { Color bg = tabPane.getBackgroundAt(tabIndex); if (bg == null) bg = Color.GRAY; g.setColor(bg); } g.fillRect(x, y, w, h); g.setColor(saved); }
7,592
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 = tabPane.getBackgroundAt(tabIndex); if (bg == null) bg = Color.GRAY; g.setColor(bg); } g.fillRect(x, y, w, h); g.setColor(saved); }
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 = tabPane.getBackgroundAt(tabIndex); if (bg == null) bg = Color.LIGHT_GRAY; g.setColor(bg); } g.fillRect(x, y, w, h); g.setColor(saved); }
7,593
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 = tabPane.getBackgroundAt(tabIndex); if (bg == null) bg = Color.GRAY; g.setColor(bg); } g.fillRect(x, y, w, h); g.setColor(saved); }
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 = tabPane.getBackgroundAt(tabIndex); if (bg == null) bg = Color.GRAY; g.setColor(bg); } 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; } g.setColor(saved); }
7,594
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 + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); switch (tabPlacement) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
7,595
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 + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
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 + w - 2, y + 2, x + w - 2, y + h); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
7,596
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 + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
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 + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
7,597
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 + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
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 + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
7,598
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 + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
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 + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + 2, y + h - 1, x + w - 1, y + h - 1); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
7,599
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 + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
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 + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
7,600
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 + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
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 + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
7,601
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 + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
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 + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
7,602
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 + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
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 + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
7,603
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 + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
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 + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w - 3, y); g.setColor(darkShadow); g.drawLine(x + w - 2, y + 1, x + w - 1, y + 2); g.drawLine(x + w - 1, y + 3, x + w - 1, y + h - 3); g.drawLine(x + w - 2, y + h - 2, x + w - 3, y + h - 1); g.drawLine(x, y + h - 1, x + w - 4, y + h - 1); g.setColor(shadow); g.drawLine(x + w - 2, y + 2, x + w - 2, y + h - 3); g.drawLine(x, y + h - 2, x + w - 3, y + h - 2); break; } g.setColor(saved); }
7,604
protected void selectNextTab(int current) { tabPane.setSelectedIndex(getNextTabIndex(current)); }
protected void selectNextTab(int current) { current = getNextTabIndex(current); if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) scrollTab(current, tabPane.getTabPlacement()); tabPane.setSelectedIndex(current); }
7,607
protected void selectNextTabInRun(int current) { tabPane.setSelectedIndex(getNextTabIndexInRun(tabPane.getTabCount(), current)); }
protected void selectNextTabInRun(int current) { tabPane.setSelectedIndex(getNextTabIndexInRun(tabPane.getTabCount(), current)); }
7,608
protected void selectPreviousTab(int current) { tabPane.setSelectedIndex(getPreviousTabIndex(current)); }
protected void selectPreviousTab(int current) { current = getPreviousTabIndex(current); if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) scrollTab(current, tabPane.getTabPlacement()); tabPane.setSelectedIndex(current); }
7,609
protected void selectPreviousTabInRun(int current) { tabPane.setSelectedIndex(getPreviousTabIndexInRun(tabPane.getTabCount(), current)); }
protected void selectPreviousTabInRun(int current) { tabPane.setSelectedIndex(getPreviousTabIndexInRun(tabPane.getTabCount(), current)); }
7,610
public int tabForCoordinate(JTabbedPane pane, int x, int y) { if (! tabPane.isValid()) tabPane.validate(); int tabCount = tabPane.getTabCount(); int index = -1; for (int i = 0; i < tabCount; ++i) { if (rects[i].contains(x, y)) { index = i; break; } } // FIXME: Handle scrollable tab layout. return index; }
public int tabForCoordinate(JTabbedPane pane, int x, int y) { if (! tabPane.isValid()) tabPane.validate(); int tabCount = tabPane.getTabCount(); int index = tabPane.getSelectedIndex(); for (int i = 0; i < tabCount; ++i) { if (rects[i].contains(x, y)) { index = i; break; } } // FIXME: Handle scrollable tab layout. return index; }
7,611
protected void uninstallDefaults() { calcRect = null; tabAreaRect = null; contentRect = null; tabRuns = null; contentBorderInsets = null; tabAreaInsets = null; selectedTabPadInsets = null; tabInsets = null; focus = null; darkShadow = null; shadow = null; lightHighlight = null; highlight = null; // Install UI colors and fonts. LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font"); }
protected void uninstallDefaults() { calcRect = null; tabAreaRect = null; contentRect = null; tabRuns = null; contentBorderInsets = null; tabAreaInsets = null; selectedTabPadInsets = null; tabInsets = null; focus = null; darkShadow = null; shadow = null; lightHighlight = null; highlight = null; // Install UI colors and fonts. LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font"); }
7,613
protected void uninstallKeyboardActions() throws NotImplementedException { // FIXME: Implement. }
protected void uninstallKeyboardActions() { // FIXME: Implement. }
7,614
private void nestedToXDF(OutputStream outputstream, String indent, int which, int stop) { String delimiter = getDelimiter(); String repeatable = getRepeatable(); String recordTerminator = getRecordTerminator(); if (which > stop) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + classXDFNodeName); if (delimiter !=null) writeOut(outputstream, " delimiter =\"" + delimiter + "\""); writeOut(outputstream, " repeatable=\"" + repeatable + "\""); if (recordTerminator !=null) writeOut(outputstream, " recordTerminator=\"" + recordTerminator + "\"/>"); } else { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + UntaggedInstructionNodeName + " axisIdRef=\""); writeOut(outputstream, ((AxisInterface) parentArray.getAxisList().get(which)).getAxisId() + "\">"); which++; nestedToXDF(outputstream, indent + sPrettyXDFOutputIndentation, which, stop); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); } }
private void nestedToXDF(OutputStream outputstream, String indent, int which, int stop) { String delimiter = getDelimiter(); String repeatable = getRepeatable(); String recordTerminator = getRecordTerminator(); if (which > stop) { if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + classXDFNodeName); if (delimiter !=null) writeOut(outputstream, " delimiter =\"" + delimiter + "\""); writeOut(outputstream, " repeatable=\"" + repeatable + "\""); if (recordTerminator !=null) writeOut(outputstream, " recordTerminator=\"" + recordTerminator + "\"/>"); } else { if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + UntaggedInstructionNodeName + " axisIdRef=\""); writeOut(outputstream, ((AxisInterface) parentArray.getAxisList().get(which)).getAxisId() + "\">"); which++; nestedToXDF(outputstream, indent + sPrettyXDFOutputIndentation, which, stop); if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); } }
7,617
private void nestedToXDF(OutputStream outputstream, String indent, int which, int stop) { String delimiter = getDelimiter(); String repeatable = getRepeatable(); String recordTerminator = getRecordTerminator(); if (which > stop) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + classXDFNodeName); if (delimiter !=null) writeOut(outputstream, " delimiter =\"" + delimiter + "\""); writeOut(outputstream, " repeatable=\"" + repeatable + "\""); if (recordTerminator !=null) writeOut(outputstream, " recordTerminator=\"" + recordTerminator + "\"/>"); } else { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + UntaggedInstructionNodeName + " axisIdRef=\""); writeOut(outputstream, ((AxisInterface) parentArray.getAxisList().get(which)).getAxisId() + "\">"); which++; nestedToXDF(outputstream, indent + sPrettyXDFOutputIndentation, which, stop); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); } }
private void nestedToXDF(OutputStream outputstream, String indent, int which, int stop) { String delimiter = getDelimiter(); String repeatable = getRepeatable(); String recordTerminator = getRecordTerminator(); if (which > stop) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + classXDFNodeName); if (delimiter !=null) writeOut(outputstream, " delimiter =\"" + delimiter + "\""); writeOut(outputstream, " repeatable=\"" + repeatable + "\""); if (recordTerminator !=null) writeOut(outputstream, " recordTerminator=\"" + recordTerminator + "\"/>"); } else { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + UntaggedInstructionNodeName + " axisIdRef=\""); writeOut(outputstream, ((AxisInterface) parentArray.getAxisList().get(which)).getAxisId() + "\">"); which++; nestedToXDF(outputstream, indent + Specification.getInstance().getPrettyXDFOutputIndentation(), which, stop); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); } }
7,618
public void addSelectionInterval(int index0, int index1) { int lo = Math.min(index0, index1); int hi = Math.max(index0, index1); oldSel = sel.clone(); if (selectionMode == SINGLE_SELECTION) sel.clear(); // COMPAT: Like Sun (but not like IBM), we allow calls to // addSelectionInterval when selectionMode is // SINGLE_SELECTION_INTERVAL iff the interval being added // is adjacent to an already selected interval if (selectionMode == SINGLE_INTERVAL_SELECTION) if (!(isSelectedIndex(index0) || isSelectedIndex(index1) || isSelectedIndex(Math.max(lo-1,0)) || isSelectedIndex(Math.min(hi+1,sel.size())))) sel.clear(); if (selectionMode == SINGLE_SELECTION) index0 = index1; // We have to update the anchorSelectionIndex and leadSelectionIndex // variables // The next if statements breaks down to "if this selection is adjacent // to the previous selection and going in the same direction" if ((isSelectedIndex(leadSelectionIndex)) && ((index0 - 1 == leadSelectionIndex && (index1 >= index0) && (leadSelectionIndex >= anchorSelectionIndex)) || (index0 + 1 == leadSelectionIndex && (index1 <= index0) && (leadSelectionIndex <= anchorSelectionIndex))) && (anchorSelectionIndex != -1 || leadSelectionIndex != -1)) { // setting setLeadCalledFromAdd to true tells setLeadSelectionIndex // not to update oldSel setLeadCalledFromAdd = true; setLeadSelectionIndex(index1); setLeadCalledFromAdd = false; } else { leadSelectionIndex = index1; anchorSelectionIndex = index0; sel.set(lo, hi+1); if (sel.equals(oldSel) == false) fireValueChanged(lo, hi, valueIsAdjusting); } }
public void addSelectionInterval(int index0, int index1) { int lo = Math.min(index0, index1); int hi = Math.max(index0, index1); oldSel = sel.clone(); if (selectionMode == SINGLE_SELECTION) setSelectionInterval(index0, index1); // COMPAT: Like Sun (but not like IBM), we allow calls to // addSelectionInterval when selectionMode is // SINGLE_SELECTION_INTERVAL iff the interval being added // is adjacent to an already selected interval if (selectionMode == SINGLE_INTERVAL_SELECTION) if (!(isSelectedIndex(index0) || isSelectedIndex(index1) || isSelectedIndex(Math.max(lo-1,0)) || isSelectedIndex(Math.min(hi+1,sel.size())))) setSelectionInterval(index0, index1); if (selectionMode == SINGLE_SELECTION) index0 = index1; // We have to update the anchorSelectionIndex and leadSelectionIndex // variables // The next if statements breaks down to "if this selection is adjacent // to the previous selection and going in the same direction" if ((isSelectedIndex(leadSelectionIndex)) && ((index0 - 1 == leadSelectionIndex && (index1 >= index0) && (leadSelectionIndex >= anchorSelectionIndex)) || (index0 + 1 == leadSelectionIndex && (index1 <= index0) && (leadSelectionIndex <= anchorSelectionIndex))) && (anchorSelectionIndex != -1 || leadSelectionIndex != -1)) { // setting setLeadCalledFromAdd to true tells setLeadSelectionIndex // not to update oldSel setLeadCalledFromAdd = true; setLeadSelectionIndex(index1); setLeadCalledFromAdd = false; } else { leadSelectionIndex = index1; anchorSelectionIndex = index0; sel.set(lo, hi+1); if (sel.equals(oldSel) == false) fireValueChanged(lo, hi, valueIsAdjusting); } }
7,619
public void addSelectionInterval(int index0, int index1) { int lo = Math.min(index0, index1); int hi = Math.max(index0, index1); oldSel = sel.clone(); if (selectionMode == SINGLE_SELECTION) sel.clear(); // COMPAT: Like Sun (but not like IBM), we allow calls to // addSelectionInterval when selectionMode is // SINGLE_SELECTION_INTERVAL iff the interval being added // is adjacent to an already selected interval if (selectionMode == SINGLE_INTERVAL_SELECTION) if (!(isSelectedIndex(index0) || isSelectedIndex(index1) || isSelectedIndex(Math.max(lo-1,0)) || isSelectedIndex(Math.min(hi+1,sel.size())))) sel.clear(); if (selectionMode == SINGLE_SELECTION) index0 = index1; // We have to update the anchorSelectionIndex and leadSelectionIndex // variables // The next if statements breaks down to "if this selection is adjacent // to the previous selection and going in the same direction" if ((isSelectedIndex(leadSelectionIndex)) && ((index0 - 1 == leadSelectionIndex && (index1 >= index0) && (leadSelectionIndex >= anchorSelectionIndex)) || (index0 + 1 == leadSelectionIndex && (index1 <= index0) && (leadSelectionIndex <= anchorSelectionIndex))) && (anchorSelectionIndex != -1 || leadSelectionIndex != -1)) { // setting setLeadCalledFromAdd to true tells setLeadSelectionIndex // not to update oldSel setLeadCalledFromAdd = true; setLeadSelectionIndex(index1); setLeadCalledFromAdd = false; } else { leadSelectionIndex = index1; anchorSelectionIndex = index0; sel.set(lo, hi+1); if (sel.equals(oldSel) == false) fireValueChanged(lo, hi, valueIsAdjusting); } }
public void addSelectionInterval(int index0, int index1) { int lo = Math.min(index0, index1); int hi = Math.max(index0, index1); oldSel = sel.clone(); if (selectionMode == SINGLE_SELECTION) sel.clear(); // COMPAT: Like Sun (but not like IBM), we allow calls to // addSelectionInterval when selectionMode is // SINGLE_SELECTION_INTERVAL iff the interval being added // is adjacent to an already selected interval if (selectionMode == SINGLE_INTERVAL_SELECTION) if (!(isSelectedIndex(index0) || isSelectedIndex(index1) || isSelectedIndex(Math.max(lo-1,0)) || isSelectedIndex(Math.min(hi+1,sel.size())))) sel.clear(); if (selectionMode == SINGLE_SELECTION) index0 = index1; // We have to update the anchorSelectionIndex and leadSelectionIndex // variables // The next if statements breaks down to "if this selection is adjacent // to the previous selection and going in the same direction" if ((isSelectedIndex(leadSelectionIndex)) && ((index0 - 1 == leadSelectionIndex && (index1 >= index0) && (leadSelectionIndex >= anchorSelectionIndex)) || (index0 + 1 == leadSelectionIndex && (index1 <= index0) && (leadSelectionIndex <= anchorSelectionIndex))) && (anchorSelectionIndex != -1 || leadSelectionIndex != -1)) { // setting setLeadCalledFromAdd to true tells setLeadSelectionIndex // not to update oldSel setLeadCalledFromAdd = true; setLeadSelectionIndex(index1); setLeadCalledFromAdd = false; } else { leadSelectionIndex = index1; anchorSelectionIndex = index0; sel.set(lo, hi+1); if (sel.equals(oldSel) == false) fireValueChanged(lo, hi, valueIsAdjusting); } }
7,620
public void setRollover(boolean r) { // if this call does not represent a CHANGE in state, then return if ((r && isRollover()) || (!r && !isRollover())) return; // cannot set ROLLOVER property unless button is enabled if (!isEnabled()) return; // make the change if (r) stateMask = stateMask | ROLLOVER; else stateMask = stateMask & (~ROLLOVER); // notify interested ChangeListeners fireStateChanged(); }
public void setRollover(boolean r) { // if this call does not represent a CHANGE in state, then return if (r == isRollover()) return; // cannot set ROLLOVER property unless button is enabled if (!isEnabled()) return; // make the change if (r) stateMask = stateMask | ROLLOVER; else stateMask = stateMask & (~ROLLOVER); // notify interested ChangeListeners fireStateChanged(); }
7,622
public void setSelected(boolean s) { // if this call does not represent a CHANGE in state, then return if ((s && isSelected()) || (!s && !isSelected())) return; // make the change if (s) stateMask = stateMask | SELECTED; else stateMask = stateMask & (~SELECTED); // notify interested ChangeListeners fireStateChanged(); // fire ItemStateChanged events if (s) { fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, null, ItemEvent.SELECTED)); if (group != null) group.setSelected(this, true); } else { fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, null, ItemEvent.DESELECTED)); if (group != null) group.setSelected(this, false); } }
public void setSelected(boolean s) { // if this call does not represent a CHANGE in state, then return if ((s && isSelected()) || (!s && !isSelected())) return; // make the change if (s) stateMask = stateMask | SELECTED; else stateMask = stateMask & (~SELECTED); // notify interested ChangeListeners fireStateChanged(); // fire ItemStateChanged events if (s) { fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, this, ItemEvent.SELECTED)); if (group != null) group.setSelected(this, true); } else { fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, null, ItemEvent.DESELECTED)); if (group != null) group.setSelected(this, false); } }
7,623
public void setSelected(boolean s) { // if this call does not represent a CHANGE in state, then return if ((s && isSelected()) || (!s && !isSelected())) return; // make the change if (s) stateMask = stateMask | SELECTED; else stateMask = stateMask & (~SELECTED); // notify interested ChangeListeners fireStateChanged(); // fire ItemStateChanged events if (s) { fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, null, ItemEvent.SELECTED)); if (group != null) group.setSelected(this, true); } else { fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, null, ItemEvent.DESELECTED)); if (group != null) group.setSelected(this, false); } }
public void setSelected(boolean s) { // if this call does not represent a CHANGE in state, then return if ((s && isSelected()) || (!s && !isSelected())) return; // make the change if (s) stateMask = stateMask | SELECTED; else stateMask = stateMask & (~SELECTED); // notify interested ChangeListeners fireStateChanged(); // fire ItemStateChanged events if (s) { fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, null, ItemEvent.SELECTED)); if (group != null) group.setSelected(this, true); } else { fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, this, ItemEvent.DESELECTED)); if (group != null) group.setSelected(this, false); } }
7,624
protected DSSKey(BigInteger p, BigInteger q, BigInteger g) { super(); this.p = p; this.q = q; this.g = g; }
protected DSSKey(int defaultFormat, BigInteger p, BigInteger q, BigInteger g) { super(); this.p = p; this.q = q; this.g = g; }
7,625
public void update(Graphics g, JComponent c) { if (c.isOpaque() && UIManager.get("MenuBar.gradient") != null) { MetalUtils.paintGradient(g, 0, 0, c.getWidth(), c.getHeight(), SwingConstants.VERTICAL, "MenuBar.gradient"); paint(g, c); } else super.update(g, c); }
public void update(Graphics g, JComponent c) { int height = c.getHeight(); if (c.isOpaque() && UIManager.get("MenuBar.gradient") != null && c.getBackground() instanceof UIResource && height > 2) { MetalUtils.paintGradient(g, 0, 0, c.getWidth(), c.getHeight(), SwingConstants.VERTICAL, "MenuBar.gradient"); paint(g, c); } else super.update(g, c); }
7,627
public void update(Graphics g, JComponent c) { if (c.isOpaque() && UIManager.get("MenuBar.gradient") != null) { MetalUtils.paintGradient(g, 0, 0, c.getWidth(), c.getHeight(), SwingConstants.VERTICAL, "MenuBar.gradient"); paint(g, c); } else super.update(g, c); }
public void update(Graphics g, JComponent c) { if (c.isOpaque() && UIManager.get("MenuBar.gradient") != null) { MetalUtils.paintGradient(g, 0, 0, c.getWidth(), height - 2, SwingConstants.VERTICAL, "MenuBar.gradient"); paint(g, c); } else super.update(g, c); }
7,628
public GlobalConfigure() { if (_instance == null) { // initialize the settings information initialize(); // set our instance to this one. _instance = this; } }
public GlobalConfigure() { if (_instance == null) { // initialize the settings information initialize(); // set our instance to this one. _instance = this; } }
7,629
public void action (SaxDocumentHandler handler, char buf [], int offset, int len) { // IF we get here, we have the delmited case for populating // a value list. // 1. set up information we need // our string that we will parse String valueListString = new String (buf, offset, len); ValueList thisValueList = CurrentValueList; // safety check if (!thisValueList.getIsDelimitedCase() ) { String noWhiteSpaceList = valueListString.trim(); if (noWhiteSpaceList.length() > 0) Log.errorln("Got non-whitespace character data for algorithm valueList. Ignoring."); return; } // 2. reconsitute information we need String parentNodeName = thisValueList.getParentNodeName(); // 3. add these values to the lookup table, if the original valueList had an ID String valueListId = thisValueList.getValueListId(); if (valueListId != null) { // a warning check, just in case if (ValueListObj.containsKey(valueListId)) Log.warnln("More than one valueList node with valueListId=\""+valueListId+"\", using latest node." ); // add the valueList array into the list of valueList objects ValueListObj.put(valueListId, thisValueList); } // 4. If there is a reference object, clone it to get // the new valueList String valueListIdRef = thisValueList.getValueListIdRef(); if (valueListIdRef != null) { if (ValueListObj.containsKey(valueListIdRef)) { // Just a simple clone since we have stored the ArrayList rather than the // ValueList object (which actually doesnt exist. :P ValueList refValueListObj = (ValueList) ValueListObj.get(valueListIdRef); try { thisValueList = (ValueList) refValueListObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone valueList object. Aborting read."); System.exit(-1); }// This is missing. Should allow override. // later note to self: Huh?? /* // override attrs with those in passed list // strValueList.setAttributes(attrs); // give the clone a unique Id and remove IdRef // strValueList.setValueListId(findUniqueIdName(ValueListObj,strValueList.getValueListId())); // strValueList.setValueListIdRef(null); // add this into the list of valueList objects // ValueListObj.put(strValueList.getValueListId(), strValueList);*/ } else { Log.warnln("Error: Reader got an valueList with ValueListIdRef=\""+valueListIdRef+"\" but no previous valueList has that id! Ignoring add valueList request."); return; } } // 5. split up string into Value Objects based on declared delimiter ArrayList myValueList = splitStringIntoValueObjects( valueListString, thisValueList); // 6. determine where these values go and then insert them ValueListDelimitedList newValueListObj = new ValueListDelimitedList (myValueList, thisValueList.getDelimiter(), thisValueList.getNoData(), thisValueList.getInfinite(), thisValueList.getInfiniteNegative(), thisValueList.getNotANumber(), thisValueList.getOverflow(), thisValueList.getUnderflow() ); if( parentNodeName.equals(XDFNodeName.AXIS) ) { // get the last axis List axisList = (List) CurrentArray.getAxes(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); lastAxisObject.addAxisValueList(newValueListObj); } else if( parentNodeName.equals(XDFNodeName.PARAMETER) ) { LastParameterObject.addValueList( newValueListObj); } else { Log.errorln("Error: weird parent node "+parentNodeName+" for "+XDFNodeName.VALUELIST+", Ignoring."); } // now add valueObjects to groups Iterator iter = myValueList.iterator(); while (iter.hasNext()) { Value newvalue = (Value) iter.next(); // add this object to all open value groups Iterator groupIter = CurrentValueGroupList.iterator(); while (groupIter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) groupIter.next(); newvalue.addToGroup(nextValueGroupObj); } } CurrentValueList.setIsDelimitedCase(true); // notify that we did the list }
public void action (SaxDocumentHandler handler, char buf [], int offset, int len) { // IF we get here, we have the delmited case for populating // a value list. // 1. set up information we need // our string that we will parse String valueListString = new String (buf, offset, len); ValueList thisValueList = CurrentValueList; // safety check if (!thisValueList.getIsDelimitedCase() ) { String noWhiteSpaceList = valueListString.trim(); if (noWhiteSpaceList.length() > 0) Log.errorln("Got non-whitespace character data for algorithm valueList. Ignoring."); return; } // 2. reconsitute information we need String parentNodeName = thisValueList.getParentNodeName(); // 3. add these values to the lookup table, if the original valueList had an ID String valueListId = thisValueList.getValueListId(); if (valueListId != null) { // a warning check, just in case if (ValueListObj.containsKey(valueListId)) Log.warnln("More than one valueList node with valueListId=\""+valueListId+"\", using latest node." ); // add the valueList array into the list of valueList objects ValueListObj.put(valueListId, thisValueList); } // 4. If there is a reference object, clone it to get // the new valueList String valueListIdRef = thisValueList.getValueListIdRef(); if (valueListIdRef != null) { if (ValueListObj.containsKey(valueListIdRef)) { // Just a simple clone since we have stored the ArrayList rather than the // ValueList object (which actually doesnt exist. :P ValueList refValueListObj = (ValueList) ValueListObj.get(valueListIdRef); try { thisValueList = (ValueList) refValueListObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone valueList object. Aborting read."); System.exit(-1); }// This is missing. Should allow override. // later note to self: Huh?? /* // override attrs with those in passed list // strValueList.setAttributes(attrs); // give the clone a unique Id and remove IdRef // strValueList.setValueListId(findUniqueIdName(ValueListObj,strValueList.getValueListId())); // strValueList.setValueListIdRef(null); // add this into the list of valueList objects // ValueListObj.put(strValueList.getValueListId(), strValueList);*/ } else { Log.warnln("Error: Reader got an valueList with ValueListIdRef=\""+valueListIdRef+"\" but no previous valueList has that id! Ignoring add valueList request."); return; } } // 5. split up string into Value Objects based on declared delimiter ArrayList myValueList = splitStringIntoValueObjects( valueListString, thisValueList); // 6. determine where these values go and then insert them ValueListDelimitedList newValueListObj = new ValueListDelimitedList (myValueList, thisValueList.getDelimiter(), thisValueList.getNoData(), thisValueList.getInfinite(), thisValueList.getInfiniteNegative(), thisValueList.getNotANumber(), thisValueList.getOverflow(), thisValueList.getUnderflow() ); if( parentNodeName.equals(XDFNodeName.AXIS) ) { // get the last axis List axisList = (List) CurrentArray.getAxes(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); lastAxisObject.addAxisValueList(newValueListObj); } else if( parentNodeName.equals(XDFNodeName.PARAMETER) ) { LastParameterObject.addValueList( newValueListObj); } else { Log.errorln("Error: weird parent node "+parentNodeName+" for "+XDFNodeName.VALUELIST+", Ignoring."); } // now add valueObjects to groups Iterator iter = myValueList.iterator(); while (iter.hasNext()) { Value newvalue = (Value) iter.next(); // add this object to all open value groups Iterator groupIter = CurrentValueGroupList.iterator(); while (groupIter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) groupIter.next(); newvalue.addToGroup(nextValueGroupObj); } } CurrentValueList.setIsDelimitedCase(true); // notify that we did the list }
7,630
public Object action (SaxDocumentHandler handler, Attributes attrs) { // 1. re-init CurrentValueList = new ValueList(); // 2. populate ValueListparameters from attribute list CurrentValueList.init(attribListToHashtable(attrs)); // 3. populate ValueListparameters w/ parent name String parentNodeName = getParentNodeName(XDFNodeName.VALUEGROUP); CurrentValueList.setParentNodeName(parentNodeName); // 4. set this parameter to false to indicate the future is not // yet determined for this :) CurrentValueList.setIsDelimitedCase(false); return (Object) null; }
public Object action (SaxDocumentHandler handler, Attributes attrs) { // 1. re-init CurrentValueList = new ValueList(); // 2. populate ValueListparameters from attribute list Hashtable attribs = attribListToHashtable(attrs); CurrentValueList.init(attribs); // 3. populate ValueListparameters w/ parent name String parentNodeName = getParentNodeName(XDFNodeName.VALUEGROUP); CurrentValueList.setParentNodeName(parentNodeName); // 4. set this parameter to false to indicate the future is not // yet determined for this :) CurrentValueList.setIsDelimitedCase(false); return (Object) null; }
7,631
public Object action (SaxDocumentHandler handler, Attributes attrs) { // 1. re-init CurrentValueList = new ValueList(); // 2. populate ValueListparameters from attribute list CurrentValueList.init(attribListToHashtable(attrs)); // 3. populate ValueListparameters w/ parent name String parentNodeName = getParentNodeName(XDFNodeName.VALUEGROUP); CurrentValueList.setParentNodeName(parentNodeName); // 4. set this parameter to false to indicate the future is not // yet determined for this :) CurrentValueList.setIsDelimitedCase(false); return (Object) null; }
public Object action (SaxDocumentHandler handler, Attributes attrs) { // 1. re-init CurrentValueList = new ValueList(); // 2. populate ValueListparameters from attribute list CurrentValueList.init(attribListToHashtable(attrs)); // 3. populate ValueListparameters w/ parent name String parentNodeName = getParentNodeName(XDFNodeName.VALUEGROUP); CurrentValueList.setParentNodeName(parentNodeName); // 4. set this parameter to false to indicate the future is not // yet determined for this :) if (attribs.containsKey("size")) CurrentValueList.setIsDelimitedCase(false); else CurrentValueList.setIsDelimitedCase(true); return (Object) null; }
7,632
private void addByteDataToCurrentArray (Locator location, byte[] data, int amount, String endian) throws SetDataException { ArrayList commandList = (ArrayList) ((FormattedXMLDataIOStyle) CurrentArray.getXMLDataIOStyle()).getFormatCommands(); int nrofIOCmd = commandList.size(); int bytes_added = 0; while (bytes_added < amount) { FormattedIOCmd currentIOCmd = (FormattedIOCmd) commandList.get(CurrentIOCmdIndex); // readCell if (currentIOCmd instanceof ReadCellFormattedIOCmd) { DataFormat currentDataFormat = DataFormatList[CurrentDataFormatIndex]; int bytes_to_add = currentDataFormat.numOfBytes(); if ( currentDataFormat instanceof IntegerDataFormat || currentDataFormat instanceof FloatDataFormat ) { String thisData = new String(data,bytes_added,bytes_to_add);// Log.errorln("Got Href Formatted Number Data:["+thisData.trim()+ "]["+bytes_added+"]["+bytes_to_add+"]"); addDataToCurrentArray(location, thisData.trim(), currentDataFormat, IntRadix[CurrentDataFormatIndex]); } else if (currentDataFormat instanceof StringDataFormat) { String thisData = new String(data,bytes_added,bytes_to_add);// Log.errorln("Got Href Formatted Character Data:["+thisData+ "]["+bytes_added+"]["+bytes_to_add+"]"); addDataToCurrentArray(location, thisData, currentDataFormat, IntRadix[CurrentDataFormatIndex]); } else if (currentDataFormat instanceof BinaryFloatDataFormat) { if (bytes_to_add == 4) { float myValue = convert4bytesToFloat(endian, data, bytes_added);// Log.errorln("Got Href Data BFloatSingle:["+myValue.toString()+"]["+bytes_added+"]["+bytes_to_add+"]"); CurrentArray.setData(location, myValue); } else if (bytes_to_add == 8) { // Log.errorln("Got Href Data BFloatDouble:["+myValue.toString()+"]["+bytes_added+"]["+bytes_to_add+"]"); double myValue = convert8bytesToDouble(endian, data, bytes_added); CurrentArray.setData(location, myValue); } else { Log.errorln("Error: got floating point with bit size != (32|64). Ignoring data."); } } else if (currentDataFormat instanceof BinaryIntegerDataFormat) {// Integer myValue = convert2bytesToInteger (endian, data, bytes_added);// Log.errorln("Got Href Data Integer:["+myValue.toString()+ "]["+bytes_added+"]["+bytes_to_add+"]"); // int numOfBytes = ((BinaryIntegerDataFormat) currentDataFormat).numOfBytes(); int myValue = convertBytesToInteger (bytes_to_add, endian, data, bytes_added); CurrentArray.setData(location, myValue); } // advance the data pointer to next location location.next(); // advance our global pointer to the current DataFormat if (NrofDataFormats > 1) if (CurrentDataFormatIndex == (NrofDataFormats - 1)) CurrentDataFormatIndex = 0; else CurrentDataFormatIndex++; bytes_added += bytes_to_add; } else if (currentIOCmd instanceof SkipCharFormattedIOCmd) { Integer bytes_to_skip = ((SkipCharFormattedIOCmd) currentIOCmd).getCount(); bytes_added += bytes_to_skip.intValue(); } else if (currentIOCmd instanceof RepeatFormattedIOCmd) { // shouldnt happen Log.errorln("Argh getFormatCommands not working right, got repeat command in addByteData!!!"); System.exit(-1); } // advance our global pointer to the current IOCmd if (nrofIOCmd> 1) if (CurrentIOCmdIndex == (nrofIOCmd - 1)) CurrentIOCmdIndex = 0; else CurrentIOCmdIndex++; } }
private void addByteDataToCurrentArray (Locator location, byte[] data, int amount, String endian) throws SetDataException { ArrayList commandList = (ArrayList) ((FormattedXMLDataIOStyle) CurrentArray.getXMLDataIOStyle()).getFormatCommands(); int nrofIOCmd = commandList.size(); int bytes_added = 0; while (bytes_added < amount) { FormattedIOCmd currentIOCmd = (FormattedIOCmd) commandList.get(CurrentIOCmdIndex); // readCell if (currentIOCmd instanceof ReadCellFormattedIOCmd) { DataFormat currentDataFormat = DataFormatList[CurrentDataFormatIndex]; int bytes_to_add = currentDataFormat.numOfBytes(); if ( currentDataFormat instanceof IntegerDataFormat || currentDataFormat instanceof FloatDataFormat ) { String thisData = new String(data,bytes_added,bytes_to_add);// Log.errorln("Got Href Formatted Number Data:["+thisData.trim()+ "]["+bytes_added+"]["+bytes_to_add+"]"); addDataToCurrentArray(location, thisData.trim(), currentDataFormat, IntRadix[CurrentDataFormatIndex]); } else if (currentDataFormat instanceof StringDataFormat) { String thisData = new String(data,bytes_added,bytes_to_add);// Log.errorln("Got Href Formatted Character Data:["+thisData+ "]["+bytes_added+"]["+bytes_to_add+"]"); addDataToCurrentArray(location, thisData, currentDataFormat, IntRadix[CurrentDataFormatIndex]); } else if (currentDataFormat instanceof BinaryFloatDataFormat) { if (bytes_to_add == 4) { float myValue = convert4bytesToFloat(endian, data, bytes_added);// Log.errorln("Got Href Data BFloatSingle:["+myValue.toString()+"]["+bytes_added+"]["+bytes_to_add+"]"); CurrentArray.setData(location, myValue); } else if (bytes_to_add == 8) { // Log.errorln("Got Href Data BFloatDouble:["+myValue.toString()+"]["+bytes_added+"]["+bytes_to_add+"]"); double myValue = convert8bytesToDouble(endian, data, bytes_added); CurrentArray.setData(location, myValue); } else { Log.errorln("Error: got floating point with bit size != (32|64). Ignoring data."); } } else if (currentDataFormat instanceof BinaryIntegerDataFormat) {// Integer myValue = convert2bytesToInteger (endian, data, bytes_added);// Log.errorln("Got Href Data Integer:["+myValue.toString()+ "]["+bytes_added+"]["+bytes_to_add+"]"); // int numOfBytes = ((BinaryIntegerDataFormat) currentDataFormat).numOfBytes(); int myValue = convertBytesToInteger (bytes_to_add, endian, data, bytes_added); CurrentArray.setData(location, myValue); } // advance the data pointer to next location location.next(); // advance our global pointer to the current DataFormat if (NrofDataFormats > 1) if (CurrentDataFormatIndex == (NrofDataFormats - 1)) CurrentDataFormatIndex = 0; else CurrentDataFormatIndex++; bytes_added += bytes_to_add; } else if (currentIOCmd instanceof SkipCharFormattedIOCmd) { Integer bytes_to_skip = ((SkipCharFormattedIOCmd) currentIOCmd).getCount(); bytes_added += bytes_to_skip.intValue(); } else if (currentIOCmd instanceof RepeatFormattedIOCmd) { // shouldnt happen Log.errorln("Argh getFormatCommands not working right, got repeat command in addByteData!!!"); System.exit(-1); } // advance our global pointer to the current IOCmd if (nrofIOCmd> 1) if (CurrentIOCmdIndex == (nrofIOCmd - 1)) CurrentIOCmdIndex = 0; else CurrentIOCmdIndex++; } }
7,633
private int convertBytesToInteger (int numOfBytes, String endianStyle, byte[] bb, int sbyte) { // is it better to use a dispatch table here? switch (numOfBytes) { case 1: // 8-bit return convert1byteToInteger (bb, sbyte); case 2: // 16-bit return convert2bytesToInteger (endianStyle, bb, sbyte); case 3: // 24-bit (unusual) return convert3bytesToInteger (endianStyle, bb, sbyte); case 4: // 32-bit return convert4bytesToInteger (endianStyle, bb, sbyte); // This will most likely break the Java Integer. Lets not pretend // that we support it yet. Will have to contemplate BigInteger implementation for this. /* case 8: // 64-bit return convert8bytesToLong (endianStyle, bb, sbyte); break; */ default: Log.errorln("XDF Can't handle binary integers of byte size:"+numOfBytes+". Aborting!"); System.exit(-1); return -1; } }
private int convertBytesToInteger (int numOfBytes, String endianStyle, byte[] bb, int sbyte) { // is it better to use a dispatch table here? switch (numOfBytes) { case 1: // 8-bit return convert1byteToInt (bb, sbyte); case 2: // 16-bit return convert2bytesToInteger (endianStyle, bb, sbyte); case 3: // 24-bit (unusual) return convert3bytesToInteger (endianStyle, bb, sbyte); case 4: // 32-bit return convert4bytesToInteger (endianStyle, bb, sbyte); // This will most likely break the Java Integer. Lets not pretend // that we support it yet. Will have to contemplate BigInteger implementation for this. /* case 8: // 64-bit return convert8bytesToLong (endianStyle, bb, sbyte); break; */ default: Log.errorln("XDF Can't handle binary integers of byte size:"+numOfBytes+". Aborting!"); System.exit(-1); return -1; } }
7,635
private int convertBytesToInteger (int numOfBytes, String endianStyle, byte[] bb, int sbyte) { // is it better to use a dispatch table here? switch (numOfBytes) { case 1: // 8-bit return convert1byteToInteger (bb, sbyte); case 2: // 16-bit return convert2bytesToInteger (endianStyle, bb, sbyte); case 3: // 24-bit (unusual) return convert3bytesToInteger (endianStyle, bb, sbyte); case 4: // 32-bit return convert4bytesToInteger (endianStyle, bb, sbyte); // This will most likely break the Java Integer. Lets not pretend // that we support it yet. Will have to contemplate BigInteger implementation for this. /* case 8: // 64-bit return convert8bytesToLong (endianStyle, bb, sbyte); break; */ default: Log.errorln("XDF Can't handle binary integers of byte size:"+numOfBytes+". Aborting!"); System.exit(-1); return -1; } }
private int convertBytesToInteger (int numOfBytes, String endianStyle, byte[] bb, int sbyte) { // is it better to use a dispatch table here? switch (numOfBytes) { case 1: // 8-bit return convert1byteToInteger (bb, sbyte); case 2: // 16-bit return convert2bytesToInt (endianStyle, bb, sbyte); case 3: // 24-bit (unusual) return convert3bytesToInteger (endianStyle, bb, sbyte); case 4: // 32-bit return convert4bytesToInteger (endianStyle, bb, sbyte); // This will most likely break the Java Integer. Lets not pretend // that we support it yet. Will have to contemplate BigInteger implementation for this. /* case 8: // 64-bit return convert8bytesToLong (endianStyle, bb, sbyte); break; */ default: Log.errorln("XDF Can't handle binary integers of byte size:"+numOfBytes+". Aborting!"); System.exit(-1); return -1; } }
7,636
private int convertBytesToInteger (int numOfBytes, String endianStyle, byte[] bb, int sbyte) { // is it better to use a dispatch table here? switch (numOfBytes) { case 1: // 8-bit return convert1byteToInteger (bb, sbyte); case 2: // 16-bit return convert2bytesToInteger (endianStyle, bb, sbyte); case 3: // 24-bit (unusual) return convert3bytesToInteger (endianStyle, bb, sbyte); case 4: // 32-bit return convert4bytesToInteger (endianStyle, bb, sbyte); // This will most likely break the Java Integer. Lets not pretend // that we support it yet. Will have to contemplate BigInteger implementation for this. /* case 8: // 64-bit return convert8bytesToLong (endianStyle, bb, sbyte); break; */ default: Log.errorln("XDF Can't handle binary integers of byte size:"+numOfBytes+". Aborting!"); System.exit(-1); return -1; } }
private int convertBytesToInteger (int numOfBytes, String endianStyle, byte[] bb, int sbyte) { // is it better to use a dispatch table here? switch (numOfBytes) { case 1: // 8-bit return convert1byteToInteger (bb, sbyte); case 2: // 16-bit return convert2bytesToInteger (endianStyle, bb, sbyte); case 3: // 24-bit (unusual) return convert3bytesToInt (endianStyle, bb, sbyte); case 4: // 32-bit return convert4bytesToInteger (endianStyle, bb, sbyte); // This will most likely break the Java Integer. Lets not pretend // that we support it yet. Will have to contemplate BigInteger implementation for this. /* case 8: // 64-bit return convert8bytesToLong (endianStyle, bb, sbyte); break; */ default: Log.errorln("XDF Can't handle binary integers of byte size:"+numOfBytes+". Aborting!"); System.exit(-1); return -1; } }
7,637