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

reenable featurePalette, update Rules

parent 7495ccc1
No related branches found
No related tags found
No related merge requests found
Showing
with 74 additions and 80 deletions
//NaturalType
Create_Attribute NaturalType (true) when true;
Create_Operation NaturalType (true) when true;
Create_Property NaturalType (true) when true;
Add_Property NaturalType (true) when true;
//NaturalType
Create_Attribute DataType (true) when true;
Create_Operation DataType (true) when true;
Create_Property DataType (true) when true;
Add_Property DataType (true) when true;
......@@ -67,7 +67,6 @@ public abstract class AttributeOperationCommonPattern extends FRaMEDShapePattern
protected final FeaturePaletteDescriptor spec_FPD = new FeaturePaletteDescriptor(
PaletteCategory.PROPERTIES_CATEGORY,
ViewVisibility.ALL_VIEWS) {
/*
@Override
public boolean featureExpression(List<String> framedFeatureNames, PaletteView paletteView) {
switch(paletteView) {
......@@ -78,7 +77,6 @@ public abstract class AttributeOperationCommonPattern extends FRaMEDShapePattern
default: return false;
}
}
*/
};
/**
......
//https://github.com/leondart/FRaMED/wiki/EditPolicy-Rules
//base rules
Add RoleType (true) when InCompartment();
Create RoleType (true) when InCompartment();
Add RoleType (true) when InType(CompartmentType);
Create RoleType (true) when InType(CompartmentType);
Add NaturalType (true) when true;
Add Group (true) when true;
Create NaturalType (true) when true;
Create Group (true) when true;
Create RelationshipExclusion (true) when true;
Create RelationshipImplication (true) when true;
Create Inheritance (true) when true;
Create Fulfillment (true) when true;
Create Relationship (true) when true;
//enable all context menues
Execute CompartmentType (true) when true;
//Execute CompartmentType (true) when true;
Execute Relationship (true) when true;
Execute Fulfillment (true) when true;
Execute Inheritance (true) when true;
//Execute Fulfillment (true) when true;
//Execute Inheritance (true) when true;
......@@ -24,40 +24,16 @@
<featureRule xsi:type="editpolicymodel:TrueFeatureRule"/>
<constraintRule xsi:type="editpolicymodel:TrueConstraintRule"/>
</policies>
<policies actionType="RelationshipExclusion">
<featureRule xsi:type="editpolicymodel:TrueFeatureRule"/>
<constraintRule xsi:type="editpolicymodel:TrueConstraintRule"/>
</policies>
<policies actionType="RelationshipImplication">
<featureRule xsi:type="editpolicymodel:TrueFeatureRule"/>
<constraintRule xsi:type="editpolicymodel:TrueConstraintRule"/>
</policies>
<policies actionType="Inheritance">
<featureRule xsi:type="editpolicymodel:TrueFeatureRule"/>
<constraintRule xsi:type="editpolicymodel:TrueConstraintRule"/>
</policies>
<policies actionType="Fulfillment">
<featureRule xsi:type="editpolicymodel:TrueFeatureRule"/>
<constraintRule xsi:type="editpolicymodel:TrueConstraintRule"/>
</policies>
<policies actionType="Relationship">
<featureRule xsi:type="editpolicymodel:TrueFeatureRule"/>
<constraintRule xsi:type="editpolicymodel:TrueConstraintRule"/>
</policies>
<policies action="Execute" actionType="CompartmentType">
<featureRule xsi:type="editpolicymodel:TrueFeatureRule"/>
<constraintRule xsi:type="editpolicymodel:TrueConstraintRule"/>
</policies>
<policies action="Execute" actionType="Relationship">
<featureRule xsi:type="editpolicymodel:TrueFeatureRule"/>
<constraintRule xsi:type="editpolicymodel:TrueConstraintRule"/>
</policies>
<policies action="Execute" actionType="Fulfillment">
<featureRule xsi:type="editpolicymodel:TrueFeatureRule"/>
<constraintRule xsi:type="editpolicymodel:TrueConstraintRule"/>
</policies>
<policies action="Execute" actionType="Inheritance">
<featureRule xsi:type="editpolicymodel:TrueFeatureRule"/>
<constraintRule xsi:type="editpolicymodel:TrueConstraintRule"/>
</policies>
</editpolicymodel:Model>
......@@ -23,7 +23,6 @@ import de.ovgu.featureide.fm.core.configuration.Configuration;
import org.framed.iorm.ui.palette.FeaturePaletteDescriptor; //*import for javadoc link
import org.framed.iorm.ui.providers.FeatureProvider;
import org.framed.iorm.ui.configuration.ChangeConfigurationContext; //*import for javadoc link
import org.framed.iorm.ui.editPolicy.EditPolicyService;
import org.framed.iorm.ui.configuration.ChangeConfigurationCommand; //*import for javadoc link
......
//Fullfillment or Players??
Start Fulfillment (Naturals) when IsSourceType(NaturalType);
Add Fulfillment (Naturals) when IsSourceType(NaturalType) and IsTargetType(CompartmentType);
Create Fulfillment (Naturals) when IsSourceType(NaturalType) and IsTargetType(CompartmentType);
Reconnect Fulfillment (Naturals) when IsSourceType(NaturalType) and IsTargetType(CompartmentType);
Start Fulfillment (Roles) when IsSourceType(RoleType);
Add Fulfillment (Roles) when IsSourceType(RoleType) and IsTargetType(CompartmentType);
Create Fulfillment (Roles) when IsSourceType(RoleType) and IsTargetType(CompartmentType);
Reconnect Fulfillment (Roles) when IsSourceType(RoleType) and IsTargetType(CompartmentType);
Start Fulfillment (Compartments) when IsSourceType(CompartmentType);
Add Fulfillment (Compartments) when IsSourceType(CompartmentType) and IsTargetType(CompartmentType) and !SourceEqualsTarget();
Create Fulfillment (Compartments) when IsSourceType(CompartmentType) and IsTargetType(CompartmentType) and !SourceEqualsTarget();
Reconnect Fulfillment (Compartments) when IsSourceType(CompartmentType) and IsTargetType(CompartmentType) and !SourceEqualsTarget();
Start Fulfillment (Dates) when IsSourceType(DataType);
Add Fulfillment (Dates) when IsSourceType(DataType);
Create Fulfillment (Dates) when IsSourceType(DataType);
Reconnect Fulfillment (Dates) when IsSourceType(DataType);
\ No newline at end of file
......@@ -11,6 +11,13 @@
<rules xsi:type="editpolicymodel:IsTargetType" type="CompartmentType"/>
</constraintRule>
</policies>
<policies actionType="Fulfillment">
<featureRule xsi:type="editpolicymodel:IsFeature" featureName="Naturals"/>
<constraintRule xsi:type="editpolicymodel:AndConstraintRule">
<rules xsi:type="editpolicymodel:IsSourceType" type="NaturalType"/>
<rules xsi:type="editpolicymodel:IsTargetType" type="CompartmentType"/>
</constraintRule>
</policies>
<policies action="Reconnect" actionType="Fulfillment">
<featureRule xsi:type="editpolicymodel:IsFeature" featureName="Naturals"/>
<constraintRule xsi:type="editpolicymodel:AndConstraintRule">
......@@ -29,6 +36,13 @@
<rules xsi:type="editpolicymodel:IsTargetType" type="CompartmentType"/>
</constraintRule>
</policies>
<policies actionType="Fulfillment">
<featureRule xsi:type="editpolicymodel:IsFeature"/>
<constraintRule xsi:type="editpolicymodel:AndConstraintRule">
<rules xsi:type="editpolicymodel:IsSourceType" type="RoleType"/>
<rules xsi:type="editpolicymodel:IsTargetType" type="CompartmentType"/>
</constraintRule>
</policies>
<policies action="Reconnect" actionType="Fulfillment">
<featureRule xsi:type="editpolicymodel:IsFeature"/>
<constraintRule xsi:type="editpolicymodel:AndConstraintRule">
......@@ -52,6 +66,18 @@
</rules>
</constraintRule>
</policies>
<policies actionType="Fulfillment">
<featureRule xsi:type="editpolicymodel:IsFeature" featureName="Compartments"/>
<constraintRule xsi:type="editpolicymodel:AndConstraintRule">
<rules xsi:type="editpolicymodel:AndConstraintRule">
<rules xsi:type="editpolicymodel:IsSourceType" type="CompartmentType"/>
<rules xsi:type="editpolicymodel:IsTargetType" type="CompartmentType"/>
</rules>
<rules xsi:type="editpolicymodel:NotConstraintRule">
<rule xsi:type="editpolicymodel:SourceEqualsTarget"/>
</rules>
</constraintRule>
</policies>
<policies action="Reconnect" actionType="Fulfillment">
<featureRule xsi:type="editpolicymodel:IsFeature" featureName="Compartments"/>
<constraintRule xsi:type="editpolicymodel:AndConstraintRule">
......@@ -72,6 +98,10 @@
<featureRule xsi:type="editpolicymodel:IsFeature" featureName="Dates"/>
<constraintRule xsi:type="editpolicymodel:IsSourceType" type="DataType"/>
</policies>
<policies actionType="Fulfillment">
<featureRule xsi:type="editpolicymodel:IsFeature" featureName="Dates"/>
<constraintRule xsi:type="editpolicymodel:IsSourceType" type="DataType"/>
</policies>
<policies action="Reconnect" actionType="Fulfillment">
<featureRule xsi:type="editpolicymodel:IsFeature" featureName="Dates"/>
<constraintRule xsi:type="editpolicymodel:IsSourceType" type="DataType"/>
......
package fulfillment;
import java.util.Arrays;
import java.util.List;
import org.eclipse.graphiti.features.IFeature;
import org.eclipse.graphiti.features.context.IAddConnectionContext;
import org.eclipse.graphiti.features.context.IAddContext;
......
package inheritance;
import java.util.Arrays;
import java.util.List;
import org.eclipse.graphiti.features.context.IAddConnectionContext;
......@@ -49,7 +48,6 @@ public class InheritancePattern extends FRaMEDConnectionPattern {
private final FeaturePaletteDescriptor spec_FPD = new FeaturePaletteDescriptor(
PaletteCategory.RELATIONS_CATEGORY,
ViewVisibility.ALL_VIEWS) {
/*
@Override
public boolean featureExpression(List<String> framedFeatureNames, PaletteView paletteView) {
switch(paletteView) {
......@@ -59,8 +57,8 @@ public class InheritancePattern extends FRaMEDConnectionPattern {
(framedFeatureNames.contains("Compartment_Inheritance") &&
framedFeatureNames.contains("Contains_Compartments")));
default: return false;
} }
*/
}
}
};
/**
......@@ -239,7 +237,7 @@ public class InheritancePattern extends FRaMEDConnectionPattern {
/**
* searches for the main or group model the inheritance should be added to
*/
public Model getModelToCreateIn(org.framed.iorm.model.ModelElement sourceShape) {
public Model getModelToCreateIn(org.framed.iorm.model.ModelElement sourceShape) { //FIXME
while(sourceShape.getContainer() != null) {
if(sourceShape.getContainer().getParent() == null ||
(sourceShape.getContainer().getParent() != null &&
......
......@@ -2,7 +2,6 @@ package model;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.emf.common.util.URI;
......@@ -15,11 +14,9 @@ import org.eclipse.graphiti.mm.pictograms.PictogramElement;
import org.eclipse.graphiti.pattern.IPattern;
import org.framed.iorm.model.Model;
import org.framed.iorm.model.OrmFactory;
import org.framed.iorm.model.Type;
import org.framed.iorm.ui.FRaMEDShapePattern;
import org.framed.iorm.ui.UILiterals;
import org.framed.iorm.ui.UIUtil;
import org.framed.iorm.ui.editPolicy.EditPolicyService;
import org.framed.iorm.ui.palette.FeaturePaletteDescriptor;
import org.framed.iorm.ui.palette.PaletteCategory;
import org.framed.iorm.ui.palette.ViewVisibility;
......
......@@ -80,9 +80,6 @@ public class NaturalTypePattern extends FRaMEDShapePattern implements IPattern {
/**
* the feature palette descriptor manages the palette visibility, see {@link FeaturePaletteDescriptor}
*/
// private final FeaturePaletteDescriptor spec_FPD = new FeaturePaletteDescriptor(
// PaletteCategory.ENTITIES_CATEGORY,
// ViewVisibility.TOPLEVEL_VIEW);
private final FeaturePaletteDescriptor spec_FPD = new FeaturePaletteDescriptor(
PaletteCategory.ENTITIES_CATEGORY,
ViewVisibility.TOPLEVEL_VIEW);
......
......@@ -106,18 +106,13 @@ public class RoleModelPattern extends FRaMEDShapePattern implements IPattern {
/**
* the feature palette descriptor manages the palette visibility, see {@link FeaturePaletteDescriptor}
*/
/*
private final FeaturePaletteDescriptor spec_FPD = new FeaturePaletteDescriptor(
PaletteCategory.ENTITIES_CATEGORY,
ViewVisibility.TOPLEVEL_VIEW) {
@Override
public boolean featureExpression(List<String> framedFeatureNames, PaletteView paletteView) {
return !(framedFeatureNames.contains("Compartment_Types"));
} };*/
private final FeaturePaletteDescriptor spec_FPD = new FeaturePaletteDescriptor(
PaletteCategory.ENTITIES_CATEGORY,
ViewVisibility.ALL_VIEWS) {
};
} };
/**
* class constructor
......
......@@ -88,12 +88,9 @@ public class RoleTypePattern extends FRaMEDShapePattern implements IPattern {
/**
* the feature palette descriptor manages the palette visibility, see {@link FeaturePaletteDescriptor}
*/
// private final FeaturePaletteDescriptor spec_FPD = new FeaturePaletteDescriptor(
// PaletteCategory.ENTITIES_CATEGORY,
// ViewVisibility.COMPARTMENT_VIEW);
private final FeaturePaletteDescriptor spec_FPD = new FeaturePaletteDescriptor(
PaletteCategory.ENTITIES_CATEGORY,
ViewVisibility.ALL_VIEWS);
ViewVisibility.COMPARTMENT_VIEW);
/**
* class constructor
......
......@@ -108,7 +108,6 @@ public class CompartmentTypePattern extends FRaMEDShapePattern implements IPatte
private final FeaturePaletteDescriptor spec_FPD = new FeaturePaletteDescriptor(
PaletteCategory.ENTITIES_CATEGORY,
ViewVisibility.ALL_VIEWS) {
/*
@Override
public boolean featureExpression(List<String> framedFeatureNames, PaletteView paletteView) {
switch(paletteView) {
......@@ -116,7 +115,6 @@ public class CompartmentTypePattern extends FRaMEDShapePattern implements IPatte
case COMPARTMENT_VIEW: return framedFeatureNames.contains("Contains_Compartments");
default: return false;
} }
*/
};
/**
......
//compartmentTypes
//If Compartment_Types is not set, then only one CompartmentType can be
//added in the top-level view (This will be named RoleModel).
Add CompartmentType (!Compartment_Types) when !InCompartment() and !ContainsCompartment();
Create CompartmentType (!Compartment_Types) when !InCompartment() and !ContainsCompartment();
Add CompartmentType (Compartment_Types) when !InCompartment();
Create CompartmentType (Compartment_Types) when !InCompartment();
Add CompartmentType (!Compartment_Types) when !InType(CompartmentType) and !ContainsCompartment();
Create CompartmentType (!Compartment_Types) when !InType(CompartmentType) and !ContainsCompartment();
Add CompartmentType (Compartment_Types) when !InType(CompartmentType);
Create CompartmentType (Compartment_Types) when !InType(CompartmentType);
\ No newline at end of file
//ContainsCompartments
Add CompartmentType (Contains_Compartments) when InCompartment();
Create CompartmentType (Contains_Compartments) when InCompartment();
\ No newline at end of file
Add CompartmentType (Contains_Compartments) when InType(CompartmentType);
Create CompartmentType (Contains_Compartments) when InType(CompartmentType);
\ No newline at end of file
//Playing_own_roles
Start Fulfillment (Playable_by_Defining_Compartment) when IsSourceType(CompartmentType);
Add Fulfillment (Playable_by_Defining_Compartment) when IsSourceType(CompartmentType) and SourceEqualsTargetType();
Create Fulfillment (Playable_by_Defining_Compartment) when IsSourceType(CompartmentType) and SourceEqualsTargetType();
Reconnect Fulfillment (Playable_by_Defining_Compartment) when IsSourceType(CompartmentType) and SourceEqualsTargetType();
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment