Class CompartmentManager
- java.lang.Object
-
- com.nomagic.magicdraw.uml.symbols.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 Summary
Constructors Constructor Description CompartmentManager()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
hideCompartmentElement(PresentationElement view, java.lang.String compartmentID, Element element)
Hides an element in a compartment.static void
hideCompartmentElements(PresentationElement view, java.lang.String compartmentID, java.util.List<Element> elements)
Hides elements in a compartment.static void
showCompartmentElement(PresentationElement view, java.lang.String compartmentID, Element element)
Shows element in a compartment.static void
showCompartmentElements(PresentationElement view, java.lang.String compartmentID, java.util.List<Element> elements)
Shows elements in a compartment.
-
-
-
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.
-
-