- 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 aRowSorter
. 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 Class Summary
Nested Classes Modifier and Type Class and Description static class
RowSorterEvent.Type
Enumeration of the types ofRowSorterEvent
s.
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor and Description RowSorterEvent(RowSorter source)
Creates aRowSorterEvent
of typeSORT_ORDER_CHANGED
.RowSorterEvent(RowSorter source, RowSorterEvent.Type type, int[] previousRowIndexToModel)
Creates aRowSorterEvent
.
-
Method Summary
Methods Modifier and Type Method and Description int
convertPreviousRowIndexToModel(int index)
Returns the location ofindex
in terms of the model prior to the sort.int
getPreviousRowCount()
Returns the number of rows before the sort.RowSorter
getSource()
Returns the source of the event as aRowSorter
.RowSorterEvent.Type
getType()
Returns the type of event.-
Methods inherited from class java.util.EventObject
toString
-
-
-
-
Constructor Detail
-
RowSorterEvent
public RowSorterEvent(RowSorter source)
Creates aRowSorterEvent
of typeSORT_ORDER_CHANGED
.- Parameters:
source
- the source of the change- Throws:
IllegalArgumentException
- ifsource
isnull
-
RowSorterEvent
public RowSorterEvent(RowSorter source, RowSorterEvent.Type type, int[] previousRowIndexToModel)
Creates aRowSorterEvent
.- Parameters:
source
- the source of the changetype
- the type of eventpreviousRowIndexToModel
- the mapping from model indices to view indices prior to the sort, may benull
- Throws:
IllegalArgumentException
- if source ortype
isnull
-
-
Method Detail
-
getSource
public RowSorter getSource()
Returns the source of the event as aRowSorter
.- 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 ofindex
in terms of the model prior to the sort. This method is only useful for events of typeSORTED
. 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 typeSORTED
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
-
-
Document created the 11/06/2005, last modified the 04/03/2020
Source of the printed document:https://www.gaudry.be/en/java-api-rf-javax/swing/event/RowSorterEvent.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.