rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
int spaceAllocated = spaceRemaining / numTabs; int currX = rects[start].x; for (int i = start; i <= end; i++) { rects[i].x = currX; rects[i].width += spaceAllocated; currX += rects[i].width; if (i == end && rects[i].x + rects[i].width != max) rects[i].width = max - rects[i].x; }
int spaceAllocated = spaceRemaining / numTabs; int currX = rects[start].x; for (int i = start; i <= end; i++) { rects[i].x = currX; rects[i].width += spaceAllocated; currX += rects[i].width; if (i == end && rects[i].x + rects[i].width != max) rects[i].width = max - rects[i].x; }
protected void padTabRun(int tabPlacement, int start, int end, int max) { if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int runWidth = rects[end].x + rects[end].width; int spaceRemaining = max - runWidth; int numTabs = end - start + 1; // now divvy up the space. int spaceAllocated = spaceRemaining / numTabs; int currX = rects[start].x; for (int i = start; i <= end; i++) { rects[i].x = currX; rects[i].width += spaceAllocated; currX += rects[i].width; // This is used because since the spaceAllocated // variable is an int, it rounds down. Sometimes, // we don't fill an entire row, so we make it do // so now. if (i == end && rects[i].x + rects[i].width != max) rects[i].width = max - rects[i].x; } } else { int runHeight = rects[end].y + rects[end].height; int spaceRemaining = max - runHeight; int numTabs = end - start + 1; int spaceAllocated = spaceRemaining / numTabs; int currY = rects[start].y; for (int i = start; i <= end; i++) { rects[i].y = currY; rects[i].height += spaceAllocated; currY += rects[i].height; if (i == end && rects[i].y + rects[i].height != max) rects[i].height = max - rects[i].y; } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
int runHeight = rects[end].y + rects[end].height; int spaceRemaining = max - runHeight; int numTabs = end - start + 1;
int runHeight = rects[end].y + rects[end].height; int spaceRemaining = max - runHeight; int numTabs = end - start + 1;
protected void padTabRun(int tabPlacement, int start, int end, int max) { if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int runWidth = rects[end].x + rects[end].width; int spaceRemaining = max - runWidth; int numTabs = end - start + 1; // now divvy up the space. int spaceAllocated = spaceRemaining / numTabs; int currX = rects[start].x; for (int i = start; i <= end; i++) { rects[i].x = currX; rects[i].width += spaceAllocated; currX += rects[i].width; // This is used because since the spaceAllocated // variable is an int, it rounds down. Sometimes, // we don't fill an entire row, so we make it do // so now. if (i == end && rects[i].x + rects[i].width != max) rects[i].width = max - rects[i].x; } } else { int runHeight = rects[end].y + rects[end].height; int spaceRemaining = max - runHeight; int numTabs = end - start + 1; int spaceAllocated = spaceRemaining / numTabs; int currY = rects[start].y; for (int i = start; i <= end; i++) { rects[i].y = currY; rects[i].height += spaceAllocated; currY += rects[i].height; if (i == end && rects[i].y + rects[i].height != max) rects[i].height = max - rects[i].y; } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
int spaceAllocated = spaceRemaining / numTabs; int currY = rects[start].y; for (int i = start; i <= end; i++) { rects[i].y = currY; rects[i].height += spaceAllocated; currY += rects[i].height; if (i == end && rects[i].y + rects[i].height != max) rects[i].height = max - rects[i].y; }
int spaceAllocated = spaceRemaining / numTabs; int currY = rects[start].y; for (int i = start; i <= end; i++) { rects[i].y = currY; rects[i].height += spaceAllocated; currY += rects[i].height; if (i == end && rects[i].y + rects[i].height != max) rects[i].height = max - rects[i].y; }
protected void padTabRun(int tabPlacement, int start, int end, int max) { if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int runWidth = rects[end].x + rects[end].width; int spaceRemaining = max - runWidth; int numTabs = end - start + 1; // now divvy up the space. int spaceAllocated = spaceRemaining / numTabs; int currX = rects[start].x; for (int i = start; i <= end; i++) { rects[i].x = currX; rects[i].width += spaceAllocated; currX += rects[i].width; // This is used because since the spaceAllocated // variable is an int, it rounds down. Sometimes, // we don't fill an entire row, so we make it do // so now. if (i == end && rects[i].x + rects[i].width != max) rects[i].width = max - rects[i].x; } } else { int runHeight = rects[end].y + rects[end].height; int spaceRemaining = max - runHeight; int numTabs = end - start + 1; int spaceAllocated = spaceRemaining / numTabs; int currY = rects[start].y; for (int i = start; i <= end; i++) { rects[i].y = currY; rects[i].height += spaceAllocated; currY += rects[i].height; if (i == end && rects[i].y + rects[i].height != max) rects[i].height = max - rects[i].y; } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
return calculateTabAreaHeight(tabPlacement, 0, 0);
return calculateTabAreaHeight(tabPlacement, 0, 0);
protected int preferredTabAreaHeight(int tabPlacement, int width) { if (tabPane.getTabCount() == 0) return calculateTabAreaHeight(tabPlacement, 0, 0); int runs = 0; int runWidth = 0; int tabWidth = 0; FontMetrics fm = getFontMetrics(); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); // Only interested in width, this is a messed up rectangle now. width -= tabAreaInsets.left + tabAreaInsets.right + insets.left + insets.right; // The reason why we can't use runCount: // This method is only called to calculate the size request // for the tabbedPane. However, this size request is dependent on // our desired width. We need to find out what the height would // be IF we got our desired width. for (int i = 0; i < tabPane.getTabCount(); i++) { tabWidth = calculateTabWidth(tabPlacement, i, fm); if (runWidth + tabWidth > width) { runWidth = tabWidth; runs++; } else runWidth += tabWidth; } runs++; int maxTabHeight = calculateMaxTabHeight(tabPlacement); int tabAreaHeight = calculateTabAreaHeight(tabPlacement, runs, maxTabHeight); return tabAreaHeight; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
tabWidth = calculateTabWidth(tabPlacement, i, fm); if (runWidth + tabWidth > width) { runWidth = tabWidth; runs++; } else runWidth += tabWidth;
tabWidth = calculateTabWidth(tabPlacement, i, fm); if (runWidth + tabWidth > width) { runWidth = tabWidth; runs++; } else runWidth += tabWidth;
protected int preferredTabAreaHeight(int tabPlacement, int width) { if (tabPane.getTabCount() == 0) return calculateTabAreaHeight(tabPlacement, 0, 0); int runs = 0; int runWidth = 0; int tabWidth = 0; FontMetrics fm = getFontMetrics(); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); // Only interested in width, this is a messed up rectangle now. width -= tabAreaInsets.left + tabAreaInsets.right + insets.left + insets.right; // The reason why we can't use runCount: // This method is only called to calculate the size request // for the tabbedPane. However, this size request is dependent on // our desired width. We need to find out what the height would // be IF we got our desired width. for (int i = 0; i < tabPane.getTabCount(); i++) { tabWidth = calculateTabWidth(tabPlacement, i, fm); if (runWidth + tabWidth > width) { runWidth = tabWidth; runs++; } else runWidth += tabWidth; } runs++; int maxTabHeight = calculateMaxTabHeight(tabPlacement); int tabAreaHeight = calculateTabAreaHeight(tabPlacement, runs, maxTabHeight); return tabAreaHeight; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
return calculateTabAreaHeight(tabPlacement, 0, 0);
return calculateTabAreaHeight(tabPlacement, 0, 0);
protected int preferredTabAreaWidth(int tabPlacement, int height) { if (tabPane.getTabCount() == 0) return calculateTabAreaHeight(tabPlacement, 0, 0); int runs = 0; int runHeight = 0; int tabHeight = 0; FontMetrics fm = getFontMetrics(); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); height -= tabAreaInsets.top + tabAreaInsets.bottom + insets.top + insets.bottom; int fontHeight = fm.getHeight(); for (int i = 0; i < tabPane.getTabCount(); i++) { tabHeight = calculateTabHeight(tabPlacement, i, fontHeight); if (runHeight + tabHeight > height) { runHeight = tabHeight; runs++; } else runHeight += tabHeight; } runs++; int maxTabWidth = calculateMaxTabWidth(tabPlacement); int tabAreaWidth = calculateTabAreaWidth(tabPlacement, runs, maxTabWidth); return tabAreaWidth; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
tabHeight = calculateTabHeight(tabPlacement, i, fontHeight); if (runHeight + tabHeight > height) { runHeight = tabHeight; runs++; } else runHeight += tabHeight;
tabHeight = calculateTabHeight(tabPlacement, i, fontHeight); if (runHeight + tabHeight > height) { runHeight = tabHeight; runs++; } else runHeight += tabHeight;
protected int preferredTabAreaWidth(int tabPlacement, int height) { if (tabPane.getTabCount() == 0) return calculateTabAreaHeight(tabPlacement, 0, 0); int runs = 0; int runHeight = 0; int tabHeight = 0; FontMetrics fm = getFontMetrics(); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); height -= tabAreaInsets.top + tabAreaInsets.bottom + insets.top + insets.bottom; int fontHeight = fm.getHeight(); for (int i = 0; i < tabPane.getTabCount(); i++) { tabHeight = calculateTabHeight(tabPlacement, i, fontHeight); if (runHeight + tabHeight > height) { runHeight = tabHeight; runs++; } else runHeight += tabHeight; } runs++; int maxTabWidth = calculateMaxTabWidth(tabPlacement); int tabAreaWidth = calculateTabAreaWidth(tabPlacement, runs, maxTabWidth); return tabAreaWidth; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
return;
return;
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; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
newTabRuns[i] = tabRuns[currentRun]; currentRun = getNextTabRun(currentRun); i++;
newTabRuns[i] = tabRuns[currentRun]; currentRun = getNextTabRun(currentRun); i++;
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; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
newTabRuns[0] = tabRuns[currentRun];
newTabRuns[0] = tabRuns[currentRun];
protected void rotateTabRuns(int tabPlacement, int selectedRun) { if (runCount == 1 || selectedRun == 1 || selectedRun == -1) return; int[] newTabRuns = new int[tabRuns.length]; int currentRun = selectedRun; int i = 1; do { newTabRuns[i] = tabRuns[currentRun]; currentRun = getNextTabRun(currentRun); i++; } while (i < runCount); if (runCount > 1) newTabRuns[0] = tabRuns[currentRun]; tabRuns = newTabRuns; BasicTabbedPaneUI.this.selectedRun = 1; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
return;
return;
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; assureRectsCreated(tabCount); FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int max = 0; 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; max = calcRect.width + tabAreaInsets.left + insets.left; 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; max = calcRect.height + tabAreaInsets.top; 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; padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; max = calcRect.width + tabAreaInsets.left + insets.left; 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);
int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; max = calcRect.width + tabAreaInsets.left + insets.left; 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);
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; assureRectsCreated(tabCount); FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int max = 0; 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; max = calcRect.width + tabAreaInsets.left + insets.left; 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; max = calcRect.height + tabAreaInsets.top; 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; padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
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; }
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; }
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; assureRectsCreated(tabCount); FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int max = 0; 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; max = calcRect.width + tabAreaInsets.left + insets.left; 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; max = calcRect.height + tabAreaInsets.top; 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; padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
int maxWidth = calculateMaxTabWidth(tabPlacement);
int maxWidth = calculateMaxTabWidth(tabPlacement);
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; assureRectsCreated(tabCount); FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int max = 0; 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; max = calcRect.width + tabAreaInsets.left + insets.left; 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; max = calcRect.height + tabAreaInsets.top; 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; padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; max = calcRect.height + tabAreaInsets.top; 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; }
calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; max = calcRect.height + tabAreaInsets.top; 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; }
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; assureRectsCreated(tabCount); FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int max = 0; 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; max = calcRect.width + tabAreaInsets.left + insets.left; 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; max = calcRect.height + tabAreaInsets.top; 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; padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
return;
return;
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.hide(); decrButton.hide(); 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.show(); decrButton.show(); } } 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.show(); decrButton.show(); } } 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(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize();
if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize();
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.hide(); decrButton.hide(); 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.show(); decrButton.show(); } } 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.show(); decrButton.show(); } } 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(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
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);
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);
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.hide(); decrButton.hide(); 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.show(); decrButton.show(); } } 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.show(); decrButton.show(); } } 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(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.show(); decrButton.show(); }
tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.show(); decrButton.show(); }
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.hide(); decrButton.hide(); 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.show(); decrButton.show(); } } 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.show(); decrButton.show(); } } 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(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize();
if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize();
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.hide(); decrButton.hide(); 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.show(); decrButton.show(); } } 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.show(); decrButton.show(); } } 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(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
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);
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);
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.hide(); decrButton.hide(); 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.show(); decrButton.show(); } } 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.show(); decrButton.show(); } } 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(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.show(); decrButton.show(); }
tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.show(); decrButton.show(); }
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.hide(); decrButton.hide(); 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.show(); decrButton.show(); } } 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.show(); decrButton.show(); } } 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(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
int w = Math.max(rects[tabC].width + rects[tabC].x, tabAreaRect.width); int h = Math.max(rects[tabC].height, tabAreaRect.height); p = findPointForIndex(currentScrollLocation); panel.setSize(w + p.x, h + p.y);
int w = Math.max(rects[tabC].width + rects[tabC].x, tabAreaRect.width); int h = Math.max(rects[tabC].height, tabAreaRect.height); p = findPointForIndex(currentScrollLocation); panel.setSize(w + p.x, h + p.y);
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.hide(); decrButton.hide(); 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.show(); decrButton.show(); } } 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.show(); decrButton.show(); } } 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(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
return calculateTabAreaHeight(tabPlacement, 0, 0);
return calculateTabAreaHeight(tabPlacement, 0, 0);
protected int preferredTabAreaHeight(int tabPlacement, int width) { if (tabPane.getTabCount() == 0) return calculateTabAreaHeight(tabPlacement, 0, 0); int runs = 1; int maxTabHeight = calculateMaxTabHeight(tabPlacement); int tabAreaHeight = calculateTabAreaHeight(tabPlacement, runs, maxTabHeight); return tabAreaHeight; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
return calculateTabAreaHeight(tabPlacement, 0, 0);
return calculateTabAreaHeight(tabPlacement, 0, 0);
protected int preferredTabAreaWidth(int tabPlacement, int height) { if (tabPane.getTabCount() == 0) return calculateTabAreaHeight(tabPlacement, 0, 0); int runs = 1; int maxTabWidth = calculateMaxTabWidth(tabPlacement); int tabAreaWidth = calculateTabAreaWidth(tabPlacement, runs, maxTabWidth); return tabAreaWidth; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
int numToCopy = Math.min(tabCount, rects.length); Rectangle[] tmp = new Rectangle[tabCount]; System.arraycopy(rects, 0, tmp, 0, numToCopy); rects = tmp;
int numToCopy = Math.min(tabCount, rects.length); Rectangle[] tmp = new Rectangle[tabCount]; System.arraycopy(rects, 0, tmp, 0, numToCopy); rects = tmp;
protected void assureRectsCreated(int tabCount) { if (rects == null) rects = new Rectangle[tabCount]; if (tabCount == rects.length) return; else { int numToCopy = Math.min(tabCount, rects.length); Rectangle[] tmp = new Rectangle[tabCount]; System.arraycopy(rects, 0, tmp, 0, numToCopy); rects = tmp; } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
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()); calcRect = tr.union(ir);
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()); height = tr.union(ir).height;
protected int calculateTabHeight(int tabPlacement, int tabIndex, int fontHeight) { Icon icon = getIconForTab(tabIndex); Insets insets = getTabInsets(tabPlacement, tabIndex); 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()); calcRect = tr.union(ir); } else calcRect.height = fontHeight; calcRect.height += insets.top + insets.bottom; return calcRect.height; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
calcRect.height = fontHeight;
height = fontHeight;
protected int calculateTabHeight(int tabPlacement, int tabIndex, int fontHeight) { Icon icon = getIconForTab(tabIndex); Insets insets = getTabInsets(tabPlacement, tabIndex); 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()); calcRect = tr.union(ir); } else calcRect.height = fontHeight; calcRect.height += insets.top + insets.bottom; return calcRect.height; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
calcRect.height += insets.top + insets.bottom; return calcRect.height;
height += insets.top + insets.bottom; return height;
protected int calculateTabHeight(int tabPlacement, int tabIndex, int fontHeight) { Icon icon = getIconForTab(tabIndex); Insets insets = getTabInsets(tabPlacement, tabIndex); 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()); calcRect = tr.union(ir); } else calcRect.height = fontHeight; calcRect.height += insets.top + insets.bottom; return calcRect.height; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
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()); calcRect = tr.union(ir);
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;
protected int calculateTabWidth(int tabPlacement, int tabIndex, FontMetrics metrics) { Icon icon = getIconForTab(tabIndex); Insets insets = getTabInsets(tabPlacement, tabIndex); 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()); calcRect = tr.union(ir); } else calcRect.width = metrics.stringWidth(tabPane.getTitleAt(tabIndex)); calcRect.width += insets.left + insets.right; return calcRect.width; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
calcRect.width = metrics.stringWidth(tabPane.getTitleAt(tabIndex));
width = metrics.stringWidth(tabPane.getTitleAt(tabIndex));
protected int calculateTabWidth(int tabPlacement, int tabIndex, FontMetrics metrics) { Icon icon = getIconForTab(tabIndex); Insets insets = getTabInsets(tabPlacement, tabIndex); 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()); calcRect = tr.union(ir); } else calcRect.width = metrics.stringWidth(tabPane.getTitleAt(tabIndex)); calcRect.width += insets.left + insets.right; return calcRect.width; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
calcRect.width += insets.left + insets.right; return calcRect.width;
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); 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()); calcRect = tr.union(ir); } else calcRect.width = metrics.stringWidth(tabPane.getTitleAt(tabIndex)); calcRect.width += insets.left + insets.right; return calcRect.width; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
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);
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);
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(); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
return new TabbedPaneScrollLayout();
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(); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
int[] newRuns = new int[tabRuns.length + 10]; System.arraycopy(tabRuns, 0, newRuns, 0, tabRuns.length); tabRuns = newRuns;
int[] newRuns = new int[tabRuns.length + 10]; System.arraycopy(tabRuns, 0, newRuns, 0, tabRuns.length); tabRuns = newRuns;
protected void expandTabRunsArray() { // This method adds another 10 index positions to the tabRuns array. if (tabRuns == null) tabRuns = new int[10]; else { int[] newRuns = new int[tabRuns.length + 10]; System.arraycopy(tabRuns, 0, newRuns, 0, tabRuns.length); tabRuns = newRuns; } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
if (index > 0) { w += rects[index - 1].x + rects[index - 1].width; if (index > selectedIndex) w -= insets.left + insets.right; }
if (index > 0) { w += rects[index - 1].x + rects[index - 1].width; if (index > selectedIndex) w -= insets.left + insets.right; }
Point findPointForIndex(int index) { int tabPlacement = tabPane.getTabPlacement(); int selectedIndex = tabPane.getSelectedIndex(); Insets insets = getSelectedTabPadInsets(tabPlacement); int w = 0; int h = 0; if (tabPlacement == TOP || tabPlacement == BOTTOM) { if (index > 0) { w += rects[index - 1].x + rects[index - 1].width; if (index > selectedIndex) w -= insets.left + insets.right; } } else { if (index > 0) { h += rects[index - 1].y + rects[index - 1].height; if (index > selectedIndex) h -= insets.top + insets.bottom; } } Point p = new Point(w, h); return p; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
if (index > 0) { h += rects[index - 1].y + rects[index - 1].height; if (index > selectedIndex) h -= insets.top + insets.bottom; }
if (index > 0) { h += rects[index - 1].y + rects[index - 1].height; if (index > selectedIndex) h -= insets.top + insets.bottom; }
Point findPointForIndex(int index) { int tabPlacement = tabPane.getTabPlacement(); int selectedIndex = tabPane.getSelectedIndex(); Insets insets = getSelectedTabPadInsets(tabPlacement); int w = 0; int h = 0; if (tabPlacement == TOP || tabPlacement == BOTTOM) { if (index > 0) { w += rects[index - 1].x + rects[index - 1].width; if (index > selectedIndex) w -= insets.left + insets.right; } } else { if (index > 0) { h += rects[index - 1].y + rects[index - 1].height; if (index > selectedIndex) h -= insets.top + insets.bottom; } } Point p = new Point(w, h); return p; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
int first = lastTabInRun(tabCount, getPreviousTabRun(i)) + 1; if (first == tabCount) first = 0; int last = lastTabInRun(tabCount, i); if (last >= tabIndex && first <= tabIndex) return 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;
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; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
protected Rectangle getTabBounds(int tabIndex, Rectangle dest)
public Rectangle getTabBounds(JTabbedPane pane, int i)
protected Rectangle getTabBounds(int tabIndex, Rectangle dest) { dest.setBounds(getTabBounds(tabPane, tabIndex)); return dest; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
dest.setBounds(getTabBounds(tabPane, tabIndex)); return dest;
return rects[i];
protected Rectangle getTabBounds(int tabIndex, Rectangle dest) { dest.setBounds(getTabBounds(tabPane, tabIndex)); return dest; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
tabPane = (JTabbedPane) c; installComponents(); installDefaults(); installListeners(); installKeyboardActions(); layoutManager = createLayoutManager(); tabPane.setLayout(layoutManager); tabPane.layout();
tabPane = (JTabbedPane) c; installComponents(); installDefaults(); installListeners(); installKeyboardActions(); layoutManager = createLayoutManager(); tabPane.setLayout(layoutManager); tabPane.layout();
public void installUI(JComponent c) { super.installUI(c); if (c instanceof JTabbedPane) { tabPane = (JTabbedPane) c; installComponents(); installDefaults(); installListeners(); installKeyboardActions(); layoutManager = createLayoutManager(); tabPane.setLayout(layoutManager); tabPane.layout(); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
if (direction == SwingConstants.WEST) selectPreviousTabInRun(tabPane.getSelectedIndex()); else if (direction == SwingConstants.EAST) selectNextTabInRun(tabPane.getSelectedIndex());
if (direction == SwingConstants.WEST) selectPreviousTabInRun(tabPane.getSelectedIndex()); else if (direction == SwingConstants.EAST) selectNextTabInRun(tabPane.getSelectedIndex());
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); } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
else { int offset = getTabRunOffset(tabPlacement, tabPane.getTabCount(), tabPane.getSelectedIndex(), (tabPlacement == SwingConstants.RIGHT) ? true : false); selectAdjacentRunTab(tabPlacement, tabPane.getSelectedIndex(), offset); }
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); } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
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); }
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); } } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; }
if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; }
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].x; int endgap = rects[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); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
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(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);
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); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
g.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h);
g.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h);
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); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
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(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);
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); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; }
if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; }
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); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
g.drawLine(x, y, x, startgap - diff); g.drawLine(x, endgap - diff, x, y + h);
g.drawLine(x, y, x, startgap - diff); g.drawLine(x, endgap - diff, x, y + h);
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); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; }
if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; }
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].y; int endgap = rects[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); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
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(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);
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); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
g.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h);
g.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h);
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); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
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(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);
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); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; }
if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; }
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); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
g.drawLine(x, y, startgap - diff, y); g.drawLine(endgap - diff, y, x + w, y);
g.drawLine(x, y, startgap - diff, y); g.drawLine(endgap - diff, y, x + w, y);
protected void paintContentBorderTopEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); g.setColor(lightHighlight); int startgap = rects[selectedIndex].x; int 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); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
Insets insets = getTabAreaInsets(tabPlacement); switch (tabPlacement) { case TOP: h += insets.bottom; break; case LEFT: w += insets.right; break; case BOTTOM: y -= insets.top; h += insets.top; break; case RIGHT: x -= insets.left; w += insets.left; break; }
Insets insets = getTabAreaInsets(tabPlacement); switch (tabPlacement) { case TOP: h += insets.bottom; break; case LEFT: w += insets.right; break; case BOTTOM: y -= insets.top; h += insets.top; break; case RIGHT: x -= insets.left; w += insets.left; break; }
protected void paintTab(Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect) { FontMetrics fm = getFontMetrics(); Icon icon = getIconForTab(tabIndex); String title = tabPane.getTitleAt(tabIndex); boolean isSelected = tabIndex == tabPane.getSelectedIndex(); calcRect = getTabBounds(tabPane, tabIndex); int x = calcRect.x; int y = calcRect.y; int w = calcRect.width; int h = calcRect.height; if (getRunForTab(tabPane.getTabCount(), tabIndex) == 1) { Insets insets = getTabAreaInsets(tabPlacement); switch (tabPlacement) { case TOP: h += insets.bottom; break; case LEFT: w += insets.right; break; case BOTTOM: y -= insets.top; h += insets.top; break; case RIGHT: x -= insets.left; w += insets.left; break; } } layoutLabel(tabPlacement, fm, tabIndex, title, icon, calcRect, iconRect, textRect, isSelected); paintTabBackground(g, tabPlacement, tabIndex, x, y, w, h, isSelected); paintTabBorder(g, tabPlacement, tabIndex, x, y, w, h, isSelected); // FIXME: Paint little folding corner and jagged edge clipped tab. if (icon != null) paintIcon(g, tabPlacement, tabIndex, icon, iconRect, isSelected); if (title != null && ! title.equals("")) paintText(g, tabPlacement, tabPane.getFont(), fm, tabIndex, title, textRect, isSelected); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
int first = lastTabInRun(tabCount, getPreviousTabRun(currRun)) + 1; if (isScroll) first = currentScrollLocation; else if (first == tabCount) first = 0; int last = lastTabInRun(tabCount, currRun); if (isScroll) { for (int k = first; k < tabCount; k++) { if (rects[k].x + rects[k].width - rects[first].x > viewport .getWidth()) { last = k; break; } } }
int first = lastTabInRun(tabCount, getPreviousTabRun(currRun)) + 1; if (isScroll) first = currentScrollLocation; else if (first == tabCount) first = 0; int last = lastTabInRun(tabCount, currRun); if (isScroll) { for (int k = first; k < tabCount; k++) { if (rects[k].x + rects[k].width - rects[first].x > viewport .getWidth()) { last = k; break; } } }
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(); int currRun = 1; if (tabCount < 1) return; if (runCount > 1) currRun = 0; for (int i = 0; i < runCount; i++) { int first = lastTabInRun(tabCount, getPreviousTabRun(currRun)) + 1; if (isScroll) first = currentScrollLocation; else if (first == tabCount) first = 0; int last = lastTabInRun(tabCount, currRun); if (isScroll) { for (int k = first; k < tabCount; k++) { if (rects[k].x + rects[k].width - rects[first].x > viewport .getWidth()) { last = k; break; } } } for (int j = first; j <= last; j++) { if (j != selectedIndex || isScroll) paintTab(g, tabPlacement, rects, j, ir, tr); } currRun = getPreviousTabRun(currRun); } if (! isScroll) paintTab(g, tabPlacement, rects, selectedIndex, ir, tr); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
for (int j = first; j <= last; j++) { if (j != selectedIndex || isScroll) paintTab(g, tabPlacement, rects, j, ir, tr); } currRun = getPreviousTabRun(currRun);
for (int j = first; j <= last; j++) { if (j != selectedIndex || isScroll) paintTab(g, tabPlacement, rects, j, ir, tr); } currRun = getPreviousTabRun(currRun);
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(); int currRun = 1; if (tabCount < 1) return; if (runCount > 1) currRun = 0; for (int i = 0; i < runCount; i++) { int first = lastTabInRun(tabCount, getPreviousTabRun(currRun)) + 1; if (isScroll) first = currentScrollLocation; else if (first == tabCount) first = 0; int last = lastTabInRun(tabCount, currRun); if (isScroll) { for (int k = first; k < tabCount; k++) { if (rects[k].x + rects[k].width - rects[first].x > viewport .getWidth()) { last = k; break; } } } for (int j = first; j <= last; j++) { if (j != selectedIndex || isScroll) paintTab(g, tabPlacement, rects, j, ir, tr); } currRun = getPreviousTabRun(currRun); } if (! isScroll) paintTab(g, tabPlacement, rects, selectedIndex, ir, tr); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
paintTab(g, tabPlacement, rects, selectedIndex, ir, tr);
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(); int currRun = 1; if (tabCount < 1) return; if (runCount > 1) currRun = 0; for (int i = 0; i < runCount; i++) { int first = lastTabInRun(tabCount, getPreviousTabRun(currRun)) + 1; if (isScroll) first = currentScrollLocation; else if (first == tabCount) first = 0; int last = lastTabInRun(tabCount, currRun); if (isScroll) { for (int k = first; k < tabCount; k++) { if (rects[k].x + rects[k].width - rects[first].x > viewport .getWidth()) { last = k; break; } } } for (int j = first; j <= last; j++) { if (j != selectedIndex || isScroll) paintTab(g, tabPlacement, rects, j, ir, tr); } currRun = getPreviousTabRun(currRun); } if (! isScroll) paintTab(g, tabPlacement, rects, selectedIndex, ir, tr); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
Color bg = tabPane.getBackgroundAt(tabIndex); if (bg == null) bg = Color.GRAY; g.setColor(bg);
Color bg = tabPane.getBackgroundAt(tabIndex); if (bg == null) bg = Color.GRAY; g.setColor(bg);
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); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
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(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);
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); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
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);
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);
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); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
g.setColor(lightHighlight); g.drawLine(x, y, x, y + h);
g.setColor(lightHighlight); g.drawLine(x, y, x, y + h);
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + 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); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
g.setColor(lightHighlight); g.drawLine(x, y, x + w, y);
g.setColor(lightHighlight); g.drawLine(x, y, x + w, y);
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); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
textView.paint(g, textRect); return;
textView.paint(g, textRect); return;
protected void paintText(Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title, Rectangle textRect, boolean isSelected) { View textView = getTextViewForTab(tabIndex); if (textView != null) { textView.paint(g, textRect); return; } Color fg = tabPane.getForegroundAt(tabIndex); if (fg == null) fg = tabPane.getForeground(); Color bg = tabPane.getBackgroundAt(tabIndex); if (bg == null) bg = tabPane.getBackground(); Color saved_color = g.getColor(); Font f = g.getFont(); g.setFont(font); if (tabPane.isEnabledAt(tabIndex)) { g.setColor(fg); int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex); if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x, textRect.y + metrics.getAscent()); else g.drawString(title, textRect.x, textRect.y + metrics.getAscent()); } else { g.setColor(bg.brighter()); int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex); if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x, textRect.y); else g.drawString(title, textRect.x, textRect.y); g.setColor(bg.darker()); if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x + 1, textRect.y + 1); else g.drawString(title, textRect.x + 1, textRect.y + 1); } g.setColor(saved_color); g.setFont(f); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
g.setColor(fg);
g.setColor(fg);
protected void paintText(Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title, Rectangle textRect, boolean isSelected) { View textView = getTextViewForTab(tabIndex); if (textView != null) { textView.paint(g, textRect); return; } Color fg = tabPane.getForegroundAt(tabIndex); if (fg == null) fg = tabPane.getForeground(); Color bg = tabPane.getBackgroundAt(tabIndex); if (bg == null) bg = tabPane.getBackground(); Color saved_color = g.getColor(); Font f = g.getFont(); g.setFont(font); if (tabPane.isEnabledAt(tabIndex)) { g.setColor(fg); int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex); if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x, textRect.y + metrics.getAscent()); else g.drawString(title, textRect.x, textRect.y + metrics.getAscent()); } else { g.setColor(bg.brighter()); int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex); if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x, textRect.y); else g.drawString(title, textRect.x, textRect.y); g.setColor(bg.darker()); if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x + 1, textRect.y + 1); else g.drawString(title, textRect.x + 1, textRect.y + 1); } g.setColor(saved_color); g.setFont(f); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex);
int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex);
protected void paintText(Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title, Rectangle textRect, boolean isSelected) { View textView = getTextViewForTab(tabIndex); if (textView != null) { textView.paint(g, textRect); return; } Color fg = tabPane.getForegroundAt(tabIndex); if (fg == null) fg = tabPane.getForeground(); Color bg = tabPane.getBackgroundAt(tabIndex); if (bg == null) bg = tabPane.getBackground(); Color saved_color = g.getColor(); Font f = g.getFont(); g.setFont(font); if (tabPane.isEnabledAt(tabIndex)) { g.setColor(fg); int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex); if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x, textRect.y + metrics.getAscent()); else g.drawString(title, textRect.x, textRect.y + metrics.getAscent()); } else { g.setColor(bg.brighter()); int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex); if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x, textRect.y); else g.drawString(title, textRect.x, textRect.y); g.setColor(bg.darker()); if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x + 1, textRect.y + 1); else g.drawString(title, textRect.x + 1, textRect.y + 1); } g.setColor(saved_color); g.setFont(f); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x, textRect.y + metrics.getAscent()); else g.drawString(title, textRect.x, textRect.y + metrics.getAscent());
if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x, textRect.y + metrics.getAscent()); else g.drawString(title, textRect.x, textRect.y + metrics.getAscent());
protected void paintText(Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title, Rectangle textRect, boolean isSelected) { View textView = getTextViewForTab(tabIndex); if (textView != null) { textView.paint(g, textRect); return; } Color fg = tabPane.getForegroundAt(tabIndex); if (fg == null) fg = tabPane.getForeground(); Color bg = tabPane.getBackgroundAt(tabIndex); if (bg == null) bg = tabPane.getBackground(); Color saved_color = g.getColor(); Font f = g.getFont(); g.setFont(font); if (tabPane.isEnabledAt(tabIndex)) { g.setColor(fg); int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex); if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x, textRect.y + metrics.getAscent()); else g.drawString(title, textRect.x, textRect.y + metrics.getAscent()); } else { g.setColor(bg.brighter()); int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex); if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x, textRect.y); else g.drawString(title, textRect.x, textRect.y); g.setColor(bg.darker()); if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x + 1, textRect.y + 1); else g.drawString(title, textRect.x + 1, textRect.y + 1); } g.setColor(saved_color); g.setFont(f); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
g.setColor(bg.brighter());
g.setColor(bg.brighter());
protected void paintText(Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title, Rectangle textRect, boolean isSelected) { View textView = getTextViewForTab(tabIndex); if (textView != null) { textView.paint(g, textRect); return; } Color fg = tabPane.getForegroundAt(tabIndex); if (fg == null) fg = tabPane.getForeground(); Color bg = tabPane.getBackgroundAt(tabIndex); if (bg == null) bg = tabPane.getBackground(); Color saved_color = g.getColor(); Font f = g.getFont(); g.setFont(font); if (tabPane.isEnabledAt(tabIndex)) { g.setColor(fg); int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex); if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x, textRect.y + metrics.getAscent()); else g.drawString(title, textRect.x, textRect.y + metrics.getAscent()); } else { g.setColor(bg.brighter()); int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex); if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x, textRect.y); else g.drawString(title, textRect.x, textRect.y); g.setColor(bg.darker()); if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x + 1, textRect.y + 1); else g.drawString(title, textRect.x + 1, textRect.y + 1); } g.setColor(saved_color); g.setFont(f); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex);
int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex);
protected void paintText(Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title, Rectangle textRect, boolean isSelected) { View textView = getTextViewForTab(tabIndex); if (textView != null) { textView.paint(g, textRect); return; } Color fg = tabPane.getForegroundAt(tabIndex); if (fg == null) fg = tabPane.getForeground(); Color bg = tabPane.getBackgroundAt(tabIndex); if (bg == null) bg = tabPane.getBackground(); Color saved_color = g.getColor(); Font f = g.getFont(); g.setFont(font); if (tabPane.isEnabledAt(tabIndex)) { g.setColor(fg); int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex); if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x, textRect.y + metrics.getAscent()); else g.drawString(title, textRect.x, textRect.y + metrics.getAscent()); } else { g.setColor(bg.brighter()); int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex); if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x, textRect.y); else g.drawString(title, textRect.x, textRect.y); g.setColor(bg.darker()); if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x + 1, textRect.y + 1); else g.drawString(title, textRect.x + 1, textRect.y + 1); } g.setColor(saved_color); g.setFont(f); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x, textRect.y); else g.drawString(title, textRect.x, textRect.y);
if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x, textRect.y); else g.drawString(title, textRect.x, textRect.y);
protected void paintText(Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title, Rectangle textRect, boolean isSelected) { View textView = getTextViewForTab(tabIndex); if (textView != null) { textView.paint(g, textRect); return; } Color fg = tabPane.getForegroundAt(tabIndex); if (fg == null) fg = tabPane.getForeground(); Color bg = tabPane.getBackgroundAt(tabIndex); if (bg == null) bg = tabPane.getBackground(); Color saved_color = g.getColor(); Font f = g.getFont(); g.setFont(font); if (tabPane.isEnabledAt(tabIndex)) { g.setColor(fg); int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex); if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x, textRect.y + metrics.getAscent()); else g.drawString(title, textRect.x, textRect.y + metrics.getAscent()); } else { g.setColor(bg.brighter()); int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex); if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x, textRect.y); else g.drawString(title, textRect.x, textRect.y); g.setColor(bg.darker()); if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x + 1, textRect.y + 1); else g.drawString(title, textRect.x + 1, textRect.y + 1); } g.setColor(saved_color); g.setFont(f); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
g.setColor(bg.darker()); if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x + 1, textRect.y + 1); else g.drawString(title, textRect.x + 1, textRect.y + 1);
g.setColor(bg.darker()); if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x + 1, textRect.y + 1); else g.drawString(title, textRect.x + 1, textRect.y + 1);
protected void paintText(Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title, Rectangle textRect, boolean isSelected) { View textView = getTextViewForTab(tabIndex); if (textView != null) { textView.paint(g, textRect); return; } Color fg = tabPane.getForegroundAt(tabIndex); if (fg == null) fg = tabPane.getForeground(); Color bg = tabPane.getBackgroundAt(tabIndex); if (bg == null) bg = tabPane.getBackground(); Color saved_color = g.getColor(); Font f = g.getFont(); g.setFont(font); if (tabPane.isEnabledAt(tabIndex)) { g.setColor(fg); int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex); if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x, textRect.y + metrics.getAscent()); else g.drawString(title, textRect.x, textRect.y + metrics.getAscent()); } else { g.setColor(bg.brighter()); int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex); if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x, textRect.y); else g.drawString(title, textRect.x, textRect.y); g.setColor(bg.darker()); if (mnemIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x + 1, textRect.y + 1); else g.drawString(title, textRect.x + 1, textRect.y + 1); } g.setColor(saved_color); g.setFont(f); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
{ case SwingConstants.TOP: targetInsets.top = topInsets.top; targetInsets.left = topInsets.left; targetInsets.right = topInsets.right; targetInsets.bottom = topInsets.bottom; break; case SwingConstants.LEFT: targetInsets.left = topInsets.top; targetInsets.top = topInsets.left; targetInsets.right = topInsets.bottom; targetInsets.bottom = topInsets.right; break; case SwingConstants.BOTTOM: targetInsets.top = topInsets.bottom; targetInsets.bottom = topInsets.top; targetInsets.left = topInsets.left; targetInsets.right = topInsets.right; break; case SwingConstants.RIGHT: targetInsets.top = topInsets.left; targetInsets.left = topInsets.bottom; targetInsets.bottom = topInsets.right; targetInsets.right = topInsets.top; break; }
{ case SwingConstants.TOP: targetInsets.top = topInsets.top; targetInsets.left = topInsets.left; targetInsets.right = topInsets.right; targetInsets.bottom = topInsets.bottom; break; case SwingConstants.LEFT: targetInsets.left = topInsets.top; targetInsets.top = topInsets.left; targetInsets.right = topInsets.bottom; targetInsets.bottom = topInsets.right; break; case SwingConstants.BOTTOM: targetInsets.top = topInsets.bottom; targetInsets.bottom = topInsets.top; targetInsets.left = topInsets.left; targetInsets.right = topInsets.right; break; case SwingConstants.RIGHT: targetInsets.top = topInsets.left; targetInsets.left = topInsets.bottom; targetInsets.bottom = topInsets.right; targetInsets.right = topInsets.top; break; }
protected static void rotateInsets(Insets topInsets, Insets targetInsets, int targetPlacement) { // Sun's version will happily throw an NPE if params are null, // so I won't check it either. switch (targetPlacement) { case SwingConstants.TOP: targetInsets.top = topInsets.top; targetInsets.left = topInsets.left; targetInsets.right = topInsets.right; targetInsets.bottom = topInsets.bottom; break; case SwingConstants.LEFT: targetInsets.left = topInsets.top; targetInsets.top = topInsets.left; targetInsets.right = topInsets.bottom; targetInsets.bottom = topInsets.right; break; case SwingConstants.BOTTOM: targetInsets.top = topInsets.bottom; targetInsets.bottom = topInsets.top; targetInsets.left = topInsets.left; targetInsets.right = topInsets.right; break; case SwingConstants.RIGHT: targetInsets.top = topInsets.left; targetInsets.left = topInsets.bottom; targetInsets.bottom = topInsets.right; targetInsets.right = topInsets.top; break; } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
{ case SwingConstants.TOP: case SwingConstants.BOTTOM: y += offset; break; case SwingConstants.RIGHT: case SwingConstants.LEFT: x += offset; break; }
{ case SwingConstants.TOP: case SwingConstants.BOTTOM: y += offset; break; case SwingConstants.RIGHT: case SwingConstants.LEFT: x += offset; break; }
protected void selectAdjacentRunTab(int tabPlacement, int tabIndex, int offset) { int x = rects[tabIndex].x + rects[tabIndex].width / 2; int y = rects[tabIndex].y + rects[tabIndex].height / 2; switch (tabPlacement) { case SwingConstants.TOP: case SwingConstants.BOTTOM: y += offset; break; case SwingConstants.RIGHT: case SwingConstants.LEFT: x += offset; break; } int index = tabForCoordinate(tabPane, x, y); if (index != -1) tabPane.setSelectedIndex(index); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
int first = lastTabInRun(tabCount, getPreviousTabRun(currRun)) + 1; if (first == tabCount) first = 0; int last = lastTabInRun(tabCount, currRun); for (int j = first; j <= last; j++) { if (getTabBounds(pane, j).contains(p)) return j; } currRun = getNextTabRun(currRun);
int first = lastTabInRun(tabCount, getPreviousTabRun(currRun)) + 1; if (first == tabCount) first = 0; int last = lastTabInRun(tabCount, currRun); for (int j = first; j <= last; j++) { if (getTabBounds(pane, j).contains(p)) return j; } currRun = getNextTabRun(currRun);
public int tabForCoordinate(JTabbedPane pane, int x, int y) { Point p = new Point(x, y); int tabCount = tabPane.getTabCount(); int currRun = 1; for (int i = 0; i < runCount; i++) { int first = lastTabInRun(tabCount, getPreviousTabRun(currRun)) + 1; if (first == tabCount) first = 0; int last = lastTabInRun(tabCount, currRun); for (int j = first; j <= last; j++) { if (getTabBounds(pane, j).contains(p)) return j; } currRun = getNextTabRun(currRun); } return -1; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTabbedPaneUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTabbedPaneUI.java
public void updateUI() { setUI((PanelUI)UIManager.getUI(this));
public void updateUI() { setUI((PanelUI) UIManager.getUI(this));
public void updateUI() { setUI((PanelUI)UIManager.getUI(this)); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/045a5b41cdfa747889101d3993040acf89788bc4/JPanel.java/buggy/core/src/classpath/javax/javax/swing/JPanel.java
public void setUI(PanelUI ui) {
public void setUI(PanelUI ui) {
public void setUI(PanelUI ui) { super.setUI(ui); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/045a5b41cdfa747889101d3993040acf89788bc4/JPanel.java/buggy/core/src/classpath/javax/javax/swing/JPanel.java
Insets insets = getInsets(); int w = defaultSize + insets.left + insets.right; int h = defaultSize + insets.top + insets.bottom; return new Dimension(w, h);
return PREFERRED_SIZE;
public Dimension getPreferredSize() { Insets insets = getInsets(); int w = defaultSize + insets.left + insets.right; int h = defaultSize + insets.top + insets.bottom; return new Dimension(w, h); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/045a5b41cdfa747889101d3993040acf89788bc4/BasicArrowButton.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicArrowButton.java
public TabbedPaneUI() { }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/TabbedPaneUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/TabbedPaneUI.java
}
}
public Icon getDisabledIconAt(int index) { checkIndex(index, 0, tabs.size()); return ((Page) tabs.elementAt(index)).getDisabledIcon(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JTabbedPane.java/buggy/core/src/classpath/javax/javax/swing/JTabbedPane.java
{
{
public Color getBackgroundAt(int index) { checkIndex(index, 0, tabs.size()); return ((Page) tabs.elementAt(index)).getBackground(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JTabbedPane.java/buggy/core/src/classpath/javax/javax/swing/JTabbedPane.java
{
{
public Color getForegroundAt(int index) { checkIndex(index, 0, tabs.size()); return ((Page) tabs.elementAt(index)).getForeground(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JTabbedPane.java/buggy/core/src/classpath/javax/javax/swing/JTabbedPane.java
}
}
public Color getForegroundAt(int index) { checkIndex(index, 0, tabs.size()); return ((Page) tabs.elementAt(index)).getForeground(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JTabbedPane.java/buggy/core/src/classpath/javax/javax/swing/JTabbedPane.java
protected void configurePropertiesFromAction(Action a) { //Factory method which sets the AbstractButton's properties according to values from the Action instance. super.configurePropertiesFromAction(a); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/JButton.java/buggy/core/src/classpath/javax/javax/swing/JButton.java
public AccessibleContext getAccessibleContext() { //Gets the AccessibleContext associated with this JButton. return null; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/JButton.java/buggy/core/src/classpath/javax/javax/swing/JButton.java
public String getUIClassID() { //Returns a string that specifies the name of the L&F class that renders this component. return "ButtonUI"; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/JButton.java/buggy/core/src/classpath/javax/javax/swing/JButton.java
public boolean isDefaultButton() { //Returns whether or not this button is the default button on the RootPane. return is_def; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/JButton.java/buggy/core/src/classpath/javax/javax/swing/JButton.java
public boolean isDefaultCapable() { //Returns whether or not this button is capable of being the default button on the RootPane. return def; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/JButton.java/buggy/core/src/classpath/javax/javax/swing/JButton.java
if ((path == null) || (treeModel.isLeaf(path.getLastPathComponent())))
if (path == null)
public void expandPath(TreePath path) { // Don't expand if last path component is a leaf node. if ((path == null) || (treeModel.isLeaf(path.getLastPathComponent()))) return; try { fireTreeWillExpand(path); } catch (ExpandVetoException ev) { // We do nothing if attempt has been vetoed. } setExpandedState(path, true); fireTreeExpanded(path); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4f54b4c49f6326d2bfe26573a0af55c73b713f0a/JTree.java/buggy/core/src/classpath/javax/javax/swing/JTree.java
setSelectionPath(temp);
revalidate(); repaint();
public void scrollPathToVisible(TreePath path) { if (path == null) return; Object[] oPath = path.getPath(); TreePath temp = new TreePath(oPath[0]); boolean stop = false; int i = 1; while (!stop) { while (isVisible(temp)) if (i < oPath.length) temp = temp.pathByAddingChild(oPath[i++]); else { stop = true; break; } makeVisible(temp); } Rectangle rect = getPathBounds(path); scrollRectToVisible(rect); setSelectionPath(temp); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/4f54b4c49f6326d2bfe26573a0af55c73b713f0a/JTree.java/buggy/core/src/classpath/javax/javax/swing/JTree.java
public TreePath getPath() {
public TreePath getPath() {
public TreePath getPath() { return path; } // getPath()
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/TreeExpansionEvent.java/buggy/core/src/classpath/javax/javax/swing/event/TreeExpansionEvent.java
}
}
public TreePath getPath() { return path; } // getPath()
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/TreeExpansionEvent.java/buggy/core/src/classpath/javax/javax/swing/event/TreeExpansionEvent.java
public TreePath getTreePath() {
public TreePath getTreePath() {
public TreePath getTreePath() { return path; } // getTreePath()
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/TreeModelEvent.java/buggy/core/src/classpath/javax/javax/swing/event/TreeModelEvent.java
}
}
public TreePath getTreePath() { return path; } // getTreePath()
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/TreeModelEvent.java/buggy/core/src/classpath/javax/javax/swing/event/TreeModelEvent.java
return new TreeSelectionEvent (source, paths, areNew, oldLeadSelectionPath,
return new TreeSelectionEvent (source, paths, areNew, oldLeadSelectionPath,
public Object cloneWithSource(Object source) { return new TreeSelectionEvent (source, paths, areNew, oldLeadSelectionPath, newLeadSelectionPath); } // cloneWithSource()
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/TreeSelectionEvent.java/buggy/core/src/classpath/javax/javax/swing/event/TreeSelectionEvent.java
}
}
public Object cloneWithSource(Object source) { return new TreeSelectionEvent (source, paths, areNew, oldLeadSelectionPath, newLeadSelectionPath); } // cloneWithSource()
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/TreeSelectionEvent.java/buggy/core/src/classpath/javax/javax/swing/event/TreeSelectionEvent.java
public DefaultTreeModel(TreeNode root, boolean asksAllowsChildren)
public DefaultTreeModel(TreeNode root)
public DefaultTreeModel(TreeNode root, boolean asksAllowsChildren) { setRoot(root); this.asksAllowsChildren = asksAllowsChildren; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/a78ab2f492456918e4f5c52be600854882e139fc/DefaultTreeModel.java/buggy/core/src/classpath/javax/javax/swing/tree/DefaultTreeModel.java
this.asksAllowsChildren = asksAllowsChildren;
public DefaultTreeModel(TreeNode root, boolean asksAllowsChildren) { setRoot(root); this.asksAllowsChildren = asksAllowsChildren; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/a78ab2f492456918e4f5c52be600854882e139fc/DefaultTreeModel.java/buggy/core/src/classpath/javax/javax/swing/tree/DefaultTreeModel.java
public TreeExpansionEvent(Object source, TreePath path) {
public TreeExpansionEvent(Object source, TreePath path) {
public TreeExpansionEvent(Object source, TreePath path) { super(source); this.path = path; } // TreeExpansionEvent()
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/TreeExpansionEvent.java/buggy/core/src/classpath/javax/javax/swing/event/TreeExpansionEvent.java