|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.wotonomy.control.EODelayedObserver
net.wotonomy.ui.EOAssociation
net.wotonomy.ui.swing.TreeModelAssociation
public class TreeModelAssociation
TreeModelAssociation binds a JTree or similar component that uses a TreeModel to a display group's list of displayable objects, each of which may have a list of child objects managed by another display group, and so on. TreeModelAssociation works exactly like a ListAssociation, with the additional capability to specify a "Children" aspect, that will allow child objects to be retrieved from a parent display group.
Field Summary | |
---|---|
protected boolean |
childrenGroupChanged
|
protected boolean |
isListening
|
protected boolean |
titlesGroupChanged
|
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 | |
---|---|
TreeModelAssociation(java.lang.Object anObject)
Constructor expecting a JTree or any other object that has void setModel(TreeModel) and TreeModel getSelectionModel() methods. |
|
TreeModelAssociation(java.lang.Object anObject,
java.lang.Object aRootLabel)
Constructor expecting a JTree or similar component and specifying a label for the root node. |
Method Summary | |
---|---|
protected void |
addAsListener()
|
void |
addTreeModelListener(javax.swing.event.TreeModelListener aListener)
|
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. |
static net.wotonomy.foundation.NSArray |
associationClassesSuperseded()
Returns a List of EOAssociation subclasses that, for the objects that are usable for this association, are less suitable than this association. |
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. |
boolean |
canBindAspect(java.lang.String anAspect,
net.wotonomy.ui.EODisplayGroup aDisplayGroup,
java.lang.String aKey)
Returns whether this association can bind to the specified display group on the specified key for the specified aspect. |
DisplayGroupNode |
createNode(net.wotonomy.ui.EODisplayGroup aParentGroup,
java.lang.Object anObject)
Creates and returns a new display group node. |
void |
establishConnection()
Establishes a connection between this association and the controlled object. |
protected void |
fireRootStructureChanged()
|
void |
fireTreeNodesChanged(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
Fires a tree nodes changed event to all listeners. |
void |
fireTreeNodesInserted(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
Fires a tree nodes inserted event to all listeners. |
void |
fireTreeNodesRemoved(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
Fires a tree nodes removed event to all listeners. |
void |
fireTreeStructureChanged(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
Fires a tree structure changed event to all listeners. |
java.lang.Object |
getChild(java.lang.Object parent,
int index)
|
int |
getChildCount(java.lang.Object parent)
|
int |
getIndexOfChild(java.lang.Object parent,
java.lang.Object child)
|
java.lang.Object |
getNodeForObject(java.lang.Object anObject)
Returns the first node found that represents the specified object, or null if not found. |
java.lang.Object |
getObjectForNode(java.lang.Object aNode)
Returns the object represented by the specified node which must be a display group node from this tree. |
javax.swing.tree.TreePath |
getPathForNode(java.lang.Object aNode)
Returns the tree path for the specified node, which must be a display group node from this tree. |
javax.swing.tree.TreePath |
getPathForObject(java.lang.Object anObject)
Returns the first tree path for the node that represents the specified object, or null if the object does not exist in this tree. |
javax.swing.tree.TreePath[] |
getPathsForObject(java.lang.Object anObject)
Returns the tree path for the node that represents the specified object, or null if the object does not exist in this tree. |
java.lang.Object |
getRoot()
|
java.lang.Object |
getRootLabel()
Gets the current root label. |
boolean |
isInsertingAfter()
Determines where new objects programmatically inserted into the children display group should be inserted, based on the value of insertingChild. |
boolean |
isInsertingChild()
Gets whether new objects programmatically inserted into the children display group should be inserted as a child of the first selected node. |
boolean |
isLeaf(java.lang.Object node)
|
boolean |
isSelectionPaintedImmediately()
Determines whether the selection should be painted immediately after the user clicks and therefore before the children display group is updated. |
static boolean |
isUsableWithObject(java.lang.Object anObject)
Returns whether this class can control the specified object. |
boolean |
isVisible(java.lang.Object node)
Returns whether this node is visible in the UI. |
protected java.lang.Object |
objectDeletedFromChildrenGroup(java.lang.Object anObject)
Called to by the children group's data source when it receives a deleteObject message, usually after an object has been deleted from the children display group. |
protected java.lang.Object |
objectInsertedIntoChildrenGroup(java.lang.Object anObject)
Called to by the children group's data source when it receives an insertObject message, usually after an object has been inserted into the children display group. |
static net.wotonomy.foundation.NSArray |
objectKeysTaken()
Returns a List of properties of the controlled object that are controlled by this class. |
protected net.wotonomy.foundation.NSArray |
objectsFetchedIntoChildrenGroup()
Called to by the children group's data source to populate it with all selected nodes and their siblings. |
void |
objectWillChange(java.lang.Object anObject)
Overridden to better discriminate what is changed. |
static java.lang.String |
primaryAspect()
Returns the aspect that is considered primary or default. |
void |
processRecentChanges()
Tells the children display group to refetch, so that it reflects any changes that were made in the node tree, and then updates the selection in the selection model. |
protected void |
removeAsListener()
|
void |
removeTreeModelListener(javax.swing.event.TreeModelListener aListener)
|
java.lang.Object |
rootLabel()
Gets the current root label. |
void |
setInsertingAfter(boolean after)
Determines where new objects programmatically inserted into the children display group should be inserted, based on the value of insertingChild. |
void |
setInsertingChild(boolean asChild)
Sets whether new objects programmatically inserted into the children display group should be inserted as a child of the first selected node. |
void |
setRootLabel(java.lang.Object aLabel)
Sets the root label. |
void |
setSelectionPaintedImmediately(boolean isImmediate)
Sets whether the selection should be painted immediately. |
void |
subjectChanged()
Called when either the selection or the contents of an associated display group have changed. |
void |
valueChanged(javax.swing.event.TreeSelectionEvent e)
|
void |
valueForPathChanged(javax.swing.tree.TreePath path,
java.lang.Object newValue)
|
Methods inherited from class net.wotonomy.ui.EOAssociation |
---|
associationClassesForObject, copyMatchingBindingsFromAssociation, displayGroupForAspect, displayGroupKeyForAspect, displayName, endEditing, object, setValueForAspect, setValueForAspectAtIndex, shouldEndEditing, shouldEndEditingAtIndex, valueForAspect, valueForAspectAtIndex |
Methods inherited from class net.wotonomy.control.EODelayedObserver |
---|
discardPendingNotification, observerQueue, priority, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean isListening
protected boolean titlesGroupChanged
protected boolean childrenGroupChanged
Constructor Detail |
---|
public TreeModelAssociation(java.lang.Object anObject)
public TreeModelAssociation(java.lang.Object anObject, java.lang.Object aRootLabel)
Method Detail |
---|
public java.lang.Object rootLabel()
public java.lang.Object getRootLabel()
public void setRootLabel(java.lang.Object aLabel)
public static net.wotonomy.foundation.NSArray aspectSignatures()
public static net.wotonomy.foundation.NSArray aspects()
public static net.wotonomy.foundation.NSArray associationClassesSuperseded()
public static boolean isUsableWithObject(java.lang.Object anObject)
public static net.wotonomy.foundation.NSArray objectKeysTaken()
public static java.lang.String primaryAspect()
public boolean canBindAspect(java.lang.String anAspect, net.wotonomy.ui.EODisplayGroup aDisplayGroup, java.lang.String aKey)
canBindAspect
in class net.wotonomy.ui.EOAssociation
public void bindAspect(java.lang.String anAspect, net.wotonomy.ui.EODisplayGroup aDisplayGroup, java.lang.String aKey)
bindAspect
in class net.wotonomy.ui.EOAssociation
public void establishConnection()
establishConnection
in class net.wotonomy.ui.EOAssociation
protected void fireRootStructureChanged()
public void breakConnection()
breakConnection
in class net.wotonomy.ui.EOAssociation
protected void addAsListener()
protected void removeAsListener()
public void objectWillChange(java.lang.Object anObject)
objectWillChange
in interface net.wotonomy.control.EOObserving
objectWillChange
in class net.wotonomy.control.EODelayedObserver
public void subjectChanged()
subjectChanged
in class net.wotonomy.ui.EOAssociation
public java.lang.Object getNodeForObject(java.lang.Object anObject)
public java.lang.Object getObjectForNode(java.lang.Object aNode)
public javax.swing.tree.TreePath getPathForNode(java.lang.Object aNode)
public javax.swing.tree.TreePath getPathForObject(java.lang.Object anObject)
public javax.swing.tree.TreePath[] getPathsForObject(java.lang.Object anObject)
public void valueChanged(javax.swing.event.TreeSelectionEvent e)
valueChanged
in interface javax.swing.event.TreeSelectionListener
public boolean isSelectionPaintedImmediately()
setSelectionPaintedImmediately(boolean)
public void setSelectionPaintedImmediately(boolean isImmediate)
public java.lang.Object getRoot()
getRoot
in interface javax.swing.tree.TreeModel
public java.lang.Object getChild(java.lang.Object parent, int index)
getChild
in interface javax.swing.tree.TreeModel
public int getChildCount(java.lang.Object parent)
getChildCount
in interface javax.swing.tree.TreeModel
public boolean isLeaf(java.lang.Object node)
isLeaf
in interface javax.swing.tree.TreeModel
public boolean isVisible(java.lang.Object node)
public void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)
valueForPathChanged
in interface javax.swing.tree.TreeModel
public int getIndexOfChild(java.lang.Object parent, java.lang.Object child)
getIndexOfChild
in interface javax.swing.tree.TreeModel
public void addTreeModelListener(javax.swing.event.TreeModelListener aListener)
addTreeModelListener
in interface javax.swing.tree.TreeModel
public void removeTreeModelListener(javax.swing.event.TreeModelListener aListener)
removeTreeModelListener
in interface javax.swing.tree.TreeModel
public void fireTreeNodesChanged(java.lang.Object source, java.lang.Object[] path, int[] childIndices, java.lang.Object[] children)
public void fireTreeNodesInserted(java.lang.Object source, java.lang.Object[] path, int[] childIndices, java.lang.Object[] children)
public void fireTreeNodesRemoved(java.lang.Object source, java.lang.Object[] path, int[] childIndices, java.lang.Object[] children)
public void fireTreeStructureChanged(java.lang.Object source, java.lang.Object[] path, int[] childIndices, java.lang.Object[] children)
public DisplayGroupNode createNode(net.wotonomy.ui.EODisplayGroup aParentGroup, java.lang.Object anObject)
public boolean isInsertingChild()
public void setInsertingChild(boolean asChild)
public boolean isInsertingAfter()
public void setInsertingAfter(boolean after)
protected java.lang.Object objectInsertedIntoChildrenGroup(java.lang.Object anObject)
protected java.lang.Object objectDeletedFromChildrenGroup(java.lang.Object anObject)
protected net.wotonomy.foundation.NSArray objectsFetchedIntoChildrenGroup()
public void processRecentChanges()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |