Skip to content

Commit

Permalink
[2024] Property values on diagrams
Browse files Browse the repository at this point in the history
- Add a new common tool section on all diagrams
- Add new tools show/hide applied property values and groups
- Move constraint tools into the common section

Bug: 2024
Change-Id: I91a03fc7aaa24ad25528f88b2d30cdd23b9b0616
Signed-off-by: Felix Dorner <felix.dorner@gmail.com>
  • Loading branch information
felixdo committed May 8, 2018
1 parent bf729f6 commit 58c9c79
Show file tree
Hide file tree
Showing 21 changed files with 4,587 additions and 4,636 deletions.

Large diffs are not rendered by default.

2,860 changes: 1,721 additions & 1,139 deletions core/plugins/org.polarsys.capella.core.sirius.analysis/description/common.odesign

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1,541 changes: 847 additions & 694 deletions core/plugins/org.polarsys.capella.core.sirius.analysis/description/oa.odesign

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2017 THALES GLOBAL SERVICES.
* Copyright (c) 2006, 2018 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -929,6 +929,10 @@ public boolean isValidABInsertScenarios(DSemanticDecorator containerView) {
return containerView instanceof DDiagram;
}

public boolean isValidInsertAppliedPV(DSemanticDecorator containerView) {
return !(containerView instanceof DDiagram);
}

/**
* Display given abstract functions
*/
Expand Down
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2017 THALES GLOBAL SERVICES.
* Copyright (c) 2006, 2018 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -440,7 +440,9 @@ public void filter(Collection<? extends EObject> collection, EClass type) {
}
}
}




public EObject forceRefresh(DDiagram diagram) {
boolean automaticRefresh = Platform.getPreferencesService().getBoolean(SiriusPlugin.ID, SiriusPreferencesKeys.PREF_AUTO_REFRESH.name(), false, null);
if (null != diagram && !automaticRefresh) {
Expand Down
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2017 THALES GLOBAL SERVICES.
* Copyright (c) 2006, 2018 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -106,6 +106,7 @@
import org.polarsys.capella.core.data.capellacore.ModellingArchitecture;
import org.polarsys.capella.core.data.capellacore.ModellingBlock;
import org.polarsys.capella.core.data.capellacore.NamedElement;
import org.polarsys.capella.core.data.capellacore.PropertyValueGroup;
import org.polarsys.capella.core.data.capellacore.Relationship;
import org.polarsys.capella.core.data.capellacore.Type;
import org.polarsys.capella.core.data.cs.AbstractActor;
Expand Down Expand Up @@ -2758,6 +2759,74 @@ public Component createActor(ModellingArchitecture container, boolean creationSe
}
return element;
}

/**
* Used to show the link between a PV/PVG and its containing PVG
*/
public Collection<CapellaElement> PVinPVG(CapellaElement elem) {
Collection<CapellaElement> result = new ArrayList<CapellaElement>();
for (EObject content : elem.eContents()) {
if (content instanceof AbstractPropertyValue || content instanceof PropertyValueGroup) {
result.add((CapellaElement) content);
}
}
return result;
}

/**
* Used to show the link between a PV/PVG and and a component (while the PV/PVG may be applied to a component, only the part is represented in the diagram!)
*/
public Collection<CapellaElement> computeValuedElements(CapellaElement elem) {
Collection<CapellaElement> result = new ArrayList<CapellaElement>();
if (elem instanceof AbstractPropertyValue) {
AbstractPropertyValue PV = (AbstractPropertyValue) elem;
for (CapellaElement element : PV.getValuedElements()) {
result.add(element);
if (element instanceof Component) {
Component comp = (Component) element;
for (Partition part : comp.getRepresentingPartitions()) {
result.add(part);
}
}
}
} else if (elem instanceof PropertyValueGroup) {
PropertyValueGroup PV = (PropertyValueGroup) elem;
for (CapellaElement element : PV.getValuedElements()) {
result.add(element);
if (element instanceof Component) {
Component comp = (Component) element;
for (Partition part : comp.getRepresentingPartitions()) {
result.add(part);
}
}
}
}
return result;
}

/**
* Used to show the applied PV/PVG (while the PV/PVG may be applied to a component, only the part is represented in
* the diagram!)
*/
public Collection<CapellaElement> computeAppliedPV(CapellaElement elem) {
Collection<CapellaElement> result = new ArrayList<CapellaElement>();
result.addAll(elem.getAppliedPropertyValueGroups());
result.addAll(elem.getAppliedPropertyValues());
// if we have a part, we also add the PV and PVG applied to the type
if (elem instanceof Part) {
Part part = (Part) elem;
result.addAll(part.getType().getAppliedPropertyValueGroups());
result.addAll(part.getType().getAppliedPropertyValues());
}
return result;
}

/**
* Return the label to be displayed for PV / PVG in diagrams
*/
public String computePVLabel(EObject PV) {
return EObjectLabelProviderHelper.getText(PV);
}

/**
* Return Customized label for component
Expand Down
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2017 THALES GLOBAL SERVICES.
* Copyright (c) 2006, 2018 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -2500,7 +2500,6 @@ public String getAssociationCenterLabel(EObject association, EObject view) {
if ((null != association) && (association instanceof Association)) {
Association ass = (Association) association;
if (!isHideAssociationLabelEnable(association, view)) {
System.out.println(ass.getName());
return ass.getName();
}
}
Expand Down
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2017 THALES GLOBAL SERVICES.
* Copyright (c) 2006, 2018 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand All @@ -18,6 +18,10 @@ public interface IFilterNameConstants {
//
// Filters
//

// Common filters
String FILTER_COMMON_HIDE_PV = "Hide Property Values"; //$NON-NLS-1$

// CC filters - Contextual Capability
String FILTER_CC_HIDE_CAPABILITIES = "Hide Capabilities"; //$NON-NLS-1$
String FILTER_CC_HIDE_CAPABILITY_EXPLOITATION = "Hide Capability Exploitations"; //$NON-NLS-1$
Expand Down
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2017 THALES GLOBAL SERVICES.
* Copyright (c) 2006, 2018 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand All @@ -21,6 +21,12 @@ public interface IToolNameConstants {
// Diagram Tools
//

//
// Common tools on all diagrams
//
String TOOL_COMMON_INSERT_REMOVE_PV = "Applied Property Values";
String TOOL_COMMON_INSERT_REMOVE_PVG = "Applied Property Value Groups";

String TOOL_CREATE_PHYSICAL_PATH = "Physical Path";//$NON-NLS-1$
String TOOL_CREATE_FUNCTIONAL_CHAIN = "Functional Chain";//$NON-NLS-1$

Expand Down

0 comments on commit 58c9c79

Please sign in to comment.