Class RowSorterEvent
java.lang.Object
java.util.EventObject
javax.swing.event.RowSorterEvent
- All Implemented Interfaces:
- Serializable
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:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumEnumeration of the types ofRowSorterEvents.
- 
Field SummaryFields declared in class java.util.EventObjectsource
- 
Constructor SummaryConstructorsConstructorDescriptionRowSorterEvent(RowSorter<?> source) Creates aRowSorterEventof typeSORT_ORDER_CHANGED.RowSorterEvent(RowSorter<?> source, RowSorterEvent.Type type, int[] previousRowIndexToModel) Creates aRowSorterEvent.
- 
Method SummaryModifier and TypeMethodDescriptionintconvertPreviousRowIndexToModel(int index) Returns the location ofindexin terms of the model prior to the sort.intReturns the number of rows before the sort.RowSorter<?> Returns the source of the event as aRowSorter.getType()Returns the type of event.Methods declared in class java.util.EventObjecttoString
- 
Constructor Details- 
RowSorterEventCreates aRowSorterEventof typeSORT_ORDER_CHANGED.- Parameters:
- source- the source of the change
- Throws:
- IllegalArgumentException- if- sourceis- null
 
- 
RowSorterEventCreates aRowSorterEvent.- 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 be- null
- Throws:
- IllegalArgumentException- if source or- typeis- null
 
 
- 
- 
Method Details- 
getSourceReturns the source of the event as aRowSorter.- Overrides:
- getSourcein class- EventObject
- Returns:
- the source of the event as a RowSorter
 
- 
getType
- 
convertPreviousRowIndexToModelpublic int convertPreviousRowIndexToModel(int index) Returns the location ofindexin 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.
 
- 
getPreviousRowCountpublic int getPreviousRowCount()Returns the number of rows before the sort. This method is only useful for events of typeSORTEDand 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
 
 
-