Class DisplayPorts

java.lang.Object
com.nomagic.magicdraw.uml.symbols.DisplayPorts

@OpenApiAll public class DisplayPorts extends Object
The utility class for showing ports on Symbol.
  • Constructor Details

    • DisplayPorts

      public DisplayPorts()
  • Method Details

    • collectAvailablePorts

      public static List<Port> collectAvailablePorts(PresentationElement presentationElement, boolean includeInherited, boolean includePrivateInherited)
      Collects all available ports for Symbol.
      Parameters:
      presentationElement - the given Symbol to collect all available ports for.
      includeInherited - should add inherited public ports.
      includePrivateInherited - should add inherited private ports.
      Returns:
      list of available ports.
    • displayAllPorts

      public static void displayAllPorts(Collection<PresentationElement> targets, boolean showNotification) throws ReadOnlyElementException
      Displays all available ports on Symbol.
      Parameters:
      targets - collection of Symbols to show all ports for.
      showNotification - true if notification should be shown when no ports are to be shown.
      Throws:
      ReadOnlyElementException - if element permissions prohibited to perform this operation.
    • displayPorts

      public static void displayPorts(PresentationElement target, List<Port> ports) throws ReadOnlyElementException
      Display chosen ports on Symbol.
      This method can be used only if some session was created with SessionManager. See code sample in SessionManager description for more details.
      Parameters:
      target - Symbol to show ports for.
      ports - list of ports to be shown.
      Throws:
      ReadOnlyElementException - if element permissions prohibited to perform this operation.
    • displayPorts

      public static void displayPorts(PresentationElement target, List<Port> ports, boolean selectCreatedPorts, boolean doNotResizeParent, boolean createPaths) throws ReadOnlyElementException
      Display chosen ports on Symbol.
      This method can be used only if some session was created with SessionManager. See code sample in SessionManager description for more details.
      Parameters:
      target - Symbol to show ports for.
      ports - list of ports to be shown.
      selectCreatedPorts - select created ports
      doNotResizeParent - do not resize Symbol to fit ports
      createPaths - add paths connected to ports
      Throws:
      ReadOnlyElementException - if element permissions prohibited to perform this operation.