Exemplo n.º 1
0
 protected void updateTablesToAddFunctionalUseCaseMap(UseCaseMap map) {
   for (int i = mappedTable.getItems().length - 1; i >= 0; i--) {
     TableEditor editor = (TableEditor) editorsTable.get(mappedTable.getItems()[i]);
     for (int j = 0; j < map.getComponentRoles().size(); j++) {
       ComponentRole c = (ComponentRole) map.getComponentRoles().get(j);
       int index = ((CCombo) editor.getEditor()).getItemCount();
       ((CCombo) editor.getEditor()).add(c.getFullName());
       ((CCombo) editor.getEditor()).setData(String.valueOf(index), c);
       auxiliarTable.put((CCombo) editor.getEditor(), c, new Integer(index));
     }
   }
 }
Exemplo n.º 2
0
 private void updateEventTableToAdd() {
   Vector architecturalMaps = new Vector();
   for (int i = 0; i < architecturalUseCaseMapTable.getItemCount(); i++) {
     architecturalMaps.add(architecturalUseCaseMapTable.getItem(i).getData());
   }
   List events = getEvents(architecturalMaps);
   Vector allEvents = new Vector();
   for (int i = 0; i < architecturalMaps.size(); i++) {
     UseCaseMap useCaseMap = (UseCaseMap) architecturalMaps.get(i);
     if (useCaseMap.getComponentRoles().size() > 0) {
       ComponentRole role = (ComponentRole) useCaseMap.getComponentRoles().get(0);
       allEvents.addAll(role.getMap().getCoreModel().getEvents());
       break;
     }
   }
   for (int i = 0; i < events.size(); i++) {
     setComboBoxToEvents(eventTable, (ConditionEvent) events.get(i), allEvents);
   }
 }
Exemplo n.º 3
0
 private void setComboBox(Table table, ComponentRole value, List componentsToMap) {
   final TableItem item = new TableItem(table, SWT.NONE);
   item.setText(new String[] {value.getFullName(), value.getAbstractInfo()});
   item.setData(value);
   TableEditor editor = new TableEditor(table);
   final CCombo comboRole = new CCombo(table, SWT.READ_ONLY);
   GridData gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
   gd.widthHint = 200;
   comboRole.setLayoutData(gd);
   int j = 0;
   for (j = 0; j < componentsToMap.size(); j++) {
     ComponentRole c = (ComponentRole) componentsToMap.get(j);
     comboRole.add(c.getFullName());
     comboRole.setData(String.valueOf(j), c);
     auxiliarTable.put(comboRole, c, new Integer(j));
   }
   if (value.getAbstractInfo().equals(ComponentRole.standardComponent)) {
     comboRole.add(value.getFullName());
     comboRole.setData(String.valueOf(j), value);
     comboRole.select(j);
     auxiliarTable.put(comboRole, value, new Integer(j));
   } else {
     comboRole.add(
         Messages.getString(
             "org.isistan.flabot.edit.ucmeditor.dialogs.FamilyManagerDialog.noneRole")); //$NON-NLS-1$
     comboRole.setData("None", "None"); // $NON-NLS-1$ //$NON-NLS-2$
     comboRole.select(j);
   }
   editor.grabHorizontal = true;
   editor.setEditor(comboRole, item, 2);
   editorsTable.put(item, editor);
   combosTable.put(item, comboRole);
 }
Exemplo n.º 4
0
 private List getEvents(Vector architecturalMaps) {
   Vector currentEvents = new Vector();
   for (int i = 0; i < eventTable.getItemCount(); i++) {
     currentEvents.add((ConditionEvent) eventTable.getItem(i).getData());
   }
   Vector result = new Vector();
   EList events;
   for (int i = 0; i < architecturalMaps.size(); i++) {
     UseCaseMap useCaseMap = (UseCaseMap) architecturalMaps.get(i);
     if (useCaseMap.getComponentRoles().size() > 0) {
       ComponentRole role = (ComponentRole) useCaseMap.getComponentRoles().get(0);
       events = role.getMap().getCoreModel().getEvents();
       for (int j = 0; j < events.size(); j++) {
         if (!currentEvents.contains(events.get(j))) {
           result.add(events.get(j));
         }
       }
       break;
     }
   }
   for (int j = result.size() - 1; j >= 0; j--) {
     ConditionEvent event = (ConditionEvent) result.get(j);
     EList conditions = event.getAssociatedConditions();
     boolean contains = false;
     for (int i = conditions.size() - 1; i >= 0; i--) {
       if (architecturalMaps.contains(
           ((Condition) conditions.get(i)).getSourceResponsibility().getMap())) {
         contains = true;
         break;
       }
     }
     if (!contains) {
       result.remove(j);
     }
   }
   return result;
 }