siuying.gm.app.gmailer4j.model.treetable
Class TreeTableExample2

java.lang.Object
  extended by siuying.gm.app.gmailer4j.model.treetable.TreeTableExample2

public class TreeTableExample2
extends java.lang.Object

Assembles the UI. The UI consists of a JTreeTable and a status label. As nodes are loaded by the FileSystemModel2, in a background thread, the status label updates as well as the renderer to draw the node that is being loaded differently.

Author:
Scott Violet, Philip Milne

Field Summary
protected  javax.swing.JFrame frame
          Frame containing everything.
protected  FileSystemModel2 model
          Model for the JTreeTable.
protected  java.lang.String path
          Path created with.
protected  int reloadCounter
          A counter increment as the Timer fies and the same path is being reloaded.
protected  javax.swing.tree.TreePath reloadPath
          TreePath being reloaded.
protected  int reloadRow
          Row the is being reloaded.
protected  javax.swing.JLabel statusLabel
          Used to indicate status.
protected  javax.swing.Timer timer
          Timer used to update reload state.
protected  JTreeTable treeTable
          Used to represent the model.
protected static int ttCount
          Number of instances of TreeTableExample2.
 
Constructor Summary
TreeTableExample2(java.lang.String path)
           
 
Method Summary
protected  javax.swing.JFrame createFrame()
          Creates the JFrame that will contain everything.
protected  javax.swing.JMenuBar createMenuBar()
          Creates a menu bar.
protected  FileSystemModel2 createModel(java.lang.String path)
          Creates the FileSystemModel2 that will be used.
protected  javax.swing.JLabel createStatusLabel()
          Creates and return a JLabel that is used to indicate the status of loading.
protected  JTreeTable createTreeTable()
          Creates and returns the instanceof JTreeTable that will be used.
static void main(java.lang.String[] args)
           
protected  void reload(java.lang.Object node)
          Invoked to reload the children of a particular node.
protected  void updateStatusLabel()
          Updates the status label based on reloadRow.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ttCount

protected static int ttCount
Number of instances of TreeTableExample2.


model

protected FileSystemModel2 model
Model for the JTreeTable.


treeTable

protected JTreeTable treeTable
Used to represent the model.


reloadRow

protected int reloadRow
Row the is being reloaded.


reloadPath

protected javax.swing.tree.TreePath reloadPath
TreePath being reloaded.


reloadCounter

protected int reloadCounter
A counter increment as the Timer fies and the same path is being reloaded.


timer

protected javax.swing.Timer timer
Timer used to update reload state.


statusLabel

protected javax.swing.JLabel statusLabel
Used to indicate status.


frame

protected javax.swing.JFrame frame
Frame containing everything.


path

protected java.lang.String path
Path created with.

Constructor Detail

TreeTableExample2

public TreeTableExample2(java.lang.String path)
Method Detail

createStatusLabel

protected javax.swing.JLabel createStatusLabel()
Creates and return a JLabel that is used to indicate the status of loading.


createTreeTable

protected JTreeTable createTreeTable()
Creates and returns the instanceof JTreeTable that will be used. This also creates, but does not start, the Timer that is used to update the display as files are loaded.


createModel

protected FileSystemModel2 createModel(java.lang.String path)
Creates the FileSystemModel2 that will be used.


createFrame

protected javax.swing.JFrame createFrame()
Creates the JFrame that will contain everything.


createMenuBar

protected javax.swing.JMenuBar createMenuBar()
Creates a menu bar.


reload

protected void reload(java.lang.Object node)
Invoked to reload the children of a particular node. This will also restart the timer.


updateStatusLabel

protected void updateStatusLabel()
Updates the status label based on reloadRow.


main

public static void main(java.lang.String[] args)