Class CompartmentManager


  • @OpenApiAll
    public class CompartmentManager
    extends java.lang.Object

    Contains utility methods for dealing with compartment and its elements.

    Example 1: Display a property in a compartment

     Property property = ...; // Property model element.
     ClassView classView = ...; // Class symbol.
    
     SessionManager manager = SessionManager.getInstance();
     manager.createSession("Show Property.");
    
     CompartmentManager.showCompartmentElement(classView, CompartmentID.ATTRIBUTES, property);
    
     manager.closeSession();
     

    Example 2: Hide a slot on a class shape

     Slot slot = ...; // Slot model element.
     ClassView classView = ...; // Class symbol.
    
     SessionManager manager = SessionManager.getInstance();
     manager.createSession("Hide slot.");
    
     CompartmentManager.hideCompartmentElement(classView, CompartmentID.TAGGED_VALUES_ON_SHAPE, slot);
    
     manager.closeSession();
     
    See Also:
    CompartmentID, SessionManager, PresentationElement, Element
    • Constructor Detail

      • CompartmentManager

        public CompartmentManager()
    • Method Detail

      • hideCompartmentElement

        public static void hideCompartmentElement​(PresentationElement view,
                                                  java.lang.String compartmentID,
                                                  Element element)
        Hides an element in a compartment.
        Parameters:
        view - symbol which contains the compartment.
        compartmentID - id of the compartment.
        element - element to hide.
      • hideCompartmentElements

        public static void hideCompartmentElements​(PresentationElement view,
                                                   java.lang.String compartmentID,
                                                   java.util.List<Element> elements)
        Hides elements in a compartment.
        Parameters:
        view - symbol which contains the compartment.
        compartmentID - id of the compartment.
        elements - elements to hide.
      • showCompartmentElement

        public static void showCompartmentElement​(PresentationElement view,
                                                  java.lang.String compartmentID,
                                                  Element element)
        Shows element in a compartment.
        Parameters:
        view - symbol which contains the compartment.
        compartmentID - id of the compartment.
        element - element to show.
      • showCompartmentElements

        public static void showCompartmentElements​(PresentationElement view,
                                                   java.lang.String compartmentID,
                                                   java.util.List<Element> elements)
        Shows elements in a compartment.
        Parameters:
        view - symbol which contains the compartment.
        compartmentID - id of the compartment.
        elements - elements to show.