Search in sources :

Example 1 with PossibleStep

use of org.eclipse.gemoc.timeline.model.PossibleStep in project gemoc-studio-modeldebugging by eclipse.

the class TimelineWindowEditPart method deepRefresh.

/**
 * Refresh {@link EditPart} in depth.
 */
private void deepRefresh() {
    refresh();
    for (Branch branch : getModelChildren()) {
        final EditPart branchEditPart = (EditPart) getViewer().getEditPartRegistry().get(branch);
        branchEditPart.refresh();
        for (Choice choice : branch.getChoices()) {
            final EditPart choiceEditPart = (EditPart) getViewer().getEditPartRegistry().get(choice);
            choiceEditPart.refresh();
            for (PossibleStep possibleStep : choice.getPossibleSteps()) {
                final EditPart possibleStepEditPart = (EditPart) getViewer().getEditPartRegistry().get(possibleStep);
                possibleStepEditPart.refresh();
            }
        }
    }
}
Also used : Choice(org.eclipse.gemoc.timeline.model.Choice) PossibleStep(org.eclipse.gemoc.timeline.model.PossibleStep) Branch(org.eclipse.gemoc.timeline.model.Branch) AbstractGraphicalEditPart(org.eclipse.gef.editparts.AbstractGraphicalEditPart) EditPart(org.eclipse.gef.EditPart)

Example 2 with PossibleStep

use of org.eclipse.gemoc.timeline.model.PossibleStep in project gemoc-studio by eclipse.

the class TimelineEditPartFactory method createEditPart.

@Override
public EditPart createEditPart(EditPart context, Object model) {
    final EditPart res;
    if (model instanceof PossibleStep) {
        res = new PossibleStepEditPart(withLabel);
    } else if (model instanceof Connection) {
        res = new ConnectionEditPart();
    } else if (model instanceof Choice) {
        res = new ChoiceEditPart();
    } else if (model instanceof Branch) {
        res = new BranchEditPart();
    } else if (model instanceof TimelineWindow) {
        res = new TimelineWindowEditPart();
    } else {
        throw new IllegalStateException("don't know what to do with " + model.getClass().getName());
    }
    res.setModel(model);
    return res;
}
Also used : Choice(org.eclipse.gemoc.timeline.model.Choice) PossibleStep(org.eclipse.gemoc.timeline.model.PossibleStep) Branch(org.eclipse.gemoc.timeline.model.Branch) TimelineWindow(org.eclipse.gemoc.timeline.model.TimelineWindow) EditPart(org.eclipse.gef.EditPart) Connection(org.eclipse.gemoc.timeline.model.Connection)

Example 3 with PossibleStep

use of org.eclipse.gemoc.timeline.model.PossibleStep in project gemoc-studio by eclipse.

the class TimelineWindowEditPart method deepRefresh.

/**
 * Refresh {@link EditPart} in depth.
 */
private void deepRefresh() {
    refresh();
    for (Branch branch : getModelChildren()) {
        final EditPart branchEditPart = (EditPart) getViewer().getEditPartRegistry().get(branch);
        branchEditPart.refresh();
        for (Choice choice : branch.getChoices()) {
            final EditPart choiceEditPart = (EditPart) getViewer().getEditPartRegistry().get(choice);
            choiceEditPart.refresh();
            for (PossibleStep possibleStep : choice.getPossibleSteps()) {
                final EditPart possibleStepEditPart = (EditPart) getViewer().getEditPartRegistry().get(possibleStep);
                possibleStepEditPart.refresh();
            }
        }
    }
}
Also used : Choice(org.eclipse.gemoc.timeline.model.Choice) PossibleStep(org.eclipse.gemoc.timeline.model.PossibleStep) Branch(org.eclipse.gemoc.timeline.model.Branch) AbstractGraphicalEditPart(org.eclipse.gef.editparts.AbstractGraphicalEditPart) EditPart(org.eclipse.gef.EditPart)

Example 4 with PossibleStep

use of org.eclipse.gemoc.timeline.model.PossibleStep in project gemoc-studio-modeldebugging by eclipse.

the class TimelineEditPartFactory method createEditPart.

@Override
public EditPart createEditPart(EditPart context, Object model) {
    final EditPart res;
    if (model instanceof PossibleStep) {
        res = new PossibleStepEditPart(withLabel);
    } else if (model instanceof Connection) {
        res = new ConnectionEditPart();
    } else if (model instanceof Choice) {
        res = new ChoiceEditPart();
    } else if (model instanceof Branch) {
        res = new BranchEditPart();
    } else if (model instanceof TimelineWindow) {
        res = new TimelineWindowEditPart();
    } else {
        throw new IllegalStateException("don't know what to do with " + model.getClass().getName());
    }
    res.setModel(model);
    return res;
}
Also used : Choice(org.eclipse.gemoc.timeline.model.Choice) PossibleStep(org.eclipse.gemoc.timeline.model.PossibleStep) Branch(org.eclipse.gemoc.timeline.model.Branch) TimelineWindow(org.eclipse.gemoc.timeline.model.TimelineWindow) EditPart(org.eclipse.gef.EditPart) Connection(org.eclipse.gemoc.timeline.model.Connection)

Aggregations

EditPart (org.eclipse.gef.EditPart)4 Branch (org.eclipse.gemoc.timeline.model.Branch)4 Choice (org.eclipse.gemoc.timeline.model.Choice)4 PossibleStep (org.eclipse.gemoc.timeline.model.PossibleStep)4 AbstractGraphicalEditPart (org.eclipse.gef.editparts.AbstractGraphicalEditPart)2 Connection (org.eclipse.gemoc.timeline.model.Connection)2 TimelineWindow (org.eclipse.gemoc.timeline.model.TimelineWindow)2