The Meta-Environment API

nl.cwi.sen1.visplugin.table.model
Class TableLocationButtonListener

java.lang.Object
  extended by nl.cwi.sen1.visplugin.table.model.TableLocationButtonListener
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener

public class TableLocationButtonListener
extends java.lang.Object
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener

This class listens for mouse events in the JTable. Preferably we would like to listen for mouse events at the cell level. There was however not a simple solution for this so this isn't a very nice solution, but it works as it should be.

Author:
Anton Lycklama a Nijeholt, Bas Basten

Field Summary
private  javax.swing.JTable m_table
           
private  TableVisualizationWindow m_window
           
private  java.awt.Cursor mouseOverCursor
           
 
Constructor Summary
TableLocationButtonListener(TableVisualizationWindow window, javax.swing.JTable table)
           
 
Method Summary
private  nl.cwi.sen1.relationstores.types.Location getLocation(java.awt.event.MouseEvent event)
          Get the cell's location ATerm at the X and Y coordinates of the mouse.
 void mouseClicked(java.awt.event.MouseEvent e)
          Handle the mouse click only if is clicked on a cell with a location link.
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
          Change the mousecursor if it moves over a location link.
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_table

private javax.swing.JTable m_table

mouseOverCursor

private java.awt.Cursor mouseOverCursor

m_window

private TableVisualizationWindow m_window
Constructor Detail

TableLocationButtonListener

public TableLocationButtonListener(TableVisualizationWindow window,
                                   javax.swing.JTable table)
Method Detail

getLocation

private nl.cwi.sen1.relationstores.types.Location getLocation(java.awt.event.MouseEvent event)
Get the cell's location ATerm at the X and Y coordinates of the mouse.

Parameters:
event -
Returns:
Returns a location ATerm if found, otherwise return null.

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Handle the mouse click only if is clicked on a cell with a location link.

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

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Change the mousecursor if it moves over a location link.

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

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

The Meta-Environment API