EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.pcm.gmf.seff.edit.parts]

COVERAGE SUMMARY FOR SOURCE FILE [VariableUsage5LabelEditPart.java]

nameclass, %method, %block, %line, %
VariableUsage5LabelEditPart.java0%   (0/6)0%   (0/52)0%   (0/812)0%   (0/242)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class VariableUsage5LabelEditPart0%   (0/1)0%   (0/40)0%   (0/634)0%   (0/202)
VariableUsage5LabelEditPart (View): void 0%   (0/1)0%   (0/4)0%   (0/2)
access$0 (VariableUsage5LabelEditPart, char): void 0%   (0/1)0%   (0/4)0%   (0/1)
addNotationalListeners (): void 0%   (0/1)0%   (0/9)0%   (0/3)
addSemanticListeners (): void 0%   (0/1)0%   (0/42)0%   (0/9)
createDefaultEditPolicies (): void 0%   (0/1)0%   (0/22)0%   (0/8)
createFigure (): IFigure 0%   (0/1)0%   (0/2)0%   (0/1)
getAccessibleEditPart (): AccessibleEditPart 0%   (0/1)0%   (0/13)0%   (0/3)
getChildBySemanticHint (String): IGraphicalEditPart 0%   (0/1)0%   (0/2)0%   (0/1)
getCompletionProcessor (): IContentAssistProcessor 0%   (0/1)0%   (0/17)0%   (0/4)
getEditText (): String 0%   (0/1)0%   (0/20)0%   (0/5)
getEditTextValidator (): ICellEditorValidator 0%   (0/1)0%   (0/5)0%   (0/1)
getFontStyleOwnerView (): View 0%   (0/1)0%   (0/3)0%   (0/1)
getLabelIcon (): Image 0%   (0/1)0%   (0/11)0%   (0/5)
getLabelIconHelper (IFigure): Image 0%   (0/1)0%   (0/11)0%   (0/3)
getLabelText (): String 0%   (0/1)0%   (0/51)0%   (0/16)
getLabelTextHelper (IFigure): String 0%   (0/1)0%   (0/11)0%   (0/3)
getManager (): DirectEditManager 0%   (0/1)0%   (0/16)0%   (0/5)
getModelChildren (): List 0%   (0/1)0%   (0/2)0%   (0/1)
getParser (): IParser 0%   (0/1)0%   (0/14)0%   (0/7)
getParserElement (): EObject 0%   (0/1)0%   (0/3)0%   (0/1)
getParserOptions (): ParserOptions 0%   (0/1)0%   (0/2)0%   (0/1)
handleNotificationEvent (Notification): void 0%   (0/1)0%   (0/96)0%   (0/32)
isEditable (): boolean 0%   (0/1)0%   (0/2)0%   (0/1)
performDirectEdit (): void 0%   (0/1)0%   (0/4)0%   (0/2)
performDirectEdit (Point): void 0%   (0/1)0%   (0/12)0%   (0/4)
performDirectEdit (char): void 0%   (0/1)0%   (0/13)0%   (0/4)
performDirectEditRequest (Request): void 0%   (0/1)0%   (0/16)0%   (0/5)
refreshFont (): void 0%   (0/1)0%   (0/34)0%   (0/8)
refreshLabel (): void 0%   (0/1)0%   (0/33)0%   (0/11)
refreshStrikeThrough (): void 0%   (0/1)0%   (0/20)0%   (0/6)
refreshUnderline (): void 0%   (0/1)0%   (0/20)0%   (0/5)
refreshVisuals (): void 0%   (0/1)0%   (0/13)0%   (0/7)
removeNotationalListeners (): void 0%   (0/1)0%   (0/6)0%   (0/3)
removeSemanticListeners (): void 0%   (0/1)0%   (0/25)0%   (0/5)
setFontColor (Color): void 0%   (0/1)0%   (0/5)0%   (0/2)
setLabel (WrappingLabel): void 0%   (0/1)0%   (0/15)0%   (0/6)
setLabelIconHelper (IFigure, Image): void 0%   (0/1)0%   (0/13)0%   (0/4)
setLabelText (String): void 0%   (0/1)0%   (0/26)0%   (0/10)
setLabelTextHelper (IFigure, String): void 0%   (0/1)0%   (0/13)0%   (0/4)
setManager (DirectEditManager): void 0%   (0/1)0%   (0/4)0%   (0/2)
     
