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:
parent
eaec4980e1
commit
4f9533c772
1640 changed files with 126485 additions and 104808 deletions
|
@ -41,41 +41,57 @@ package javax.swing.event;
|
|||
import java.util.EventObject;
|
||||
|
||||
import javax.swing.tree.TreePath;
|
||||
import javax.swing.tree.TreeSelectionModel;
|
||||
|
||||
/**
|
||||
* TreeSelectionEvent
|
||||
* An event that carries information about a change to a
|
||||
* {@link TreeSelectionModel}.
|
||||
*
|
||||
* @see TreeSelectionListener
|
||||
*
|
||||
* @author Andrew Selkirk
|
||||
* @version 1.0
|
||||
*/
|
||||
public class TreeSelectionEvent extends EventObject {
|
||||
public class TreeSelectionEvent extends EventObject
|
||||
{
|
||||
|
||||
/**
|
||||
* paths
|
||||
* The paths that have been added or removed from the selection.
|
||||
*/
|
||||
protected TreePath[] paths;
|
||||
|
||||
/**
|
||||
* areNew
|
||||
* Flags indicating if the paths were added (<code>true</code>) or removed
|
||||
* (<code>false</code>) from the selection.
|
||||
*/
|
||||
protected boolean[] areNew;
|
||||
|
||||
/**
|
||||
* oldLeadSelectionPath
|
||||
* The old lead selection path (may be <code>null</code>).
|
||||
*/
|
||||
protected TreePath oldLeadSelectionPath;
|
||||
|
||||
/**
|
||||
* newLeadSelectionPath
|
||||
* The new lead selection path (may be <code>null</code>).
|
||||
*/
|
||||
protected TreePath newLeadSelectionPath;
|
||||
|
||||
/**
|
||||
* Constructor TreeSelectionEvent
|
||||
* @param source TODO
|
||||
* @param paths TODO
|
||||
* @param areNew TODO
|
||||
* @param oldLeadSelectionPath TODO
|
||||
* @param newLeadSelectionPath TODO
|
||||
* Creates a new <code>TreeSelectionEvent</code>.
|
||||
*
|
||||
* @param source the source (usually a {@link TreeSelectionModel},
|
||||
* <code>null</code> not permitted).
|
||||
* @param paths an array of the paths that have been added to or removed
|
||||
* from the selection.
|
||||
* @param areNew a flag for each path where <code>true</code> indicates the
|
||||
* corresponding path has been added to the selection and
|
||||
* <code>false</code> indicates the path has been removed.
|
||||
* @param oldLeadSelectionPath the old lead selection path (<code>null</code>
|
||||
* permitted).
|
||||
* @param newLeadSelectionPath the new lead selection path (<code>null</code>
|
||||
* permitted).
|
||||
*
|
||||
* @throws IllegalArgumentException if <code>source</code> is
|
||||
* <code>null</code>.
|
||||
*/
|
||||
public TreeSelectionEvent(Object source, TreePath[] paths,
|
||||
boolean[] areNew, TreePath oldLeadSelectionPath,
|
||||
|
@ -89,12 +105,21 @@ public class TreeSelectionEvent extends EventObject {
|
|||
}
|
||||
|
||||
/**
|
||||
* Constructor TreeSelectionEvent
|
||||
* @param source TODO
|
||||
* @param path TODO
|
||||
* @param isNew TODO
|
||||
* @param oldLeadSelectionPath TODO
|
||||
* @param newLeadSelectionPath TODO
|
||||
* Creates a new <code>TreeSelectionEvent</code>.
|
||||
*
|
||||
* @param source the event source (usually a {@link TreeSelectionModel},
|
||||
* <code>null</code> not permitted).
|
||||
* @param path the path.
|
||||
* @param isNew <code>true</code> indicates that <code>path</code> has been
|
||||
* added to the selection, and <code>false</code> indicates that it has
|
||||
* been removed.
|
||||
* @param oldLeadSelectionPath the old lead selection path (<code>null</code>
|
||||
* permitted).
|
||||
* @param newLeadSelectionPath the new lead selection path (<code>null</code>
|
||||
* permitted).
|
||||
*
|
||||
* @throws IllegalArgumentException if <code>source</code> is
|
||||
* <code>null</code>.
|
||||
*/
|
||||
public TreeSelectionEvent(Object source, TreePath path,
|
||||
boolean isNew, TreePath oldLeadSelectionPath,
|
||||
|
@ -108,7 +133,11 @@ public class TreeSelectionEvent extends EventObject {
|
|||
}
|
||||
|
||||
/**
|
||||
* @return the first path element
|
||||
* Returns the first path element.
|
||||
*
|
||||
* @return The first path element.
|
||||
*
|
||||
* @see #getPaths()
|
||||
*/
|
||||
public TreePath getPath()
|
||||
{
|
||||
|
@ -116,8 +145,11 @@ public class TreeSelectionEvent extends EventObject {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns an array of the paths that changed in the selection.
|
||||
*
|
||||
* @return the paths with selection changed
|
||||
* @return The paths that changed in the selection.
|
||||
*
|
||||
* @see #isAddedPath(TreePath)
|
||||
*/
|
||||
public TreePath[] getPaths()
|
||||
{
|
||||
|
@ -125,7 +157,13 @@ public class TreeSelectionEvent extends EventObject {
|
|||
}
|
||||
|
||||
/**
|
||||
* @return true if the first path is added to the selection, false otherwise
|
||||
* Returns <code>true</code> if the path returned by {@link #getPath()} has
|
||||
* been added to the selection, and <code>false</code> if it has been
|
||||
* removed.
|
||||
*
|
||||
* @return A boolean.
|
||||
*
|
||||
* @see #isAddedPath(int)
|
||||
*/
|
||||
public boolean isAddedPath()
|
||||
{
|
||||
|
@ -133,21 +171,42 @@ public class TreeSelectionEvent extends EventObject {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param path the path to check
|
||||
* @return true if the path is added to the selection, false otherwise
|
||||
* Returns <code>true</code> if <code>path</code> has been added to the
|
||||
* selection, and <code>false</code> if the path has been removed from the
|
||||
* selection.
|
||||
*
|
||||
* @param path the path to check.
|
||||
*
|
||||
* @return A flag indicating whether the path has been added to, or removed
|
||||
* from, the selection.
|
||||
*
|
||||
* @throw IllegalArgumentException if <code>path</code> is not one of the
|
||||
* paths in {@link #getPaths()}.
|
||||
*
|
||||
* @see #isAddedPath(int)
|
||||
*/
|
||||
public boolean isAddedPath(TreePath path)
|
||||
{
|
||||
for (int i = paths.length - 1; i >= 0; i--)
|
||||
if (paths[i].equals(path))
|
||||
return areNew[i];
|
||||
return areNew[i];
|
||||
|
||||
return false;
|
||||
throw new IllegalArgumentException("Unknown 'path' argument.");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param index the index'th path
|
||||
* @return true if the path is added to the selection, false otherwise
|
||||
* Returns <code>true</code> if the path at the specified index has been
|
||||
* added to the selection, and <code>false</code> if the path has been
|
||||
* removed from the selection.
|
||||
*
|
||||
* @param index the path index.
|
||||
*
|
||||
* @return A flag indicating whether the path has been added to, or removed
|
||||
* from, the selection.
|
||||
*
|
||||
* @since 1.3
|
||||
*
|
||||
* @see #isAddedPath(TreePath)
|
||||
*/
|
||||
public boolean isAddedPath(int index)
|
||||
{
|
||||
|
@ -155,7 +214,11 @@ public class TreeSelectionEvent extends EventObject {
|
|||
}
|
||||
|
||||
/**
|
||||
* @return the previous lead selection path
|
||||
* Returns the old lead selection path.
|
||||
*
|
||||
* @return The old lead selection path (possibly <code>null</code>).
|
||||
*
|
||||
* @see #getNewLeadSelectionPath()
|
||||
*/
|
||||
public TreePath getOldLeadSelectionPath()
|
||||
{
|
||||
|
@ -163,7 +226,11 @@ public class TreeSelectionEvent extends EventObject {
|
|||
}
|
||||
|
||||
/**
|
||||
* @return the current lead selection path
|
||||
* Returns the new lead selection path.
|
||||
*
|
||||
* @return The new lead selection path (possibly <code>null</code>).
|
||||
*
|
||||
* @see #getOldLeadSelectionPath()
|
||||
*/
|
||||
public TreePath getNewLeadSelectionPath()
|
||||
{
|
||||
|
@ -171,14 +238,20 @@ public class TreeSelectionEvent extends EventObject {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param source the new event source
|
||||
* @return a cloned event with another event source
|
||||
* Creates a shallow copy of this <code>TreeSelectionEvent</code>, replacing
|
||||
* the source with <code>source</code>.
|
||||
*
|
||||
* @param source the new event source (<code>null</code> not permitted).
|
||||
*
|
||||
* @return A cloned event with another event source.
|
||||
*
|
||||
* @throws IllegalArgumentException if <code>source</code> is
|
||||
* <code>null</code>.
|
||||
*/
|
||||
public Object cloneWithSource(Object source)
|
||||
{
|
||||
return new TreeSelectionEvent (source, paths, areNew,
|
||||
oldLeadSelectionPath,
|
||||
newLeadSelectionPath);
|
||||
return new TreeSelectionEvent (source, paths, areNew, oldLeadSelectionPath,
|
||||
newLeadSelectionPath);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue