Пример #1
0
 private void addCorrespondencesToCandidate(MappingTask mappingTask) {
   List<ValueCorrespondence> candidateCorrespondences = new ArrayList<ValueCorrespondence>();
   for (ValueCorrespondence valueCorrespondence : mappingTask.getValueCorrespondences()) {
     if (checkValueCorrespondences(valueCorrespondence)) {
       for (ValueCorrespondence candidateCorrespondence :
           mappingTask.getCandidateCorrespondences()) {
         if (valueCorrespondence.hasEqualPaths(candidateCorrespondence)) {
           candidateCorrespondences.add(candidateCorrespondence);
           break;
         }
       }
       mappingTask.addCandidateCorrespondence(valueCorrespondence);
     }
   }
   mappingTask.getValueCorrespondences().clear();
   mappingTask.getCandidateCorrespondences().removeAll(candidateCorrespondences);
   Scenario scenario = (Scenario) modello.getBean(Costanti.CURRENT_SCENARIO);
   MappingTaskTopComponent mappingTaskTopComponent = scenario.getMappingTaskTopComponent();
   mappingTaskTopComponent.getJLayeredPane().getGlassPane().clearConnectionLayer();
 }
Пример #2
0
  private void checkValueCorrespondenceInMappingTask(MappingTask mappingTask) {

    if (!mappingTask.getValueCorrespondences().isEmpty()) {
      if (firstCheck == null) {
        NotifyDescriptor nd =
            new NotifyDescriptor.Confirmation(
                NbBundle.getMessage(Costanti.class, Costanti.FIND_VALUE_CORRESPONDENCES),
                DialogDescriptor.YES_NO_OPTION);
        DialogDisplayer.getDefault().notify(nd);
        if (nd.getValue().equals(NotifyDescriptor.YES_OPTION)) {
          this.firstCheck = true;
          addCorrespondencesToCandidate(mappingTask);
        } else {
          this.firstCheck = false;
        }
      }
    }
  }
 @Override
 public void performAction() {
   Scenario scenario = (Scenario) modello.getBean(Costanti.CURRENT_SCENARIO);
   MappingTask mappingTask = scenario.getMappingTask();
   if (mappingTask.getValueCorrespondences().size() == 0
       && mappingTask.getMappingData().getSTTgds().isEmpty()) {
     NotifyDescriptor nd =
         new NotifyDescriptor.Message(
             NbBundle.getMessage(Costanti.class, Costanti.EMPTY_CORRESPONDENCES),
             DialogDescriptor.WARNING_MESSAGE);
     DialogDisplayer.getDefault().notify(nd);
     return;
   }
   try {
     openTransformationWindows();
     openInstanceWindows();
     enableActions();
   } catch (Exception ex) {
     DialogDisplayer.getDefault()
         .notify(new NotifyDescriptor.Message(ex.getMessage(), DialogDescriptor.ERROR_MESSAGE));
   }
 }