Search in sources :

Example 6 with StochasticExpressionEditDialog

use of org.palladiosimulator.editors.commons.dialogs.stoex.StochasticExpressionEditDialog in project Palladio-Editors-Sirius by PalladioSimulator.

the class AddHDDProcessingResourceSpecification method getReadProcessingRate.

private PCMRandomVariable getReadProcessingRate() {
    final PCMRandomVariable pcmRandomVariable = CoreFactory.eINSTANCE.createPCMRandomVariable();
    pcmRandomVariable.setSpecification("");
    final StochasticExpressionEditDialog dialog = new StochasticExpressionEditDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), TypeEnum.DOUBLE, pcmRandomVariable);
    dialog.setDisplayTitle(SET_READ_PROCESSING_RATE);
    dialog.open();
    if (dialog.getResult() == null) {
        return null;
    }
    pcmRandomVariable.setSpecification(dialog.getResultText());
    return pcmRandomVariable;
}
Also used : StochasticExpressionEditDialog(org.palladiosimulator.editors.commons.dialogs.stoex.StochasticExpressionEditDialog) PCMRandomVariable(org.palladiosimulator.pcm.core.PCMRandomVariable)

Example 7 with StochasticExpressionEditDialog

use of org.palladiosimulator.editors.commons.dialogs.stoex.StochasticExpressionEditDialog in project Palladio-Editors-Sirius by PalladioSimulator.

the class AddLinkingResourceAction method getRandomVariableFromStoExDialog.

/**
 * Opens a StoxEx dialog and returns the resulting {@link PCMRandomVariable}.
 *
 * @param displayTitle
 *            Title of the StoEx dialog
 * @return PCMRandomVariable if user entered valid data and confirmed. Will return null if user
 *         canceled dialog
 */
private PCMRandomVariable getRandomVariableFromStoExDialog(final String displayTitle) {
    final PCMRandomVariable randomVariable = CoreFactory.eINSTANCE.createPCMRandomVariable();
    randomVariable.setSpecification("");
    final StochasticExpressionEditDialog dialog = new StochasticExpressionEditDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), TypeEnum.DOUBLE, randomVariable);
    dialog.setDisplayTitle(displayTitle);
    dialog.open();
    if (dialog.getReturnCode() == Dialog.CANCEL) {
        return null;
    }
    randomVariable.setSpecification(dialog.getResultText());
    return randomVariable;
}
Also used : StochasticExpressionEditDialog(org.palladiosimulator.editors.commons.dialogs.stoex.StochasticExpressionEditDialog) PCMRandomVariable(org.palladiosimulator.pcm.core.PCMRandomVariable)

Example 8 with StochasticExpressionEditDialog

use of org.palladiosimulator.editors.commons.dialogs.stoex.StochasticExpressionEditDialog in project Palladio-Editors-Sirius by PalladioSimulator.

the class OpenExternalStoexEditor method dialogNotEmptyRandomVariable.

private void dialogNotEmptyRandomVariable(final RandomVariable randVar) {
    final StochasticExpressionEditDialog dialog = this.createDialog(randVar);
    if (dialog.getReturnCode() == Window.OK) {
        final String result = dialog.getResultText();
        randVar.setSpecification(result);
    }
}
Also used : StochasticExpressionEditDialog(org.palladiosimulator.editors.commons.dialogs.stoex.StochasticExpressionEditDialog)

Example 9 with StochasticExpressionEditDialog

use of org.palladiosimulator.editors.commons.dialogs.stoex.StochasticExpressionEditDialog in project Palladio-Editors-Sirius by PalladioSimulator.

the class OpenExternalStoexEditor method createDialog.

private StochasticExpressionEditDialog createDialog(final RandomVariable randVar) {
    final StochasticExpressionEditDialog dialog = new StochasticExpressionEditDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), this.getExpectedType(randVar), randVar);
    dialog.setInitialExpression(randVar);
    dialog.open();
    return dialog;
}
Also used : StochasticExpressionEditDialog(org.palladiosimulator.editors.commons.dialogs.stoex.StochasticExpressionEditDialog)

Aggregations

StochasticExpressionEditDialog (org.palladiosimulator.editors.commons.dialogs.stoex.StochasticExpressionEditDialog)9 PCMRandomVariable (org.palladiosimulator.pcm.core.PCMRandomVariable)5 PCMStoExPrettyPrintVisitor (de.uka.ipd.sdq.pcm.stochasticexpressions.PCMStoExPrettyPrintVisitor)1 RandomVariable (de.uka.ipd.sdq.stoex.RandomVariable)1 ICommand (org.eclipse.gmf.runtime.common.core.command.ICommand)1 SetValueCommand (org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand)1 SetRequest (org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest)1