ARoad0.Gui2
Class ACSTree

java.lang.Object
  extended by ARoad0.Gui2.ACSTree
All Implemented Interfaces:
MVC_Model, MVC_View, StaticClass

public class ACSTree
extends java.lang.Object
implements MVC_Model, MVC_View, StaticClass

This class is responsible for creating and for updating viewable trees from an ACS. All the methods are static. createGraphicalTree is the main method.


Field Summary
private static javax.swing.tree.DefaultTreeModel acsTreeModel__
           
private static javax.swing.tree.DefaultMutableTreeNode currentACSNode__
           
private static int INITIAL_CAPACITY
           
private static ACSTree instance__
           
static java.util.Map M_ACS_TREE_UPPER_NODES
           
 
Constructor Summary
private ACSTree()
          only one private constructor
 
Method Summary
private static boolean[] buildUpGraphicalDirectoryChildren(Directory _dir)
          Creates the non-null children as TreeNodes in a graphical tree.
static boolean checkACSTreeNode(ACSRun _acs, java.lang.String _node)
          Checks the need of a node in the acs tree from the ACS properties.
static javax.swing.JTree createACSExplorer(ACSRun _acs, javax.swing.JTree _tree, javax.swing.tree.DefaultMutableTreeNode _root)
          Creates a graphical subtree of ACS objects.
static javax.swing.JTree createAcsRightGraphicalTree(ACSRun _acs, javax.swing.JTree _tree, javax.swing.tree.DefaultMutableTreeNode _accRoot)
          Creates a graphical flat list of ACS rights.
static javax.swing.JTree createACSTree(ACS _acs)
          Creates a new graphical tree of ACS objects.
static javax.swing.JTree createExtContResourceGraphicalTree(ACS _acs, javax.swing.JTree _tree, javax.swing.tree.DefaultMutableTreeNode _root)
          Creates a graphical tree of external controlled resources owned by another ACS, through the external AclEntries or Linked Privileges.
static javax.swing.JTree createExtEligPartyGraphicalTree(ACS _acs, javax.swing.JTree _tree, javax.swing.tree.DefaultMutableTreeNode _epRoot)
          Creates 3 graphical subtrees of external eligible parties, which are accounts (groupID and userID) and actors (that are also resources) owned by another ACS, for which the ACS controls specific rights through its AclEntries or Linked Privileges.
static javax.swing.JTree createGraphicalTree(ACSRun _acs, javax.swing.JTree _tree, javax.swing.tree.DefaultMutableTreeNode _root, java.lang.String _rootName)
          Creates a graphical tree for a standard node from one of the 10 value of 'nodesInACSTree' in the ACS BeanInfo.
static javax.swing.JTree createOwnAclGraphicalTree(ACS _acs, javax.swing.JTree _tree, javax.swing.tree.DefaultMutableTreeNode _root)
          Creates a graphical tree of own AclEntries, or simply a flat list if there is no subACS resources with AclEntries.
static javax.swing.JTree createOwnActorGraphicalTree(ACS _acs, javax.swing.JTree _tree, javax.swing.tree.DefaultMutableTreeNode _actRoot)
          Creates a graphical flat list of own actors (which are also resources).
static javax.swing.JTree createOwnEligiblePartyVirtualFolderGraphicalTree(ACS _acs, javax.swing.JTree _tree, javax.swing.tree.DefaultMutableTreeNode _vfRoot)
          Creates a graphical subtree of own EligibleParty virtual folders for an ACS.
static javax.swing.JTree createOwnGroupGraphicalTree(ACS _acs, javax.swing.JTree _tree, javax.swing.tree.DefaultMutableTreeNode _grpRoot)
          Creates a graphical tree of own groupIDs with all their members, including other groupIDs.
static javax.swing.JTree createOwnPrivilegeGraphicalTree(ACS _acs, javax.swing.JTree _tree, javax.swing.tree.DefaultMutableTreeNode _priRoot)
          Creates a graphical list of own typed and linked privileges for an ACS.
static javax.swing.JTree createOwnResourceGraphicalTree(ACS _acs, javax.swing.JTree _tree, javax.swing.tree.DefaultMutableTreeNode _resRoot)
          Creates a graphical subtree of own resources for an ACS.
