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 [VariableUsage3LabelEditPart.java]

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

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class VariableUsage3LabelEditPart0%   (0/1)0%   (0/40)0%   (0/634)0%   (0/202)
VariableUsage3LabelEditPart (View): void 0%   (0/1)0%   (0/4)0%   (0/2)
access$0 (VariableUsage3LabelEditPart, 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 VariableUsage3LabelEditPart$10%   (0/1)0%   (0/4)0%   (0/27)0%   (0/9)
VariableUsage3LabelEditPart$1 (VariableUsage3LabelEditPart): 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 VariableUsage3LabelEditPart$20%   (0/1)0%   (0/2)0%   (0/43)0%   (0/12)
VariableUsage3LabelEditPart$2 (VariableUsage3LabelEditPart): void 0%   (0/1)0%   (0/6)0%   (0/2)
isValid (Object): String 0%   (0/1)0%   (0/37)0%   (0/10)
     
class VariableUsage3LabelEditPart$2$10%   (0/1)0%   (0/2)0%   (0/29)0%   (0/6)
VariableUsage3LabelEditPart$2$1 (VariableUsage3LabelEditPart$2, IParser, EObj... 0%   (0/1)0%   (0/15)0%   (0/2)
run (): void 0%   (0/1)0%   (0/14)0%   (0/4)
     
class VariableUsage3LabelEditPart$30%   (0/1)0%   (0/2)0%   (0/63)0%   (0/18)
VariableUsage3LabelEditPart$3 (VariableUsage3LabelEditPart, Request): void 0%   (0/1)0%   (0/9)0%   (0/2)
run (): void 0%   (0/1)0%   (0/54)0%   (0/16)
     
class VariableUsage3LabelEditPart$40%   (0/1)0%   (0/2)0%   (0/16)0%   (0/4)
VariableUsage3LabelEditPart$4 (VariableUsage3LabelEditPart, 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 VariableUsage3LabelEditPart extends CompartmentEditPart implements
62                ITextAwareEditPart {
63 
64        /**
65         * @generated
66         */
67        public static final int VISUAL_ID = 5035;
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 VariableUsage3LabelEditPart(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        /**
215         * Enhanced method to present the name of the
216         * VariableReference of the VariableUsage this
217         * wrapping label edit part is about
218         *
219         * @generated not
220         */
221        protected String getLabelText() {
222                String text = null;
223                EObject parserElement = getParserElement();
224                if (parserElement != null) {
225                        if (parserElement instanceof VariableUsage) {
226                                // customized
227                                VariableUsage usage = (VariableUsage) this
228                                                .resolveSemanticElement();
229                                if (usage.getNamedReference__VariableUsage() != null) {
230                                        text = new PCMStoExPrettyPrintVisitor().prettyPrint(usage
231                                                        .getNamedReference__VariableUsage());
232                                }
233                        } else {
234                                if (parserElement != null && getParser() != null) {
235                                        text = getParser().getPrintString(
236                                                        new EObjectAdapter(parserElement),
237                                                        getParserOptions().intValue());
238                                }
239                        }
240                }
241                if (text == null || text.length() == 0) {
242                        text = defaultText;
243                }
244                return text;
245        }
246 
247        /**
248         * @generated
249         */
250        public void setLabelText(String text) {
251                setLabelTextHelper(getFigure(), text);
252                Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
253                if (pdEditPolicy instanceof PalladioComponentModelTextSelectionEditPolicy) {
254                        ((PalladioComponentModelTextSelectionEditPolicy) pdEditPolicy)
255                                        .refreshFeedback();
256                }
257                Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
258                if (sfEditPolicy instanceof PalladioComponentModelTextSelectionEditPolicy) {
259                        ((PalladioComponentModelTextSelectionEditPolicy) sfEditPolicy)
260                                        .refreshFeedback();
261                }
262        }
263 
264        /**
265         * @generated
266         */
267        public String getEditText() {
268                if (getParserElement() == null || getParser() == null) {
269                        return ""; //$NON-NLS-1$
270                }
271                return getParser().getEditString(
272                                new EObjectAdapter(getParserElement()),
273                                getParserOptions().intValue());
274        }
275 
276        /**
277         * @generated
278         */
279        protected boolean isEditable() {
280                return false;
281        }
282 
283        /**
284         * @generated
285         */
286        public ICellEditorValidator getEditTextValidator() {
287                return new ICellEditorValidator() {
288 
289                        public String isValid(final Object value) {
290                                if (value instanceof String) {
291                                        final EObject element = getParserElement();
292                                        final IParser parser = getParser();
293                                        try {
294                                                IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
295                                                                .runExclusive(new RunnableWithResult.Impl() {
296 
297                                                                        public void run() {
298                                                                                setResult(parser.isValidEditString(
299                                                                                                new EObjectAdapter(element),
300                                                                                                (String) value));
301                                                                        }
302                                                                });
303                                                return valid.getCode() == ParserEditStatus.EDITABLE ? null
304                                                                : valid.getMessage();
305                                        } catch (InterruptedException ie) {
306                                                ie.printStackTrace();
307                                        }
308                                }
309 
310                                // shouldn't get here
311                                return null;
312                        }
313                };
314        }
315 
316        /**
317         * @generated
318         */
319        public IContentAssistProcessor getCompletionProcessor() {
320                if (getParserElement() == null || getParser() == null) {
321                        return null;
322                }
323                return getParser().getCompletionProcessor(
324                                new EObjectAdapter(getParserElement()));
325        }
326 
327        /**
328         * @generated
329         */
330        public ParserOptions getParserOptions() {
331                return ParserOptions.NONE;
332        }
333 
334        /**
335         * @generated
336         */
337        public IParser getParser() {
338                if (parser == null) {
339                        parser = PalladioComponentModelParserProvider
340                                        .getParser(
341                                                        PalladioComponentModelElementTypes.VariableUsage_3036,
342                                                        getParserElement(),
343                                                        PalladioComponentModelVisualIDRegistry
344                                                                        .getType(de.uka.ipd.sdq.pcm.gmf.seff.edit.parts.VariableUsage3LabelEditPart.VISUAL_ID));
345                }
346                return parser;
347        }
348 
349        /**
350         * @generated
351         */
352        protected DirectEditManager getManager() {
353                if (manager == null) {
354                        setManager(new TextDirectEditManager(this, TextDirectEditManager
355                                        .getTextCellEditorClass(this),
356                                        PalladioComponentModelEditPartFactory
357                                                        .getTextCellEditorLocator(this)));
358                }
359                return manager;
360        }
361 
362        /**
363         * @generated
364         */
365        protected void setManager(DirectEditManager manager) {
366                this.manager = manager;
367        }
368 
369        /**
370         * @generated
371         */
372        protected void performDirectEdit() {
373                getManager().show();
374        }
375 
376        /**
377         * @generated
378         */
379        protected void performDirectEdit(Point eventLocation) {
380                if (getManager().getClass() == TextDirectEditManager.class) {
381                        ((TextDirectEditManager) getManager()).show(eventLocation
382                                        .getSWTPoint());
383                }
384        }
385 
386        /**
387         * @generated
388         */
389        private void performDirectEdit(char initialCharacter) {
390                if (getManager() instanceof TextDirectEditManager) {
391                        ((TextDirectEditManager) getManager()).show(initialCharacter);
392                } else {
393                        performDirectEdit();
394                }
395        }
396 
397        /**
398         * @generated
399         */
400        protected void performDirectEditRequest(Request request) {
401                final Request theRequest = request;
402                try {
403                        getEditingDomain().runExclusive(new Runnable() {
404 
405                                public void run() {
406                                        if (isActive() && isEditable()) {
407                                                if (theRequest
408                                                                .getExtendedData()
409                                                                .get(
410                                                                                RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
411                                                        Character initialChar = (Character) theRequest
412                                                                        .getExtendedData()
413                                                                        .get(
414                                                                                        RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
415                                                        performDirectEdit(initialChar.charValue());
416                                                } else if ((theRequest instanceof DirectEditRequest)
417                                                                && (getEditText().equals(getLabelText()))) {
418                                                        DirectEditRequest editRequest = (DirectEditRequest) theRequest;
419                                                        performDirectEdit(editRequest.getLocation());
420                                                } else {
421                                                        performDirectEdit();
422                                                }
423                                        }
424                                }
425                        });
426                } catch (InterruptedException e) {
427                        e.printStackTrace();
428                }
429        }
430 
431        /**
432         * @generated
433         */
434        protected void refreshVisuals() {
435                super.refreshVisuals();
436                refreshLabel();
437                refreshFont();
438                refreshFontColor();
439                refreshUnderline();
440                refreshStrikeThrough();
441        }
442 
443        /**
444         * @generated
445         */
446        protected void refreshLabel() {
447                setLabelTextHelper(getFigure(), getLabelText());
448                setLabelIconHelper(getFigure(), getLabelIcon());
449                Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
450                if (pdEditPolicy instanceof PalladioComponentModelTextSelectionEditPolicy) {
451                        ((PalladioComponentModelTextSelectionEditPolicy) pdEditPolicy)
452                                        .refreshFeedback();
453                }
454                Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
455                if (sfEditPolicy instanceof PalladioComponentModelTextSelectionEditPolicy) {
456                        ((PalladioComponentModelTextSelectionEditPolicy) sfEditPolicy)
457                                        .refreshFeedback();
458                }
459        }
460 
461        /**
462         * @generated
463         */
464        protected void refreshUnderline() {
465                FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
466                                NotationPackage.eINSTANCE.getFontStyle());
467                if (style != null && getFigure() instanceof WrappingLabel) {
468                        ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
469                }
470        }
471 
472        /**
473         * @generated
474         */
475        protected void refreshStrikeThrough() {
476                FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
477                                NotationPackage.eINSTANCE.getFontStyle());
478                if (style != null && getFigure() instanceof WrappingLabel) {
479                        ((WrappingLabel) getFigure()).setTextStrikeThrough(style
480                                        .isStrikeThrough());
481                }
482        }
483 
484        /**
485         * @generated
486         */
487        protected void refreshFont() {
488                FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
489                                NotationPackage.eINSTANCE.getFontStyle());
490                if (style != null) {
491                        FontData fontData = new FontData(style.getFontName(), style
492                                        .getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL)
493                                        | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
494                        setFont(fontData);
495                }
496        }
497 
498        /**
499         * @generated
500         */
501        protected void setFontColor(Color color) {
502                getFigure().setForegroundColor(color);
503        }
504 
505        /**
506         * @generated
507         */
508        protected void addSemanticListeners() {
509                if (getParser() instanceof ISemanticParser) {
510                        EObject element = resolveSemanticElement();
511                        parserElements = ((ISemanticParser) getParser())
512                                        .getSemanticElementsBeingParsed(element);
513                        for (int i = 0; i < parserElements.size(); i++) {
514                                addListenerFilter(
515                                                "SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
516                        }
517                } else {
518                        super.addSemanticListeners();
519                }
520        }
521 
522        /**
523         * @generated
524         */
525        protected void removeSemanticListeners() {
526                if (parserElements != null) {
527                        for (int i = 0; i < parserElements.size(); i++) {
528                                removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
529                        }
530                } else {
531                        super.removeSemanticListeners();
532                }
533        }
534 
535        /**
536         * @generated
537         */
538        protected AccessibleEditPart getAccessibleEditPart() {
539                if (accessibleEP == null) {
540                        accessibleEP = new AccessibleGraphicalEditPart() {
541 
542                                public void getName(AccessibleEvent e) {
543                                        e.result = getLabelTextHelper(getFigure());
544                                }
545                        };
546                }
547                return accessibleEP;
548        }
549 
550        /**
551         * @generated
552         */
553        private View getFontStyleOwnerView() {
554                return getPrimaryView();
555        }
556 
557        /**
558         * @generated
559         */
560        protected void addNotationalListeners() {
561                super.addNotationalListeners();
562                addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
563        }
564 
565        /**
566         * @generated
567         */
568        protected void removeNotationalListeners() {
569                super.removeNotationalListeners();
570                removeListenerFilter("PrimaryView"); //$NON-NLS-1$
571        }
572 
573        /**
574         * @generated
575         */
576        protected void handleNotificationEvent(Notification event) {
577                Object feature = event.getFeature();
578                if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
579                        Integer c = (Integer) event.getNewValue();
580                        setFontColor(DiagramColorRegistry.getInstance().getColor(c));
581                } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(
582                                feature)) {
583                        refreshUnderline();
584                } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough()
585                                .equals(feature)) {
586                        refreshStrikeThrough();
587                } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(
588                                feature)
589                                || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(
590                                                feature)
591                                || NotationPackage.eINSTANCE.getFontStyle_Bold()
592                                                .equals(feature)
593                                || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(
594                                                feature)) {
595                        refreshFont();
596                } else {
597                        if (getParser() != null
598                                        && getParser().isAffectingEvent(event,
599                                                        getParserOptions().intValue())) {
600                                refreshLabel();
601                        }
602                        if (getParser() instanceof ISemanticParser) {
603                                ISemanticParser modelParser = (ISemanticParser) getParser();
604                                if (modelParser.areSemanticElementsAffected(null, event)) {
605                                        removeSemanticListeners();
606                                        if (resolveSemanticElement() != null) {
607                                                addSemanticListeners();
608                                        }
609                                        refreshLabel();
610                                }
611                        }
612                }
613                super.handleNotificationEvent(event);
614        }
615 
616        /**
617         * @generated
618         */
619        protected IFigure createFigure() {
620                // Parent should assign one using setLabel() method
621                return null;
622        }
623 
624}

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