rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
}
}
public void setSelectedPath(MenuElement[] path) { if (path == null) { clearSelectedPath(); return; } int i; int minSize = path.length; // size of the smaller path. if (path.length > selectedPath.size()) { minSize = selectedPath.size(); // if new selected path contains more elements then current // selection then first add all elements at // the indexes > selectedPath.size for (i = selectedPath.size(); i < path.length; i++) { selectedPath.add(path[i]); path[i].menuSelectionChanged(true); } } else if (path.length < selectedPath.size()) { // if new selected path contains less elements then current // selection then first remove all elements from the selection // at the indexes > path.length for (i = selectedPath.size() - 1; i >= path.length; i--) { ((MenuElement) selectedPath.get(i)).menuSelectionChanged(false); selectedPath.remove(i); } minSize = path.length; } // Now compare elements in new and current selection path at the // same location and adjust selection until // same menu elements will be encountered at the // same index in both current and new selection path. MenuElement oldSelectedItem; for (i = minSize - 1; i >= 0; i--) { oldSelectedItem = (MenuElement) selectedPath.get(i); if (path[i].equals(oldSelectedItem)) break; oldSelectedItem.menuSelectionChanged(false); path[i].menuSelectionChanged(true); selectedPath.setElementAt(path[i], i); } fireStateChanged(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/MenuSelectionManager.java/buggy/core/src/classpath/javax/javax/swing/MenuSelectionManager.java
public void setSelectedPath(MenuElement[] path) { if (path == null) { clearSelectedPath(); return; } int i; int minSize = path.length; // size of the smaller path. if (path.length > selectedPath.size()) { minSize = selectedPath.size(); // if new selected path contains more elements then current // selection then first add all elements at // the indexes > selectedPath.size for (i = selectedPath.size(); i < path.length; i++) { selectedPath.add(path[i]); path[i].menuSelectionChanged(true); } } else if (path.length < selectedPath.size()) { // if new selected path contains less elements then current // selection then first remove all elements from the selection // at the indexes > path.length for (i = selectedPath.size() - 1; i >= path.length; i--) { ((MenuElement) selectedPath.get(i)).menuSelectionChanged(false); selectedPath.remove(i); } minSize = path.length; } // Now compare elements in new and current selection path at the // same location and adjust selection until // same menu elements will be encountered at the // same index in both current and new selection path. MenuElement oldSelectedItem; for (i = minSize - 1; i >= 0; i--) { oldSelectedItem = (MenuElement) selectedPath.get(i); if (path[i].equals(oldSelectedItem)) break; oldSelectedItem.menuSelectionChanged(false); path[i].menuSelectionChanged(true); selectedPath.setElementAt(path[i], i); } fireStateChanged(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/MenuSelectionManager.java/buggy/core/src/classpath/javax/javax/swing/MenuSelectionManager.java
{
{
public void setSelectedPath(MenuElement[] path) { if (path == null) { clearSelectedPath(); return; } int i; int minSize = path.length; // size of the smaller path. if (path.length > selectedPath.size()) { minSize = selectedPath.size(); // if new selected path contains more elements then current // selection then first add all elements at // the indexes > selectedPath.size for (i = selectedPath.size(); i < path.length; i++) { selectedPath.add(path[i]); path[i].menuSelectionChanged(true); } } else if (path.length < selectedPath.size()) { // if new selected path contains less elements then current // selection then first remove all elements from the selection // at the indexes > path.length for (i = selectedPath.size() - 1; i >= path.length; i--) { ((MenuElement) selectedPath.get(i)).menuSelectionChanged(false); selectedPath.remove(i); } minSize = path.length; } // Now compare elements in new and current selection path at the // same location and adjust selection until // same menu elements will be encountered at the // same index in both current and new selection path. MenuElement oldSelectedItem; for (i = minSize - 1; i >= 0; i--) { oldSelectedItem = (MenuElement) selectedPath.get(i); if (path[i].equals(oldSelectedItem)) break; oldSelectedItem.menuSelectionChanged(false); path[i].menuSelectionChanged(true); selectedPath.setElementAt(path[i], i); } fireStateChanged(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/MenuSelectionManager.java/buggy/core/src/classpath/javax/javax/swing/MenuSelectionManager.java
}
}
public void setSelectedPath(MenuElement[] path) { if (path == null) { clearSelectedPath(); return; } int i; int minSize = path.length; // size of the smaller path. if (path.length > selectedPath.size()) { minSize = selectedPath.size(); // if new selected path contains more elements then current // selection then first add all elements at // the indexes > selectedPath.size for (i = selectedPath.size(); i < path.length; i++) { selectedPath.add(path[i]); path[i].menuSelectionChanged(true); } } else if (path.length < selectedPath.size()) { // if new selected path contains less elements then current // selection then first remove all elements from the selection // at the indexes > path.length for (i = selectedPath.size() - 1; i >= path.length; i--) { ((MenuElement) selectedPath.get(i)).menuSelectionChanged(false); selectedPath.remove(i); } minSize = path.length; } // Now compare elements in new and current selection path at the // same location and adjust selection until // same menu elements will be encountered at the // same index in both current and new selection path. MenuElement oldSelectedItem; for (i = minSize - 1; i >= 0; i--) { oldSelectedItem = (MenuElement) selectedPath.get(i); if (path[i].equals(oldSelectedItem)) break; oldSelectedItem.menuSelectionChanged(false); path[i].menuSelectionChanged(true); selectedPath.setElementAt(path[i], i); } fireStateChanged(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/MenuSelectionManager.java/buggy/core/src/classpath/javax/javax/swing/MenuSelectionManager.java
minSize = path.length;
minSize = path.length;
public void setSelectedPath(MenuElement[] path) { if (path == null) { clearSelectedPath(); return; } int i; int minSize = path.length; // size of the smaller path. if (path.length > selectedPath.size()) { minSize = selectedPath.size(); // if new selected path contains more elements then current // selection then first add all elements at // the indexes > selectedPath.size for (i = selectedPath.size(); i < path.length; i++) { selectedPath.add(path[i]); path[i].menuSelectionChanged(true); } } else if (path.length < selectedPath.size()) { // if new selected path contains less elements then current // selection then first remove all elements from the selection // at the indexes > path.length for (i = selectedPath.size() - 1; i >= path.length; i--) { ((MenuElement) selectedPath.get(i)).menuSelectionChanged(false); selectedPath.remove(i); } minSize = path.length; } // Now compare elements in new and current selection path at the // same location and adjust selection until // same menu elements will be encountered at the // same index in both current and new selection path. MenuElement oldSelectedItem; for (i = minSize - 1; i >= 0; i--) { oldSelectedItem = (MenuElement) selectedPath.get(i); if (path[i].equals(oldSelectedItem)) break; oldSelectedItem.menuSelectionChanged(false); path[i].menuSelectionChanged(true); selectedPath.setElementAt(path[i], i); } fireStateChanged(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/MenuSelectionManager.java/buggy/core/src/classpath/javax/javax/swing/MenuSelectionManager.java
break;
break;
public void setSelectedPath(MenuElement[] path) { if (path == null) { clearSelectedPath(); return; } int i; int minSize = path.length; // size of the smaller path. if (path.length > selectedPath.size()) { minSize = selectedPath.size(); // if new selected path contains more elements then current // selection then first add all elements at // the indexes > selectedPath.size for (i = selectedPath.size(); i < path.length; i++) { selectedPath.add(path[i]); path[i].menuSelectionChanged(true); } } else if (path.length < selectedPath.size()) { // if new selected path contains less elements then current // selection then first remove all elements from the selection // at the indexes > path.length for (i = selectedPath.size() - 1; i >= path.length; i--) { ((MenuElement) selectedPath.get(i)).menuSelectionChanged(false); selectedPath.remove(i); } minSize = path.length; } // Now compare elements in new and current selection path at the // same location and adjust selection until // same menu elements will be encountered at the // same index in both current and new selection path. MenuElement oldSelectedItem; for (i = minSize - 1; i >= 0; i--) { oldSelectedItem = (MenuElement) selectedPath.get(i); if (path[i].equals(oldSelectedItem)) break; oldSelectedItem.menuSelectionChanged(false); path[i].menuSelectionChanged(true); selectedPath.setElementAt(path[i], i); } fireStateChanged(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/MenuSelectionManager.java/buggy/core/src/classpath/javax/javax/swing/MenuSelectionManager.java
if (selected)
if (selected && isEnabled())
public void setSelected(boolean selected) { // if this menu selection is true, then activate this menu and // display popup associated with this menu if (selected) { super.setArmed(true); super.setSelected(true); // FIXME: The popup menu should be shown on the screen after certain // number of seconds pass. The 'delay' property of this menu indicates // this amount of seconds. 'delay' property is 0 by default. if (this.isShowing()) { fireMenuSelected(); int x = 0; int y = 0; if (menuLocation == null) { // Calculate correct position of the popup. Note that location of the popup // passed to show() should be relative to the popup's invoker if (isTopLevelMenu()) y = this.getHeight(); else x = this.getWidth(); getPopupMenu().show(this, x, y); } else getPopupMenu().show(this, menuLocation.x, menuLocation.y); } } else { super.setSelected(false); super.setArmed(false); fireMenuDeselected(); popupMenu.setVisible(false); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/50cfc3ee73e2e377b07c91f0e40a2f172b10fd27/JMenu.java/buggy/core/src/classpath/javax/javax/swing/JMenu.java
if (this.isShowing())
if (isShowing())
public void setSelected(boolean selected) { // if this menu selection is true, then activate this menu and // display popup associated with this menu if (selected) { super.setArmed(true); super.setSelected(true); // FIXME: The popup menu should be shown on the screen after certain // number of seconds pass. The 'delay' property of this menu indicates // this amount of seconds. 'delay' property is 0 by default. if (this.isShowing()) { fireMenuSelected(); int x = 0; int y = 0; if (menuLocation == null) { // Calculate correct position of the popup. Note that location of the popup // passed to show() should be relative to the popup's invoker if (isTopLevelMenu()) y = this.getHeight(); else x = this.getWidth(); getPopupMenu().show(this, x, y); } else getPopupMenu().show(this, menuLocation.x, menuLocation.y); } } else { super.setSelected(false); super.setArmed(false); fireMenuDeselected(); popupMenu.setVisible(false); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/50cfc3ee73e2e377b07c91f0e40a2f172b10fd27/JMenu.java/buggy/core/src/classpath/javax/javax/swing/JMenu.java
add(list, BorderLayout.CENTER);
setLayout(new GridLayout(1, 1)); list.setBorder(new BevelBorder(BevelBorder.LOWERED)); add(list);
public WindowBar() { this.list = new JList(); this.model = new DefaultListModel(); this.wrappers = new HashMap<JInternalFrame, FrameWrapper>(); list.setModel(model); add(list, BorderLayout.CENTER); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/030e1d99f2692b3daf2cdfd280f1d13cba464a71/WindowBar.java/clean/gui/src/desktop/org/jnode/desktop/WindowBar.java
if (compiledCode1 instanceof byte[]) { return NumberUtils.hex((byte[])compiledCode1); } else { return super.toString(); } }
if (compiledCode1 instanceof byte[]) { return NumberUtils.hex((byte[]) compiledCode1); } else { return super.toString(); } }
public String toString() { if (compiledCode1 instanceof byte[]) { return NumberUtils.hex((byte[])compiledCode1); } else { return super.toString(); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/50e31eccd50a204db22831206646c58f95c4cc44/VmCompiledCode.java/buggy/core/src/core/org/jnode/vm/classmgr/VmCompiledCode.java
((MutableComboBoxModel) dataModel).addElement(element);
((MutableComboBoxModel) dataModel).addElement(element);
public void addItem(Object element) { if (dataModel instanceof MutableComboBoxModel) ((MutableComboBoxModel) dataModel).addElement(element); else throw new RuntimeException("Unable to add the item because the data " + "model it is not an instance of " + "MutableComboBoxModel."); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
setEnabled(true); setToolTipText(null);
setEnabled(true); setToolTipText(null);
protected void configurePropertiesFromAction(Action a) { if (a == null) { setEnabled(true); setToolTipText(null); } else { setEnabled(a.isEnabled()); setToolTipText((String) (a.getValue(Action.SHORT_DESCRIPTION))); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
setEnabled(a.isEnabled()); setToolTipText((String) (a.getValue(Action.SHORT_DESCRIPTION)));
setEnabled(a.isEnabled()); setToolTipText((String) (a.getValue(Action.SHORT_DESCRIPTION)));
protected void configurePropertiesFromAction(Action a) { if (a == null) { setEnabled(true); setToolTipText(null); } else { setEnabled(a.isEnabled()); setToolTipText((String) (a.getValue(Action.SHORT_DESCRIPTION))); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
public void propertyChange(PropertyChangeEvent e) { Action act = (Action) (e.getSource()); configurePropertiesFromAction(act); }
public void propertyChange(PropertyChangeEvent e) { Action act = (Action) (e.getSource()); configurePropertiesFromAction(act); }
protected PropertyChangeListener createActionPropertyChangeListener(Action action) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { Action act = (Action) (e.getSource()); configurePropertiesFromAction(act); } }; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
{ Action act = (Action) (e.getSource()); configurePropertiesFromAction(act); }
{ Action act = (Action) (e.getSource()); configurePropertiesFromAction(act); }
public void propertyChange(PropertyChangeEvent e) { Action act = (Action) (e.getSource()); configurePropertiesFromAction(act); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
return accessibleContext;
return accessibleContext;
public AccessibleContext getAccessibleContext() { if (accessibleContext == null) accessibleContext = new AccessibleJComboBox(); return accessibleContext; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
public int getSelectedIndex() { Object selectedItem = getSelectedItem(); if (selectedItem != null) { if (dataModel instanceof DefaultComboBoxModel) // Uses special method of DefaultComboBoxModel to retrieve the index. return ((DefaultComboBoxModel) dataModel).getIndexOf(selectedItem); else { // Iterates over all items to retrieve the index. int size = dataModel.getSize(); for (int i = 0; i < size; i++) { Object o = dataModel.getElementAt(i); // XXX: Is special handling of ComparableS neccessary? if ((selectedItem != null) ? selectedItem.equals(o) : o == null) return i; } } } // returns that no item is currently selected return -1; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
return ((DefaultComboBoxModel) dataModel).getIndexOf(selectedItem);
return ((DefaultComboBoxModel) dataModel).getIndexOf(selectedItem);
public int getSelectedIndex() { Object selectedItem = getSelectedItem(); if (selectedItem != null) { if (dataModel instanceof DefaultComboBoxModel) // Uses special method of DefaultComboBoxModel to retrieve the index. return ((DefaultComboBoxModel) dataModel).getIndexOf(selectedItem); else { // Iterates over all items to retrieve the index. int size = dataModel.getSize(); for (int i = 0; i < size; i++) { Object o = dataModel.getElementAt(i); // XXX: Is special handling of ComparableS neccessary? if ((selectedItem != null) ? selectedItem.equals(o) : o == null) return i; } } } // returns that no item is currently selected return -1; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
int size = dataModel.getSize();
int size = dataModel.getSize();
public int getSelectedIndex() { Object selectedItem = getSelectedItem(); if (selectedItem != null) { if (dataModel instanceof DefaultComboBoxModel) // Uses special method of DefaultComboBoxModel to retrieve the index. return ((DefaultComboBoxModel) dataModel).getIndexOf(selectedItem); else { // Iterates over all items to retrieve the index. int size = dataModel.getSize(); for (int i = 0; i < size; i++) { Object o = dataModel.getElementAt(i); // XXX: Is special handling of ComparableS neccessary? if ((selectedItem != null) ? selectedItem.equals(o) : o == null) return i; } } } // returns that no item is currently selected return -1; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
Object o = dataModel.getElementAt(i);
Object o = dataModel.getElementAt(i);
public int getSelectedIndex() { Object selectedItem = getSelectedItem(); if (selectedItem != null) { if (dataModel instanceof DefaultComboBoxModel) // Uses special method of DefaultComboBoxModel to retrieve the index. return ((DefaultComboBoxModel) dataModel).getIndexOf(selectedItem); else { // Iterates over all items to retrieve the index. int size = dataModel.getSize(); for (int i = 0; i < size; i++) { Object o = dataModel.getElementAt(i); // XXX: Is special handling of ComparableS neccessary? if ((selectedItem != null) ? selectedItem.equals(o) : o == null) return i; } } } // returns that no item is currently selected return -1; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
return i; } } }
return i; } } }
public int getSelectedIndex() { Object selectedItem = getSelectedItem(); if (selectedItem != null) { if (dataModel instanceof DefaultComboBoxModel) // Uses special method of DefaultComboBoxModel to retrieve the index. return ((DefaultComboBoxModel) dataModel).getIndexOf(selectedItem); else { // Iterates over all items to retrieve the index. int size = dataModel.getSize(); for (int i = 0; i < size; i++) { Object o = dataModel.getElementAt(i); // XXX: Is special handling of ComparableS neccessary? if ((selectedItem != null) ? selectedItem.equals(o) : o == null) return i; } } } // returns that no item is currently selected return -1; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
return (ComboBoxUI) ui;
return (ComboBoxUI) ui;
public ComboBoxUI getUI() { return (ComboBoxUI) ui; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
((MutableComboBoxModel) dataModel).insertElementAt(element, index);
((MutableComboBoxModel) dataModel).insertElementAt(element, index);
public void insertItemAt(Object element, int index) { if (dataModel instanceof MutableComboBoxModel) ((MutableComboBoxModel) dataModel).insertElementAt(element, index); else throw new RuntimeException("Unable to insert the item because the data " + "model it is not an instance of " + "MutableComboBoxModel."); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
public void removeAllItems() { if (dataModel instanceof DefaultComboBoxModel) // Uses special method if we have a DefaultComboBoxModel. ((DefaultComboBoxModel) dataModel).removeAllElements(); else if (dataModel instanceof MutableComboBoxModel) { // Iterates over all items and removes each. MutableComboBoxModel mcbm = (MutableComboBoxModel) dataModel; // We intentionally remove the items backwards to support models which // shift their content to the beginning (e.g. linked lists) for (int i = mcbm.getSize() - 1; i >= 0; i--) mcbm.removeElementAt(i); } else throw new RuntimeException("Unable to remove the items because the data " +"model it is not an instance of " + "MutableComboBoxModel."); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
MutableComboBoxModel mcbm = (MutableComboBoxModel) dataModel;
MutableComboBoxModel mcbm = (MutableComboBoxModel) dataModel;
public void removeAllItems() { if (dataModel instanceof DefaultComboBoxModel) // Uses special method if we have a DefaultComboBoxModel. ((DefaultComboBoxModel) dataModel).removeAllElements(); else if (dataModel instanceof MutableComboBoxModel) { // Iterates over all items and removes each. MutableComboBoxModel mcbm = (MutableComboBoxModel) dataModel; // We intentionally remove the items backwards to support models which // shift their content to the beginning (e.g. linked lists) for (int i = mcbm.getSize() - 1; i >= 0; i--) mcbm.removeElementAt(i); } else throw new RuntimeException("Unable to remove the items because the data " +"model it is not an instance of " + "MutableComboBoxModel."); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
mcbm.removeElementAt(i); }
mcbm.removeElementAt(i); }
public void removeAllItems() { if (dataModel instanceof DefaultComboBoxModel) // Uses special method if we have a DefaultComboBoxModel. ((DefaultComboBoxModel) dataModel).removeAllElements(); else if (dataModel instanceof MutableComboBoxModel) { // Iterates over all items and removes each. MutableComboBoxModel mcbm = (MutableComboBoxModel) dataModel; // We intentionally remove the items backwards to support models which // shift their content to the beginning (e.g. linked lists) for (int i = mcbm.getSize() - 1; i >= 0; i--) mcbm.removeElementAt(i); } else throw new RuntimeException("Unable to remove the items because the data " +"model it is not an instance of " + "MutableComboBoxModel."); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
((MutableComboBoxModel) dataModel).removeElement(element);
((MutableComboBoxModel) dataModel).removeElement(element);
public void removeItem(Object element) { if (dataModel instanceof MutableComboBoxModel) ((MutableComboBoxModel) dataModel).removeElement(element); else throw new RuntimeException("Unable to remove the item because the data " + "model it is not an instance of " + "MutableComboBoxModel."); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
((MutableComboBoxModel) dataModel).removeElementAt(index);
((MutableComboBoxModel) dataModel).removeElementAt(index);
public void removeItemAt(int index) { if (dataModel instanceof MutableComboBoxModel) ((MutableComboBoxModel) dataModel).removeElementAt(index); else throw new RuntimeException("Unable to remove the item because the data " + "model it is not an instance of " + "MutableComboBoxModel."); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
isEditable = editable;
isEditable = editable;
public void setEditable(boolean editable) { if (isEditable != editable) { isEditable = editable; firePropertyChange("editable", !isEditable, isEditable); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
super.setEnabled(enabled); firePropertyChange("enabled", oldEnabled, enabled);
super.setEnabled(enabled); firePropertyChange("enabled", oldEnabled, enabled);
public void setEnabled(boolean enabled) { boolean oldEnabled = super.isEnabled(); if (enabled != oldEnabled) { super.setEnabled(enabled); firePropertyChange("enabled", oldEnabled, enabled); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
int oldMaximumRowCount = maximumRowCount; maximumRowCount = rowCount;
int oldMaximumRowCount = maximumRowCount; maximumRowCount = rowCount;
public void setMaximumRowCount(int rowCount) { if (maximumRowCount != rowCount) { int oldMaximumRowCount = maximumRowCount; maximumRowCount = rowCount; firePropertyChange("maximumRowCount", oldMaximumRowCount, maximumRowCount); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
if (dataModel == newDataModel) return;
if (dataModel == newDataModel) return;
public void setModel(ComboBoxModel newDataModel) { // dataModel is null if it this method is called from inside the constructors. if (dataModel != null) { // Prevents unneccessary updates. if (dataModel == newDataModel) return; // Removes itself (as DataListener) from the to-be-replaced model. dataModel.removeListDataListener(this); } /* Adds itself as a DataListener to the new model. * It is intentioned that this operation will fail with a NullPointerException if the * caller delivered a null argument. */ newDataModel.addListDataListener(this); // Stores old data model for event notification. ComboBoxModel oldDataModel = dataModel; dataModel = newDataModel; // Notifies the listeners of the model change. firePropertyChange("model", oldDataModel, dataModel); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
dataModel.removeListDataListener(this); }
dataModel.removeListDataListener(this); }
public void setModel(ComboBoxModel newDataModel) { // dataModel is null if it this method is called from inside the constructors. if (dataModel != null) { // Prevents unneccessary updates. if (dataModel == newDataModel) return; // Removes itself (as DataListener) from the to-be-replaced model. dataModel.removeListDataListener(this); } /* Adds itself as a DataListener to the new model. * It is intentioned that this operation will fail with a NullPointerException if the * caller delivered a null argument. */ newDataModel.addListDataListener(this); // Stores old data model for event notification. ComboBoxModel oldDataModel = dataModel; dataModel = newDataModel; // Notifies the listeners of the model change. firePropertyChange("model", oldDataModel, dataModel); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
public void setPrototypeDisplayValue(Object newPrototypeDisplayValue)
public void setPrototypeDisplayValue(Object value)
public void setPrototypeDisplayValue(Object newPrototypeDisplayValue) { prototypeDisplayValue = newPrototypeDisplayValue; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
prototypeDisplayValue = newPrototypeDisplayValue;
Object oldValue = prototypeDisplayValue; prototypeDisplayValue = value; firePropertyChange("prototypeDisplayValue", oldValue, value);
public void setPrototypeDisplayValue(Object newPrototypeDisplayValue) { prototypeDisplayValue = newPrototypeDisplayValue; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
ListCellRenderer oldRenderer = renderer; renderer = aRenderer;
ListCellRenderer oldRenderer = renderer; renderer = aRenderer;
public void setRenderer(ListCellRenderer aRenderer) { if (renderer != aRenderer) { ListCellRenderer oldRenderer = renderer; renderer = aRenderer; firePropertyChange("renderer", oldRenderer, renderer); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
throw new IllegalArgumentException("illegal index: " + index);
throw new IllegalArgumentException("illegal index: " + index);
public void setSelectedIndex(int index) { if (index < -1 || index >= dataModel.getSize()) // Fails because index is out of bounds. throw new IllegalArgumentException("illegal index: " + index); else // Selects the item at the given index or clears the selection if the // index value is -1. setSelectedItem((index == -1) ? null : dataModel.getElementAt(index)); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
setSelectedItem((index == -1) ? null : dataModel.getElementAt(index)); }
setSelectedItem((index == -1) ? null : dataModel.getElementAt(index)); }
public void setSelectedIndex(int index) { if (index < -1 || index >= dataModel.getSize()) // Fails because index is out of bounds. throw new IllegalArgumentException("illegal index: " + index); else // Selects the item at the given index or clears the selection if the // index value is -1. setSelectedItem((index == -1) ? null : dataModel.getElementAt(index)); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
super.setUI(ui);
super.setUI(ui);
public void setUI(ComboBoxUI ui) { super.setUI(ui); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
invalidate();
invalidate();
public void updateUI() { setUI((ComboBoxUI) UIManager.getUI(this)); invalidate(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/JComboBox.java/clean/core/src/classpath/javax/javax/swing/JComboBox.java
public DefaultComboBoxModel(Object[] items)
public DefaultComboBoxModel()
public DefaultComboBoxModel(Object[] items) { list = new Vector(Arrays.asList(items)); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/DefaultComboBoxModel.java/buggy/core/src/classpath/javax/javax/swing/DefaultComboBoxModel.java
list = new Vector(Arrays.asList(items));
list = new Vector();
public DefaultComboBoxModel(Object[] items) { list = new Vector(Arrays.asList(items)); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/159638d634951eb718c5e3a0917ef516d5a44797/DefaultComboBoxModel.java/buggy/core/src/classpath/javax/javax/swing/DefaultComboBoxModel.java
changeSupport.firePropertyChange(propertyName, new Boolean(oldValue), new Boolean(newValue));
changeSupport.firePropertyChange(propertyName, Boolean.valueOf(oldValue), Boolean.valueOf(newValue));
public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) { if (changeSupport != null) changeSupport.firePropertyChange(propertyName, new Boolean(oldValue), new Boolean(newValue)); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/511ee4599fec6e0fd95b9d64823beef0c7439ee1/JComponent.java/clean/core/src/classpath/javax/javax/swing/JComponent.java
this.propertyListeners = new Hashtable();
this.propertyListeners = new HashMap();
public SwingPropertyChangeSupport(Object source) { super(source); this.source = source; this.listeners = new EventListenerList(); this.propertyListeners = new Hashtable(); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/SwingPropertyChangeSupport.java/buggy/core/src/classpath/javax/javax/swing/event/SwingPropertyChangeSupport.java
this.x = (int) x; this.y = (int) y; this.width = (int) width; this.height = (int) height;
this.x = (int) Math.floor(x); this.y = (int) Math.floor(y); this.width = (int) Math.ceil(x + width) - this.x; this.height = (int) Math.ceil(y + height) - this.y;
public void setRect(double x, double y, double width, double height) { this.x = (int) x; this.y = (int) y; this.width = (int) width; this.height = (int) height; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c703200057968fb1fad7e17bbcfd87040b579718/Rectangle.java/buggy/core/src/classpath/java/java/awt/Rectangle.java
public PropertyChangeListener[] getPropertyChangeListeners(String property)
public PropertyChangeListener[] getPropertyChangeListeners()
public PropertyChangeListener[] getPropertyChangeListeners(String property) { return changeSupport == null ? new PropertyChangeListener[0] : changeSupport.getPropertyChangeListeners(property); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/566e4ab93ebc97794094572536829e581d565b11/Component.java/buggy/core/src/classpath/java/java/awt/Component.java
: changeSupport.getPropertyChangeListeners(property);
: changeSupport.getPropertyChangeListeners();
public PropertyChangeListener[] getPropertyChangeListeners(String property) { return changeSupport == null ? new PropertyChangeListener[0] : changeSupport.getPropertyChangeListeners(property); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/566e4ab93ebc97794094572536829e581d565b11/Component.java/buggy/core/src/classpath/java/java/awt/Component.java
public synchronized PropertyChangeListener[] getPropertyChangeListeners( String propertyName)
public synchronized PropertyChangeListener[] getPropertyChangeListeners()
public synchronized PropertyChangeListener[] getPropertyChangeListeners( String propertyName) { EventListenerList list = (EventListenerList) propertyListeners.get(propertyName); if (list == null) return getPropertyChangeListeners(); int size = listeners.getListenerCount() + list.getListenerCount(); PropertyChangeListener[] result = new PropertyChangeListener[size]; // copy in the general listeners int index = 0; for (int i = 0; i < listeners.listenerList.length; i += 2) { result[index++] = (PropertyChangeListener) listeners.listenerList[i + 1]; } // copy in the specific listeners Object[] specificListeners = list.getListenerList(); for (int i = 0; i < specificListeners.length; i += 2) { result[index++] = (PropertyChangeListener) specificListeners[i + 1]; } return result; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/SwingPropertyChangeSupport.java/buggy/core/src/classpath/javax/javax/swing/event/SwingPropertyChangeSupport.java
EventListenerList list = (EventListenerList) propertyListeners.get(propertyName); if (list == null) return getPropertyChangeListeners(); int size = listeners.getListenerCount() + list.getListenerCount();
List namedListeners = new ArrayList(); Set namedListenerEntries = propertyListeners.entrySet(); Iterator iterator = namedListenerEntries.iterator(); while (iterator.hasNext()) { Map.Entry e = (Map.Entry) iterator.next(); String propertyName = (String) e.getKey(); EventListenerList ell = (EventListenerList) e.getValue(); if (ell != null) { Object[] list = ell.getListenerList(); for (int i = 0; i < list.length; i += 2) { namedListeners.add(new PropertyChangeListenerProxy(propertyName, (PropertyChangeListener) list[i + 1])); } } } int size = listeners.getListenerCount() + namedListeners.size();
public synchronized PropertyChangeListener[] getPropertyChangeListeners( String propertyName) { EventListenerList list = (EventListenerList) propertyListeners.get(propertyName); if (list == null) return getPropertyChangeListeners(); int size = listeners.getListenerCount() + list.getListenerCount(); PropertyChangeListener[] result = new PropertyChangeListener[size]; // copy in the general listeners int index = 0; for (int i = 0; i < listeners.listenerList.length; i += 2) { result[index++] = (PropertyChangeListener) listeners.listenerList[i + 1]; } // copy in the specific listeners Object[] specificListeners = list.getListenerList(); for (int i = 0; i < specificListeners.length; i += 2) { result[index++] = (PropertyChangeListener) specificListeners[i + 1]; } return result; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/SwingPropertyChangeSupport.java/buggy/core/src/classpath/javax/javax/swing/event/SwingPropertyChangeSupport.java
for (int i = 0; i < listeners.listenerList.length; i += 2) { result[index++] = (PropertyChangeListener) listeners.listenerList[i + 1]; }
for (int i = 0; i < list.length; i += 2) result[index++] = (PropertyChangeListener) list[i + 1];
public synchronized PropertyChangeListener[] getPropertyChangeListeners( String propertyName) { EventListenerList list = (EventListenerList) propertyListeners.get(propertyName); if (list == null) return getPropertyChangeListeners(); int size = listeners.getListenerCount() + list.getListenerCount(); PropertyChangeListener[] result = new PropertyChangeListener[size]; // copy in the general listeners int index = 0; for (int i = 0; i < listeners.listenerList.length; i += 2) { result[index++] = (PropertyChangeListener) listeners.listenerList[i + 1]; } // copy in the specific listeners Object[] specificListeners = list.getListenerList(); for (int i = 0; i < specificListeners.length; i += 2) { result[index++] = (PropertyChangeListener) specificListeners[i + 1]; } return result; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/SwingPropertyChangeSupport.java/buggy/core/src/classpath/javax/javax/swing/event/SwingPropertyChangeSupport.java
Object[] specificListeners = list.getListenerList(); for (int i = 0; i < specificListeners.length; i += 2) { result[index++] = (PropertyChangeListener) specificListeners[i + 1]; }
Iterator iterator2 = namedListeners.iterator(); while (iterator2.hasNext()) result[index++] = (PropertyChangeListenerProxy) iterator2.next();
public synchronized PropertyChangeListener[] getPropertyChangeListeners( String propertyName) { EventListenerList list = (EventListenerList) propertyListeners.get(propertyName); if (list == null) return getPropertyChangeListeners(); int size = listeners.getListenerCount() + list.getListenerCount(); PropertyChangeListener[] result = new PropertyChangeListener[size]; // copy in the general listeners int index = 0; for (int i = 0; i < listeners.listenerList.length; i += 2) { result[index++] = (PropertyChangeListener) listeners.listenerList[i + 1]; } // copy in the specific listeners Object[] specificListeners = list.getListenerList(); for (int i = 0; i < specificListeners.length; i += 2) { result[index++] = (PropertyChangeListener) specificListeners[i + 1]; } return result; }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/SwingPropertyChangeSupport.java/buggy/core/src/classpath/javax/javax/swing/event/SwingPropertyChangeSupport.java
g.fillRect(clip.x, clip.y, clip.width, clip.height);
g.fillRect(0, 0, c.getWidth(), c.getHeight());
public void update(Graphics g, JComponent c) { if (c.isOpaque()) { g.setColor(c.getBackground()); Rectangle clip = g.getClipBounds(); g.fillRect(clip.x, clip.y, clip.width, clip.height); } paint(g, c); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/ComponentUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/ComponentUI.java
public synchronized void addInvalidComponent(JComponent component) { Component ancestor = component.getParent(); while (ancestor != null && (! (ancestor instanceof JComponent) || ! ((JComponent) ancestor).isValidateRoot() )) ancestor = ancestor.getParent(); if (ancestor != null && ancestor instanceof JComponent && ((JComponent) ancestor).isValidateRoot()) component = (JComponent) ancestor; if (invalidComponents.contains(component)) return; invalidComponents.add(component); if (! repaintWorker.isLive()) { repaintWorker.setLive(true); SwingUtilities.invokeLater(repaintWorker); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/RepaintManager.java/buggy/core/src/classpath/javax/javax/swing/RepaintManager.java
public FileArgument(String name, String description) { super(name, description, SINGLE);
public FileArgument(String name, String description, boolean multi) { super(name, description, multi);
public FileArgument(String name, String description) { super(name, description, SINGLE); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/51e4aed2205f326c2698e2154ea7f83ae5dfc2b6/FileArgument.java/buggy/shell/src/shell/org/jnode/shell/help/FileArgument.java
return (double) (model.getValue() - model.getMinimum()) / (model .getMaximum() - model.getMinimum());
return (double) (model.getValue() - model.getMinimum()) / (model.getMaximum() - model.getMinimum());
public double getPercentComplete() { if (getMaximum() == getMinimum()) return 1.0; else return (double) (model.getValue() - model.getMinimum()) / (model .getMaximum() - model.getMinimum()); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JProgressBar.java/buggy/core/src/classpath/javax/javax/swing/JProgressBar.java
border.paintBorder(this, graphics, 0, 0, getWidth(), getHeight());
border.paintBorder(this, graphics, 0, 0, getWidth(), getHeight());
protected void paintBorder(Graphics graphics) { Border border = getBorder(); if (paintBorder && border != null) border.paintBorder(this, graphics, 0, 0, getWidth(), getHeight()); }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JProgressBar.java/buggy/core/src/classpath/javax/javax/swing/JProgressBar.java
firePropertyChange("borderPainted", oldPainted, paintBorder);
firePropertyChange("borderPainted", oldPainted, paintBorder);
public void setBorderPainted(boolean painted) { if (painted != paintBorder) { boolean oldPainted = paintBorder; paintBorder = painted; firePropertyChange("borderPainted", oldPainted, paintBorder); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JProgressBar.java/buggy/core/src/classpath/javax/javax/swing/JProgressBar.java
public void setIndeterminate(boolean newValue)
public void setIndeterminate(boolean flag)
public void setIndeterminate(boolean newValue) { if (indeterminate != newValue) { boolean olddeter = indeterminate; indeterminate = newValue; firePropertyChange("indeterminate", olddeter, indeterminate); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JProgressBar.java/buggy/core/src/classpath/javax/javax/swing/JProgressBar.java
if (indeterminate != newValue)
if (indeterminate != flag)
public void setIndeterminate(boolean newValue) { if (indeterminate != newValue) { boolean olddeter = indeterminate; indeterminate = newValue; firePropertyChange("indeterminate", olddeter, indeterminate); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JProgressBar.java/buggy/core/src/classpath/javax/javax/swing/JProgressBar.java
boolean olddeter = indeterminate; indeterminate = newValue; firePropertyChange("indeterminate", olddeter, indeterminate);
indeterminate = flag; firePropertyChange("indeterminate", !flag, indeterminate);
public void setIndeterminate(boolean newValue) { if (indeterminate != newValue) { boolean olddeter = indeterminate; indeterminate = newValue; firePropertyChange("indeterminate", olddeter, indeterminate); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JProgressBar.java/buggy/core/src/classpath/javax/javax/swing/JProgressBar.java
firePropertyChange("orientation", oldOrientation, this.orientation);
firePropertyChange("orientation", oldOrientation, this.orientation);
public void setOrientation(int orientation) { if (orientation != VERTICAL && orientation != HORIZONTAL) throw new IllegalArgumentException(orientation + " is not a legal orientation"); if (this.orientation != orientation) { int oldOrientation = this.orientation; this.orientation = orientation; firePropertyChange("orientation", oldOrientation, this.orientation); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JProgressBar.java/buggy/core/src/classpath/javax/javax/swing/JProgressBar.java
firePropertyChange("stringPainted", oldPainted, paintString);
firePropertyChange("stringPainted", oldPainted, paintString);
public void setStringPainted(boolean painted) { if (paintString != painted) { boolean oldPainted = paintString; paintString = painted; firePropertyChange("stringPainted", oldPainted, paintString); } }
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/7a2e92fd1a70a7ebb674875e63bf471ea5bca540/JProgressBar.java/buggy/core/src/classpath/javax/javax/swing/JProgressBar.java
if (e.getSource() == incrButton) { if (++currentScrollLocation >= tabCount) currentScrollLocation = tabCount - 1; int width = 0; for (int i = currentScrollLocation - 1; i < tabCount; i++) width += rects[i].width; if (width < viewport.getWidth()) currentScrollLocation--; else if (! decrButton.isEnabled()) decrButton.setEnabled(true); tabPane.revalidate(); tabPane.repaint(); return; } else if (e.getSource() == decrButton) { if (--currentScrollLocation < 0) currentScrollLocation = 0; if (currentScrollLocation == 0) decrButton.setEnabled(false); else if (! incrButton.isEnabled()) incrButton.setEnabled(true); tabPane.revalidate(); tabPane.repaint(); return; }
if (e.getSource() == incrButton) { if (++currentScrollLocation >= tabCount) currentScrollLocation = tabCount - 1; int width = 0; for (int i = currentScrollLocation - 1; i < tabCount; i++) width += rects[i].width; if (width < viewport.getWidth()) currentScrollLocation--; else if (! decrButton.isEnabled()) decrButton.setEnabled(true); tabPane.revalidate(); tabPane.repaint(); return; } else if (e.getSource() == decrButton) { if (--currentScrollLocation < 0) currentScrollLocation = 0; if (currentScrollLocation == 0) decrButton.setEnabled(false); else if (! incrButton.isEnabled()) incrButton.setEnabled(true); tabPane.revalidate(); tabPane.repaint(); return; }
public void mousePressed(MouseEvent e) { int x = e.getX(); int y = e.getY(); int tabCount = tabPane.getTabCount(); if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { if (e.getSource() == incrButton) { if (++currentScrollLocation >= tabCount) currentScrollLocation = tabCount - 1; int width = 0; for (int i = currentScrollLocation - 1; i < tabCount; i++) width += rects[i].width; if (width < viewport.getWidth()) // FIXME: Still getting mouse events after the button is disabled. // incrButton.setEnabled(false); currentScrollLocation--; else if (! decrButton.isEnabled()) decrButton.setEnabled(true); tabPane.revalidate(); tabPane.repaint(); return; } else if (e.getSource() == decrButton) { if (--currentScrollLocation < 0) currentScrollLocation = 0; if (currentScrollLocation == 0) decrButton.setEnabled(false); else if (! incrButton.isEnabled()) incrButton.setEnabled(true); tabPane.revalidate(); tabPane.repaint(); return; } } int index = tabForCoordinate(tabPane, x, y); // We need to check since there are areas where tabs cannot be // e.g. in the inset area. if (index != -1 && tabPane.isEnabledAt(index)) tabPane.setSelectedIndex(index); tabPane.revalidate(); tabPane.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
tabPane.setSelectedIndex(index);
tabPane.setSelectedIndex(index);
public void mousePressed(MouseEvent e) { int x = e.getX(); int y = e.getY(); int tabCount = tabPane.getTabCount(); if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { if (e.getSource() == incrButton) { if (++currentScrollLocation >= tabCount) currentScrollLocation = tabCount - 1; int width = 0; for (int i = currentScrollLocation - 1; i < tabCount; i++) width += rects[i].width; if (width < viewport.getWidth()) // FIXME: Still getting mouse events after the button is disabled. // incrButton.setEnabled(false); currentScrollLocation--; else if (! decrButton.isEnabled()) decrButton.setEnabled(true); tabPane.revalidate(); tabPane.repaint(); return; } else if (e.getSource() == decrButton) { if (--currentScrollLocation < 0) currentScrollLocation = 0; if (currentScrollLocation == 0) decrButton.setEnabled(false); else if (! incrButton.isEnabled()) incrButton.setEnabled(true); tabPane.revalidate(); tabPane.repaint(); return; } } int index = tabForCoordinate(tabPane, x, y); // We need to check since there are areas where tabs cannot be // e.g. in the inset area. if (index != -1 && tabPane.isEnabledAt(index)) tabPane.setSelectedIndex(index); tabPane.revalidate(); tabPane.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
{ layoutManager = createLayoutManager(); tabPane.setLayout(layoutManager);
{ layoutManager = createLayoutManager(); tabPane.setLayout(layoutManager);
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("tabLayoutPolicy")) { layoutManager = createLayoutManager(); tabPane.setLayout(layoutManager); } else if (e.getPropertyName().equals("tabPlacement") && tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { incrButton = createIncreaseButton(); decrButton = createDecreaseButton(); } tabPane.layout(); tabPane.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
&& tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT)
&& tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT)
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("tabLayoutPolicy")) { layoutManager = createLayoutManager(); tabPane.setLayout(layoutManager); } else if (e.getPropertyName().equals("tabPlacement") && tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { incrButton = createIncreaseButton(); decrButton = createDecreaseButton(); } tabPane.layout(); tabPane.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
incrButton = createIncreaseButton(); decrButton = createDecreaseButton();
incrButton = createIncreaseButton(); decrButton = createDecreaseButton();
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("tabLayoutPolicy")) { layoutManager = createLayoutManager(); tabPane.setLayout(layoutManager); } else if (e.getPropertyName().equals("tabPlacement") && tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { incrButton = createIncreaseButton(); decrButton = createDecreaseButton(); } tabPane.layout(); tabPane.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
paintTabArea(g, tabPane.getTabPlacement(), tabPane.getSelectedIndex());
paintTabArea(g, tabPane.getTabPlacement(), tabPane.getSelectedIndex());
public void paint(Graphics g, JComponent c) { paintTabArea(g, tabPane.getTabPlacement(), 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
{
{
public void addLayoutComponent(String name, Component comp) { // Do nothing. }
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
Component visible = getVisibleComponent(); Insets insets = getContentBorderInsets(tabPane.getTabPlacement()); if (visible != null) visible.setBounds(contentRect.x + insets.left, contentRect.y + insets.top, contentRect.width - insets.left - insets.right, contentRect.height - insets.top - insets.bottom);
Component visible = getVisibleComponent(); Insets insets = getContentBorderInsets(tabPane.getTabPlacement()); if (visible != null) visible.setBounds(contentRect.x + insets.left, contentRect.y + insets.top, contentRect.width - insets.left - insets.right, contentRect.height - insets.top - insets.bottom);
public void calculateLayoutInfo() { calculateTabRects(tabPane.getTabPlacement(), tabPane.getTabCount()); if (tabPane.getSelectedIndex() != -1) { Component visible = getVisibleComponent(); Insets insets = getContentBorderInsets(tabPane.getTabPlacement()); if (visible != null) visible.setBounds(contentRect.x + insets.left, contentRect.y + insets.top, contentRect.width - insets.left - insets.right, contentRect.height - insets.top - insets.bottom); } }
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 calculateLayoutInfo() { calculateTabRects(tabPane.getTabPlacement(), tabPane.getTabCount()); if (tabPane.getSelectedIndex() != -1) { Component visible = getVisibleComponent(); Insets insets = getContentBorderInsets(tabPane.getTabPlacement()); if (visible != null) visible.setBounds(contentRect.x + insets.left, contentRect.y + insets.top, contentRect.width - insets.left - insets.right, contentRect.height - insets.top - insets.bottom); } }
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
c = tabPane.getComponentAt(i); if (c == null) continue; calcRect = c.getBounds(); dims = c.getPreferredSize(); if (dims != null) { componentHeight = Math.max(componentHeight, dims.height); componentWidth = Math.max(componentWidth, dims.width); }
c = tabPane.getComponentAt(i); if (c == null) continue; calcRect = c.getBounds(); dims = c.getPreferredSize(); if (dims != null) { componentHeight = Math.max(componentHeight, dims.height); componentWidth = Math.max(componentWidth, dims.width); }
protected Dimension calculateSize(boolean minimum) { int tabPlacement = tabPane.getTabPlacement(); int width = 0; int height = 0; int componentHeight = 0; int componentWidth = 0; Component c; Dimension dims; for (int i = 0; i < tabPane.getTabCount(); i++) { c = tabPane.getComponentAt(i); if (c == null) continue; calcRect = c.getBounds(); dims = c.getPreferredSize(); if (dims != null) { componentHeight = Math.max(componentHeight, dims.height); componentWidth = Math.max(componentWidth, dims.width); } } Insets insets = tabPane.getInsets(); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int min = calculateMaxTabWidth(tabPlacement); width = Math.max(min, componentWidth); int tabAreaHeight = preferredTabAreaHeight(tabPlacement, width); height = tabAreaHeight + componentHeight; } else { int min = calculateMaxTabHeight(tabPlacement); height = Math.max(min, componentHeight); int tabAreaWidth = preferredTabAreaWidth(tabPlacement, height); width = tabAreaWidth + componentWidth; } return new Dimension(width, 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
protected Dimension calculateSize(boolean minimum) { int tabPlacement = tabPane.getTabPlacement(); int width = 0; int height = 0; int componentHeight = 0; int componentWidth = 0; Component c; Dimension dims; for (int i = 0; i < tabPane.getTabCount(); i++) { c = tabPane.getComponentAt(i); if (c == null) continue; calcRect = c.getBounds(); dims = c.getPreferredSize(); if (dims != null) { componentHeight = Math.max(componentHeight, dims.height); componentWidth = Math.max(componentWidth, dims.width); } } Insets insets = tabPane.getInsets(); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int min = calculateMaxTabWidth(tabPlacement); width = Math.max(min, componentWidth); int tabAreaHeight = preferredTabAreaHeight(tabPlacement, width); height = tabAreaHeight + componentHeight; } else { int min = calculateMaxTabHeight(tabPlacement); height = Math.max(min, componentHeight); int tabAreaWidth = preferredTabAreaWidth(tabPlacement, height); width = tabAreaWidth + componentWidth; } return new Dimension(width, 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
int min = calculateMaxTabWidth(tabPlacement); width = Math.max(min, componentWidth); int tabAreaHeight = preferredTabAreaHeight(tabPlacement, width); height = tabAreaHeight + componentHeight;
int min = calculateMaxTabWidth(tabPlacement); width = Math.max(min, componentWidth); int tabAreaHeight = preferredTabAreaHeight(tabPlacement, width); height = tabAreaHeight + componentHeight;
protected Dimension calculateSize(boolean minimum) { int tabPlacement = tabPane.getTabPlacement(); int width = 0; int height = 0; int componentHeight = 0; int componentWidth = 0; Component c; Dimension dims; for (int i = 0; i < tabPane.getTabCount(); i++) { c = tabPane.getComponentAt(i); if (c == null) continue; calcRect = c.getBounds(); dims = c.getPreferredSize(); if (dims != null) { componentHeight = Math.max(componentHeight, dims.height); componentWidth = Math.max(componentWidth, dims.width); } } Insets insets = tabPane.getInsets(); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int min = calculateMaxTabWidth(tabPlacement); width = Math.max(min, componentWidth); int tabAreaHeight = preferredTabAreaHeight(tabPlacement, width); height = tabAreaHeight + componentHeight; } else { int min = calculateMaxTabHeight(tabPlacement); height = Math.max(min, componentHeight); int tabAreaWidth = preferredTabAreaWidth(tabPlacement, height); width = tabAreaWidth + componentWidth; } return new Dimension(width, 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
int min = calculateMaxTabHeight(tabPlacement); height = Math.max(min, componentHeight); int tabAreaWidth = preferredTabAreaWidth(tabPlacement, height); width = tabAreaWidth + componentWidth;
int min = calculateMaxTabHeight(tabPlacement); height = Math.max(min, componentHeight); int tabAreaWidth = preferredTabAreaWidth(tabPlacement, height); width = tabAreaWidth + componentWidth;
protected Dimension calculateSize(boolean minimum) { int tabPlacement = tabPane.getTabPlacement(); int width = 0; int height = 0; int componentHeight = 0; int componentWidth = 0; Component c; Dimension dims; for (int i = 0; i < tabPane.getTabCount(); i++) { c = tabPane.getComponentAt(i); if (c == null) continue; calcRect = c.getBounds(); dims = c.getPreferredSize(); if (dims != null) { componentHeight = Math.max(componentHeight, dims.height); componentWidth = Math.max(componentWidth, dims.width); } } Insets insets = tabPane.getInsets(); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int min = calculateMaxTabWidth(tabPlacement); width = Math.max(min, componentWidth); int tabAreaHeight = preferredTabAreaHeight(tabPlacement, width); height = tabAreaHeight + componentHeight; } else { int min = calculateMaxTabHeight(tabPlacement); height = Math.max(min, componentHeight); int tabAreaWidth = preferredTabAreaWidth(tabPlacement, height); width = tabAreaWidth + componentWidth; } return new Dimension(width, 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
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 = 0; int start = getTabRunIndent(tabPlacement, 1); 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; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); if (runWidth + width > max) { runWidth = tabAreaInsets.left + insets.left + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; } } runs++; 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 + insets.top; int height = 0; start += tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); if (runHeight + height > max) { runHeight = tabAreaInsets.top + insets.top + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; } } runs++; 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; tabRuns[0] = 0; normalizeTabRuns(tabPlacement, tabCount, start, max); selectedRun = getRunForTab(tabCount, tabPane.getSelectedIndex()); if (shouldRotateTabRuns(tabPlacement)) rotateTabRuns(tabPlacement, selectedRun); // Need to pad the runs and move them to the correct location. 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 (shouldPadTabRun(tabPlacement, i)) padTabRun(tabPlacement, first, last, max); // Done padding, now need to move it. if (tabPlacement == SwingConstants.TOP && i > 0) { for (int j = first; j <= last; j++) rects[j].y += (runCount - i) * maxTabHeight - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.BOTTOM) { int height = tabPane.getBounds().height - insets.bottom - tabAreaInsets.bottom; int adjustment; if (i == 0) adjustment = height - maxTabHeight; else adjustment = height - (runCount - i + 1) * maxTabHeight - (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].y = adjustment; } if (tabPlacement == SwingConstants.LEFT && i > 0) { for (int j = first; j <= last; j++) rects[j].x += (runCount - i) * maxTabWidth - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.RIGHT) { int width = tabPane.getBounds().width - insets.right - tabAreaInsets.right; int adjustment; if (i == 0) adjustment = width - maxTabWidth; else adjustment = width - (runCount - i + 1) * maxTabWidth + (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].x = adjustment; } } 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);
int maxHeight = calculateMaxTabHeight(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 = 0; int start = getTabRunIndent(tabPlacement, 1); 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; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); if (runWidth + width > max) { runWidth = tabAreaInsets.left + insets.left + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; } } runs++; 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 + insets.top; int height = 0; start += tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); if (runHeight + height > max) { runHeight = tabAreaInsets.top + insets.top + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; } } runs++; 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; tabRuns[0] = 0; normalizeTabRuns(tabPlacement, tabCount, start, max); selectedRun = getRunForTab(tabCount, tabPane.getSelectedIndex()); if (shouldRotateTabRuns(tabPlacement)) rotateTabRuns(tabPlacement, selectedRun); // Need to pad the runs and move them to the correct location. 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 (shouldPadTabRun(tabPlacement, i)) padTabRun(tabPlacement, first, last, max); // Done padding, now need to move it. if (tabPlacement == SwingConstants.TOP && i > 0) { for (int j = first; j <= last; j++) rects[j].y += (runCount - i) * maxTabHeight - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.BOTTOM) { int height = tabPane.getBounds().height - insets.bottom - tabAreaInsets.bottom; int adjustment; if (i == 0) adjustment = height - maxTabHeight; else adjustment = height - (runCount - i + 1) * maxTabHeight - (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].y = adjustment; } if (tabPlacement == SwingConstants.LEFT && i > 0) { for (int j = first; j <= last; j++) rects[j].x += (runCount - i) * maxTabWidth - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.RIGHT) { int width = tabPane.getBounds().width - insets.right - tabAreaInsets.right; int adjustment; if (i == 0) adjustment = width - maxTabWidth; else adjustment = width - (runCount - i + 1) * maxTabWidth + (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].x = adjustment; } } 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.width -= tabAreaInsets.left + tabAreaInsets.right; max = calcRect.width + tabAreaInsets.left + insets.left; start += tabAreaInsets.left + insets.left; int width = 0; int runWidth = start;
calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; max = calcRect.width + tabAreaInsets.left + insets.left; start += tabAreaInsets.left + insets.left; int width = 0; int runWidth = start;
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 = 0; int start = getTabRunIndent(tabPlacement, 1); 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; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); if (runWidth + width > max) { runWidth = tabAreaInsets.left + insets.left + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; } } runs++; 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 + insets.top; int height = 0; start += tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); if (runHeight + height > max) { runHeight = tabAreaInsets.top + insets.top + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; } } runs++; 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; tabRuns[0] = 0; normalizeTabRuns(tabPlacement, tabCount, start, max); selectedRun = getRunForTab(tabCount, tabPane.getSelectedIndex()); if (shouldRotateTabRuns(tabPlacement)) rotateTabRuns(tabPlacement, selectedRun); // Need to pad the runs and move them to the correct location. 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 (shouldPadTabRun(tabPlacement, i)) padTabRun(tabPlacement, first, last, max); // Done padding, now need to move it. if (tabPlacement == SwingConstants.TOP && i > 0) { for (int j = first; j <= last; j++) rects[j].y += (runCount - i) * maxTabHeight - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.BOTTOM) { int height = tabPane.getBounds().height - insets.bottom - tabAreaInsets.bottom; int adjustment; if (i == 0) adjustment = height - maxTabHeight; else adjustment = height - (runCount - i + 1) * maxTabHeight - (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].y = adjustment; } if (tabPlacement == SwingConstants.LEFT && i > 0) { for (int j = first; j <= last; j++) rects[j].x += (runCount - i) * maxTabWidth - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.RIGHT) { int width = tabPane.getBounds().width - insets.right - tabAreaInsets.right; int adjustment; if (i == 0) adjustment = width - maxTabWidth; else adjustment = width - (runCount - i + 1) * maxTabWidth + (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].x = adjustment; } } 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
for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm);
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 = 0; int start = getTabRunIndent(tabPlacement, 1); 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; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); if (runWidth + width > max) { runWidth = tabAreaInsets.left + insets.left + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; } } runs++; 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 + insets.top; int height = 0; start += tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); if (runHeight + height > max) { runHeight = tabAreaInsets.top + insets.top + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; } } runs++; 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; tabRuns[0] = 0; normalizeTabRuns(tabPlacement, tabCount, start, max); selectedRun = getRunForTab(tabCount, tabPane.getSelectedIndex()); if (shouldRotateTabRuns(tabPlacement)) rotateTabRuns(tabPlacement, selectedRun); // Need to pad the runs and move them to the correct location. 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 (shouldPadTabRun(tabPlacement, i)) padTabRun(tabPlacement, first, last, max); // Done padding, now need to move it. if (tabPlacement == SwingConstants.TOP && i > 0) { for (int j = first; j <= last; j++) rects[j].y += (runCount - i) * maxTabHeight - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.BOTTOM) { int height = tabPane.getBounds().height - insets.bottom - tabAreaInsets.bottom; int adjustment; if (i == 0) adjustment = height - maxTabHeight; else adjustment = height - (runCount - i + 1) * maxTabHeight - (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].y = adjustment; } if (tabPlacement == SwingConstants.LEFT && i > 0) { for (int j = first; j <= last; j++) rects[j].x += (runCount - i) * maxTabWidth - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.RIGHT) { int width = tabPane.getBounds().width - insets.right - tabAreaInsets.right; int adjustment; if (i == 0) adjustment = width - maxTabWidth; else adjustment = width - (runCount - i + 1) * maxTabWidth + (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].x = adjustment; } } 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
if (runWidth + width > max) { runWidth = tabAreaInsets.left + insets.left + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; } } runs++; 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; }
if (runWidth + width > max) { runWidth = tabAreaInsets.left + insets.left + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; } } runs++; 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 = 0; int start = getTabRunIndent(tabPlacement, 1); 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; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); if (runWidth + width > max) { runWidth = tabAreaInsets.left + insets.left + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; } } runs++; 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 + insets.top; int height = 0; start += tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); if (runHeight + height > max) { runHeight = tabAreaInsets.top + insets.top + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; } } runs++; 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; tabRuns[0] = 0; normalizeTabRuns(tabPlacement, tabCount, start, max); selectedRun = getRunForTab(tabCount, tabPane.getSelectedIndex()); if (shouldRotateTabRuns(tabPlacement)) rotateTabRuns(tabPlacement, selectedRun); // Need to pad the runs and move them to the correct location. 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 (shouldPadTabRun(tabPlacement, i)) padTabRun(tabPlacement, first, last, max); // Done padding, now need to move it. if (tabPlacement == SwingConstants.TOP && i > 0) { for (int j = first; j <= last; j++) rects[j].y += (runCount - i) * maxTabHeight - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.BOTTOM) { int height = tabPane.getBounds().height - insets.bottom - tabAreaInsets.bottom; int adjustment; if (i == 0) adjustment = height - maxTabHeight; else adjustment = height - (runCount - i + 1) * maxTabHeight - (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].y = adjustment; } if (tabPlacement == SwingConstants.LEFT && i > 0) { for (int j = first; j <= last; j++) rects[j].x += (runCount - i) * maxTabWidth - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.RIGHT) { int width = tabPane.getBounds().width - insets.right - tabAreaInsets.right; int adjustment; if (i == 0) adjustment = width - maxTabWidth; else adjustment = width - (runCount - i + 1) * maxTabWidth + (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].x = adjustment; } } 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); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; max = calcRect.height + tabAreaInsets.top + insets.top;
int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; max = calcRect.height + tabAreaInsets.top + insets.top;
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 = 0; int start = getTabRunIndent(tabPlacement, 1); 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; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); if (runWidth + width > max) { runWidth = tabAreaInsets.left + insets.left + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; } } runs++; 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 + insets.top; int height = 0; start += tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); if (runHeight + height > max) { runHeight = tabAreaInsets.top + insets.top + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; } } runs++; 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; tabRuns[0] = 0; normalizeTabRuns(tabPlacement, tabCount, start, max); selectedRun = getRunForTab(tabCount, tabPane.getSelectedIndex()); if (shouldRotateTabRuns(tabPlacement)) rotateTabRuns(tabPlacement, selectedRun); // Need to pad the runs and move them to the correct location. 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 (shouldPadTabRun(tabPlacement, i)) padTabRun(tabPlacement, first, last, max); // Done padding, now need to move it. if (tabPlacement == SwingConstants.TOP && i > 0) { for (int j = first; j <= last; j++) rects[j].y += (runCount - i) * maxTabHeight - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.BOTTOM) { int height = tabPane.getBounds().height - insets.bottom - tabAreaInsets.bottom; int adjustment; if (i == 0) adjustment = height - maxTabHeight; else adjustment = height - (runCount - i + 1) * maxTabHeight - (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].y = adjustment; } if (tabPlacement == SwingConstants.LEFT && i > 0) { for (int j = first; j <= last; j++) rects[j].x += (runCount - i) * maxTabWidth - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.RIGHT) { int width = tabPane.getBounds().width - insets.right - tabAreaInsets.right; int adjustment; if (i == 0) adjustment = width - maxTabWidth; else adjustment = width - (runCount - i + 1) * maxTabWidth + (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].x = adjustment; } } 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 height = 0; start += tabAreaInsets.top + insets.top; int runHeight = start;
int height = 0; start += tabAreaInsets.top + insets.top; int runHeight = start;
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 = 0; int start = getTabRunIndent(tabPlacement, 1); 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; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); if (runWidth + width > max) { runWidth = tabAreaInsets.left + insets.left + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; } } runs++; 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 + insets.top; int height = 0; start += tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); if (runHeight + height > max) { runHeight = tabAreaInsets.top + insets.top + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; } } runs++; 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; tabRuns[0] = 0; normalizeTabRuns(tabPlacement, tabCount, start, max); selectedRun = getRunForTab(tabCount, tabPane.getSelectedIndex()); if (shouldRotateTabRuns(tabPlacement)) rotateTabRuns(tabPlacement, selectedRun); // Need to pad the runs and move them to the correct location. 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 (shouldPadTabRun(tabPlacement, i)) padTabRun(tabPlacement, first, last, max); // Done padding, now need to move it. if (tabPlacement == SwingConstants.TOP && i > 0) { for (int j = first; j <= last; j++) rects[j].y += (runCount - i) * maxTabHeight - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.BOTTOM) { int height = tabPane.getBounds().height - insets.bottom - tabAreaInsets.bottom; int adjustment; if (i == 0) adjustment = height - maxTabHeight; else adjustment = height - (runCount - i + 1) * maxTabHeight - (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].y = adjustment; } if (tabPlacement == SwingConstants.LEFT && i > 0) { for (int j = first; j <= last; j++) rects[j].x += (runCount - i) * maxTabWidth - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.RIGHT) { int width = tabPane.getBounds().width - insets.right - tabAreaInsets.right; int adjustment; if (i == 0) adjustment = width - maxTabWidth; else adjustment = width - (runCount - i + 1) * maxTabWidth + (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].x = adjustment; } } 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 fontHeight = fm.getHeight();
int fontHeight = fm.getHeight();
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 = 0; int start = getTabRunIndent(tabPlacement, 1); 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; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); if (runWidth + width > max) { runWidth = tabAreaInsets.left + insets.left + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; } } runs++; 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 + insets.top; int height = 0; start += tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); if (runHeight + height > max) { runHeight = tabAreaInsets.top + insets.top + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; } } runs++; 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; tabRuns[0] = 0; normalizeTabRuns(tabPlacement, tabCount, start, max); selectedRun = getRunForTab(tabCount, tabPane.getSelectedIndex()); if (shouldRotateTabRuns(tabPlacement)) rotateTabRuns(tabPlacement, selectedRun); // Need to pad the runs and move them to the correct location. 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 (shouldPadTabRun(tabPlacement, i)) padTabRun(tabPlacement, first, last, max); // Done padding, now need to move it. if (tabPlacement == SwingConstants.TOP && i > 0) { for (int j = first; j <= last; j++) rects[j].y += (runCount - i) * maxTabHeight - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.BOTTOM) { int height = tabPane.getBounds().height - insets.bottom - tabAreaInsets.bottom; int adjustment; if (i == 0) adjustment = height - maxTabHeight; else adjustment = height - (runCount - i + 1) * maxTabHeight - (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].y = adjustment; } if (tabPlacement == SwingConstants.LEFT && i > 0) { for (int j = first; j <= last; j++) rects[j].x += (runCount - i) * maxTabWidth - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.RIGHT) { int width = tabPane.getBounds().width - insets.right - tabAreaInsets.right; int adjustment; if (i == 0) adjustment = width - maxTabWidth; else adjustment = width - (runCount - i + 1) * maxTabWidth + (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].x = adjustment; } } 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
for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); if (runHeight + height > max) { runHeight = tabAreaInsets.top + insets.top + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; } } runs++;
for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); if (runHeight + height > max) { runHeight = tabAreaInsets.top + insets.top + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; } } runs++;
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 = 0; int start = getTabRunIndent(tabPlacement, 1); 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; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); if (runWidth + width > max) { runWidth = tabAreaInsets.left + insets.left + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; } } runs++; 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 + insets.top; int height = 0; start += tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); if (runHeight + height > max) { runHeight = tabAreaInsets.top + insets.top + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; } } runs++; 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; tabRuns[0] = 0; normalizeTabRuns(tabPlacement, tabCount, start, max); selectedRun = getRunForTab(tabCount, tabPane.getSelectedIndex()); if (shouldRotateTabRuns(tabPlacement)) rotateTabRuns(tabPlacement, selectedRun); // Need to pad the runs and move them to the correct location. 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 (shouldPadTabRun(tabPlacement, i)) padTabRun(tabPlacement, first, last, max); // Done padding, now need to move it. if (tabPlacement == SwingConstants.TOP && i > 0) { for (int j = first; j <= last; j++) rects[j].y += (runCount - i) * maxTabHeight - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.BOTTOM) { int height = tabPane.getBounds().height - insets.bottom - tabAreaInsets.bottom; int adjustment; if (i == 0) adjustment = height - maxTabHeight; else adjustment = height - (runCount - i + 1) * maxTabHeight - (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].y = adjustment; } if (tabPlacement == SwingConstants.LEFT && i > 0) { for (int j = first; j <= last; j++) rects[j].x += (runCount - i) * maxTabWidth - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.RIGHT) { int width = tabPane.getBounds().width - insets.right - tabAreaInsets.right; int adjustment; if (i == 0) adjustment = width - maxTabWidth; else adjustment = width - (runCount - i + 1) * maxTabWidth + (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].x = adjustment; } } 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
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; }
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 = 0; int start = getTabRunIndent(tabPlacement, 1); 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; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); if (runWidth + width > max) { runWidth = tabAreaInsets.left + insets.left + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; } } runs++; 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 + insets.top; int height = 0; start += tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); if (runHeight + height > max) { runHeight = tabAreaInsets.top + insets.top + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; } } runs++; 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; tabRuns[0] = 0; normalizeTabRuns(tabPlacement, tabCount, start, max); selectedRun = getRunForTab(tabCount, tabPane.getSelectedIndex()); if (shouldRotateTabRuns(tabPlacement)) rotateTabRuns(tabPlacement, selectedRun); // Need to pad the runs and move them to the correct location. 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 (shouldPadTabRun(tabPlacement, i)) padTabRun(tabPlacement, first, last, max); // Done padding, now need to move it. if (tabPlacement == SwingConstants.TOP && i > 0) { for (int j = first; j <= last; j++) rects[j].y += (runCount - i) * maxTabHeight - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.BOTTOM) { int height = tabPane.getBounds().height - insets.bottom - tabAreaInsets.bottom; int adjustment; if (i == 0) adjustment = height - maxTabHeight; else adjustment = height - (runCount - i + 1) * maxTabHeight - (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].y = adjustment; } if (tabPlacement == SwingConstants.LEFT && i > 0) { for (int j = first; j <= last; j++) rects[j].x += (runCount - i) * maxTabWidth - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.RIGHT) { int width = tabPane.getBounds().width - insets.right - tabAreaInsets.right; int adjustment; if (i == 0) adjustment = width - maxTabWidth; else adjustment = width - (runCount - i + 1) * maxTabWidth + (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].x = adjustment; } } 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
rotateTabRuns(tabPlacement, selectedRun);
rotateTabRuns(tabPlacement, selectedRun);
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 = 0; int start = getTabRunIndent(tabPlacement, 1); 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; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); if (runWidth + width > max) { runWidth = tabAreaInsets.left + insets.left + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; } } runs++; 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 + insets.top; int height = 0; start += tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); if (runHeight + height > max) { runHeight = tabAreaInsets.top + insets.top + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; } } runs++; 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; tabRuns[0] = 0; normalizeTabRuns(tabPlacement, tabCount, start, max); selectedRun = getRunForTab(tabCount, tabPane.getSelectedIndex()); if (shouldRotateTabRuns(tabPlacement)) rotateTabRuns(tabPlacement, selectedRun); // Need to pad the runs and move them to the correct location. 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 (shouldPadTabRun(tabPlacement, i)) padTabRun(tabPlacement, first, last, max); // Done padding, now need to move it. if (tabPlacement == SwingConstants.TOP && i > 0) { for (int j = first; j <= last; j++) rects[j].y += (runCount - i) * maxTabHeight - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.BOTTOM) { int height = tabPane.getBounds().height - insets.bottom - tabAreaInsets.bottom; int adjustment; if (i == 0) adjustment = height - maxTabHeight; else adjustment = height - (runCount - i + 1) * maxTabHeight - (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].y = adjustment; } if (tabPlacement == SwingConstants.LEFT && i > 0) { for (int j = first; j <= last; j++) rects[j].x += (runCount - i) * maxTabWidth - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.RIGHT) { int width = tabPane.getBounds().width - insets.right - tabAreaInsets.right; int adjustment; if (i == 0) adjustment = width - maxTabWidth; else adjustment = width - (runCount - i + 1) * maxTabWidth + (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].x = adjustment; } } 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 first = lastTabInRun(tabCount, getPreviousTabRun(i)) + 1; if (first == tabCount) first = 0; int last = lastTabInRun(tabCount, i); if (shouldPadTabRun(tabPlacement, i)) padTabRun(tabPlacement, first, last, max);
int first = lastTabInRun(tabCount, getPreviousTabRun(i)) + 1; if (first == tabCount) first = 0; int last = lastTabInRun(tabCount, i); if (shouldPadTabRun(tabPlacement, i)) padTabRun(tabPlacement, first, last, max);
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 = 0; int start = getTabRunIndent(tabPlacement, 1); 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; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); if (runWidth + width > max) { runWidth = tabAreaInsets.left + insets.left + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; } } runs++; 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 + insets.top; int height = 0; start += tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); if (runHeight + height > max) { runHeight = tabAreaInsets.top + insets.top + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; } } runs++; 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; tabRuns[0] = 0; normalizeTabRuns(tabPlacement, tabCount, start, max); selectedRun = getRunForTab(tabCount, tabPane.getSelectedIndex()); if (shouldRotateTabRuns(tabPlacement)) rotateTabRuns(tabPlacement, selectedRun); // Need to pad the runs and move them to the correct location. 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 (shouldPadTabRun(tabPlacement, i)) padTabRun(tabPlacement, first, last, max); // Done padding, now need to move it. if (tabPlacement == SwingConstants.TOP && i > 0) { for (int j = first; j <= last; j++) rects[j].y += (runCount - i) * maxTabHeight - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.BOTTOM) { int height = tabPane.getBounds().height - insets.bottom - tabAreaInsets.bottom; int adjustment; if (i == 0) adjustment = height - maxTabHeight; else adjustment = height - (runCount - i + 1) * maxTabHeight - (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].y = adjustment; } if (tabPlacement == SwingConstants.LEFT && i > 0) { for (int j = first; j <= last; j++) rects[j].x += (runCount - i) * maxTabWidth - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.RIGHT) { int width = tabPane.getBounds().width - insets.right - tabAreaInsets.right; int adjustment; if (i == 0) adjustment = width - maxTabWidth; else adjustment = width - (runCount - i + 1) * maxTabWidth + (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].x = adjustment; } } 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
if (tabPlacement == SwingConstants.TOP && i > 0) { for (int j = first; j <= last; j++) rects[j].y += (runCount - i) * maxTabHeight - (runCount - i) * tabRunOverlay; }
if (tabPlacement == SwingConstants.TOP && i > 0) { for (int j = first; j <= last; j++) rects[j].y += (runCount - i) * maxTabHeight - (runCount - i) * tabRunOverlay; }
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 = 0; int start = getTabRunIndent(tabPlacement, 1); 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; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); if (runWidth + width > max) { runWidth = tabAreaInsets.left + insets.left + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; } } runs++; 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 + insets.top; int height = 0; start += tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); if (runHeight + height > max) { runHeight = tabAreaInsets.top + insets.top + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; } } runs++; 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; tabRuns[0] = 0; normalizeTabRuns(tabPlacement, tabCount, start, max); selectedRun = getRunForTab(tabCount, tabPane.getSelectedIndex()); if (shouldRotateTabRuns(tabPlacement)) rotateTabRuns(tabPlacement, selectedRun); // Need to pad the runs and move them to the correct location. 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 (shouldPadTabRun(tabPlacement, i)) padTabRun(tabPlacement, first, last, max); // Done padding, now need to move it. if (tabPlacement == SwingConstants.TOP && i > 0) { for (int j = first; j <= last; j++) rects[j].y += (runCount - i) * maxTabHeight - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.BOTTOM) { int height = tabPane.getBounds().height - insets.bottom - tabAreaInsets.bottom; int adjustment; if (i == 0) adjustment = height - maxTabHeight; else adjustment = height - (runCount - i + 1) * maxTabHeight - (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].y = adjustment; } if (tabPlacement == SwingConstants.LEFT && i > 0) { for (int j = first; j <= last; j++) rects[j].x += (runCount - i) * maxTabWidth - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.RIGHT) { int width = tabPane.getBounds().width - insets.right - tabAreaInsets.right; int adjustment; if (i == 0) adjustment = width - maxTabWidth; else adjustment = width - (runCount - i + 1) * maxTabWidth + (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].x = adjustment; } } 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
if (tabPlacement == SwingConstants.BOTTOM) { int height = tabPane.getBounds().height - insets.bottom - tabAreaInsets.bottom; int adjustment; if (i == 0) adjustment = height - maxTabHeight; else adjustment = height - (runCount - i + 1) * maxTabHeight - (runCount - i) * tabRunOverlay;
if (tabPlacement == SwingConstants.BOTTOM) { int height = tabPane.getBounds().height - insets.bottom - tabAreaInsets.bottom; int adjustment; if (i == 0) adjustment = height - maxTabHeight; else adjustment = height - (runCount - i + 1) * maxTabHeight - (runCount - i) * tabRunOverlay;
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 = 0; int start = getTabRunIndent(tabPlacement, 1); 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; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); if (runWidth + width > max) { runWidth = tabAreaInsets.left + insets.left + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; } } runs++; 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 + insets.top; int height = 0; start += tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); if (runHeight + height > max) { runHeight = tabAreaInsets.top + insets.top + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; } } runs++; 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; tabRuns[0] = 0; normalizeTabRuns(tabPlacement, tabCount, start, max); selectedRun = getRunForTab(tabCount, tabPane.getSelectedIndex()); if (shouldRotateTabRuns(tabPlacement)) rotateTabRuns(tabPlacement, selectedRun); // Need to pad the runs and move them to the correct location. 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 (shouldPadTabRun(tabPlacement, i)) padTabRun(tabPlacement, first, last, max); // Done padding, now need to move it. if (tabPlacement == SwingConstants.TOP && i > 0) { for (int j = first; j <= last; j++) rects[j].y += (runCount - i) * maxTabHeight - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.BOTTOM) { int height = tabPane.getBounds().height - insets.bottom - tabAreaInsets.bottom; int adjustment; if (i == 0) adjustment = height - maxTabHeight; else adjustment = height - (runCount - i + 1) * maxTabHeight - (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].y = adjustment; } if (tabPlacement == SwingConstants.LEFT && i > 0) { for (int j = first; j <= last; j++) rects[j].x += (runCount - i) * maxTabWidth - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.RIGHT) { int width = tabPane.getBounds().width - insets.right - tabAreaInsets.right; int adjustment; if (i == 0) adjustment = width - maxTabWidth; else adjustment = width - (runCount - i + 1) * maxTabWidth + (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].x = adjustment; } } 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
for (int j = first; j <= last; j++) rects[j].y = adjustment; }
for (int j = first; j <= last; j++) rects[j].y = adjustment; }
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 = 0; int start = getTabRunIndent(tabPlacement, 1); 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; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); if (runWidth + width > max) { runWidth = tabAreaInsets.left + insets.left + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; } } runs++; 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 + insets.top; int height = 0; start += tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); if (runHeight + height > max) { runHeight = tabAreaInsets.top + insets.top + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; } } runs++; 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; tabRuns[0] = 0; normalizeTabRuns(tabPlacement, tabCount, start, max); selectedRun = getRunForTab(tabCount, tabPane.getSelectedIndex()); if (shouldRotateTabRuns(tabPlacement)) rotateTabRuns(tabPlacement, selectedRun); // Need to pad the runs and move them to the correct location. 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 (shouldPadTabRun(tabPlacement, i)) padTabRun(tabPlacement, first, last, max); // Done padding, now need to move it. if (tabPlacement == SwingConstants.TOP && i > 0) { for (int j = first; j <= last; j++) rects[j].y += (runCount - i) * maxTabHeight - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.BOTTOM) { int height = tabPane.getBounds().height - insets.bottom - tabAreaInsets.bottom; int adjustment; if (i == 0) adjustment = height - maxTabHeight; else adjustment = height - (runCount - i + 1) * maxTabHeight - (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].y = adjustment; } if (tabPlacement == SwingConstants.LEFT && i > 0) { for (int j = first; j <= last; j++) rects[j].x += (runCount - i) * maxTabWidth - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.RIGHT) { int width = tabPane.getBounds().width - insets.right - tabAreaInsets.right; int adjustment; if (i == 0) adjustment = width - maxTabWidth; else adjustment = width - (runCount - i + 1) * maxTabWidth + (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].x = adjustment; } } 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
if (tabPlacement == SwingConstants.LEFT && i > 0) { for (int j = first; j <= last; j++) rects[j].x += (runCount - i) * maxTabWidth - (runCount - i) * tabRunOverlay; }
if (tabPlacement == SwingConstants.LEFT && i > 0) { for (int j = first; j <= last; j++) rects[j].x += (runCount - i) * maxTabWidth - (runCount - i) * tabRunOverlay; }
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 = 0; int start = getTabRunIndent(tabPlacement, 1); 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; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); if (runWidth + width > max) { runWidth = tabAreaInsets.left + insets.left + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; } } runs++; 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 + insets.top; int height = 0; start += tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); if (runHeight + height > max) { runHeight = tabAreaInsets.top + insets.top + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; } } runs++; 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; tabRuns[0] = 0; normalizeTabRuns(tabPlacement, tabCount, start, max); selectedRun = getRunForTab(tabCount, tabPane.getSelectedIndex()); if (shouldRotateTabRuns(tabPlacement)) rotateTabRuns(tabPlacement, selectedRun); // Need to pad the runs and move them to the correct location. 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 (shouldPadTabRun(tabPlacement, i)) padTabRun(tabPlacement, first, last, max); // Done padding, now need to move it. if (tabPlacement == SwingConstants.TOP && i > 0) { for (int j = first; j <= last; j++) rects[j].y += (runCount - i) * maxTabHeight - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.BOTTOM) { int height = tabPane.getBounds().height - insets.bottom - tabAreaInsets.bottom; int adjustment; if (i == 0) adjustment = height - maxTabHeight; else adjustment = height - (runCount - i + 1) * maxTabHeight - (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].y = adjustment; } if (tabPlacement == SwingConstants.LEFT && i > 0) { for (int j = first; j <= last; j++) rects[j].x += (runCount - i) * maxTabWidth - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.RIGHT) { int width = tabPane.getBounds().width - insets.right - tabAreaInsets.right; int adjustment; if (i == 0) adjustment = width - maxTabWidth; else adjustment = width - (runCount - i + 1) * maxTabWidth + (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].x = adjustment; } } 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
if (tabPlacement == SwingConstants.RIGHT) { int width = tabPane.getBounds().width - insets.right - tabAreaInsets.right; int adjustment; if (i == 0) adjustment = width - maxTabWidth; else adjustment = width - (runCount - i + 1) * maxTabWidth + (runCount - i) * tabRunOverlay;
if (tabPlacement == SwingConstants.RIGHT) { int width = tabPane.getBounds().width - insets.right - tabAreaInsets.right; int adjustment; if (i == 0) adjustment = width - maxTabWidth; else adjustment = width - (runCount - i + 1) * maxTabWidth + (runCount - i) * tabRunOverlay;
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 = 0; int start = getTabRunIndent(tabPlacement, 1); 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; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); if (runWidth + width > max) { runWidth = tabAreaInsets.left + insets.left + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; } } runs++; 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 + insets.top; int height = 0; start += tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); if (runHeight + height > max) { runHeight = tabAreaInsets.top + insets.top + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; } } runs++; 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; tabRuns[0] = 0; normalizeTabRuns(tabPlacement, tabCount, start, max); selectedRun = getRunForTab(tabCount, tabPane.getSelectedIndex()); if (shouldRotateTabRuns(tabPlacement)) rotateTabRuns(tabPlacement, selectedRun); // Need to pad the runs and move them to the correct location. 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 (shouldPadTabRun(tabPlacement, i)) padTabRun(tabPlacement, first, last, max); // Done padding, now need to move it. if (tabPlacement == SwingConstants.TOP && i > 0) { for (int j = first; j <= last; j++) rects[j].y += (runCount - i) * maxTabHeight - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.BOTTOM) { int height = tabPane.getBounds().height - insets.bottom - tabAreaInsets.bottom; int adjustment; if (i == 0) adjustment = height - maxTabHeight; else adjustment = height - (runCount - i + 1) * maxTabHeight - (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].y = adjustment; } if (tabPlacement == SwingConstants.LEFT && i > 0) { for (int j = first; j <= last; j++) rects[j].x += (runCount - i) * maxTabWidth - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.RIGHT) { int width = tabPane.getBounds().width - insets.right - tabAreaInsets.right; int adjustment; if (i == 0) adjustment = width - maxTabWidth; else adjustment = width - (runCount - i + 1) * maxTabWidth + (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].x = adjustment; } } 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
for (int j = first; j <= last; j++) rects[j].x = adjustment; }
for (int j = first; j <= last; j++) rects[j].x = adjustment; }
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 = 0; int start = getTabRunIndent(tabPlacement, 1); 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; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); if (runWidth + width > max) { runWidth = tabAreaInsets.left + insets.left + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(runWidth, insets.top + tabAreaInsets.top, width, maxHeight); runWidth += width; } } runs++; 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 + insets.top; int height = 0; start += tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); if (runHeight + height > max) { runHeight = tabAreaInsets.top + insets.top + getTabRunIndent(tabPlacement, ++runs); rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; if (runs > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runs] = i; } else { rects[i] = new Rectangle(insets.left + tabAreaInsets.left, runHeight, maxWidth, height); runHeight += height; } } runs++; 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; tabRuns[0] = 0; normalizeTabRuns(tabPlacement, tabCount, start, max); selectedRun = getRunForTab(tabCount, tabPane.getSelectedIndex()); if (shouldRotateTabRuns(tabPlacement)) rotateTabRuns(tabPlacement, selectedRun); // Need to pad the runs and move them to the correct location. 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 (shouldPadTabRun(tabPlacement, i)) padTabRun(tabPlacement, first, last, max); // Done padding, now need to move it. if (tabPlacement == SwingConstants.TOP && i > 0) { for (int j = first; j <= last; j++) rects[j].y += (runCount - i) * maxTabHeight - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.BOTTOM) { int height = tabPane.getBounds().height - insets.bottom - tabAreaInsets.bottom; int adjustment; if (i == 0) adjustment = height - maxTabHeight; else adjustment = height - (runCount - i + 1) * maxTabHeight - (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].y = adjustment; } if (tabPlacement == SwingConstants.LEFT && i > 0) { for (int j = first; j <= last; j++) rects[j].x += (runCount - i) * maxTabWidth - (runCount - i) * tabRunOverlay; } if (tabPlacement == SwingConstants.RIGHT) { int width = tabPane.getBounds().width - insets.right - tabAreaInsets.right; int adjustment; if (i == 0) adjustment = width - maxTabWidth; else adjustment = width - (runCount - i + 1) * maxTabWidth + (runCount - i) * tabRunOverlay; for (int j = first; j <= last; j++) rects[j].x = adjustment; } } 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
for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.x + currRun.width; int spaceInNext = nextRun.x + nextRun.width;
for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.x + currRun.width; int spaceInNext = nextRun.x + nextRun.width;
protected void normalizeTabRuns(int tabPlacement, int tabCount, int start, int max) { Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingUtilities.TOP || tabPlacement == SwingUtilities.BOTTOM) { // We should only do this for runCount - 1, cause we can only shift that many times between // runs. for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.x + currRun.width; int spaceInNext = nextRun.x + nextRun.width; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.width < max) { tabRuns[i]--; spaceInNext += currRun.width; spaceInCurr -= currRun.width; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); } // Fix the bounds. int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currX = tabAreaInsets.left; for (int j = first; j <= last; j++) { rects[j].x = currX; currX += rects[j].width; } } } else { for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.y + currRun.height; int spaceInNext = nextRun.y + nextRun.height; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.height < max) { tabRuns[i]--; spaceInNext += currRun.height; spaceInCurr -= currRun.height; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); } int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currY = tabAreaInsets.top; for (int j = first; j <= last; j++) { rects[j].y = currY; currY += rects[j].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
int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.width < max) { tabRuns[i]--; spaceInNext += currRun.width; spaceInCurr -= currRun.width; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); }
int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.width < max) { tabRuns[i]--; spaceInNext += currRun.width; spaceInCurr -= currRun.width; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); }
protected void normalizeTabRuns(int tabPlacement, int tabCount, int start, int max) { Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingUtilities.TOP || tabPlacement == SwingUtilities.BOTTOM) { // We should only do this for runCount - 1, cause we can only shift that many times between // runs. for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.x + currRun.width; int spaceInNext = nextRun.x + nextRun.width; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.width < max) { tabRuns[i]--; spaceInNext += currRun.width; spaceInCurr -= currRun.width; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); } // Fix the bounds. int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currX = tabAreaInsets.left; for (int j = first; j <= last; j++) { rects[j].x = currX; currX += rects[j].width; } } } else { for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.y + currRun.height; int spaceInNext = nextRun.y + nextRun.height; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.height < max) { tabRuns[i]--; spaceInNext += currRun.height; spaceInCurr -= currRun.height; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); } int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currY = tabAreaInsets.top; for (int j = first; j <= last; j++) { rects[j].y = currY; currY += rects[j].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
int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currX = tabAreaInsets.left; for (int j = first; j <= last; j++) { rects[j].x = currX; currX += rects[j].width; } }
int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currX = tabAreaInsets.left; for (int j = first; j <= last; j++) { rects[j].x = currX; currX += rects[j].width; } }
protected void normalizeTabRuns(int tabPlacement, int tabCount, int start, int max) { Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingUtilities.TOP || tabPlacement == SwingUtilities.BOTTOM) { // We should only do this for runCount - 1, cause we can only shift that many times between // runs. for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.x + currRun.width; int spaceInNext = nextRun.x + nextRun.width; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.width < max) { tabRuns[i]--; spaceInNext += currRun.width; spaceInCurr -= currRun.width; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); } // Fix the bounds. int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currX = tabAreaInsets.left; for (int j = first; j <= last; j++) { rects[j].x = currX; currX += rects[j].width; } } } else { for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.y + currRun.height; int spaceInNext = nextRun.y + nextRun.height; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.height < max) { tabRuns[i]--; spaceInNext += currRun.height; spaceInCurr -= currRun.height; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); } int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currY = tabAreaInsets.top; for (int j = first; j <= last; j++) { rects[j].y = currY; currY += rects[j].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
for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.y + currRun.height; int spaceInNext = nextRun.y + nextRun.height;
for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.y + currRun.height; int spaceInNext = nextRun.y + nextRun.height;
protected void normalizeTabRuns(int tabPlacement, int tabCount, int start, int max) { Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingUtilities.TOP || tabPlacement == SwingUtilities.BOTTOM) { // We should only do this for runCount - 1, cause we can only shift that many times between // runs. for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.x + currRun.width; int spaceInNext = nextRun.x + nextRun.width; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.width < max) { tabRuns[i]--; spaceInNext += currRun.width; spaceInCurr -= currRun.width; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); } // Fix the bounds. int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currX = tabAreaInsets.left; for (int j = first; j <= last; j++) { rects[j].x = currX; currX += rects[j].width; } } } else { for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.y + currRun.height; int spaceInNext = nextRun.y + nextRun.height; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.height < max) { tabRuns[i]--; spaceInNext += currRun.height; spaceInCurr -= currRun.height; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); } int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currY = tabAreaInsets.top; for (int j = first; j <= last; j++) { rects[j].y = currY; currY += rects[j].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
int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.height < max) { tabRuns[i]--; spaceInNext += currRun.height; spaceInCurr -= currRun.height; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); }
int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.height < max) { tabRuns[i]--; spaceInNext += currRun.height; spaceInCurr -= currRun.height; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); }
protected void normalizeTabRuns(int tabPlacement, int tabCount, int start, int max) { Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingUtilities.TOP || tabPlacement == SwingUtilities.BOTTOM) { // We should only do this for runCount - 1, cause we can only shift that many times between // runs. for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.x + currRun.width; int spaceInNext = nextRun.x + nextRun.width; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.width < max) { tabRuns[i]--; spaceInNext += currRun.width; spaceInCurr -= currRun.width; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); } // Fix the bounds. int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currX = tabAreaInsets.left; for (int j = first; j <= last; j++) { rects[j].x = currX; currX += rects[j].width; } } } else { for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.y + currRun.height; int spaceInNext = nextRun.y + nextRun.height; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.height < max) { tabRuns[i]--; spaceInNext += currRun.height; spaceInCurr -= currRun.height; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); } int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currY = tabAreaInsets.top; for (int j = first; j <= last; j++) { rects[j].y = currY; currY += rects[j].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
int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currY = tabAreaInsets.top; for (int j = first; j <= last; j++) { rects[j].y = currY; currY += rects[j].height; } }
int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currY = tabAreaInsets.top; for (int j = first; j <= last; j++) { rects[j].y = currY; currY += rects[j].height; } }
protected void normalizeTabRuns(int tabPlacement, int tabCount, int start, int max) { Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingUtilities.TOP || tabPlacement == SwingUtilities.BOTTOM) { // We should only do this for runCount - 1, cause we can only shift that many times between // runs. for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.x + currRun.width; int spaceInNext = nextRun.x + nextRun.width; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.width < max) { tabRuns[i]--; spaceInNext += currRun.width; spaceInCurr -= currRun.width; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); } // Fix the bounds. int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currX = tabAreaInsets.left; for (int j = first; j <= last; j++) { rects[j].x = currX; currX += rects[j].width; } } } else { for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.y + currRun.height; int spaceInNext = nextRun.y + nextRun.height; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.height < max) { tabRuns[i]--; spaceInNext += currRun.height; spaceInCurr -= currRun.height; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); } int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currY = tabAreaInsets.top; for (int j = first; j <= last; j++) { rects[j].y = currY; currY += rects[j].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
int runWidth = rects[end].x + rects[end].width; int spaceRemaining = max - runWidth; int numTabs = end - start + 1;
int runWidth = rects[end].x + rects[end].width; int spaceRemaining = max - runWidth; 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