コード例 #1
0
  public ValidateDiagramCommand() {
    validationList = MainWindow.getInstance().getValidationList();
    validationList.reset();

    validators.add(new TerminatorValidator());
    validators.add(new ElementsConnectionValidator());
    validators.add(new JudgmentValidator());
    validators.add(new FlowValidator());
    validators.add(new SyntaxValidator());
  }
コード例 #2
0
 @Override
 public void execute() {
   MainWindow.getInstance().setStatus("Begin validation");
   Main.log("Begin validation");
   for (IDiagramValidator validator : validators) {
     validator.execute();
   }
   if (validationList.getValidationItems().isEmpty()) {
     MainWindow.getInstance().setStatus("Validation success");
     Main.log("Validation success");
   } else {
     MainWindow.getInstance().setStatus("Validation fail");
     Main.log("Validation fail");
   }
 }