コード例 #1
0
 protected void updateStereotypeText() {
   MModelElement me = (MModelElement) getOwner();
   if (me == null) return;
   MStereotype stereo = me.getStereotype();
   if (stereo == null || stereo.getName() == null || stereo.getName().length() == 0)
     _stereo.setText("");
   else {
     _stereo.setText(Notation.generateStereotype(this, stereo));
   }
 }
コード例 #2
0
 public Object makeNode() {
   Object newNode = super.makeNode();
   MComponentInstance compspecType = (MComponentInstance) newNode; // neue ComponentInstance.
   System.err.println("makeNode() called");
   compspecType.setName(orig.getName()); // Name ist gesetzt.
   MStereotype stereotype = new MStereotypeImpl(); // new Stereotype.
   stereotype.setName("comp spec"); // Sterotype Name auf "comp spec" gesetzt.
   compspecType.setStereotype(stereotype); // Stereotyp setzen.
   /*for (Iterator it = orig.getFeatures().iterator(); it.hasNext(); ) {
   		Object f = it.next();
   		if (f instanceof MAttribute) {
   		    MAttribute origAttr = (MAttribute)f;
   		    MAttribute attr = compspecType.getFactory().createAttribute();
   		    attr.setName(origAttr.getName());
   		    attr.setType(origAttr.getType());
   		    attr.setVisibility(origAttr.getVisibility());
   		    compspecType.addFeature(attr);
   		}
   	    }
   */
   return newNode;
 }