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

nameclass, %method, %block, %line, %
ParametricResourceDemandEditPart.java0%   (0/7)0%   (0/54)0%   (0/840)0%   (0/252)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ParametricResourceDemandEditPart0%   (0/1)0%   (0/43)0%   (0/654)0%   (0/212)
ParametricResourceDemandEditPart (View): void 0%   (0/1)0%   (0/10)0%   (0/4)
access$0 (ParametricResourceDemandEditPart): IMapMode 0%   (0/1)0%   (0/3)0%   (0/1)
access$1 (ParametricResourceDemandEditPart, 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/20)0%   (0/5)
createDefaultEditPolicies (): void 0%   (0/1)0%   (0/35)0%   (0/15)
createFigure (): IFigure 0%   (0/1)0%   (0/10)0%   (0/3)
createFigurePrim (): IFigure 0%   (0/1)0%   (0/5)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/60)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/8)0%   (0/2)
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 ParametricResourceDemandEditPart$10%   (0/1)0%   (0/2)0%   (0/43)0%   (0/12)
ParametricResourceDemandEditPart$1 (ParametricResourceDemandEditPart): void 0%   (0/1)0%   (0/6)0%   (0/2)
isValid (Object): String 0%   (0/1)0%   (0/37)0%   (0/10)
     
class ParametricResourceDemandEditPart$1$10%   (0/1)0%   (0/2)0%   (0/29)0%   (0/6)
ParametricResourceDemandEditPart$1$1 (ParametricResourceDemandEditPart$1, IPa... 0%   (0/1)0%   (0/15)0%   (0/2)
run (): void 0%   (0/1)0%   (0/14)0%   (0/4)
     
class ParametricResourceDemandEditPart$20%   (0/1)0%   (0/2)0%   (0/63)0%   (0/18)
ParametricResourceDemandEditPart$2 (ParametricResourceDemandEditPart, Request... 0%   (0/1)0%   (0/9)0%   (0/2)
run (): void 0%   (0/1)0%   (0/54)0%   (0/16)
     
class ParametricResourceDemandEditPart$30%   (0/1)0%   (0/2)0%   (0/13)0%   (0/5)
ParametricResourceDemandEditPart$3 (ParametricResourceDemandEditPart): void 0%   (0/1)0%   (0/6)0%   (0/2)
notifyChanged (Notification): void 0%   (0/1)0%   (0/7)0%   (0/3)
     
class ParametricResourceDemandEditPart$40%   (0/1)0%   (0/2)0%   (0/16)0%   (0/4)
ParametricResourceDemandEditPart$4 (ParametricResourceDemandEditPart, Abstrac... 0%   (0/1)0%   (0/7)0%   (0/2)
getName (AccessibleEvent): void 0%   (0/1)0%   (0/9)0%   (0/2)
     
class ParametricResourceDemandEditPart$ParametricResourceDemandFigure0%   (0/1)0%   (0/1)0%   (0/22)0%   (0/5)
ParametricResourceDemandEditPart$ParametricResourceDemandFigure (ParametricRe... 0%   (0/1)0%   (0/22)0%   (0/5)

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.Collections;
7import java.util.List;
8 
9import org.eclipse.draw2d.IFigure;
10import org.eclipse.draw2d.Label;
11import org.eclipse.draw2d.geometry.Dimension;
12import org.eclipse.draw2d.geometry.Point;
13import org.eclipse.emf.common.notify.Notification;
14import org.eclipse.emf.ecore.EObject;
15import org.eclipse.emf.ecore.util.EContentAdapter;
16import org.eclipse.emf.transaction.RunnableWithResult;
17import org.eclipse.gef.AccessibleEditPart;
18import org.eclipse.gef.DragTracker;
19import org.eclipse.gef.EditPolicy;
20import org.eclipse.gef.Request;
21import org.eclipse.gef.requests.DirectEditRequest;
22import org.eclipse.gef.requests.SelectionRequest;
23import org.eclipse.gef.tools.DirectEditManager;
24import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
25import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
26import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
27import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
28import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
29import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
30import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
31import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
32import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
33import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ListItemComponentEditPolicy;
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.DragEditPartsTrackerEx;
37import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
38import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
39import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
40import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
41import org.eclipse.gmf.runtime.notation.FontStyle;
42import org.eclipse.gmf.runtime.notation.NotationPackage;
43import org.eclipse.gmf.runtime.notation.View;
44import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
45import org.eclipse.jface.viewers.ICellEditorValidator;
46import org.eclipse.swt.SWT;
47import org.eclipse.swt.accessibility.AccessibleEvent;
48import org.eclipse.swt.graphics.Color;
49import org.eclipse.swt.graphics.FontData;
50import org.eclipse.swt.graphics.Image;
51 
52import de.uka.ipd.sdq.pcm.dialogs.OpenStoExDialog;
53import de.uka.ipd.sdq.pcm.gmf.seff.edit.policies.PalladioComponentModelTextNonResizableEditPolicy;
54import de.uka.ipd.sdq.pcm.gmf.seff.edit.policies.PalladioComponentModelTextSelectionEditPolicy;
55import de.uka.ipd.sdq.pcm.gmf.seff.edit.policies.ParametricResourceDemandItemSemanticEditPolicy;
56import de.uka.ipd.sdq.pcm.gmf.seff.part.PalladioComponentModelVisualIDRegistry;
57import de.uka.ipd.sdq.pcm.gmf.seff.providers.PalladioComponentModelElementTypes;
58import de.uka.ipd.sdq.pcm.gmf.seff.providers.PalladioComponentModelParserProvider;
59import de.uka.ipd.sdq.pcm.seff.seff_performance.ParametricResourceDemand;
60import de.uka.ipd.sdq.pcm.seff.seff_performance.Seff_performancePackage;
61import de.uka.ipd.sdq.pcm.stochasticexpressions.PCMStoExPrettyPrintVisitor;
62 
63/**
64 * @generated
65 */
66public class ParametricResourceDemandEditPart extends CompartmentEditPart
67                implements ITextAwareEditPart {
68 
69        /**
70         * @generated
71         */
72        public static final int VISUAL_ID = 3051;
73 
74        /**
75         * @generated
76         */
77        private DirectEditManager manager;
78 
79        /**
80         * @generated
81         */
82        private IParser parser;
83 
84        /**
85         * @generated
86         */
87        private List parserElements;
88 
89        /**
90         * @generated
91         */
92        private String defaultText;
93 
94        /**
95         * @generated
96         */
97        public ParametricResourceDemandEditPart(View view) {
98                super(view);
99        }
100 
101        /**
102         * @generated
103         */
104        public DragTracker getDragTracker(Request request) {
105                if (request instanceof SelectionRequest
106                                && ((SelectionRequest) request).getLastButtonPressed() == 3) {
107                        return null;
108                }
109                return new DragEditPartsTrackerEx(this);
110        }
111 
112        /**
113         * @generated not
114         */
115        protected void createDefaultEditPolicies() {
116                super.createDefaultEditPolicies();
117                installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE,
118                                new ParametricResourceDemandItemSemanticEditPolicy());
119                installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE,
120                                new PalladioComponentModelTextNonResizableEditPolicy());
121                installEditPolicy(EditPolicy.COMPONENT_ROLE,
122                                new ListItemComponentEditPolicy());
123                installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE,
124                                new LabelDirectEditPolicy());
125                installEditPolicy(
126                                EditPolicyRoles.OPEN_ROLE,
127                                new OpenStoExDialog(
128                                                Seff_performancePackage.eINSTANCE
129                                                                .getParametricResourceDemand_Specification_ParametericResourceDemand()));
130        }
131 
132        /**
133         * @generated
134         */
135        protected String getLabelTextHelper(IFigure figure) {
136                if (figure instanceof WrappingLabel) {
137                        return ((WrappingLabel) figure).getText();
138                } else {
139                        return ((Label) figure).getText();
140                }
141        }
142 
143        /**
144         * @generated
145         */
146        protected void setLabelTextHelper(IFigure figure, String text) {
147                if (figure instanceof WrappingLabel) {
148                        ((WrappingLabel) figure).setText(text);
149                } else {
150                        ((Label) figure).setText(text);
151                }
152        }
153 
154        /**
155         * @generated
156         */
157        protected Image getLabelIconHelper(IFigure figure) {
158                if (figure instanceof WrappingLabel) {
159                        return ((WrappingLabel) figure).getIcon();
160                } else {
161                        return ((Label) figure).getIcon();
162                }
163        }
164 
165        /**
166         * @generated
167         */
168        protected void setLabelIconHelper(IFigure figure, Image icon) {
169                if (figure instanceof WrappingLabel) {
170                        ((WrappingLabel) figure).setIcon(icon);
171                } else {
172                        ((Label) figure).setIcon(icon);
173                }
174        }
175 
176        /**
177         * @generated
178         */
179        public void setLabel(IFigure figure) {
180                unregisterVisuals();
181                setFigure(figure);
182                defaultText = getLabelTextHelper(figure);
183                registerVisuals();
184                refreshVisuals();
185        }
186 
187        /**
188         * @generated
189         */
190        protected List getModelChildren() {
191                return Collections.EMPTY_LIST;
192        }
193 
194        /**
195         * @generated
196         */
197        public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
198                return null;
199        }
200 
201        /**
202         * @generated
203         */
204        protected EObject getParserElement() {
205                return resolveSemanticElement();
206        }
207 
208        /**
209         * @generated
210         */
211        protected Image getLabelIcon() {
212                EObject parserElement = getParserElement();
213                if (parserElement == null) {
214                        return null;
215                }
216                return PalladioComponentModelElementTypes.getImage(parserElement
217                                .eClass());
218        }
219 
220        /**
221         * @generated not
222         */
223        protected String getLabelText() {
224                String text = null;
225                if (resolveSemanticElement() instanceof ParametricResourceDemand) {
226                        ParametricResourceDemand demand = (ParametricResourceDemand) resolveSemanticElement();
227                        if (demand.getRequiredResource_ParametricResourceDemand() != null) {
228                                text = new PCMStoExPrettyPrintVisitor().prettyPrint(demand
229                                                .getSpecification_ParametericResourceDemand()
230                                                .getExpression());
231                                if (text == null)
232                                        text = "";
233                                else
234                                        text += " ";
235                                text += "<"
236                                                + demand.getRequiredResource_ParametricResourceDemand()
237                                                                .getEntityName() + ">";
238                        }
239                }
240                if (text == null || text.length() == 0) {
241                        text = defaultText;
242                }
243                return text;
244        }
245 
246        /**
247         * @generated
248         */
249        public void setLabelText(String text) {
250                setLabelTextHelper(getFigure(), text);
251                Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
252                if (pdEditPolicy instanceof PalladioComponentModelTextSelectionEditPolicy) {
253                        ((PalladioComponentModelTextSelectionEditPolicy) pdEditPolicy)
254                                        .refreshFeedback();
255                }
256                Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
257                if (sfEditPolicy instanceof PalladioComponentModelTextSelectionEditPolicy) {
258                        ((PalladioComponentModelTextSelectionEditPolicy) sfEditPolicy)
259                                        .refreshFeedback();
260                }
261        }
262 
263        /**
264         * @generated
265         */
266        public String getEditText() {
267                if (getParserElement() == null || getParser() == null) {
268                        return ""; //$NON-NLS-1$
269                }
270                return getParser().getEditString(
271                                new EObjectAdapter(getParserElement()),
272                                getParserOptions().intValue());
273        }
274 
275        /**
276         * @generated
277         */
278        protected boolean isEditable() {
279                return false;
280        }
281 
282        /**
283         * @generated
284         */
285        public ICellEditorValidator getEditTextValidator() {
286                return new ICellEditorValidator() {
287 
288                        public String isValid(final Object value) {
289                                if (value instanceof String) {
290                                        final EObject element = getParserElement();
291                                        final IParser parser = getParser();
292                                        try {
293                                                IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
294                                                                .runExclusive(new RunnableWithResult.Impl() {
295 
296                                                                        public void run() {
297                                                                                setResult(parser.isValidEditString(
298                                                                                                new EObjectAdapter(element),
299                                                                                                (String) value));
300                                                                        }
301                                                                });
302                                                return valid.getCode() == ParserEditStatus.EDITABLE ? null
303                                                                : valid.getMessage();
304                                        } catch (InterruptedException ie) {
305                                                ie.printStackTrace();
306                                        }
307                                }
308 
309                                // shouldn't get here
310                                return null;
311                        }
312                };
313        }
314 
315        /**
316         * @generated
317         */
318        public IContentAssistProcessor getCompletionProcessor() {
319                if (getParserElement() == null || getParser() == null) {
320                        return null;
321                }
322                return getParser().getCompletionProcessor(
323                                new EObjectAdapter(getParserElement()));
324        }
325 
326        /**
327         * @generated
328         */
329        public ParserOptions getParserOptions() {
330                return ParserOptions.NONE;
331        }
332 
333        /**
334         * @generated
335         */
336        public IParser getParser() {
337                if (parser == null) {
338                        parser = PalladioComponentModelParserProvider
339                                        .getParser(
340                                                        PalladioComponentModelElementTypes.ParametricResourceDemand_3051,
341                                                        getParserElement(),
342                                                        PalladioComponentModelVisualIDRegistry
343                                                                        .getType(de.uka.ipd.sdq.pcm.gmf.seff.edit.parts.ParametricResourceDemandEditPart.VISUAL_ID));
344                }
345                return parser;
346        }
347 
348        /**
349         * @generated
350         */
351        protected DirectEditManager getManager() {
352                if (manager == null) {
353                        setManager(new TextDirectEditManager(this, TextDirectEditManager
354                                        .getTextCellEditorClass(this),
355                                        PalladioComponentModelEditPartFactory
356                                                        .getTextCellEditorLocator(this)));
357                }
358                return manager;
359        }
360 
361        /**
362         * @generated
363         */
364        protected void setManager(DirectEditManager manager) {
365                this.manager = manager;
366        }
367 
368        /**
369         * @generated
370         */
371        protected void performDirectEdit() {
372                getManager().show();
373        }
374 
375        /**
376         * @generated
377         */
378        protected void performDirectEdit(Point eventLocation) {
379                if (getManager().getClass() == TextDirectEditManager.class) {
380                        ((TextDirectEditManager) getManager()).show(eventLocation
381                                        .getSWTPoint());
382                }
383        }
384 
385        /**
386         * @generated
387         */
388        private void performDirectEdit(char initialCharacter) {
389                if (getManager() instanceof TextDirectEditManager) {
390                        ((TextDirectEditManager) getManager()).show(initialCharacter);
391                } else {
392                        performDirectEdit();
393                }
394        }
395 
396        /**
397         * @generated
398         */
399        protected void performDirectEditRequest(Request request) {
400                final Request theRequest = request;
401                try {
402                        getEditingDomain().runExclusive(new Runnable() {
403 
404                                public void run() {
405                                        if (isActive() && isEditable()) {
406                                                if (theRequest
407                                                                .getExtendedData()
408                                                                .get(
409                                                                                RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
410                                                        Character initialChar = (Character) theRequest
411                                                                        .getExtendedData()
412                                                                        .get(
413                                                                                        RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
414                                                        performDirectEdit(initialChar.charValue());
415                                                } else if ((theRequest instanceof DirectEditRequest)
416                                                                && (getEditText().equals(getLabelText()))) {
417                                                        DirectEditRequest editRequest = (DirectEditRequest) theRequest;
418                                                        performDirectEdit(editRequest.getLocation());
419                                                } else {
420                                                        performDirectEdit();
421                                                }
422                                        }
423                                }
424                        });
425                } catch (InterruptedException e) {
426                        e.printStackTrace();
427                }
428        }
429 
430        /**
431         * @generated
432         */
433        protected void refreshVisuals() {
434                super.refreshVisuals();
435                refreshLabel();
436                refreshFont();
437                refreshFontColor();
438                refreshUnderline();
439                refreshStrikeThrough();
440        }
441 
442        /**
443         * @generated
444         */
445        protected void refreshLabel() {
446                setLabelTextHelper(getFigure(), getLabelText());
447                setLabelIconHelper(getFigure(), getLabelIcon());
448                Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
449                if (pdEditPolicy instanceof PalladioComponentModelTextSelectionEditPolicy) {
450                        ((PalladioComponentModelTextSelectionEditPolicy) pdEditPolicy)
451                                        .refreshFeedback();
452                }
453                Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
454                if (sfEditPolicy instanceof PalladioComponentModelTextSelectionEditPolicy) {
455                        ((PalladioComponentModelTextSelectionEditPolicy) sfEditPolicy)
456                                        .refreshFeedback();
457                }
458        }
459 
460        /**
461         * @generated
462         */
463        protected void refreshUnderline() {
464                FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
465                                NotationPackage.eINSTANCE.getFontStyle());
466                if (style != null && getFigure() instanceof WrappingLabel) {
467                        ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
468                }
469        }
470 
471        /**
472         * @generated
473         */
474        protected void refreshStrikeThrough() {
475                FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
476                                NotationPackage.eINSTANCE.getFontStyle());
477                if (style != null && getFigure() instanceof WrappingLabel) {
478                        ((WrappingLabel) getFigure()).setTextStrikeThrough(style
479                                        .isStrikeThrough());
480                }
481        }
482 
483        /**
484         * @generated
485         */
486        protected void refreshFont() {
487                FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
488                                NotationPackage.eINSTANCE.getFontStyle());
489                if (style != null) {
490                        FontData fontData = new FontData(style.getFontName(), style
491                                        .getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL)
492                                        | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
493                        setFont(fontData);
494                }
495        }
496 
497        /**
498         * @generated
499         */
500        protected void setFontColor(Color color) {
501                getFigure().setForegroundColor(color);
502        }
503 
504        private EContentAdapter changeListener = null;
505        private EObject adaptedElement = null;
506 
507        /**
508         * @generated not
509         */
510        protected void addSemanticListeners() {
511                ParametricResourceDemand element = (ParametricResourceDemand) resolveSemanticElement();
512                changeListener = new EContentAdapter() {
513 
514                        @Override
515                        public void notifyChanged(Notification notification) {
516                                super.notifyChanged(notification);
517                                refreshLabel();
518                        }
519 
520                };
521                adaptedElement = element;
522                element.eAdapters().add(changeListener);
523        }
524 
525        /**
526         * @generated not
527         */
528        protected void removeSemanticListeners() {
529                adaptedElement.eAdapters().remove(changeListener);
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                IFigure label = createFigurePrim();
618                defaultText = getLabelTextHelper(label);
619                return label;
620        }
621 
622        /**
623         * @generated
624         */
625        protected IFigure createFigurePrim() {
626                return new ParametricResourceDemandFigure();
627        }
628 
629        /**
630         * @generated
631         */
632        public class ParametricResourceDemandFigure extends WrappingLabel {
633 
634                /**
635                 * @generated
636                 */
637                public ParametricResourceDemandFigure() {
638                        this.setText("<...>");
639                        this.setMinimumSize(new Dimension(getMapMode().DPtoLP(0),
640                                        getMapMode().DPtoLP(0)));
641                }
642 
643        }
644 
645}

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