static javax.swing.JTree createOwnResourceVirtualFolderGraphicalTree(ACS _acs, javax.swing.JTree _tree, javax.swing.tree.DefaultMutableTreeNode _vfRoot)
          Creates a graphical subtree of own resource virtual folders for an ACS.
static javax.swing.JTree createOwnUserGraphicalTree(ACS _acs, javax.swing.JTree _tree, javax.swing.tree.DefaultMutableTreeNode _accRoot)
          Creates a graphical flat list of own userIDs.
static javax.swing.tree.DefaultMutableTreeNode getACSTreeMainNode(javax.swing.tree.DefaultTreeModel _treeModel, ImmutableACS _acs, java.lang.String _title, boolean _forExplorer)
          Get one of the twelve main nodes in an ACS tree, in the explorer or an another ACS tree.
static javax.swing.tree.DefaultTreeModel getExtContActorTree(ImmutableACS _acs, javax.swing.tree.DefaultTreeModel _treeModel, javax.swing.tree.DefaultMutableTreeNode _actRoot)
          Create a graphical flat list of external controlled actors (which are also resources!)
static javax.swing.tree.DefaultTreeModel getExtContResourceSubTreeRoots(javax.swing.tree.DefaultTreeModel _treeModel, javax.swing.tree.DefaultMutableTreeNode _root)
          Get the children under the 'External Controlled Resources' node in an ACSTree.
static javax.swing.tree.DefaultTreeModel getExtContResourceTree(ImmutableACS _acs, javax.swing.tree.DefaultTreeModel _treeModel, javax.swing.tree.DefaultMutableTreeNode _root)
          Create a graphical flat list of external controlled resources, which are never actors, owned by another ACS.
static javax.swing.tree.DefaultTreeModel getExtEligibleActorTree(ImmutableACS _acs, javax.swing.tree.DefaultTreeModel _treeModel, javax.swing.tree.DefaultMutableTreeNode _root)
          Creates a graphical flat list of Actors owned by another ACS, for which the ACS controls specific rights through its external AclEntries or Linked Privileges.
static javax.swing.tree.DefaultTreeModel getExtEligibleGroupTree(ImmutableACS _acs, javax.swing.tree.DefaultTreeModel _treeModel, javax.swing.tree.DefaultMutableTreeNode _root)
          Creates a graphical flat list of GroupIDs owned by another ACS, for which the ACS controls specific rights through its external AclEntries or Linked Privileges.
static javax.swing.tree.DefaultTreeModel getExtEligibleUserTree(ImmutableACS _acs, javax.swing.tree.DefaultTreeModel _treeModel, javax.swing.tree.DefaultMutableTreeNode _root)
          Creates a graphical flat list of UserIDs owned by another ACS, for which the ACS controls specific rights through its external AclEntries or Linked Privileges.
static javax.swing.tree.DefaultTreeModel getExtEPSubTreeRoots(javax.swing.tree.DefaultTreeModel _treeModel, javax.swing.tree.DefaultMutableTreeNode _root)
          Get the three standard nodes under the 'External Eligible Parties' node in an ACSTree: EEACTORS, EGROUPS, EUSERS.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance__

private static ACSTree instance__

INITIAL_CAPACITY

private static final int INITIAL_CAPACITY
See Also:
Constant Field Values

currentACSNode__

private static javax.swing.tree.DefaultMutableTreeNode currentACSNode__

acsTreeModel__

private static javax.swing.tree.DefaultTreeModel acsTreeModel__

M_ACS_TREE_UPPER_NODES

public static final java.util.Map M_ACS_TREE_UPPER_NODES
Constructor Detail

ACSTree

private ACSTree()
only one private constructor

Method Detail

createACSTree

public static final javax.swing.JTree createACSTree(ACS _acs)
                                             throws ProcessError
Creates a new graphical tree of ACS objects. Called by gDMak.ActionOpenMainFrame. Calls createACSExplorer().

Parameters:
_acs - to process
Returns:
JTree of objects in the ACS
Throws:
ProcessError - if _acs is null

createACSExplorer

public static final javax.swing.JTree createACSExplorer(ACSRun _acs,
                                                        javax.swing.JTree _tree,
                                                        javax.swing.tree.DefaultMutableTreeNode _root)
                                                 throws ProcessError
Creates a graphical subtree of ACS objects. Calls the createXXXGraphicalTree() method, following the 10 value of "nodesInACSTree" in the ACS BeanInfo. Calls checkACSTreeNode() for checking the values for the key 'Explorer.NoAcsNode' from ACSImpl.getM_SpecializedTypesAndExplorer(). Calls createGraphicalTree(). Called by createACSTree() and TreeManager.createExplorer().

Parameters:
_acs - to process
_tree - to process, which may be the explorer tree or not
_root - of the ACS tree in _tree
Returns:
JTree of objects in the ACS, as a subtree under _root
Throws:
ProcessError - if _acs is null or if "nodesInACSTree" return null in the BeanInfo of the ACS

checkACSTreeNode

public static final boolean checkACSTreeNode(ACSRun _acs,
                                             java.lang.String _node)
Checks the need of a node in the acs tree from the ACS properties. ACLs, users, groups, ACS rights, resource virtual folders, eligible party virtual folders, or privileges may be jumped if acs.getM_TypesAndGUIPolicy() contains the relevant value for the key 'Explorer.NoAcsNode'. Called by createACSExplorer().

Parameters:
_acs - to process is an ACS or an ACSFactoryImpl. If ACSFactoryImpl, only the node 'ACSRIGHTS' is displayed.
_node - is a node name from ACSImplBeanInfo.getBeanDescriptor().getValue("nodesInACSTree")
Returns:
true if the node has to be displayed in the acs tree

createGraphicalTree

public static final javax.swing.JTree createGraphicalTree(ACSRun _acs,
                                                          javax.swing.JTree _tree,
                                                          javax.swing.tree.DefaultMutableTreeNode _root,
                                                          java.lang.String _rootName)
Creates a graphical tree for a standard node from one of the 10 value of 'nodesInACSTree' in the ACS BeanInfo. If it is the'RESOURCES' node, the user objects are not the base objects, but their name last component. This avoids to link the base object to the node, allowing the lazy loading of resources from the database files. For the other nodes, the user objects in the nodes are the base objects, excepting for the AclEntries, the Privileges and the external objects. Calls all the createXXXXXXGraphicalTree(). Called by createACSExplorer().

Parameters:
_acs - to process is an ACS or an ACSFactoryImpl
_tree - to which ACS objects are added, with a DefaultTreeModel (not a TreeModel)
_root - is the node to which the graphical tree is added
_rootName - is the user value of _root, that is a string which must be a key in M_ACS_TREE_UPPER_NODES
Returns:
_tree with a subtree of BaseObjects under _nodeRoot

createOwnActorGraphicalTree

public static final javax.swing.JTree createOwnActorGraphicalTree(ACS _acs,
                                                                  javax.swing.JTree _tree,
                                                                  javax.swing.tree.DefaultMutableTreeNode _actRoot)
Creates a graphical flat list of own actors (which are also resources).

Parameters:
_acs - ACS to process
_tree - JTree to which ACS objects are added, with a DefaultTreeModel (not a TreeModel)
_actRoot - DefaultMutableTreeNode in _tree, to which the ACS actors are added
Returns:
_tree with a subtree of actors

createOwnResourceGraphicalTree

public static final javax.swing.JTree createOwnResourceGraphicalTree(ACS _acs,
                                                                     javax.swing.JTree _tree,
                                                                     javax.swing.tree.DefaultMutableTreeNode _resRoot)
Creates a graphical subtree of own resources for an ACS. The search is processed from up to down, and from the first to the last child of each node. Two trees are processed:

- the Resources tree from ARoad0.gBase

- the TreeNodes tree from javax.swing

The user objects are not the base objects, but their name last component. This choice avoids to link the base object to the node, allowing a future lazy loading of resources from the database files. One resource may be associated to only one TreeNode of the account tree. Calls buildUpGraphicalDirectoryChildren().

Parameters:
_acs - to process
_tree - to which ACS objects are added, with a DefaultTreeModel (not a TreeModel)
_resRoot - DefaultMutableTreeNode in _tree, to which the ACS resources are added
Returns:
JTree with a subtree of the ACS resources.

createOwnGroupGraphicalTree

public static final javax.swing.JTree createOwnGroupGraphicalTree(ACS _acs,
                                                                  javax.swing.JTree _tree,
                                                                  javax.swing.tree.DefaultMutableTreeNode _grpRoot)
Creates a graphical tree of own groupIDs with all their members, including other groupIDs. The to-display-by-type groups are put under their proper nodes under the argument _accRoot. On the contrary of the resource tree, one groupID object may be associated there to several TreeNodes in the tree. Calls the buildUpGroupTree method in ACSTreeUtilities. Calls ACSTreeUtilities.getL_GroupTreesToDisplay() to create the groups tree roots, and ACSFactoryUtilityImpl.getL_SubAcsToDisplay() to create the subACSs. From the keys 'Explorer.SubAcsNode' and 'Explorer.AcsGroupTree' in the map of ACSImpl.getM_SpecializedTypesAndExplorer(), creates the String nodes '' or '', the parents of the to-display-by-type nodes, where fffff is the first word after 'GroupType.' in the group type for the groups to display directly under this node.

Parameters:
_acs - to process
_tree - to which ACS objects are added, with a DefaultTreeModel
_grpRoot - in _tree, to which the ACS groups are added. May contains nodes for the typed groups.
Returns:
_tree with a subtree of groups

createOwnUserGraphicalTree

public static final javax.swing.JTree createOwnUserGraphicalTree(ACS _acs,
                                                                 javax.swing.JTree _tree,
                                                                 javax.swing.tree.DefaultMutableTreeNode _accRoot)
Creates a graphical flat list of own userIDs.

Parameters:
_acs - to process
_tree - to which ACS objects are added, with a DefaultTreeModel (not a TreeModel)
_accRoot - is the node in _tree, to which the ACS userIDs are added
Returns:
_tree with a list of userIDs

createOwnAclGraphicalTree

public static final javax.swing.JTree createOwnAclGraphicalTree(ACS _acs,
                                                                javax.swing.JTree _tree,
                                                                javax.swing.tree.DefaultMutableTreeNode _root)
Creates a graphical tree of own AclEntries, or simply a flat list if there is no subACS resources with AclEntries.

Parameters:
_acs - to process
_tree - to which ACS objects are added, with a DefaultTreeModel (not a TreeModel)
_root - is the node in _tree, to which the ACS AclEntries are added
Returns:
_tree with a list of AclEntry detailled names

createExtEligPartyGraphicalTree

public static final javax.swing.JTree createExtEligPartyGraphicalTree(ACS _acs,
                                                                      javax.swing.JTree _tree,
                                                                      javax.swing.tree.DefaultMutableTreeNode _epRoot)
Creates 3 graphical subtrees of external eligible parties, which are accounts (groupID and userID) and actors (that are also resources) owned by another ACS, for which the ACS controls specific rights through its AclEntries or Linked Privileges. The user object is the eligible party name, not the eligible party.

Parameters:
_acs - to process
_tree - to which ACS objects are added, with a DefaultTreeModel (not a TreeModel)
_epRoot - in _tree, to which the ACS eligible parties are added
Returns:
JTree _tree with a list of account and actor names

createExtContResourceGraphicalTree

public static final javax.swing.JTree createExtContResourceGraphicalTree(ACS _acs,
                                                                         javax.swing.JTree _tree,
                                                                         javax.swing.tree.DefaultMutableTreeNode _root)
Creates a graphical tree of external controlled resources owned by another ACS, through the external AclEntries or Linked Privileges. The user object in the tree is the resource name, not the resource. Calls getExtContResourceSubTreeRoots(), getExtContActorTree() and getExtContResourceTree().

Parameters:
_acs - to handle
_tree - to which ACS objects are added, with a DefaultTreeModel (not a TreeModel)
_root - in _tree, to which the ACS resourcess are added
Returns:
JTree _tree with a list of resource names

createAcsRightGraphicalTree

public static final javax.swing.JTree createAcsRightGraphicalTree(ACSRun _acs,
                                                                  javax.swing.JTree _tree,
                                                                  javax.swing.tree.DefaultMutableTreeNode _accRoot)
Creates a graphical flat list of ACS rights.

Parameters:
_acs - to process is an ACS or an ACSFactoryImpl
_tree - to which ACS objects are added, with a DefaultTreeModel (not a TreeModel)
_accRoot - is the node in _tree, to which the ACS rights are added
Returns:
_tree with a list of acsrights

createOwnResourceVirtualFolderGraphicalTree

public static final javax.swing.JTree createOwnResourceVirtualFolderGraphicalTree(ACS _acs,
                                                                                  javax.swing.JTree _tree,
                                                                                  javax.swing.tree.DefaultMutableTreeNode _vfRoot)
Creates a graphical subtree of own resource virtual folders for an ACS. The searching is processed from up to down, and from the first to the last child of each node.

Two trees are processed:

- the VirtualFolders tree or list from ARoad0.gBase

- the TreeNodes tree from javax.swing

The TreeNode user objects are the base objects. One virtual folder may be associated to only one TreeNode of the tree. Calls ACSTreeUtilities.buildUpVirtualFolderTree(). Called by createGraphicalTree().

Parameters:
_acs - to process
_tree - to which ACS objects are added, with a DefaultTreeModel (not a TreeModel)
_vfRoot - in _tree, to which the resource virtual folders are added
Returns:
JTree with a subtree of the ACS resource virtual folders.

createOwnEligiblePartyVirtualFolderGraphicalTree

public static final javax.swing.JTree createOwnEligiblePartyVirtualFolderGraphicalTree(ACS _acs,
                                                                                       javax.swing.JTree _tree,
                                                                                       javax.swing.tree.DefaultMutableTreeNode _vfRoot)
Creates a graphical subtree of own EligibleParty virtual folders for an ACS. The searching is processed from up to down, and from the first to the last child of each node.

Two trees are processed:

- the VirtualFolders tree or list from ARoad0.gBase

- the TreeNodes tree from javax.swing

The TreeNode user objects are the base objects. One virtual folder may be associated to only one TreeNode of the tree. Calls ACSTreeUtilities.buildUpVirtualFolderTree(). Called by createGraphicalTree().

Parameters:
_acs - to process
_tree - to which ACS objects are added, with a DefaultTreeModel (not a TreeModel)
_vfRoot - in _tree, to which the EligibleParty virtual folders are added
Returns:
JTree with a subtree of the EligibleParty virtual folders.

createOwnPrivilegeGraphicalTree

public static final javax.swing.JTree createOwnPrivilegeGraphicalTree(ACS _acs,
                                                                      javax.swing.JTree _tree,
                                                                      javax.swing.tree.DefaultMutableTreeNode _priRoot)
Creates a graphical list of own typed and linked privileges for an ACS. If there are both typed and linked privileges, the typed ones are displayed first. The user object in the node is the detailled name, like in AclEntries. Called by createGraphicalTree().

Parameters:
_acs - to process
_tree - to which ACS objects are added, with a DefaultTreeModel (not a TreeModel)
_priRoot - in _tree, to which the privileges are added
Returns:
JTree with a subtree of the ACS privileges.

getExtEligibleGroupTree

public static final javax.swing.tree.DefaultTreeModel getExtEligibleGroupTree(ImmutableACS _acs,
                                                                              javax.swing.tree.DefaultTreeModel _treeModel,
                                                                              javax.swing.tree.DefaultMutableTreeNode _root)
Creates a graphical flat list of GroupIDs owned by another ACS, for which the ACS controls specific rights through its external AclEntries or Linked Privileges. The user object is the eligible party name, not the eligible party. Calls ACS_Facade.ACS_Facade.getExtEligibleGroupArray().

Parameters:
_acs - to process
_treeModel - to which ACS objects are added
_root - in _treeModel, to which the ACS eligible parties are added
Returns:
updated _treeModel

getExtEligibleActorTree

public static final javax.swing.tree.DefaultTreeModel getExtEligibleActorTree(ImmutableACS _acs,
                                                                              javax.swing.tree.DefaultTreeModel _treeModel,
                                                                              javax.swing.tree.DefaultMutableTreeNode _root)
Creates a graphical flat list of Actors owned by another ACS, for which the ACS controls specific rights through its external AclEntries or Linked Privileges. The user object is the eligible party name, not the eligible party. Calls ACS_Facade.ACS_Facade.getExtEligibleActorArray().

Parameters:
_acs - to process
_treeModel - to which ACS objects are added
_root - in _treeModel, to which the ACS eligible parties are added
Returns:
updated _treeModel

