Package org.jfree.ui
Class SortableTableHeaderListener
java.lang.Object
org.jfree.ui.SortableTableHeaderListener
- All Implemented Interfaces:
MouseListener,MouseMotionListener,EventListener
public class SortableTableHeaderListener
extends Object
implements MouseListener, MouseMotionListener
Captures mouse clicks on a table header, with the intention of triggering a sort. Adapted from
code by Nabuo Tamemasa posted on http://www.codeguru.com.
- Author:
- Nabuo Tamemasa
-
Constructor Summary
ConstructorsConstructorDescriptionSortableTableHeaderListener(SortableTableModel model, SortButtonRenderer renderer) Standard constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidThis event is ignored (not required).voidIf the user is dragging or resizing, then we clear the sort column.voidThis event is ignored (not required).voidThis event is ignored (not required).voidThis event is ignored (not required).voidHandle a mouse press event - if the user is NOT resizing a column and NOT dragging a column then give visual feedback that the column header has been pressed.voidWhen the user releases the mouse button, we attempt to sort the table.voidsetTableModel(SortableTableModel model) Sets the table model for the listener.
-
Constructor Details
-
SortableTableHeaderListener
Standard constructor.- Parameters:
model- the model.renderer- the renderer.
-
-
Method Details
-
setTableModel
Sets the table model for the listener.- Parameters:
model- the model.
-
mousePressed
Handle a mouse press event - if the user is NOT resizing a column and NOT dragging a column then give visual feedback that the column header has been pressed.- Specified by:
mousePressedin interfaceMouseListener- Parameters:
e- the mouse event.
-
mouseDragged
If the user is dragging or resizing, then we clear the sort column.- Specified by:
mouseDraggedin interfaceMouseMotionListener- Parameters:
e- the mouse event.
-
mouseEntered
This event is ignored (not required).- Specified by:
mouseEnteredin interfaceMouseListener- Parameters:
e- the mouse event.
-
mouseClicked
This event is ignored (not required).- Specified by:
mouseClickedin interfaceMouseListener- Parameters:
e- the mouse event.
-
mouseMoved
This event is ignored (not required).- Specified by:
mouseMovedin interfaceMouseMotionListener- Parameters:
e- the mouse event.
-
mouseExited
This event is ignored (not required).- Specified by:
mouseExitedin interfaceMouseListener- Parameters:
e- the mouse event.
-
mouseReleased
When the user releases the mouse button, we attempt to sort the table.- Specified by:
mouseReleasedin interfaceMouseListener- Parameters:
e- the mouse event.
-