Skip to content
Snippets Groups Projects
Commit aaacb426 authored by nullsub's avatar nullsub
Browse files

update patterns

parent 9aa8007d
Branches
No related tags found
No related merge requests found
......@@ -7,7 +7,6 @@ import org.eclipse.graphiti.mm.pictograms.Shape;
import org.eclipse.graphiti.pattern.IPattern;
import org.framed.iorm.model.NamedElement;
import org.framed.iorm.model.OrmFactory;
import org.framed.iorm.model.Type;
import org.framed.iorm.ui.UIUtil;
import org.framed.iorm.ui.editPolicy.EditPolicyService;
import org.framed.iorm.ui.references.AbstractHasAttsAndOpsReference;
......
......@@ -233,7 +233,7 @@ public class FulfillmentPattern extends FRaMEDConnectionPattern {
Anchor sourceAnchor = createContext.getSourceAnchor();
org.framed.iorm.model.ModelElement sourceShape = UIUtil.getModelElementForAnchor(sourceAnchor);
if (sourceShape != null) {
if(sourceTypes.contains(sourceShape.getType()))
// if(sourceTypes.contains(sourceShape.getType()))
return EditPolicyService.getHandler(this.getDiagram()).canStart(createContext, Type.FULFILLMENT);
}
return false;
......
......@@ -101,8 +101,8 @@ public class ModelPattern extends FRaMEDShapePattern implements IPattern {
public boolean canAdd(IAddContext addContext) {
if(addContext.getNewObject() instanceof Model && ((Model)addContext.getNewObject()).getParent() != null) {
Type type = ((Model) addContext.getNewObject()).getParent().getType();
return (UIUtil.getLinkedModelForDiagram(getDiagram()) == null);
//&& EditPolicyService.getHandler(this.getDiagram()).canAdd(addContext, type);
return (UIUtil.getLinkedModelForDiagram(getDiagram()) == null)
&& EditPolicyService.getHandler(this.getDiagram()).canAdd(addContext, type);
}
return false;
}
......
......@@ -221,7 +221,11 @@
</policies>
<policies action="Start" actionType="Fulfillment">
<featureRule xsi:type="Editpolicymodel:TrueFeatureRule"/>
<constraintRule xsi:type="Editpolicymodel:TrueConstraintRule"/>
<constraintRule xsi:type="Editpolicymodel:IsSourceType" type="NaturalType"/>
</policies>
<policies action="Start" actionType="Fulfillment">
<featureRule xsi:type="Editpolicymodel:IsFeature" featureName="Dates"/>
<constraintRule xsi:type="Editpolicymodel:IsSourceType" type="DataType"/>
</policies>
<policies action="Start" actionType="Relationship">
<featureRule xsi:type="Editpolicymodel:TrueFeatureRule"/>
......
......@@ -2,12 +2,10 @@ package org.framed.iorm.ui.editPolicy;
import org.eclipse.graphiti.features.context.impl.AddConnectionContext;
import org.eclipse.graphiti.mm.pictograms.Anchor;
import org.eclipse.graphiti.mm.pictograms.ContainerShape;
import org.eclipse.graphiti.mm.pictograms.Diagram;
import org.eclipse.graphiti.mm.pictograms.Shape;
import org.framed.iorm.model.ModelElement;
import org.framed.iorm.model.Type;
import org.framed.iorm.ui.UILiterals;
import org.framed.iorm.ui.UIUtil;
import org.framed.iorm.ui.exceptions.NoDiagramFoundException;
......@@ -43,6 +41,7 @@ public class ConstraintRuleVisitor {
*/
private boolean isStepOut;
@SuppressWarnings("unused")
private Type type;
private Diagram diagram;
......@@ -201,7 +200,6 @@ public class ConstraintRuleVisitor {
return false;
}
private boolean orRuleVisitor(OrConstraintRule rule) {
for(ConstraintRule abstractRule : rule.getRules()) {
if(checkRule(abstractRule))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment