Skip to content
Snippets Groups Projects
Commit f7bbfc85 authored by Nils Christian Ehmke's avatar Nils Christian Ehmke
Browse files

Added a non-removable component to every project; #982

parent 698261ff
No related branches found
No related tags found
No related merge requests found
...@@ -34,6 +34,7 @@ import kieker.analysis.model.analysisMetaModel.MIInputPort; ...@@ -34,6 +34,7 @@ import kieker.analysis.model.analysisMetaModel.MIInputPort;
import kieker.analysis.model.analysisMetaModel.MIOutputPort; import kieker.analysis.model.analysisMetaModel.MIOutputPort;
import kieker.analysis.model.analysisMetaModel.MIPlugin; import kieker.analysis.model.analysisMetaModel.MIPlugin;
import kieker.analysis.model.analysisMetaModel.MIProject; import kieker.analysis.model.analysisMetaModel.MIProject;
import kieker.analysis.model.analysisMetaModel.MIProperty;
import kieker.analysis.model.analysisMetaModel.MIReader; import kieker.analysis.model.analysisMetaModel.MIReader;
import kieker.analysis.model.analysisMetaModel.MIRepository; import kieker.analysis.model.analysisMetaModel.MIRepository;
import kieker.analysis.model.analysisMetaModel.MIRepositoryConnector; import kieker.analysis.model.analysisMetaModel.MIRepositoryConnector;
...@@ -78,6 +79,7 @@ public class CurrentAnalysisEditorBean { ...@@ -78,6 +79,7 @@ public class CurrentAnalysisEditorBean {
private static final Log LOG = LogFactory.getLog(CurrentAnalysisEditorBean.class); private static final Log LOG = LogFactory.getLog(CurrentAnalysisEditorBean.class);
private static final MIAnalysisMetaModelFactory FACTORY = MAnalysisMetaModelFactory.eINSTANCE; private static final MIAnalysisMetaModelFactory FACTORY = MAnalysisMetaModelFactory.eINSTANCE;
private MIAnalysisComponent globalConfigurationInstance;
private ComponentListContainer availableComponents; private ComponentListContainer availableComponents;
private MIAnalysisComponent selectedComponent; private MIAnalysisComponent selectedComponent;
private boolean unsavedModifications; private boolean unsavedModifications;
...@@ -395,15 +397,13 @@ public class CurrentAnalysisEditorBean { ...@@ -395,15 +397,13 @@ public class CurrentAnalysisEditorBean {
final List<Object> result = new ArrayList<Object>(); final List<Object> result = new ArrayList<Object>();
// Add the properties as strings // Add the properties as strings
result.add("Name"); if (this.selectedComponent != this.globalConfigurationInstance) {
result.add("ClassName"); result.add("Name");
result.add("ClassName");
}
// Get the original properties of the plugin // Get the original properties of the plugin
if (this.selectedComponent instanceof MIPlugin) { result.addAll(this.selectedComponent.getProperties());
result.addAll(((MIPlugin) this.selectedComponent).getProperties());
} else {
result.addAll(((MIRepository) this.selectedComponent).getProperties());
}
return result; return result;
} }
...@@ -481,6 +481,11 @@ public class CurrentAnalysisEditorBean { ...@@ -481,6 +481,11 @@ public class CurrentAnalysisEditorBean {
* repositories and their connections. All further components will be added mostly by other methods. * repositories and their connections. All further components will be added mostly by other methods.
*/ */
public void initializeGraph() { public void initializeGraph() {
this.globalConfigurationInstance = CurrentAnalysisEditorBean.FACTORY.createFilter();
final MIProperty prop1 = CurrentAnalysisEditorBean.FACTORY.createProperty();
prop1.setName("Bla");
this.globalConfigurationInstance.getProperties().add(prop1);
// Make sure that the currentAnalysisEditorGraphBean knows "this" as well. // Make sure that the currentAnalysisEditorGraphBean knows "this" as well.
this.currentAnalysisEditorGraphBean.setCurrentAnalysisEditorBean(this); this.currentAnalysisEditorGraphBean.setCurrentAnalysisEditorBean(this);
...@@ -649,4 +654,8 @@ public class CurrentAnalysisEditorBean { ...@@ -649,4 +654,8 @@ public class CurrentAnalysisEditorBean {
this.setModificationsFlag(); this.setModificationsFlag();
} }
public MIAnalysisComponent getGlobalConfigurationComponent() {
return this.globalConfigurationInstance;
}
} }
...@@ -71,6 +71,7 @@ public class CurrentAnalysisEditorGraphBean { ...@@ -71,6 +71,7 @@ public class CurrentAnalysisEditorGraphBean {
private static final String JS_CMD_CREATE_GRAPH_VAR = "var graph = GraphFlow()"; private static final String JS_CMD_CREATE_GRAPH_VAR = "var graph = GraphFlow()";
private static final String JS_CMD_ADD_EDGE_CONSTRAINTS = "graph.addEdgeConstraints()"; private static final String JS_CMD_ADD_EDGE_CONSTRAINTS = "graph.addEdgeConstraints()";
private static final String JS_CMD_SET_GLOBAL_ICON = "graph.setNodeIcon('Global', '../img/graphIcons/ProjectConfiguration.png', true)";
private static final String JS_CMD_SET_FILTER_ICON = "graph.setNodeIcon('Filter', '../img/graphIcons/FilterIcon.png', true)"; private static final String JS_CMD_SET_FILTER_ICON = "graph.setNodeIcon('Filter', '../img/graphIcons/FilterIcon.png', true)";
private static final String JS_CMD_SET_READER_ICON = "graph.setNodeIcon('Reader', '../img/graphIcons/ReaderIcon.png', true)"; private static final String JS_CMD_SET_READER_ICON = "graph.setNodeIcon('Reader', '../img/graphIcons/ReaderIcon.png', true)";
private static final String JS_CMD_SET_REPOSITORY_ICON = "graph.setNodeIcon('Repository', '../img/graphIcons/RepositoryIcon.png', true)"; private static final String JS_CMD_SET_REPOSITORY_ICON = "graph.setNodeIcon('Repository', '../img/graphIcons/RepositoryIcon.png', true)";
...@@ -88,6 +89,7 @@ public class CurrentAnalysisEditorGraphBean { ...@@ -88,6 +89,7 @@ public class CurrentAnalysisEditorGraphBean {
private static final String JS_CMD_ADD_FILTER = "var center = graph.getScreenCenter(); graph.addNode(center.x, center.y, %s,[%s],[%s],[%s],'Filter', false)"; private static final String JS_CMD_ADD_FILTER = "var center = graph.getScreenCenter(); graph.addNode(center.x, center.y, %s,[%s],[%s],[%s],'Filter', false)";
private static final String JS_CMD_ADD_READER = "var center = graph.getScreenCenter(); graph.addNode(center.x, center.y, %s,[%s],null,[%s], 'Reader', false)"; private static final String JS_CMD_ADD_READER = "var center = graph.getScreenCenter(); graph.addNode(center.x, center.y, %s,[%s],null,[%s], 'Reader', false)";
private static final String JS_CMD_ADD_REPOSITORY = "var center = graph.getScreenCenter(); graph.addNode(center.x, center.y, %s, null, [%s], null, 'Repository',false)"; private static final String JS_CMD_ADD_REPOSITORY = "var center = graph.getScreenCenter(); graph.addNode(center.x, center.y, %s, null, [%s], null, 'Repository',false)";
private static final String JS_CMD_ADD_GLOBAL_COMPONENT = "var center = graph.getScreenCenter(); graph.addNode(center.x, center.y, {'id':'%s', 'name':'Project-Configuration', 'nodeClass':'', 'tooltip':''}, null, null, null,'Global', false); graph.setNodeData('%s.close', {'$visible' : false});";
private static final String JS_CMD_ENABLE_GRID = "graph.setGridVisible(true, false)"; private static final String JS_CMD_ENABLE_GRID = "graph.setGridVisible(true, false)";
private static final String JS_CMD_DISABLE_GRID = "graph.setGridVisible(false, false)"; private static final String JS_CMD_DISABLE_GRID = "graph.setGridVisible(false, false)";
...@@ -133,6 +135,12 @@ public class CurrentAnalysisEditorGraphBean { ...@@ -133,6 +135,12 @@ public class CurrentAnalysisEditorGraphBean {
RequestContext.getCurrentInstance().execute(CurrentAnalysisEditorGraphBean.JS_CMD_SET_FILTER_ICON); RequestContext.getCurrentInstance().execute(CurrentAnalysisEditorGraphBean.JS_CMD_SET_FILTER_ICON);
RequestContext.getCurrentInstance().execute(CurrentAnalysisEditorGraphBean.JS_CMD_SET_REPOSITORY_ICON); RequestContext.getCurrentInstance().execute(CurrentAnalysisEditorGraphBean.JS_CMD_SET_REPOSITORY_ICON);
RequestContext.getCurrentInstance().execute(CurrentAnalysisEditorGraphBean.JS_CMD_SET_READER_ICON); RequestContext.getCurrentInstance().execute(CurrentAnalysisEditorGraphBean.JS_CMD_SET_READER_ICON);
RequestContext.getCurrentInstance().execute(CurrentAnalysisEditorGraphBean.JS_CMD_SET_GLOBAL_ICON);
// Create an MIAnalysisComponent instance, which represents the global configuration of the project
final MIAnalysisComponent globalComponent = this.currentAnalysisEditorBean.getGlobalConfigurationComponent();
final int id = this.componentMap.get(globalComponent);
RequestContext.getCurrentInstance().execute(String.format(CurrentAnalysisEditorGraphBean.JS_CMD_ADD_GLOBAL_COMPONENT, "id" + id, "id" + id));
} }
/** /**
......
Kieker.WebGUI/src/main/webapp/img/graphIcons/ProjectConfiguration.png

13.2 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment