Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.jempeg.empeg.emplode.action
Class SelectionTracker  view SelectionTracker download SelectionTracker.java

java.lang.Object
  extended byorg.jempeg.empeg.emplode.action.SelectionTracker
All Implemented Interfaces:
java.util.EventListener, java.awt.event.FocusListener

public class SelectionTracker
extends java.lang.Object
implements java.awt.event.FocusListener

SelectionTracker provides an interface to finding out which nodes are currently selected in the tree and table.

Version:
$Revision: 1.5 $

Field Summary
private  javax.swing.JTable myTable
           
private  boolean myTableFocused
           
private  javax.swing.JTree myTree
           
private  boolean myTreeFocused
           
 
Constructor Summary
SelectionTracker(javax.swing.JTree _tree, javax.swing.JTable _table)
          Constructs a new SelectionTracker.
 
Method Summary
 void focusGained(java.awt.event.FocusEvent _event)
          Invoked when a component gains the keyboard focus.
 void focusLost(java.awt.event.FocusEvent _event)
          Invoked when a component loses the keyboard focus.
 org.jempeg.empeg.emplode.model.EmpegPlaylistTreeNodeIfc getPlaylist()
          Returns the currently visible playlist tree node from whichever component has focus.
 org.jempeg.empeg.emplode.model.EmpegTreeNodeIfc getSelectedNode()
          Returns the currently selected node from whichever component has focus.
 org.jempeg.empeg.emplode.model.EmpegTreeNodeIfc[] getSelectedNodes()
          Returns the currently selected nodes from whichever component has focus.
 org.jempeg.empeg.emplode.model.EmpegTreeNodeIfc getSelectedTableNode()
          Returns the first currently selected node in the table view.
 org.jempeg.empeg.emplode.model.EmpegTreeNodeIfc[] getSelectedTableNodes()
          Returns the currently selected nodes in the table view.
 org.jempeg.empeg.emplode.model.EmpegPlaylistTreeNodeIfc getSelectedTreeNode()
          Returns the currently selected tree node in the tree view.
 org.jempeg.empeg.emplode.model.EmpegPlaylistTreeNodeIfc[] getSelectedTreeNodes()
          Just here for symmetry.
 javax.swing.JTable getTable()
          Returns the table.
 org.jempeg.empeg.emplode.model.EmpegTreeNodeIfc getTableNode(int _index)
          Returns the node in the table view at the given index.
 org.jempeg.empeg.emplode.model.EmpegPlaylistTreeNodeIfc getTablePlaylist()
          Returns the playlist tree node that corresponds to the current table view.
 javax.swing.JTree getTree()
          Returns the tree.
 org.jempeg.empeg.emplode.model.EmpegPlaylistTreeNodeIfc getTreePlaylist()
          Returns the playlist tree node that corresponds to the current tree selection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myTreeFocused

private boolean myTreeFocused

myTableFocused

private boolean myTableFocused

myTree

private javax.swing.JTree myTree

myTable

private javax.swing.JTable myTable
Constructor Detail

SelectionTracker

public SelectionTracker(javax.swing.JTree _tree,
                        javax.swing.JTable _table)
Constructs a new SelectionTracker.

Method Detail

getTree

public javax.swing.JTree getTree()
Returns the tree.


getTable

public javax.swing.JTable getTable()
Returns the table.


focusGained

public void focusGained(java.awt.event.FocusEvent _event)
Invoked when a component gains the keyboard focus.

Specified by:
focusGained in interface java.awt.event.FocusListener

focusLost

public void focusLost(java.awt.event.FocusEvent _event)
Invoked when a component loses the keyboard focus.

Specified by:
focusLost in interface java.awt.event.FocusListener

getSelectedNode

public org.jempeg.empeg.emplode.model.EmpegTreeNodeIfc getSelectedNode()
Returns the currently selected node from whichever component has focus. This will return null if neither the tree nor the table have focus.


getSelectedNodes

public org.jempeg.empeg.emplode.model.EmpegTreeNodeIfc[] getSelectedNodes()
Returns the currently selected nodes from whichever component has focus. This will return null if neither the tree nor the table have focus.


getPlaylist

public org.jempeg.empeg.emplode.model.EmpegPlaylistTreeNodeIfc getPlaylist()
Returns the currently visible playlist tree node from whichever component has focus. This will return null if neither the tree nor the table have focus.


getSelectedTreeNode

public org.jempeg.empeg.emplode.model.EmpegPlaylistTreeNodeIfc getSelectedTreeNode()
Returns the currently selected tree node in the tree view.


getSelectedTreeNodes

public org.jempeg.empeg.emplode.model.EmpegPlaylistTreeNodeIfc[] getSelectedTreeNodes()
Just here for symmetry. Returns an array of 1.


getSelectedTableNode

public org.jempeg.empeg.emplode.model.EmpegTreeNodeIfc getSelectedTableNode()
Returns the first currently selected node in the table view.


getSelectedTableNodes

public org.jempeg.empeg.emplode.model.EmpegTreeNodeIfc[] getSelectedTableNodes()
Returns the currently selected nodes in the table view.


getTableNode

public org.jempeg.empeg.emplode.model.EmpegTreeNodeIfc getTableNode(int _index)
Returns the node in the table view at the given index.


getTreePlaylist

public org.jempeg.empeg.emplode.model.EmpegPlaylistTreeNodeIfc getTreePlaylist()
Returns the playlist tree node that corresponds to the current tree selection.


getTablePlaylist

public org.jempeg.empeg.emplode.model.EmpegPlaylistTreeNodeIfc getTablePlaylist()
Returns the playlist tree node that corresponds to the current table view.