1 | package de.uka.ipd.sdq.pcm.dialogs.resource; |
2 | |
3 | import org.eclipse.emf.ecore.EObject; |
4 | |
5 | import de.uka.ipd.sdq.pcm.dialogs.OpenStoExDialog; |
6 | import de.uka.ipd.sdq.pcm.resourceenvironment.CommunicationLinkResourceSpecification; |
7 | import de.uka.ipd.sdq.stoex.RandomVariable; |
8 | import de.uka.ipd.sdq.stoex.analyser.visitors.TypeEnum; |
9 | |
10 | |
11 | // Manually written open policy to open the StoEx Dialog. It's |
12 | // called via a CustomBehaviour in the genmap |
13 | public class OpenThroughputDialog extends OpenStoExDialog { |
14 | |
15 | |
16 | @Override |
17 | protected RandomVariable getRandomVariable(EObject parent) { |
18 | // Default Implementation. Override as necessary |
19 | if (randomVariableFeature == null && parent instanceof RandomVariable) { |
20 | return (RandomVariable) parent; |
21 | } else if (randomVariableFeature == null |
22 | && parent instanceof CommunicationLinkResourceSpecification) { |
23 | return ((CommunicationLinkResourceSpecification) parent) |
24 | .getThroughput_CommunicationLinkResourceSpecification(); |
25 | } else { |
26 | return (RandomVariable) parent.eGet(randomVariableFeature); |
27 | } |
28 | } |
29 | |
30 | @Override |
31 | protected TypeEnum getExpectedType(RandomVariable rv) { |
32 | return TypeEnum.DOUBLE; |
33 | } |
34 | |
35 | } |