com.jrefinery.ui
Class SortableTableHeaderListener

java.lang.Object
  extended by com.jrefinery.ui.SortableTableHeaderListener
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener

public class SortableTableHeaderListener
extends java.lang.Object
implements java.awt.event.MouseListener, java.awt.event.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.


Constructor Summary
SortableTableHeaderListener(SortableTableModel model, SortButtonRenderer renderer)
          Standard constructor.
 
Method Summary
 void mouseClicked(java.awt.event.MouseEvent e)
          This event is ignored (not required).
 void mouseDragged(java.awt.event.MouseEvent e)
          If the user is dragging or resizing, then we clear the sort column.
 void mouseEntered(java.awt.event.MouseEvent e)
          This event is ignored (not required).
 void mouseExited(java.awt.event.MouseEvent e)
          This event is ignored (not required).
 void mouseMoved(java.awt.event.MouseEvent e)
          This event is ignored (not required).
 void mousePressed(java.awt.event.MouseEvent e)
          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.
 void mouseReleased(java.awt.event.MouseEvent e)
          When the user releases the mouse button, we attempt to sort the table.
 void setTableModel(SortableTableModel model)
          Sets the table model for the listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortableTableHeaderListener

public SortableTableHeaderListener(SortableTableModel model,
                                   SortButtonRenderer renderer)
Standard constructor.

Parameters:
model - ;
renderer - ;
Method Detail

setTableModel

public void setTableModel(SortableTableModel model)
Sets the table model for the listener.


mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
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:
mousePressed in interface java.awt.event.MouseListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
If the user is dragging or resizing, then we clear the sort column.

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
This event is ignored (not required).

Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
This event is ignored (not required).

Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
This event is ignored (not required).

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
This event is ignored (not required).

Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
When the user releases the mouse button, we attempt to sort the table.

Specified by:
mouseReleased in interface java.awt.event.MouseListener


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.