diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentAnalysisEditorBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentAnalysisEditorBean.java index d3ea5ee49e16b592c9bd7a03e61464c87e39442d..fe2ec941344f801bd6d350300dd857e697230178 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentAnalysisEditorBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentAnalysisEditorBean.java @@ -34,6 +34,7 @@ import kieker.analysis.model.analysisMetaModel.MIInputPort; import kieker.analysis.model.analysisMetaModel.MIOutputPort; import kieker.analysis.model.analysisMetaModel.MIPlugin; import kieker.analysis.model.analysisMetaModel.MIProject; +import kieker.analysis.model.analysisMetaModel.MIProperty; import kieker.analysis.model.analysisMetaModel.MIReader; import kieker.analysis.model.analysisMetaModel.MIRepository; import kieker.analysis.model.analysisMetaModel.MIRepositoryConnector; @@ -78,6 +79,7 @@ public class CurrentAnalysisEditorBean { private static final Log LOG = LogFactory.getLog(CurrentAnalysisEditorBean.class); private static final MIAnalysisMetaModelFactory FACTORY = MAnalysisMetaModelFactory.eINSTANCE; + private MIAnalysisComponent globalConfigurationInstance; private ComponentListContainer availableComponents; private MIAnalysisComponent selectedComponent; private boolean unsavedModifications; @@ -395,15 +397,13 @@ public class CurrentAnalysisEditorBean { final List<Object> result = new ArrayList<Object>(); // Add the properties as strings - result.add("Name"); - result.add("ClassName"); + if (this.selectedComponent != this.globalConfigurationInstance) { + result.add("Name"); + result.add("ClassName"); + } // Get the original properties of the plugin - if (this.selectedComponent instanceof MIPlugin) { - result.addAll(((MIPlugin) this.selectedComponent).getProperties()); - } else { - result.addAll(((MIRepository) this.selectedComponent).getProperties()); - } + result.addAll(this.selectedComponent.getProperties()); return result; } @@ -481,6 +481,11 @@ public class CurrentAnalysisEditorBean { * repositories and their connections. All further components will be added mostly by other methods. */ 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. this.currentAnalysisEditorGraphBean.setCurrentAnalysisEditorBean(this); @@ -649,4 +654,8 @@ public class CurrentAnalysisEditorBean { this.setModificationsFlag(); } + public MIAnalysisComponent getGlobalConfigurationComponent() { + return this.globalConfigurationInstance; + } + } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentAnalysisEditorGraphBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentAnalysisEditorGraphBean.java index 3e2148d55f3c7f9b05c253b99e34a5960c94d64c..0d5a0973cb2ff9474730721ccffea503a34c962f 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentAnalysisEditorGraphBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentAnalysisEditorGraphBean.java @@ -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_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_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)"; @@ -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_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_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_DISABLE_GRID = "graph.setGridVisible(false, false)"; @@ -133,6 +135,12 @@ public class CurrentAnalysisEditorGraphBean { 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_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)); } /** diff --git a/Kieker.WebGUI/src/main/webapp/img/graphIcons/ProjectConfiguration.png b/Kieker.WebGUI/src/main/webapp/img/graphIcons/ProjectConfiguration.png new file mode 100644 index 0000000000000000000000000000000000000000..203f88308a7399448403f54a6b790b1157bcab82 Binary files /dev/null and b/Kieker.WebGUI/src/main/webapp/img/graphIcons/ProjectConfiguration.png differ