Imported GNU Classpath 0.90

Imported GNU Classpath 0.90
       * scripts/makemake.tcl: LocaleData.java moved to gnu/java/locale.

       * sources.am: Regenerated.
       * gcj/javaprims.h: Regenerated.
       * Makefile.in: Regenerated.
       * gcj/Makefile.in: Regenerated.
       * include/Makefile.in: Regenerated.
       * testsuite/Makefile.in: Regenerated.

       * gnu/java/lang/VMInstrumentationImpl.java: New override.
       * gnu/java/net/local/LocalSocketImpl.java: Likewise.
       * gnu/classpath/jdwp/VMMethod.java: Likewise.
       * gnu/classpath/jdwp/VMVirtualMachine.java: Update to latest
       interface.
       * java/lang/Thread.java: Add UncaughtExceptionHandler.
       * java/lang/reflect/Method.java: Implements GenericDeclaration and
       isSynthetic(),
       * java/lang/reflect/Field.java: Likewise.
       * java/lang/reflect/Constructor.java
       * java/lang/Class.java: Implements Type, GenericDeclaration,
       getSimpleName() and getEnclosing*() methods.
       * java/lang/Class.h: Add new public methods.
       * java/lang/Math.java: Add signum(), ulp() and log10().
       * java/lang/natMath.cc (log10): New function.
       * java/security/VMSecureRandom.java: New override.
       * java/util/logging/Logger.java: Updated to latest classpath
       version.
       * java/util/logging/LogManager.java: New override.

From-SVN: r113887
This commit is contained in:
Mark Wielaard 2006-05-18 17:29:21 +00:00
parent eaec4980e1
commit 4f9533c772
1640 changed files with 126485 additions and 104808 deletions

View file

@ -162,11 +162,14 @@ public class DefaultListSelectionModel implements Cloneable,
/**
* Sets the value of the {@link #selectionMode} property.
*
* @param a The new value of the property
* @param mode The new value of the property
*/
public void setSelectionMode(int a)
public void setSelectionMode(int mode)
{
selectionMode = a;
if (mode < ListSelectionModel.SINGLE_SELECTION
|| mode > ListSelectionModel.MULTIPLE_INTERVAL_SELECTION)
throw new IllegalArgumentException("Unrecognised mode: " + mode);
selectionMode = mode;
}
/**
@ -286,8 +289,14 @@ public class DefaultListSelectionModel implements Cloneable,
int beg = sel.nextSetBit(0), end = -1;
for(int i=beg; i >= 0; i=sel.nextSetBit(i+1))
end = i;
if (sel.equals(oldSel) == false)
fireValueChanged(beg, end, valueIsAdjusting);
BitSet old = (BitSet) oldSel;
// The new and previous lead location requires repainting.
old.set(oldLeadIndex, !sel.get(oldLeadIndex));
old.set(leadSelectionIndex, !sel.get(leadSelectionIndex));
fireDifference(sel, old);
}
/**
@ -492,8 +501,7 @@ public class DefaultListSelectionModel implements Cloneable,
leadSelectionIndex = index1;
anchorSelectionIndex = index0;
sel.set(lo, hi+1);
if (sel.equals(oldSel) == false)
fireValueChanged(lo, hi, valueIsAdjusting);
fireDifference(sel, (BitSet) oldSel);
}
}
@ -530,8 +538,8 @@ public class DefaultListSelectionModel implements Cloneable,
//TODO: will probably need MouseDragged to test properly and know if this works
setAnchorSelectionIndex(index0);
leadSelectionIndex = index1;
if (sel.equals(oldSel) == false)
fireValueChanged(lo, hi, valueIsAdjusting);
fireDifference(sel, (BitSet) oldSel);
}
/**
@ -539,20 +547,48 @@ public class DefaultListSelectionModel implements Cloneable,
*/
public void clearSelection()
{
oldSel = sel.clone();
int sz = sel.size();
// Find the selected interval.
int from = sel.nextSetBit(0);
if (from < 0)
return; // Empty selection - nothing to do.
int to = from;
int i;
for (i = from; i>=0; i=sel.nextSetBit(i+1))
to = i;
sel.clear();
if (sel.equals(oldSel) == false)
fireValueChanged(0, sz, valueIsAdjusting);
fireValueChanged(from, to, valueIsAdjusting);
}
/**
* Clears the current selection and marks a given interval as
* "selected". If the current selection mode is
* <code>SINGLE_SELECTION</code> only the index <code>index2</code> is
* selected.
*
* @param index0 The low end of the new selection
* Fire the change event, covering the difference between the two sets.
*
* @param current the current set
* @param x the previous set, the object will be reused.
*/
private void fireDifference(BitSet current, BitSet x)
{
x.xor(current);
int from = x.nextSetBit(0);
if (from < 0)
return; // No difference.
int to = from;
int i;
for (i = from; i >= 0; i = x.nextSetBit(i+1))
to = i;
fireValueChanged(from, to, valueIsAdjusting);
}
/**
* Clears the current selection and marks a given interval as "selected". If
* the current selection mode is <code>SINGLE_SELECTION</code> only the
* index <code>index2</code> is selected.
*
* @param index0 The low end of the new selection
* @param index1 The high end of the new selection
*/
public void setSelectionInterval(int index0, int index1)
@ -560,7 +596,7 @@ public class DefaultListSelectionModel implements Cloneable,
if (index0 == -1 || index1 == -1)
return;
oldSel = sel.clone();
BitSet oldSel = (BitSet) sel.clone();
sel.clear();
if (selectionMode == SINGLE_SELECTION)
index0 = index1;
@ -571,8 +607,8 @@ public class DefaultListSelectionModel implements Cloneable,
// update the anchorSelectionIndex and leadSelectionIndex variables
setAnchorSelectionIndex(index0);
leadSelectionIndex=index1;
if (sel.equals(oldSel) == false)
fireValueChanged(lo, hi, valueIsAdjusting);
fireDifference(sel, oldSel);
}
/**
@ -744,6 +780,7 @@ public class DefaultListSelectionModel implements Cloneable,
DefaultListSelectionModel model =
(DefaultListSelectionModel) super.clone();
model.sel = (BitSet) sel.clone();
model.listenerList = new EventListenerList();
return model;
}
}