Search in sources :

Example 1 with Connection

use of org.eclipse.gemoc.timeline.model.Connection 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 2 with Connection

use of org.eclipse.gemoc.timeline.model.Connection 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)2 Branch (org.eclipse.gemoc.timeline.model.Branch)2 Choice (org.eclipse.gemoc.timeline.model.Choice)2 Connection (org.eclipse.gemoc.timeline.model.Connection)2 PossibleStep (org.eclipse.gemoc.timeline.model.PossibleStep)2 TimelineWindow (org.eclipse.gemoc.timeline.model.TimelineWindow)2