Class OpenedDiagramValidator

  • All Implemented Interfaces:
    com.nomagic.magicdraw.core.diagram.DiagramsChangeListener, ValidationRule

    @OpenApiAll
    public abstract class OpenedDiagramValidator
    extends DiagramValidator
    implements com.nomagic.magicdraw.core.diagram.DiagramsChangeListener
    Works the same as the base rule DiagramValidator, but narrows the scope down only to currently opened diagrams. When creating annotations, the diagrams in scope should be retrieved by using DiagramValidator.getDiagrams() method.
    • Constructor Detail

      • OpenedDiagramValidator

        public OpenedDiagramValidator()
    • Method Detail

      • init

        public void init​(Project project,
                         Constraint constraint)
        Description copied from interface: ValidationRule
        This is the first method that is invoked on the implementation of the ValidationRule interface. Implementation can initialize internal state if required.
        Specified by:
        init in interface ValidationRule
        Overrides:
        init in class DiagramValidator
        Parameters:
        project - a project of the constraint
        constraint - a constraint object
      • diagramsChanged

        public void diagramsChanged​(java.util.Collection<AbstractDiagramPresentationElement> opened,
                                    java.util.Collection<AbstractDiagramPresentationElement> closed)
        Called when opened diagrams changes. Should not be called manually.
        Specified by:
        diagramsChanged in interface com.nomagic.magicdraw.core.diagram.DiagramsChangeListener
        Parameters:
        opened - newly opened diagrams including inner diagrams displayed within them.
        closed - newly closed diagrams including inner diagrams, if the diagrams are no longer open in any other tab.