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

COVERAGE SUMMARY FOR SOURCE FILE [VariableCharacterisationEditPart.java]

nameclass, %method, %block, %line, %
VariableCharacterisationEditPart.java0%   (0/6)0%   (0/52)0%   (0/773)0%   (0/232)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class VariableCharacterisationEditPart0%   (0/1)0%   (0/42)0%   (0/608)0%   (0/195)
VariableCharacterisationEditPart (View): void 0%   (0/1)0%   (0/10)0%   (0/4)
access$0 (VariableCharacterisationEditPart, 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/24)0%   (0/6)
createDefaultEditPolicies (): void 0%   (0/1)0%   (0/33)0%   (0/12)
createFigure (): IFigure 0%   (0/1)0%   (0/10)0%   (0/3)
createFigurePrim (): IFigure 0%   (0/1)0%   (0/4)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)
getDragTracker (Request): DragTracker 0%   (0/1)0%   (0/15)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/46)0%   (0/11)
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/63)0%   (0/22)
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/11)0%   (0/3)
setFontColor (Color): void 0%   (0/1)0%   (0/5)0%   (0/2)
setLabel (IFigure): 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 VariableCharacterisationEditPart$10%   (0/1)0%   (0/2)0%   (0/43)0%   (0/12)
VariableCharacterisationEditPart$1 (VariableCharacterisationEditPart): void 0%   (0/1)0%   (0/6)0%   (0/2)
isValid (Object): String 0%   (0/1)0%   (0/37)0%   (0/10)
     
class VariableCharacterisationEditPart$1$10%   (0/1)0%   (0/2)0%   (0/29)0%   (0/6)
VariableCharacterisationEditPart$1$1 (VariableCharacterisationEditPart$1, IPa... 0%   (0/1)0%   (0/15)0%   (0/2)
run (): void 0%   (0/1)0%   (0/14)0%   (0/4)
     
class VariableCharacterisationEditPart$20%   (0/1)0%   (0/2)0%   (0/63)0%   (0/18)
VariableCharacterisationEditPart$2 (VariableCharacterisationEditPart, Request... 0%   (0/1)0%   (0/9)0%   (0/2)
run (): void 0%   (0/1)0%   (0/54)0%   (0/16)
     
class VariableCharacterisationEditPart$30%   (0/1)0%   (0/2)0%   (0/14)0%   (0/6)
VariableCharacterisationEditPart$3 (VariableCharacterisationEditPart): void 0%   (0/1)0%   (0/6)0%   (0/2)
notifyChanged (Notification): void 0%   (0/1)0%   (0/8)0%   (0/4)
     
class VariableCharacterisationEditPart$40%   (0/1)0%   (0/2)0%   (0/16)0%   (0/4)
VariableCharacterisationEditPart$4 (VariableCharacterisationEditPart, Abstrac... 0%   (0/1)0%   (0/7)0%   (0/2)
getName (AccessibleEvent): void 0%   (0/1)0%   (0/9)0%   (0/2)

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

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