|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectARoad0.Gui2.ACSTreeUtilities
public class ACSTreeUtilities
This class is responsible for providing useful methods for updating the ACS trees when a base object changes. All methods are static methods.
Field Summary | |
---|---|
private static javax.swing.tree.DefaultTreeModel |
acsTreeModel__
|
private static javax.swing.tree.DefaultMutableTreeNode |
currentACSNode__
|
private static int |
INITIAL_CAPACITY
|
private static java.lang.String |
lineSepar__
|
Constructor Summary | |
---|---|
private |
ACSTreeUtilities()
only one private constructor |
Method Summary | |
---|---|
static javax.swing.tree.DefaultTreeModel |
addDetailledNameUnderNode(javax.swing.tree.DefaultTreeModel _treeModel,
javax.swing.tree.DefaultMutableTreeNode _parentNode,
DetailledName _obj,
ACS _acs)
Inserts a detailledName in a DefaultTreeModel, in a flat list under a node, following the natural order of the argument class. |
static javax.swing.tree.DefaultTreeModel |
buildUpGroupTree(ACS _acs,
javax.swing.tree.DefaultTreeModel _treeModel,
javax.swing.tree.DefaultMutableTreeNode _node,
GroupID _group)
Builds up a subtree for a GroupID. |
static javax.swing.tree.DefaultTreeModel |
buildUpVirtualFolderMembers(javax.swing.tree.DefaultTreeModel _treeModel,
javax.swing.tree.DefaultMutableTreeNode _node)
Builds up the member nodes for a virtual folder. |
static javax.swing.tree.DefaultTreeModel |
buildUpVirtualFolderTree(ACS _acs,
javax.swing.tree.DefaultTreeModel _treeModel,
javax.swing.tree.DefaultMutableTreeNode _node,
ImmutableVirtualFolder _vf)
Builds up a subtree for a virtual folder, including both the children abd the members. |
static javax.swing.tree.DefaultMutableTreeNode |
getACSTreeMainNode(javax.swing.tree.DefaultTreeModel _treeModel,
ACSRun _acs,
java.lang.String _title,
boolean _forExplorer)
Gets one of the main nodes in an ACS tree, in the explorer or an another ACS tree. |
static javax.swing.tree.DefaultMutableTreeNode |
getCurrentObjectNode(javax.swing.tree.DefaultMutableTreeNode _rootNode,
java.lang.Object _object)
Gets the first tree node associated to a BaseObject (excepting for a view) in a subtree from a node (in the explorer or another tree). |
static javax.swing.tree.DefaultMutableTreeNode |
getCurrentParent(javax.swing.tree.DefaultMutableTreeNode _rootNode,
BaseObject _object)
Gets the unique parent node associated to a base object (NOT an ACS or a view) in a subtree from a node (in the explorer or another tree). |
static javax.swing.tree.DefaultMutableTreeNode |
getCurrentParentOfVirtualFolderInTree(javax.swing.tree.DefaultMutableTreeNode _rootNode,
ImmutableVirtualFolder _vf)
Gets the parent node of a VirtualFolder in a tree, in the explorer or another ACS tree. |
static javax.swing.tree.DefaultMutableTreeNode |
getDetailledNameNodeInExplorer(DetailledName _object,
ImmutableName _aCSname)
Gets the first tree node associated to a detailled name object in a subtree from a node (in the explorer or another tree). |
static javax.swing.tree.DefaultMutableTreeNode |
getParentOfResource(ImmutableACS _acs,
javax.swing.tree.DefaultTreeModel _treeModel,
ImmutableResource _resource,
boolean _isExplorer)
Gets the unique parent node to associate to a resource in a subtree from the ACSTree.RESOURCES node (in the explorer or another tree). |
static javax.swing.tree.DefaultMutableTreeNode |
getParentOfSubOrTreeTypedGroupID(javax.swing.tree.DefaultMutableTreeNode _rootNode,
ImmutableGroupID _grp)
Gets the parent node associated to a sub-or-tree-typed group in the explorer or another ACS tree. |
static ImmutableName |
getResourceInTree(ImmutableName _acsName,
javax.swing.tree.DefaultMutableTreeNode _node)
Since the resource in an ACS tree is not the user object of the node, gets the resource through the sequence of Strings from the node 'RESOURCES' which defines the resource name. |
protected static boolean |
isInResourceTree(javax.swing.tree.DefaultMutableTreeNode _node)
Says if a node in a subtree belongs to the resources tree of an acs, in the explorer or another tree. |
static javax.swing.tree.DefaultTreeModel |
modifyObjectUnderNode(javax.swing.tree.DefaultTreeModel _treeModel,
javax.swing.tree.DefaultMutableTreeNode _parentNode,
java.lang.Object _obj,
boolean _toInsert)
Inserts or removes a base object in a DefaultTreeModel. |
static void |
removeACSorViewNode(ImmutableName _objectName)
Removes the node associated to an ACS or a view in the explorer. |
static void |
removeAllChildren(javax.swing.tree.DefaultTreeModel _treeModel,
javax.swing.tree.DefaultMutableTreeNode _rootNode)
Removes all the children of a node in a tree, since DefaultMutableTreeNode.removeAllChildren() does not work. |
private static boolean[] |
setGraphicalGroupIDMembers(GroupID _grp)
Creates or analyzes the non-null and non-empty members as TreeNodes in a graphical tree, to return the members which have no associated nodes in the ACS tree. |
private static boolean[] |
setGraphicalVirtualFolderChildren(ImmutableVirtualFolder _vf)
Creates the non-null children as TreeNodes in a graphical tree. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int INITIAL_CAPACITY
private static java.lang.String lineSepar__
private static javax.swing.tree.DefaultMutableTreeNode currentACSNode__
private static javax.swing.tree.DefaultTreeModel acsTreeModel__
Constructor Detail |
---|
private ACSTreeUtilities()
Method Detail |
---|
public static final void removeACSorViewNode(ImmutableName _objectName)
_objectName
- of the ACS or the viewpublic static final void removeAllChildren(javax.swing.tree.DefaultTreeModel _treeModel, javax.swing.tree.DefaultMutableTreeNode _rootNode)
_treeModel
- of the tree_rootNode
- for which the children have to be removedpublic static final javax.swing.tree.DefaultTreeModel modifyObjectUnderNode(javax.swing.tree.DefaultTreeModel _treeModel, javax.swing.tree.DefaultMutableTreeNode _parentNode, java.lang.Object _obj, boolean _toInsert)
_treeModel
- of the objects tree_parentNode
- under which the user object
is removed or inserted at the end of the list_obj
- to insert or to remove. Never null. Must be a BaseObject
if _treeModel is a RESOURCES tree, that is isInResourceTree(_parentNode)
returns true._toInsert
- true to insert, false to remove
isInResourceTree(javax.swing.tree.DefaultMutableTreeNode)
public static final javax.swing.tree.DefaultTreeModel addDetailledNameUnderNode(javax.swing.tree.DefaultTreeModel _treeModel, javax.swing.tree.DefaultMutableTreeNode _parentNode, DetailledName _obj, ACS _acs)
_treeModel
- of the objects tree_parentNode
- under which the user object
is removed or inserted at the end of the list_obj
- to insert. Never null._acs
- ACS of _obj. Never null.
java.lang.InternalError
- if the argument _obj, or the user object of
a _parentNode child, is not a Comparablepublic static final javax.swing.tree.DefaultMutableTreeNode getCurrentParent(javax.swing.tree.DefaultMutableTreeNode _rootNode, BaseObject _object)
_rootNode
- in the tree which defines the subtree_object
- displayed only once in the subtree from _rootNode
public static final javax.swing.tree.DefaultMutableTreeNode getCurrentObjectNode(javax.swing.tree.DefaultMutableTreeNode _rootNode, java.lang.Object _object)
_rootNode
- in the tree which defines the subtree_object
- displayed in the subtree from _rootNode
public static final javax.swing.tree.DefaultMutableTreeNode getDetailledNameNodeInExplorer(DetailledName _object, ImmutableName _aCSname)
_object
- is a DetailledName object displayed in the explorer_aCSname
- is the name of the ACS that manages _object
public static final javax.swing.tree.DefaultMutableTreeNode getParentOfResource(ImmutableACS _acs, javax.swing.tree.DefaultTreeModel _treeModel, ImmutableResource _resource, boolean _isExplorer)
_acs
- displayed in the ACS tree_treeModel
- of the objects tree_resource
- displayed only once in the subtree from
the ACSTree.RESOURCES node_isExplorer
- true if it is in the explorer tree, false if it is
in the ACS main frame tree
java.lang.InternalError
- if the search is abortedpublic static final javax.swing.tree.DefaultMutableTreeNode getACSTreeMainNode(javax.swing.tree.DefaultTreeModel _treeModel, ACSRun _acs, java.lang.String _title, boolean _forExplorer)
_treeModel
- the explorer tree model, or the ACS tree model if
it is for an ACS main frame_acs
- is an ACS or a partial ACSFactoryImpl
which is displayed in the acs tree_title
- title or user string, of the required node; it has to be
defined in ACSTree.M_ACS_TREE_UPPER_NODES_forExplorer
- true if it is in the explorer tree, false if it is
in the ACS main frame tree
for the main nodes definitions
public static final javax.swing.tree.DefaultTreeModel buildUpGroupTree(ACS _acs, javax.swing.tree.DefaultTreeModel _treeModel, javax.swing.tree.DefaultMutableTreeNode _node, GroupID _group)
ACSTree.createExtEligPartyGraphicalTree(),
ACSTreeBaseListenerImpl.changeGroupIDMember().
Calls setGraphicalGroupIDMembers(). When the group is new, it has only an empty member which is not displayed. If the number of levels in the tree exceeds 15, it is probably a bug. In that case, the process stops, the tree is uncomplete and an error message is displayed to the user.
_acs
- which owns _group_treeModel
- which owns _node_node
- having children to update_group
- in _acs, associated to _node in _treeModel
public static final ImmutableName getResourceInTree(ImmutableName _acsName, javax.swing.tree.DefaultMutableTreeNode _node)
_acsName
- is the name of the acs which owned the resource_node
- of the resource in the tree
public static final javax.swing.tree.DefaultMutableTreeNode getParentOfSubOrTreeTypedGroupID(javax.swing.tree.DefaultMutableTreeNode _rootNode, ImmutableGroupID _grp)
_rootNode
- TreeNode to which all the ACS groups are added._grp
- is a sub-or-tree-typed GroupID to put
at the second level of groups in the ACS tree
public static final javax.swing.tree.DefaultMutableTreeNode getCurrentParentOfVirtualFolderInTree(javax.swing.tree.DefaultMutableTreeNode _rootNode, ImmutableVirtualFolder _vf)
_rootNode
- root of one of the two VirtualFolders tree in an ACS tree_vf
- to put in or to remove from the VirtualFolder tree
public static final javax.swing.tree.DefaultTreeModel buildUpVirtualFolderMembers(javax.swing.tree.DefaultTreeModel _treeModel, javax.swing.tree.DefaultMutableTreeNode _node)
_treeModel
- which owns _node; updated by this method_node
- has a VirtualFolder as object, which may have members, and _node
has no child for the moment
public static final javax.swing.tree.DefaultTreeModel buildUpVirtualFolderTree(ACS _acs, javax.swing.tree.DefaultTreeModel _treeModel, javax.swing.tree.DefaultMutableTreeNode _node, ImmutableVirtualFolder _vf)
- the virtual folder subtree from ARoad0.gBase,
- the TreeNode tree from java.swing,
- the virtual folder members as a list from ARoad0.gBase.
Like in ACSTree.createOwnResourceGraphicalTree(), one virtual folder cannot be associated to several TreeNodes in the tree. Called by ACSTree.createOwnResourceVirtualFolderGraphicalTree() and createOwnEligiblePartyVirtualFolderGraphicalTree().
Calls setGraphicalVirtualFolderChildren() and buildUpVirtualFolderMembers() which update acsTreeModel__. This method should not be called if _node has no child (a child is not a folder element).
_acs
- which owns _vf_treeModel
- which owns _node; updated by this method_node
- having children to update_vf
- in _acs, user object of _node in _treeModel, and without parent
protected static final boolean isInResourceTree(javax.swing.tree.DefaultMutableTreeNode _node)
_node
- in an ACS tree. Never null. May be the RESOURCES node.
private static final boolean[] setGraphicalGroupIDMembers(GroupID _grp)
_grp
- already created as graphical tree node in acsTreeModel__
private static final boolean[] setGraphicalVirtualFolderChildren(ImmutableVirtualFolder _vf)
_vf
- already created as graphical tree node in acsTreeModel__
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |