venice
Class ClosePackageCommand

java.lang.Object
  |
  +--venice.Command
        |
        +--venice.ClosePackageCommand

public class ClosePackageCommand
extends Command

Closes the packages selected in Visualization. This means that all their children will become hidden and all relationships crossing the selected packages will be combined in composite relationships not going in the package. This is same as moving relationships up for each child.

Author:
Petteri Kamppuri

Fields inherited from class venice.Command
stAppModule
 
Constructor Summary
ClosePackageCommand()
           
 
Method Summary
static void addRelationshipToCompRelListNotifyingOtherEnd(VModelElement inElement, VRelationship inRel)
           
 void execute()
          This method iterates through the list of selected VModelElements and does the close operation on each package in the list.
static void moveAllChildRelationshipsToThisPackage(VPackage inPackage)
          This method closes the given VPackage.
 
Methods inherited from class venice.Command
getAppModule, setAppModule
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

ClosePackageCommand

public ClosePackageCommand()
Method Detail

execute

public void execute()
This method iterates through the list of selected VModelElements and does the close operation on each package in the list.
Overrides:
execute in class Command

moveAllChildRelationshipsToThisPackage

public static void moveAllChildRelationshipsToThisPackage(VPackage inPackage)
This method closes the given VPackage. Closing means hiding all children and moving all their relationships up to the level of the package.
 closePackage(inPackage)
 		for each child as myChild
              for each relationship of myChild and its children as myRel
                      // handle relationship leaving this package
                      if not (myRel.src isDescentOf this and myRel.dst isDescentOf this)
                              myRel.hide/remove from visualization
                              inPackage.addToCompositeRelationship(myRel)
              myChild.hide // or global hide all children with ZInvisibleGroup
      inPackage.setShowContents(false)
 
Parameters:
inPackage - The package to close.

addRelationshipToCompRelListNotifyingOtherEnd

public static void addRelationshipToCompRelListNotifyingOtherEnd(VModelElement inElement,
                                                                 VRelationship inRel)
Parameters:
inElement - the element to which the inRel will be added as a composite relationship
inRel - the relationship which will be placed as a composite relationship