net.wotonomy.ui.swing
Class TreeColumnAssociation

java.lang.Object
  extended by net.wotonomy.control.EODelayedObserver
      extended by net.wotonomy.ui.EOAssociation
          extended by net.wotonomy.ui.swing.TableColumnAssociation
              extended by net.wotonomy.ui.swing.TreeColumnAssociation
All Implemented Interfaces:
java.util.Observer, net.wotonomy.control.EOObserving

public class TreeColumnAssociation
extends TableColumnAssociation

TreeColumnAssociation is a TableColumnAssocation that works like a TreeAssociation, allowing any table to display hierarchical data in a tabular format. This class is mainly a convenience for connecting a TreeAssociation to a JTree to a TreeTableCellRenderer to a TableColumn.

Like TableColumnAssociation, you must call setTable() to specify the JTable to be used. (The corresponding table association will direct all column header sorting to the root node of the tree association.) You may also optionally call setTree() to specify a customized JTree to be used. If not specified, a slightly customized JTree will be used (see createTree() and configureColumn()). TreeColumnAssociation supports the following bindings, just as TableColumnAssociation does:

TreeColumnAssociation additionally supports the following bindings, just as TreeAssociation does, except that the value binding is used instead of the titles binding.

Version:
$Revision: 904 $
Author:
michael@mpowers.net, $Author: cgruber $

Field Summary
 
Fields inherited from class net.wotonomy.ui.EOAssociation
ActionAspect, ArgumentAspect, aspectToGroup, aspectToKey, AttributeAspectSignature, AttributeToManyAspectSignature, AttributeToOneAspectSignature, AttributeToOneToManyAspectSignature, BoldAspect, ChildrenAspect, control, DestinationAspect, EditableAspect, EnabledAspect, IconAspect, IsLeafAspect, ItalicAspect, LabelAspect, NullAspectSignature, ObjectsAspect, ParentAspect, SelectedObjectAspect, SelectedTitleAspect, SourceAspect, TitlesAspect, ToManyAspectSignature, ToOneAspectSignature, ToOneToManyAspectSignature, URLAspect, ValueAspect, VisibleAspect
 
Fields inherited from class net.wotonomy.control.EODelayedObserver
ObserverNumberOfPriorities, ObserverPriorityFifth, ObserverPriorityFirst, ObserverPriorityFourth, ObserverPriorityImmediate, ObserverPriorityLater, ObserverPrioritySecond, ObserverPrioritySixth, ObserverPriorityThird
 
Constructor Summary
TreeColumnAssociation(java.lang.Object anObject)
          Constructor specifying the object to be controlled by this association.
 
Method Summary
static net.wotonomy.foundation.NSArray aspects()
          Returns a List that describes the aspects supported by this class.
static net.wotonomy.foundation.NSArray aspectSignatures()
          Returns a List of aspect signatures whose contents correspond with the aspects list.
 void bindAspect(java.lang.String anAspect, net.wotonomy.ui.EODisplayGroup aDisplayGroup, java.lang.String aKey)
          Binds the specified aspect of this association to the specified key on the specified display group.
 void breakConnection()
          Breaks the connection between this association and its object.
protected  void configureColumn(javax.swing.table.TableColumn aColumn)
          Called by establishConnection to configure the column with a TreeTableCellRenderer using the current JTree.
protected  javax.swing.JTree createTree()
          Called by establishConnection if setTree was not called.
protected  TreeModelAssociation createTreeAssociation(javax.swing.JTree aTree)
          Called by establishConnection to create a tree association only if no tree association has already been created.
 void establishConnection()
          Overridden to call createTree if necessary, call configureColumn, call createTreeAssociation if necessary, and then call to super.
 javax.swing.JTree getTree()
          Gets the JTree currently used for the column renderer.
 TreeModelAssociation getTreeModelAssociation()
          Gets the TreeModelAssociation currently used for the tree.
 void setTree(javax.swing.JTree aTree)
          Sets the JTree to be used for the column renderer.
 
Methods inherited from class net.wotonomy.ui.swing.TableColumnAssociation
addAsListener, associationClassesSuperseded, canBindAspect, drawSortIndicator, getIndexOfMatchingOrdering, getSortIndicatorColor, getSortOrdering, getTableAssociation, isEditableAtRow, isSortable, isSortCaseSensitive, isUsableWithObject, objectKeysTaken, primaryAspect, removeAsListener, setSortable, setSortCaseSensitive, setTable, setValueAtIndex, valueAtIndex
 
Methods inherited from class net.wotonomy.ui.EOAssociation
associationClassesForObject, copyMatchingBindingsFromAssociation, displayGroupForAspect, displayGroupKeyForAspect, displayName, endEditing, object, setValueForAspect, setValueForAspectAtIndex, shouldEndEditing, shouldEndEditingAtIndex, subjectChanged, valueForAspect, valueForAspectAtIndex
 
Methods inherited from class net.wotonomy.control.EODelayedObserver
discardPendingNotification, objectWillChange, observerQueue, priority, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeColumnAssociation

public TreeColumnAssociation(java.lang.Object anObject)
Constructor specifying the object to be controlled by this association. Throws an exception if the object is not a TableColumn.

Method Detail

aspectSignatures

public static net.wotonomy.foundation.NSArray aspectSignatures()
Returns a List of aspect signatures whose contents correspond with the aspects list. Each element is a string whose characters represent a capability of the corresponding aspect. An empty signature "" means that the aspect can bind without needing a key. This implementation returns "A1M" for each element in the aspects array.


aspects

public static net.wotonomy.foundation.NSArray aspects()
Returns a List that describes the aspects supported by this class. Each element in the list is the string name of the aspect. This implementation returns an empty list.


bindAspect

public void bindAspect(java.lang.String anAspect,
                       net.wotonomy.ui.EODisplayGroup aDisplayGroup,
                       java.lang.String aKey)
Binds the specified aspect of this association to the specified key on the specified display group.

Overrides:
bindAspect in class TableColumnAssociation

establishConnection

public void establishConnection()
Overridden to call createTree if necessary, call configureColumn, call createTreeAssociation if necessary, and then call to super.

Overrides:
establishConnection in class TableColumnAssociation

breakConnection

public void breakConnection()
Breaks the connection between this association and its object. Override to stop listening for events from the object.

Overrides:
breakConnection in class TableColumnAssociation

createTree

protected javax.swing.JTree createTree()
Called by establishConnection if setTree was not called. This implementation returns a stock JTree. Override to provide your own customized JTree. Note that TreeTableCellRenderer will further customize this tree when configureColumn is called.


createTreeAssociation

protected TreeModelAssociation createTreeAssociation(javax.swing.JTree aTree)
Called by establishConnection to create a tree association only if no tree association has already been created. This implementation returns a stock TreeAssociation. Override to return your own customized TreeAssociation.


configureColumn

protected void configureColumn(javax.swing.table.TableColumn aColumn)
Called by establishConnection to configure the column with a TreeTableCellRenderer using the current JTree. Override to further customize the column, or customize your column yourself after the call to establishConnection.


getTree

public javax.swing.JTree getTree()
Gets the JTree currently used for the column renderer. If not specified, returns null.


getTreeModelAssociation

public TreeModelAssociation getTreeModelAssociation()
Gets the TreeModelAssociation currently used for the tree. If not tree is not specified, returns null.


setTree

public void setTree(javax.swing.JTree aTree)
Sets the JTree to be used for the column renderer. If not specified, createTree() will be called to create a JTree.



Copyright © 2006 null. All Rights Reserved.