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;
}
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());
}
}
}
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;
}
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;
}
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;
}
Aggregations