org.peace_tools.views
Class ClusterTreeTableView

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.peace_tools.views.ClusterTreeTableView
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class ClusterTreeTableView
extends javax.swing.JPanel
implements java.awt.event.ActionListener

The tree table model that provides a combination of a tree and table to display cluster information in a convenient form.

The tree-table or Outline model is a generic non-standard GUI component developed by Sun Microsystems as part of the NetBeans IDE. This jar has been obtain from the NetBeans package as a part. The tree-table is a combination both a JTree and a JTable. The first column in the tree-table is a tree that provides the user with a convenient interface to access and control view of hierarchical information. The remaining columns in the tree-table display detailed information about each entry in the tree table. Additional details on the tree table is available at: http://bits.netbeans.org/dev/javadoc/index.html

See Also:
Serialized Form

Nested Class Summary
private  class ClusterTreeTableView.DataSetRenderer
          A tree cell renderer that essentially provides a better representative set of Icons to make the overall display look a bit prettier.
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  org.netbeans.swing.outline.Outline clusterTable
          The actual Tree-table that provides a graphical view of the list of clusters in a given cluster file.
private  javax.swing.JSplitPane contentPane
          The main content pane that contains the summary pane along with the tree table.
private  MainFrame mainFrame
          Convenient reference to the main frame class that logically owns this component.
private  ClusterTreeTableModel model
          The table-tree model that is being used to display information in this view.
private  java.lang.String SELECT_EST_MSG
          A simple message that is displayed to the user.
private static long serialVersionUID
          A generated serial version ID for serialization (more realistically to keep the compiler happy).
private  javax.swing.JComboBox sortOrder
          Various options on how the clusters in the cluster tree table view are to be sorted.
private  javax.swing.JToolBar toolbar
          The toolbar that contains some commonly used tools with the jobs.
private static javax.swing.Icon[] TreeIcons
          The array of icons that are displayed in a the cluster/EST tree adjacent to entries.
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ClusterTreeTableView(ClusterTreeTableModel model, MainFrame frame)
          The default constructor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
           
private  void createToolbar()
          Helper method to configure and setup various tools in the tool bar.
private  void saveSelectedESTs()
          Helper method to save the selected ESTs.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TreeIcons

private static final javax.swing.Icon[] TreeIcons
The array of icons that are displayed in a the cluster/EST tree adjacent to entries. The icons are meant to provide quick visual cues as to the contents of an tree and possibly make the display look customized and nice.


toolbar

private javax.swing.JToolBar toolbar
The toolbar that contains some commonly used tools with the jobs.


clusterTable

private org.netbeans.swing.outline.Outline clusterTable
The actual Tree-table that provides a graphical view of the list of clusters in a given cluster file.


model

private final ClusterTreeTableModel model
The table-tree model that is being used to display information in this view. This value is set in the constructor and is never changed.


mainFrame

private final MainFrame mainFrame
Convenient reference to the main frame class that logically owns this component. This value is set in the constructor and is never changed.


sortOrder

private javax.swing.JComboBox sortOrder
Various options on how the clusters in the cluster tree table view are to be sorted. The options are populated when this combo box is created in the createToolbar() method.


contentPane

private javax.swing.JSplitPane contentPane
The main content pane that contains the summary pane along with the tree table. The summary pane may or may not be displayed depending on the current user settings.


SELECT_EST_MSG

private java.lang.String SELECT_EST_MSG
A simple message that is displayed to the user.


serialVersionUID

private static final long serialVersionUID
A generated serial version ID for serialization (more realistically to keep the compiler happy).

See Also:
Constant Field Values
Constructor Detail

ClusterTreeTableView

public ClusterTreeTableView(ClusterTreeTableModel model,
                            MainFrame frame)
The default constructor. The default constructor sets up the job list table and configures the tree-table to the default configuration.

Parameters:
model - The data model to be used to display the cluster and EST information in the tree-table.
frame - The main frame that logically owns this view. This reference is used to launch the classifier dialog.
Method Detail

createToolbar

private void createToolbar()
Helper method to configure and setup various tools in the tool bar. This method was introduced to streamline the code better and cut down the code clutter in the constructor.


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

saveSelectedESTs

private void saveSelectedESTs()
Helper method to save the selected ESTs. This method is invoked from the actionPerformed() method whenever the user clicks on the tool bar button to save selected ESTs. This method performs the following tasks:
  1. If no entries are selected, then this method displays a warning message and exits immediately with no further action.
  2. Otherwise, it prompts the user to select a file. If the user cancels the file selection operation then this method exits without any side effects.
  3. Once the user selects a valid file, it writes the ESTs corresponding to the selected entries to the file. Any errors that occur are suitably reported to the user.