/*
  * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
  */
 public void actionPerformed(ActionEvent e) {
   super.actionPerformed(e);
   if (e.getSource() instanceof UMLComboBox2) {
     UMLComboBox2 source = (UMLComboBox2) e.getSource();
     Object target = source.getTarget();
     if (Model.getFacade().getContext(target) != source.getSelectedItem()) {
       Model.getStateMachinesHelper().setContext(target, source.getSelectedItem());
     }
   }
 }
Exemple #2
0
 public void actionPerformed(ActionEvent e) {
   Object source = e.getSource();
   if (source instanceof UMLComboBox2) {
     UMLComboBox2 box = (UMLComboBox2) source;
     Object diagram = box.getTarget();
     Object homeModel = box.getSelectedItem();
     if (diagram instanceof Relocatable) {
       Relocatable d = (Relocatable) diagram;
       if (d.isRelocationAllowed(homeModel)) {
         d.relocate(homeModel);
       }
     }
   }
 }
 /*
  * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
  */
 public void actionPerformed(ActionEvent e) {
   Object source = e.getSource(); // the source UI element of the event
   Object oldClassifier = null;
   Object newClassifier = null;
   Object m = null;
   if (source instanceof UMLComboBox2) {
     UMLComboBox2 box = (UMLComboBox2) source;
     Object ofs = box.getTarget();
     if (Model.getFacade().isAObjectFlowState(ofs)) {
       oldClassifier = Model.getFacade().getType(ofs);
       m = ofs;
     }
     Object cl = box.getSelectedItem();
     if (Model.getFacade().isAClassifier(cl)) {
       newClassifier = cl;
     }
   }
   if (newClassifier != oldClassifier && m != null && newClassifier != null) {
     super.actionPerformed(e);
     Model.getCoreHelper().setType(m, newClassifier);
   }
 }
 /** @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */
 public void actionPerformed(ActionEvent e) {
   super.actionPerformed(e);
   Object source = e.getSource();
   MClassifier oldClassifier = null;
   MClassifier newClassifier = null;
   MAttribute attr = null;
   if (source instanceof UMLComboBox2) {
     UMLComboBox2 box = (UMLComboBox2) source;
     Object o = box.getTarget();
     if (o instanceof MAttribute) {
       attr = (MAttribute) o;
       oldClassifier = attr.getType();
     }
     o = box.getSelectedItem();
     if (o instanceof MClassifier) {
       newClassifier = (MClassifier) o;
     }
   }
   if (newClassifier != oldClassifier && attr != null) {
     attr.setType(newClassifier);
   }
 }
 /*
  * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
  */
 @Override
 public void actionPerformed(ActionEvent e) {
   super.actionPerformed(e);
   Object source = e.getSource();
   Object oldClassifier = null;
   Object newClassifier = null;
   Object para = null;
   if (source instanceof UMLComboBox2) {
     UMLComboBox2 box = ((UMLComboBox2) source);
     Object o = box.getTarget();
     if (Model.getFacade().isAParameter(o)) {
       para = o;
       oldClassifier = Model.getFacade().getType(para);
     }
     o = box.getSelectedItem();
     if (Model.getFacade().isAClassifier(o)) {
       newClassifier = o;
     }
   }
   if (newClassifier != null && newClassifier != oldClassifier && para != null) {
     Model.getCoreHelper().setType(para, newClassifier);
     super.actionPerformed(e);
   }
 }