class VariableUsage5LabelEditPart$10%   (0/1)0%   (0/4)0%   (0/27)0%   (0/9)
VariableUsage5LabelEditPart$1 (VariableUsage5LabelEditPart): void 0%   (0/1)0%   (0/6)0%   (0/2)
createSelectionHandles (): List 0%   (0/1)0%   (0/17)0%   (0/5)
getCommand (Request): Command 0%   (0/1)0%   (0/2)0%   (0/1)
understandsRequest (Request): boolean 0%   (0/1)0%   (0/2)0%   (0/1)
     
class VariableUsage5LabelEditPart$20%   (0/1)0%   (0/2)0%   (0/43)0%   (0/12)
VariableUsage5LabelEditPart$2 (VariableUsage5LabelEditPart): void 0%   (0/1)0%   (0/6)0%   (0/2)
isValid (Object): String 0%   (0/1)0%   (0/37)0%   (0/10)
     
class VariableUsage5LabelEditPart$2$10%   (0/1)0%   (0/2)0%   (0/29)0%   (0/6)
VariableUsage5LabelEditPart$2$1 (VariableUsage5LabelEditPart$2, IParser, EObj... 0%   (0/1)0%   (0/15)0%   (0/2)
run (): void 0%   (0/1)0%   (0/14)0%   (0/4)
     
class VariableUsage5LabelEditPart$30%   (0/1)0%   (0/2)0%   (0/63)0%   (0/18)
VariableUsage5LabelEditPart$3 (VariableUsage5LabelEditPart, Request): void 0%   (0/1)0%   (0/9)0%   (0/2)
run (): void 0%   (0/1)0%   (0/54)0%   (0/16)
     
class VariableUsage5LabelEditPart$40%   (0/1)0%   (0/2)0%   (0/16)0%   (0/4)
VariableUsage5LabelEditPart$4 (VariableUsage5LabelEditPart, AbstractGraphical... 0%   (0/1)0%   (0/7)0%   (0/2)
getName (AccessibleEvent): void 0%   (0/1)0%   (0/9)0%   (0/2)

1/*
2 * Copyright 2006 SDQ Research Group, University of Karlsruhe (TH)
3 */
4package de.uka.ipd.sdq.pcm.gmf.seff.edit.parts;
5 
6import java.util.ArrayList;
7import java.util.Collections;
8import java.util.List;
9 
10import org.eclipse.draw2d.IFigure;
11import org.eclipse.draw2d.Label;
12import org.eclipse.draw2d.geometry.Point;
13import org.eclipse.emf.common.notify.Notification;
14import org.eclipse.emf.ecore.EObject;
15import org.eclipse.emf.transaction.RunnableWithResult;
16import org.eclipse.gef.AccessibleEditPart;
17import org.eclipse.gef.EditPolicy;
18import org.eclipse.gef.GraphicalEditPart;
19import org.eclipse.gef.Request;
20import org.eclipse.gef.commands.Command;
21import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
22import org.eclipse.gef.handles.MoveHandle;
23import org.eclipse.gef.handles.NonResizableHandleKit;
24import org.eclipse.gef.requests.DirectEditRequest;
25import org.eclipse.gef.tools.DirectEditManager;
26import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
27import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
28import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
29import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
30import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
31import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
32import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
33import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
34import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
35import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
36import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
37import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
38import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
39import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
40import org.eclipse.gmf.runtime.notation.FontStyle;
41import org.eclipse.gmf.runtime.notation.NotationPackage;
42import org.eclipse.gmf.runtime.notation.View;
43import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
44import org.eclipse.jface.viewers.ICellEditorValidator;
45import org.eclipse.swt.SWT;
46import org.eclipse.swt.accessibility.AccessibleEvent;
47import org.eclipse.swt.graphics.Color;
48import org.eclipse.swt.graphics.FontData;
49import org.eclipse.swt.graphics.Image;
50 
51import de.uka.ipd.sdq.pcm.gmf.seff.edit.policies.PalladioComponentModelTextSelectionEditPolicy;
52import de.uka.ipd.sdq.pcm.gmf.seff.part.PalladioComponentModelVisualIDRegistry;
53import de.uka.ipd.sdq.pcm.gmf.seff.providers.PalladioComponentModelElementTypes;
54import de.uka.ipd.sdq.pcm.gmf.seff.providers.PalladioComponentModelParserProvider;
55import de.uka.ipd.sdq.pcm.parameter.VariableUsage;
56import de.uka.ipd.sdq.pcm.stochasticexpressions.PCMStoExPrettyPrintVisitor;
57 
58/**
59 * @generated
60 */
61public class VariableUsage5LabelEditPart extends CompartmentEditPart implements
62                ITextAwareEditPart {
63 
64        /**
65         * @generated
66         */
67        public static final int VISUAL_ID = 5050;
68 
69        /**
70         * @generated
71         */
72        private DirectEditManager manager;
73 
74        /**
75         * @generated
76         */
77        private IParser parser;
78 
79        /**
80         * @generated
81         */
82        private List parserElements;
83 
84        /**
85         * @generated
86         */
87        private String defaultText;
88 
89        /**
90         * @generated
91         */
92        public VariableUsage5LabelEditPart(View view) {
93                super(view);
94        }
95 
96        /**
97         * @generated
98         */
99        protected void createDefaultEditPolicies() {
100                super.createDefaultEditPolicies();
101                installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE,
102                                new PalladioComponentModelTextSelectionEditPolicy());
103                installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE,
104                                new LabelDirectEditPolicy());
105                installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE,
106                                new NonResizableEditPolicy() {
107 
108                                        protected List createSelectionHandles() {
109                                                List handles = new ArrayList();
110                                                NonResizableHandleKit.addMoveHandle(
111                                                                (GraphicalEditPart) getHost(), handles);
112                                                ((MoveHandle) handles.get(0)).setBorder(null);
113                                                return handles;
114                                        }
115 
116                                        public Command getCommand(Request request) {
117                                                return null;
118                                        }
119 
120                                        public boolean understandsRequest(Request request) {
121                                                return false;
122                                        }
123                                });
124        }
125 
126        /**
127         * @generated
128         */
129        protected String getLabelTextHelper(IFigure figure) {
130                if (figure instanceof WrappingLabel) {
131                        return ((WrappingLabel) figure).getText();
132                } else {
133                        return ((Label) figure).getText();
134                }
135        }
136 
137        /**
138         * @generated
139         */
140        protected void setLabelTextHelper(IFigure figure, String text) {
141                if (figure instanceof WrappingLabel) {
142                        ((WrappingLabel) figure).setText(text);
143                } else {
144                        ((Label) figure).setText(text);
145                }
146        }
147 
148        /**
149         * @generated
150         */
151        protected Image getLabelIconHelper(IFigure figure) {
152                if (figure instanceof WrappingLabel) {
153                        return ((WrappingLabel) figure).getIcon();
154                } else {
155                        return ((Label) figure).getIcon();
156                }
157        }
158 
159        /**
160         * @generated
161         */
162        protected void setLabelIconHelper(IFigure figure, Image icon) {
163                if (figure instanceof WrappingLabel) {
164                        ((WrappingLabel) figure).setIcon(icon);
165                } else {
166                        ((Label) figure).setIcon(icon);
167                }
168        }
169 
170        /**
171         * @generated
172         */
173        public void setLabel(WrappingLabel figure) {
174                unregisterVisuals();
175                setFigure(figure);
176                defaultText = getLabelTextHelper(figure);
177                registerVisuals();
178                refreshVisuals();
179        }
180 
181        /**
182         * @generated
183         */
184        protected List getModelChildren() {
185                return Collections.EMPTY_LIST;
186        }
187 
188        /**
189         * @generated
190         */
191        public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
192                return null;
193        }
194 
195        /**
196         * @generated
197         */
198        protected EObject getParserElement() {
199                return resolveSemanticElement();
200        }
201 
202        /**
203         * @generated
204         */
205        protected Image getLabelIcon() {
206                EObject parserElement = getParserElement();
207                if (parserElement == null) {
208                        return null;
209                }
210                return PalladioComponentModelElementTypes.getImage(parserElement
211                                .eClass());
212        }
213 
214        /**Displays the name of the referenced variable.
215         *
216         * @generated not
217         */
218        protected String getLabelText() {
219                String text = null;
220                EObject parserElement = getParserElement();
221                if (parserElement != null) {
222                        if (parserElement instanceof VariableUsage) {
223                                // customized
224                                VariableUsage usage = (VariableUsage) this
225                                                .resolveSemanticElement();
226                                if (usage.getNamedReference__VariableUsage() != null) {
227                                        text = new PCMStoExPrettyPrintVisitor().prettyPrint(usage
228                                                        .getNamedReference__VariableUsage());
229                                }
230                        } else {
231                                if (parserElement != null && getParser() != null) {
232                                        text = getParser().getPrintString(
233                                                        new EObjectAdapter(parserElement),
234                                                        getParserOptions().intValue());
235                                }
236                        }
237                }
238                if (text == null || text.length() == 0) {
239                        text = defaultText;
240                }
241                return text;
242        }
243 
244        /**
245         * @generated
246         */
247        public void setLabelText(String text) {
248                setLabelTextHelper(getFigure(), text);
249                Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
250                if (pdEditPolicy instanceof PalladioComponentModelTextSelectionEditPolicy) {
251                        ((PalladioComponentModelTextSelectionEditPolicy) pdEditPolicy)
252                                        .refreshFeedback();
253                }
254                Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
255                if (sfEditPolicy instanceof PalladioComponentModelTextSelectionEditPolicy) {
256                        ((PalladioComponentModelTextSelectionEditPolicy) sfEditPolicy)
257                                        .refreshFeedback();
258                }
259        }
260 
261        /**
262         * @generated
263         */
264        public String getEditText() {
265                if (getParserElement() == null || getParser() == null) {
266                        return ""; //$NON-NLS-1$
267                }
268                return getParser().getEditString(
269                                new EObjectAdapter(getParserElement()),
270                                getParserOptions().intValue());
271        }
272 
273        /**
274         * @generated
275         */
276        protected boolean isEditable() {
277                return false;
278        }
279 
280        /**
281         * @generated
282         */
283        public ICellEditorValidator getEditTextValidator() {
284                return new ICellEditorValidator() {
285 
286                        public String isValid(final Object value) {
287                                if (value instanceof String) {
288                                        final EObject element = getParserElement();
289                                        final IParser parser = getParser();
290                                        try {
291                                                IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
292                                                                .runExclusive(new RunnableWithResult.Impl() {
293 
294                                                                        public void run() {
295                                                                                setResult(parser.isValidEditString(
296                                                                                                new EObjectAdapter(element),
297                                                                                                (String) value));
298                                                                        }
299                                                                });
300                                                return valid.getCode() == ParserEditStatus.EDITABLE ? null
301                                                                : valid.getMessage();
302                                        } catch (InterruptedException ie) {
303                                                ie.printStackTrace();
304                                        }
305                                }
306 
307                                // shouldn't get here
308                                return null;
309                        }
310                };
311        }
312 
313        /**
314         * @generated
315         */
316        public IContentAssistProcessor getCompletionProcessor() {
317                if (getParserElement() == null || getParser() == null) {
318                        return null;
319                }
320                return getParser().getCompletionProcessor(
321                                new EObjectAdapter(getParserElement()));
322        }
323 
324        /**
325         * @generated
326         */
327        public ParserOptions getParserOptions() {
328                return ParserOptions.NONE;
329        }
330 
331        /**
332         * @generated
333         */
334        public IParser getParser() {
335                if (parser == null) {
336                        parser = PalladioComponentModelParserProvider
337                                        .getParser(
338                                                        PalladioComponentModelElementTypes.VariableUsage_3054,
339                                                        getParserElement(),
340                                                        PalladioComponentModelVisualIDRegistry
341                                                                        .getType(de.uka.ipd.sdq.pcm.gmf.seff.edit.parts.VariableUsage5LabelEditPart.VISUAL_ID));
342                }
343                return parser;
344        }
345 
346        /**
347         * @generated
348         */
349        protected DirectEditManager getManager() {
350                if (manager == null) {
351                        setManager(new TextDirectEditManager(this, TextDirectEditManager
352                                        .getTextCellEditorClass(this),
353                                        PalladioComponentModelEditPartFactory
354                                                        .getTextCellEditorLocator(this)));
355                }
356                return manager;
357        }
358 
359        /**
360         * @generated
361         */
362        protected void setManager(DirectEditManager manager) {
363                this.manager = manager;
364        }
365 
366        /**
367         * @generated
368         */
369        protected void performDirectEdit() {
370                getManager().show();
371        }
372 
373        /**
374         * @generated
375         */
376        protected void performDirectEdit(Point eventLocation) {
377                if (getManager().getClass() == TextDirectEditManager.class) {
378                        ((TextDirectEditManager) getManager()).show(eventLocation
379                                        .getSWTPoint());
380                }
381        }
382 
383        /**
384         * @generated
385         */
386        private void performDirectEdit(char initialCharacter) {
387                if (getManager() instanceof TextDirectEditManager) {
388                        ((TextDirectEditManager) getManager()).show(initialCharacter);
389                } else {
390                        performDirectEdit();
391                }
392        }
393 
394        /**
395         * @generated
396         */
397        protected void performDirectEditRequest(Request request) {
398                final Request theRequest = request;
399                try {
400                        getEditingDomain().runExclusive(new Runnable() {
401 
402                                public void run() {
403                                        if (isActive() && isEditable()) {
404                                                if (theRequest
405                                                                .getExtendedData()
406                                                                .get(
407                                                                                RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
408                                                        Character initialChar = (Character) theRequest
409                                                                        .getExtendedData()
410                                                                        .get(
411                                                                                        RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
412                                                        performDirectEdit(initialChar.charValue());
413                                                } else if ((theRequest instanceof DirectEditRequest)
414                                                                && (getEditText().equals(getLabelText()))) {
415                                                        DirectEditRequest editRequest = (DirectEditRequest) theRequest;
416                                                        performDirectEdit(editRequest.getLocation());
417                                                } else {
418                                                        performDirectEdit();
419                                                }
420                                        }
421                                }
422                        });
423                } catch (InterruptedException e) {
424                        e.printStackTrace();
425                }
426        }
427 
428        /**
429         * @generated
430         */
431        protected void refreshVisuals() {
432                super.refreshVisuals();
433                refreshLabel();
434                refreshFont();
435                refreshFontColor();
436                refreshUnderline();
437                refreshStrikeThrough();
438        }
439 
440        /**
441         * @generated
442         */
443        protected void refreshLabel() {
444                setLabelTextHelper(getFigure(), getLabelText());
445                setLabelIconHelper(getFigure(), getLabelIcon());
446                Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
447                if (pdEditPolicy instanceof PalladioComponentModelTextSelectionEditPolicy) {
448                        ((PalladioComponentModelTextSelectionEditPolicy) pdEditPolicy)
449                                        .refreshFeedback();
450                }
451                Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
452                if (sfEditPolicy instanceof PalladioComponentModelTextSelectionEditPolicy) {
453                        ((PalladioComponentModelTextSelectionEditPolicy) sfEditPolicy)
454                                        .refreshFeedback();
455                }
456        }
457 
458        /**
459         * @generated
460         */
461        protected void refreshUnderline() {
462                FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
463                                NotationPackage.eINSTANCE.getFontStyle());
464                if (style != null && getFigure() instanceof WrappingLabel) {
465                        ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
466                }
467        }
468 
469        /**
470         * @generated
471         */
472        protected void refreshStrikeThrough() {
473                FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
474                                NotationPackage.eINSTANCE.getFontStyle());
475                if (style != null && getFigure() instanceof WrappingLabel) {
476                        ((WrappingLabel) getFigure()).setTextStrikeThrough(style
477                                        .isStrikeThrough());
478                }
479        }
480 
481        /**
482         * @generated
483         */
484        protected void refreshFont() {
485                FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
486                                NotationPackage.eINSTANCE.getFontStyle());
487                if (style != null) {
488                        FontData fontData = new FontData(style.getFontName(), style
489                                        .getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL)
490                                        | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
491                        setFont(fontData);
492                }
493        }
494 
495        /**
496         * @generated
497         */
498        protected void setFontColor(Color color) {
499                getFigure().setForegroundColor(color);
500        }
501 
502        /**
503         * @generated
504         */
505        protected void addSemanticListeners() {
506                if (getParser() instanceof ISemanticParser) {
507                        EObject element = resolveSemanticElement();
508                        parserElements = ((ISemanticParser) getParser())
509                                        .getSemanticElementsBeingParsed(element);
510                        for (int i = 0; i < parserElements.size(); i++) {
511                                addListenerFilter(
512                                                "SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
513                        }
514                } else {
515                        super.addSemanticListeners();
516                }
517        }
518 
519        /**
520         * @generated
521         */
522        protected void removeSemanticListeners() {
523                if (parserElements != null) {
524                        for (int i = 0; i < parserElements.size(); i++) {
525                                removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
526                        }
527                } else {
528                        super.removeSemanticListeners();
529                }
530        }
531 
532        /**
533         * @generated
534         */
535        protected AccessibleEditPart getAccessibleEditPart() {
536                if (accessibleEP == null) {
537                        accessibleEP = new AccessibleGraphicalEditPart() {
538 
539                                public void getName(AccessibleEvent e) {
540                                        e.result = getLabelTextHelper(getFigure());
541                                }
542                        };
543                }
544                return accessibleEP;
545        }
546 
547        /**
548         * @generated
549         */
550        private View getFontStyleOwnerView() {
551                return getPrimaryView();
552        }
553 
554        /**
555         * @generated
556         */
557        protected void addNotationalListeners() {
558                super.addNotationalListeners();
559                addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
560        }
561 
562        /**
563         * @generated
564         */
565        protected void removeNotationalListeners() {
566                super.removeNotationalListeners();
567                removeListenerFilter("PrimaryView"); //$NON-NLS-1$
568        }
569 
570        /**
571         * @generated
572         */
573        protected void handleNotificationEvent(Notification event) {
574                Object feature = event.getFeature();
575                if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
576                        Integer c = (Integer) event.getNewValue();
577                        setFontColor(DiagramColorRegistry.getInstance().getColor(c));
578                } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(
579                                feature)) {
580                        refreshUnderline();
581                } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough()
582                                .equals(feature)) {
583                        refreshStrikeThrough();
584                } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(
585                                feature)
586                                || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(
587                                                feature)
588                                || NotationPackage.eINSTANCE.getFontStyle_Bold()
589                                                .equals(feature)
590                                || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(
591                                                feature)) {
592                        refreshFont();
593                } else {
594                        if (getParser() != null
595                                        && getParser().isAffectingEvent(event,
596                                                        getParserOptions().intValue())) {
597                                refreshLabel();
598                        }
599                        if (getParser() instanceof ISemanticParser) {
600                                ISemanticParser modelParser = (ISemanticParser) getParser();
601                                if (modelParser.areSemanticElementsAffected(null, event)) {
602                                        removeSemanticListeners();
603                                        if (resolveSemanticElement() != null) {
604                                                addSemanticListeners();
605                                        }
606                                        refreshLabel();
607                                }
608                        }
609                }
610                super.handleNotificationEvent(event);
611        }
612 
613        /**
614         * @generated
615         */
616        protected IFigure createFigure() {
617                // Parent should assign one using setLabel() method
618                return null;
619        }
620 
621}

[all classes][de.uka.ipd.sdq.pcm.gmf.seff.edit.parts]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov