Search in sources :

Example 1 with CinematicRoot

use of org.obeonetwork.dsl.cinematic.CinematicRoot in project InformationSystem by ObeoNetwork.

the class CinematicModelWizard method createInitialModel.

/**
 * Create a new model.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated NOT
 */
protected EObject createInitialModel() {
    CinematicRoot rootObject = cinematicFactory.createCinematicRoot();
    rootObject.setCreatedOn(new Date());
    return rootObject;
}
Also used : CinematicRoot(org.obeonetwork.dsl.cinematic.CinematicRoot) Date(java.util.Date)

Example 2 with CinematicRoot

use of org.obeonetwork.dsl.cinematic.CinematicRoot in project InformationSystem by ObeoNetwork.

the class CinematicRootCinematicRootPropertiesEditionComponent method updateSemanticModel.

/**
 * {@inheritDoc}
 * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updateSemanticModel(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
 */
public void updateSemanticModel(final IPropertiesEditionEvent event) {
    CinematicRoot cinematicRoot = (CinematicRoot) semanticObject;
    if (CinematicViewsRepository.CinematicRoot.Properties.description == event.getAffectedEditor()) {
        cinematicRoot.setDescription((java.lang.String) EEFConverterUtil.createFromString(EcorePackage.Literals.ESTRING, (String) event.getNewValue()));
    }
    if (CinematicViewsRepository.CinematicRoot.Properties.name == event.getAffectedEditor()) {
        cinematicRoot.setName((java.lang.String) EEFConverterUtil.createFromString(EcorePackage.Literals.ESTRING, (String) event.getNewValue()));
    }
    if (CinematicViewsRepository.CinematicRoot.Properties.flows == event.getAffectedEditor()) {
        if (event.getKind() == PropertiesEditionEvent.ADD) {
            EReferencePropertiesEditionContext context = new EReferencePropertiesEditionContext(editingContext, this, flowsSettings, editingContext.getAdapterFactory());
            PropertiesEditingProvider provider = (PropertiesEditingProvider) editingContext.getAdapterFactory().adapt(semanticObject, PropertiesEditingProvider.class);
            if (provider != null) {
                PropertiesEditingPolicy policy = provider.getPolicy(context);
                if (policy instanceof CreateEditingPolicy) {
                    policy.execute();
                }
            }
        } else if (event.getKind() == PropertiesEditionEvent.EDIT) {
            EObjectPropertiesEditionContext context = new EObjectPropertiesEditionContext(editingContext, this, (EObject) event.getNewValue(), editingContext.getAdapterFactory());
            PropertiesEditingProvider provider = (PropertiesEditingProvider) editingContext.getAdapterFactory().adapt((EObject) event.getNewValue(), PropertiesEditingProvider.class);
            if (provider != null) {
                PropertiesEditingPolicy editionPolicy = provider.getPolicy(context);
                if (editionPolicy != null) {
                    editionPolicy.execute();
                }
            }
        } else if (event.getKind() == PropertiesEditionEvent.REMOVE) {
            flowsSettings.removeFromReference((EObject) event.getNewValue());
        } else if (event.getKind() == PropertiesEditionEvent.MOVE) {
            flowsSettings.move(event.getNewIndex(), (Flow) event.getNewValue());
        }
    }
    if (CinematicViewsRepository.CinematicRoot.Properties.viewContainers == event.getAffectedEditor()) {
        if (event.getKind() == PropertiesEditionEvent.ADD) {
            EReferencePropertiesEditionContext context = new EReferencePropertiesEditionContext(editingContext, this, viewContainersSettings, editingContext.getAdapterFactory());
            PropertiesEditingProvider provider = (PropertiesEditingProvider) editingContext.getAdapterFactory().adapt(semanticObject, PropertiesEditingProvider.class);
            if (provider != null) {
                PropertiesEditingPolicy policy = provider.getPolicy(context);
                if (policy instanceof CreateEditingPolicy) {
                    policy.execute();
                }
            }
        } else if (event.getKind() == PropertiesEditionEvent.EDIT) {
            EObjectPropertiesEditionContext context = new EObjectPropertiesEditionContext(editingContext, this, (EObject) event.getNewValue(), editingContext.getAdapterFactory());
            PropertiesEditingProvider provider = (PropertiesEditingProvider) editingContext.getAdapterFactory().adapt((EObject) event.getNewValue(), PropertiesEditingProvider.class);
            if (provider != null) {
                PropertiesEditingPolicy editionPolicy = provider.getPolicy(context);
                if (editionPolicy != null) {
                    editionPolicy.execute();
                }
            }
        } else if (event.getKind() == PropertiesEditionEvent.REMOVE) {
            viewContainersSettings.removeFromReference((EObject) event.getNewValue());
        } else if (event.getKind() == PropertiesEditionEvent.MOVE) {
            viewContainersSettings.move(event.getNewIndex(), (ViewContainer) event.getNewValue());
        }
    }
    if (CinematicViewsRepository.CinematicRoot.Properties.subPackages == event.getAffectedEditor()) {
        if (event.getKind() == PropertiesEditionEvent.ADD) {
            EReferencePropertiesEditionContext context = new EReferencePropertiesEditionContext(editingContext, this, subPackagesSettings, editingContext.getAdapterFactory());
            PropertiesEditingProvider provider = (PropertiesEditingProvider) editingContext.getAdapterFactory().adapt(semanticObject, PropertiesEditingProvider.class);
            if (provider != null) {
                PropertiesEditingPolicy policy = provider.getPolicy(context);
                if (policy instanceof CreateEditingPolicy) {
                    policy.execute();
                }
            }
        } else if (event.getKind() == PropertiesEditionEvent.EDIT) {
            EObjectPropertiesEditionContext context = new EObjectPropertiesEditionContext(editingContext, this, (EObject) event.getNewValue(), editingContext.getAdapterFactory());
            PropertiesEditingProvider provider = (PropertiesEditingProvider) editingContext.getAdapterFactory().adapt((EObject) event.getNewValue(), PropertiesEditingProvider.class);
            if (provider != null) {
                PropertiesEditingPolicy editionPolicy = provider.getPolicy(context);
                if (editionPolicy != null) {
                    editionPolicy.execute();
                }
            }
        } else if (event.getKind() == PropertiesEditionEvent.REMOVE) {
            subPackagesSettings.removeFromReference((EObject) event.getNewValue());
        } else if (event.getKind() == PropertiesEditionEvent.MOVE) {
            subPackagesSettings.move(event.getNewIndex(), (Package) event.getNewValue());
        }
    }
}
Also used : EObjectPropertiesEditionContext(org.eclipse.emf.eef.runtime.context.impl.EObjectPropertiesEditionContext) PropertiesEditingProvider(org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider) EObject(org.eclipse.emf.ecore.EObject) CinematicRoot(org.obeonetwork.dsl.cinematic.CinematicRoot) PropertiesEditingPolicy(org.eclipse.emf.eef.runtime.policies.PropertiesEditingPolicy) CreateEditingPolicy(org.eclipse.emf.eef.runtime.policies.impl.CreateEditingPolicy) EcorePackage(org.eclipse.emf.ecore.EcorePackage) Package(org.obeonetwork.dsl.cinematic.Package) EnvironmentPackage(org.obeonetwork.dsl.environment.EnvironmentPackage) CinematicPackage(org.obeonetwork.dsl.cinematic.CinematicPackage) EReferencePropertiesEditionContext(org.eclipse.emf.eef.runtime.context.impl.EReferencePropertiesEditionContext) ViewContainer(org.obeonetwork.dsl.cinematic.view.ViewContainer) Flow(org.obeonetwork.dsl.cinematic.flow.Flow)

Example 3 with CinematicRoot

use of org.obeonetwork.dsl.cinematic.CinematicRoot in project InformationSystem by ObeoNetwork.

the class CinematicBindingServices method getGlobalBindingRegistry.

private BindingRegistry getGlobalBindingRegistry(CinematicElement element) {
    CinematicRoot root = getCinematicRoot(element);
    if (root != null) {
        if (root.getBindingRegistries().isEmpty()) {
            BindingRegistry bindingRegistry = EnvironmentFactory.eINSTANCE.createBindingRegistry();
            root.getBindingRegistries().add(bindingRegistry);
            root.eResource().getContents().add(bindingRegistry);
            return bindingRegistry;
        } else {
            return root.getBindingRegistries().get(0);
        }
    }
    return null;
}
Also used : BindingRegistry(org.obeonetwork.dsl.environment.BindingRegistry) CinematicRoot(org.obeonetwork.dsl.cinematic.CinematicRoot)

Example 4 with CinematicRoot

use of org.obeonetwork.dsl.cinematic.CinematicRoot in project InformationSystem by ObeoNetwork.

the class CinematicServices method getAllSubFlowStates.

private Set<SubflowState> getAllSubFlowStates(EObject object) {
    Set<SubflowState> subflows = new HashSet<SubflowState>();
    CinematicRoot root = getCinematicRoot(object);
    for (TreeIterator<EObject> iterAssoc = root.eAllContents(); iterAssoc.hasNext(); ) {
        Object obj = iterAssoc.next();
        if (obj instanceof SubflowState) {
            subflows.add((SubflowState) obj);
        }
    }
    return subflows;
}
Also used : EObject(org.eclipse.emf.ecore.EObject) SubflowState(org.obeonetwork.dsl.cinematic.flow.SubflowState) EObject(org.eclipse.emf.ecore.EObject) CinematicRoot(org.obeonetwork.dsl.cinematic.CinematicRoot) HashSet(java.util.HashSet)