getExtEligibleUserTree

public static final javax.swing.tree.DefaultTreeModel getExtEligibleUserTree(ImmutableACS _acs,
                                                                             javax.swing.tree.DefaultTreeModel _treeModel,
                                                                             javax.swing.tree.DefaultMutableTreeNode _root)
Creates a graphical flat list of UserIDs owned by another ACS, for which the ACS controls specific rights through its external AclEntries or Linked Privileges. The user object is the eligible party name, not the eligible party. Calls ACS_Facade.ACS_Facade.getExtEligibleUserArray().

Parameters:
_acs - to process
_treeModel - to which ACS objects are added
_root - in _treeModel, to which the ACS eligible parties are added
Returns:
updated _treeModel

getExtContActorTree

public static final javax.swing.tree.DefaultTreeModel getExtContActorTree(ImmutableACS _acs,
                                                                          javax.swing.tree.DefaultTreeModel _treeModel,
                                                                          javax.swing.tree.DefaultMutableTreeNode _actRoot)
Create a graphical flat list of external controlled actors (which are also resources!) owned by another ACS. The user object in tree is here the actor name, not the actor, to display an extended name.

Parameters:
_acs - to process
_treeModel - to which ACS objects are added
_actRoot - DefaultMutableTreeNode in _tree, to which the actors are added
Returns:
updated _treeModel

getExtContResourceTree

public static final javax.swing.tree.DefaultTreeModel getExtContResourceTree(ImmutableACS _acs,
                                                                             javax.swing.tree.DefaultTreeModel _treeModel,
                                                                             javax.swing.tree.DefaultMutableTreeNode _root)
Create a graphical flat list of external controlled resources, which are never actors, owned by another ACS. The user object in tree is here the name, not the resource, to display an extended name.

Parameters:
_acs - to process
_treeModel - to which ACS objects are added
_root - in _treeModel, to which the resources are added
Returns:
updated _treeModel

getExtContResourceSubTreeRoots

public static final javax.swing.tree.DefaultTreeModel getExtContResourceSubTreeRoots(javax.swing.tree.DefaultTreeModel _treeModel,
                                                                                     javax.swing.tree.DefaultMutableTreeNode _root)
Get the children under the 'External Controlled Resources' node in an ACSTree.

Parameters:
_treeModel - to which ACS objects are added, with a DefaultTreeModel (not a TreeModel)
_root - in _tree, to which the ACS resources are added
Returns:
_treeModel completed

getExtEPSubTreeRoots

public static final javax.swing.tree.DefaultTreeModel getExtEPSubTreeRoots(javax.swing.tree.DefaultTreeModel _treeModel,
                                                                           javax.swing.tree.DefaultMutableTreeNode _root)
Get the three standard nodes under the 'External Eligible Parties' node in an ACSTree: EEACTORS, EGROUPS, EUSERS.

Parameters:
_treeModel - to which ACS objects are added
_root - in _tree, to which the ACS resources are added
Returns:
_treeModel completed

getACSTreeMainNode

public static final javax.swing.tree.DefaultMutableTreeNode getACSTreeMainNode(javax.swing.tree.DefaultTreeModel _treeModel,
                                                                               ImmutableACS _acs,
                                                                               java.lang.String _title,
                                                                               boolean _forExplorer)
Get one of the twelve main nodes in an ACS tree, in the explorer or an another ACS tree.

Parameters:
_treeModel - the explorer tree model, or the ACS tree model if it is for an ACS main frame
_acs - displayed in the ACS tree
_title - title or user string, of the required node; it has to be an ACSTree static final variable as ACS.ACTORS for instance
_forExplorer - true if it is in the explorer, false if it is in the ACS main frame
Returns:
the required node in the ACS tree. May be null.

buildUpGraphicalDirectoryChildren

private static final boolean[] buildUpGraphicalDirectoryChildren(Directory _dir)
Creates the non-null children as TreeNodes in a graphical tree. Called by createOwnResourceGraphicalTree(), with strong links through the updating of acsTreeModel__.

Parameters:
_dir - already created as graphical tree in acsTreeModel__
Returns:
boolean[] that indicates where there are directories as _dir children. The array index is from _dir.getEorL_Children(), not from the associated currentACSNode__, where null children are removed. Is null if there is no children.