APIdia Launch Partner
Top Description Inners Fields Constructors Methods
javax.swing.event

public Class RowSorterEvent

extends EventObject
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
javax.swing.RowSorter

RowSorterEvent provides notification of changes to a RowSorter. Two types of notification are possible:
Since
1.6
See Also
javax.swing.RowSorter

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
RowSorterEvent.Type

Enumeration of the types of RowSorterEvents.

Field Summary

Modifier and TypeField and Description
private int[]
private RowSorterEvent.Type
Inherited from java.util.EventObject:
source

Constructor Summary

AccessConstructor and Description
public
RowSorterEvent(RowSorter<?>
the source of the change
source
)

Creates a RowSorterEvent of type SORT_ORDER_CHANGED.

public
RowSorterEvent(RowSorter<?>
the source of the change
source
,
RowSorterEvent.Type
the type of event
type
,
int[]
the mapping from model indices to view indices prior to the sort, may be null
previousRowIndexToModel
)

Creates a RowSorterEvent.

Method Summary

Modifier and TypeMethod and Description
public int

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.
convertPreviousRowIndexToModel
(int
the index in terms of the view
index
)

Returns the location of index in terms of the model prior to the sort.

public int

Returns:

the number of rows in terms of the view prior to the sort
getPreviousRowCount
()

Returns the number of rows before the sort.

public RowSorter<?>

Returns:

the source of the event as a RowSorter
getSource
()

Overrides java.util.EventObject.getSource.

Returns the source of the event as a RowSorter.

public RowSorterEvent.Type

Returns:

the type of event
getType
()

Returns the type of event.

Inherited from java.util.EventObject:
toString

Field Detail

oldViewToModelback to summary
private int[] oldViewToModel
typeback to summary
private RowSorterEvent.Type type

Constructor Detail

RowSorterEventback to summary
public RowSorterEvent(RowSorter<?> source)

Creates a RowSorterEvent of type SORT_ORDER_CHANGED.

Parameters
source:RowSorter<?>

the source of the change

Exceptions
IllegalArgumentException:
if source is null
RowSorterEventback to summary
public RowSorterEvent(RowSorter<?> source, RowSorterEvent.Type type, int[] previousRowIndexToModel)

Creates a RowSorterEvent.

Parameters
source:RowSorter<?>

the source of the change

type:RowSorterEvent.Type

the type of event

previousRowIndexToModel:int[]

the mapping from model indices to view indices prior to the sort, may be null

Exceptions
IllegalArgumentException:
if source or type is null

Method Detail

convertPreviousRowIndexToModelback to summary
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:int

the index in terms of the view

Returns:int

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.

getPreviousRowCountback to summary
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:int

the number of rows in terms of the view prior to the sort

getSourceback to summary
public RowSorter<?> getSource()

Overrides java.util.EventObject.getSource.

Returns the source of the event as a RowSorter.

Returns:RowSorter<?>

the source of the event as a RowSorter

Annotations
@Override
getTypeback to summary
public RowSorterEvent.Type getType()

Returns the type of event.

Returns:RowSorterEvent.Type

the type of event

javax.swing.event back to summary

public final Enum RowSorterEvent.Type

extends Enum<RowSorterEvent.Type>
Class Inheritance

Enumeration of the types of RowSorterEvents.
Since
1.6

Field Summary

Modifier and TypeField and Description
public static final RowSorterEvent.Type
SORT_ORDER_CHANGED

Indicates the sort order has changed.

public static final RowSorterEvent.Type
SORTED

Indicates the contents have been newly sorted or transformed in some way.

Constructor Summary

AccessConstructor and Description
private
Type()

Method Summary

Modifier and TypeMethod and Description
public static RowSorterEvent.Type
public static RowSorterEvent.Type[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

SORT_ORDER_CHANGEDback to summary
public static final RowSorterEvent.Type SORT_ORDER_CHANGED

Indicates the sort order has changed.

SORTEDback to summary
public static final RowSorterEvent.Type SORTED

Indicates the contents have been newly sorted or transformed in some way.

Constructor Detail

Typeback to summary
private Type()

Method Detail

valueOfback to summary
public static RowSorterEvent.Type valueOf(String name)
valuesback to summary
public static RowSorterEvent.Type[] values()