Example 5 with CinematicRoot

use of org.obeonetwork.dsl.cinematic.CinematicRoot in project InformationSystem by ObeoNetwork.

the class CinematicServices method getAllTransitions.

private Set<Transition> getAllTransitions(EObject object) {
    Set<Transition> transitions = new HashSet<Transition>();
    CinematicRoot root = getCinematicRoot(object);
    for (TreeIterator<EObject> iterAssoc = root.eAllContents(); iterAssoc.hasNext(); ) {
        Object obj = iterAssoc.next();
        if (obj instanceof Transition) {
            transitions.add((Transition) obj);
        }
    }
    return transitions;
}
Also used : EObject(org.eclipse.emf.ecore.EObject) Transition(org.obeonetwork.dsl.cinematic.flow.Transition) EObject(org.eclipse.emf.ecore.EObject) CinematicRoot(org.obeonetwork.dsl.cinematic.CinematicRoot) HashSet(java.util.HashSet)

Aggregations

CinematicRoot (org.obeonetwork.dsl.cinematic.CinematicRoot)10 EObject (org.eclipse.emf.ecore.EObject)6 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 EcorePackage (org.eclipse.emf.ecore.EcorePackage)2 ReferencesTableSettings (org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings)2 CinematicPackage (org.obeonetwork.dsl.cinematic.CinematicPackage)2 Package (org.obeonetwork.dsl.cinematic.Package)2 Flow (org.obeonetwork.dsl.cinematic.flow.Flow)2 Toolkit (org.obeonetwork.dsl.cinematic.toolkits.Toolkit)2 Widget (org.obeonetwork.dsl.cinematic.toolkits.Widget)2 ViewContainer (org.obeonetwork.dsl.cinematic.view.ViewContainer)2 EnvironmentPackage (org.obeonetwork.dsl.environment.EnvironmentPackage)2 Date (java.util.Date)1 EObjectPropertiesEditionContext (org.eclipse.emf.eef.runtime.context.impl.EObjectPropertiesEditionContext)1 EReferencePropertiesEditionContext (org.eclipse.emf.eef.runtime.context.impl.EReferencePropertiesEditionContext)1 EObjectFilter (org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter)1 PropertiesEditingPolicy (org.eclipse.emf.eef.runtime.policies.PropertiesEditingPolicy)1 CreateEditingPolicy (org.eclipse.emf.eef.runtime.policies.impl.CreateEditingPolicy)1 PropertiesEditingProvider (org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider)1