예제 #1
0
 /** @generated */
 protected void handleNotificationEvent(Notification event) {
   refreshLabel();
   Object feature = event.getFeature();
   if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
     Integer c = (Integer) event.getNewValue();
     setFontColor(DiagramColorRegistry.getInstance().getColor(c));
   } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
     refreshUnderline();
   } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
     refreshStrikeThrough();
   } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature)
       || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature)
       || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
       || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
     refreshFont();
   } else {
     if (getParser() != null
         && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
       refreshLabel();
     }
     if (getParser() instanceof ISemanticParser) {
       ISemanticParser modelParser = (ISemanticParser) getParser();
       if (modelParser.areSemanticElementsAffected(null, event)) {
         removeSemanticListeners();
         if (resolveSemanticElement() != null) {
           addSemanticListeners();
         }
         refreshLabel();
       }
     }
   }
   super.handleNotificationEvent(event);
 }
 /** @generated */
 @Override
 protected void createDefaultEditPolicies() {
   super.createDefaultEditPolicies();
   installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
   installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
   installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultNodeLabelDragPolicy());
 }
 /** @generated */
 protected void refreshVisuals() {
   super.refreshVisuals();
   refreshLabel();
   refreshFont();
   refreshFontColor();
   refreshUnderline();
   refreshStrikeThrough();
 }
 /** @generated */
 protected void removeSemanticListeners() {
   if (parserElements != null) {
     for (int i = 0; i < parserElements.size(); i++) {
       removeListenerFilter("SemanticModel" + i); // $NON-NLS-1$
     }
   } else {
     super.removeSemanticListeners();
   }
 }
 /** @generated */
 protected void addSemanticListeners() {
   if (getParser() instanceof ISemanticParser) {
     EObject element = resolveSemanticElement();
     parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
     for (int i = 0; i < parserElements.size(); i++) {
       addListenerFilter(
           "SemanticModel" + i, this, (EObject) parserElements.get(i)); // $NON-NLS-1$
     }
   } else {
     super.addSemanticListeners();
   }
 }
 /** @generated */
 public void deactivate() {
   removeOwnerElementListeners();
   super.deactivate();
 }
 /** @generated */
 public void activate() {
   super.activate();
   addOwnerElementListeners();
 }
 /** @generated */
 protected void removeNotationalListeners() {
   super.removeNotationalListeners();
   removeListenerFilter("PrimaryView"); // $NON-NLS-1$
 }
 /** @generated */
 protected void addNotationalListeners() {
   super.addNotationalListeners();
   addListenerFilter("PrimaryView", this, getPrimaryView()); // $NON-NLS-1$
 }