Class RowSorterEvent
- java.lang.Object
-
- java.util.EventObject
-
- javax.swing.event.RowSorterEvent
- All Implemented Interfaces:
- Serializable
public class RowSorterEvent extends EventObject
RowSorterEvent
provides notification of changes to a RowSorter
. Two types of notification are possible:
-
Type.SORT_ORDER_CHANGED
: indicates the sort order has changed. This is typically followed by a notification of: -
Type.SORTED
: indicates the contents of the model have been transformed in some way. For example, the contents may have been sorted or filtered.
- Since:
- 1.6
- See Also:
RowSorter
Nested Classes
Modifier and Type | Class and Description |
---|---|
static class |
RowSorterEvent.Type Enumeration of the types of |
Fields
Fields inherited from class java.util.EventObject
source
Constructors
Constructor and Description |
---|
RowSorterEvent(RowSorter source) Creates a |
RowSorterEvent(RowSorter source,
RowSorterEvent.Type type,
int[] previousRowIndexToModel) Creates a |
Methods
Modifier and Type | Method and Description |
---|---|
int |
convertPreviousRowIndexToModel(int index) Returns the location of |
int |
getPreviousRowCount() Returns the number of rows before the sort. |
RowSorter |
getSource() Returns the source of the event as a |
RowSorterEvent.Type |
getType() Returns the type of event. |
Methods inherited from class java.util.EventObject
toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Constructors
RowSorterEvent
public RowSorterEvent(RowSorter source)
Creates a RowSorterEvent
of type SORT_ORDER_CHANGED
.
- Parameters:
-
source
- the source of the change - Throws:
-
IllegalArgumentException
- ifsource
isnull
RowSorterEvent
public RowSorterEvent(RowSorter source, RowSorterEvent.Type type, int[] previousRowIndexToModel)
Creates a RowSorterEvent
.
- Parameters:
-
source
- the source of the change -
type
- the type of event -
previousRowIndexToModel
- the mapping from model indices to view indices prior to the sort, may benull
- Throws:
-
IllegalArgumentException
- if source ortype
isnull
Methods
getSource
public RowSorter getSource()
Returns the source of the event as a RowSorter
.
- Overrides:
-
getSource
in classEventObject
- Returns:
- the source of the event as a
RowSorter
getType
public RowSorterEvent.Type getType()
Returns the type of event.
- Returns:
- the type of event
convertPreviousRowIndexToModel
public int convertPreviousRowIndexToModel(int index)
Returns the location of index
in terms of the model prior to the sort. This method is only useful for events of type SORTED
. This method will return -1 if the index is not valid, or the locations prior to the sort have not been provided.
- Parameters:
-
index
- the index in terms of the view - Returns:
- the index in terms of the model prior to the sort, or -1 if the location is not valid or the mapping was not provided.
getPreviousRowCount
public int getPreviousRowCount()
Returns the number of rows before the sort. This method is only useful for events of type SORTED
and if the last locations have not been provided will return 0.
- Returns:
- the number of rows in terms of the view prior to the sort
© 1993, 2020, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/javase/8/docs/api/javax/swing/event/RowSorterEvent.html