diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorBean.java index f61698262999b47c2a802ffad544ee3fbaf3f7ce..3620b05cd47e733a2862f799efca6d4484c56e1e 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorBean.java @@ -174,10 +174,21 @@ public final class CurrentAnalysisEditorBean { // No code necessary } + /** + * Getter for the attribute {@link CurrentAnalysisEditorBean#projectsBean}. + * + * @return Delivers the value of the attribute. + */ public ProjectsBean getProjectsBean() { return this.projectsBean; } + /** + * Setter for the attribute {@link CurrentAnalysisEditorBean#projectsBean}. + * + * @param projectsBean + * The new value of the attribute. + */ public void setProjectsBean(final ProjectsBean projectsBean) { this.projectsBean = projectsBean; } @@ -485,6 +496,13 @@ public final class CurrentAnalysisEditorBean { } } + /** + * Searches for input ports within the given class and returns them. + * + * @param clazz + * The class to be analyzed. + * @return A list containing the available input ports. + */ public List<InputPort> getInputPorts(final Class<?> clazz) { final ArrayList<InputPort> result = new ArrayList<InputPort>(); @@ -500,6 +518,13 @@ public final class CurrentAnalysisEditorBean { return result; } + /** + * Searches for output ports within the given class and returns them. + * + * @param clazz + * The class to be analyzed. + * @return A list containing the available output ports. + */ public List<OutputPort> getOutputPorts(final Class<?> clazz) { final ArrayList<OutputPort> result = new ArrayList<OutputPort>(); @@ -516,6 +541,13 @@ public final class CurrentAnalysisEditorBean { return result; } + /** + * Searches for repository ports within the given class and returns them. + * + * @param clazz + * The class to be analyzed. + * @return A list containing the available repository ports. + */ public List<RepositoryPort> getRepositoryPorts(final Class<?> clazz) { final ArrayList<RepositoryPort> result = new ArrayList<RepositoryPort>(); diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorBeanV2.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorBeanV2.java index 9815160c6aaa54c08244b020ad72f343ba983564..97fdc0a3e5b1291bab1964ccbce7a2455ac8b405 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorBeanV2.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorBeanV2.java @@ -219,10 +219,21 @@ public final class CurrentAnalysisEditorBeanV2 { } } + /** + * Getter for the attribute {@link CurrentAnalysisEditorBeanV2#projectsBean}. + * + * @return Delivers the value of the attribute. + */ public ProjectsBean getProjectsBean() { return this.projectsBean; } + /** + * Setter for the attribute {@link CurrentAnalysisEditorBeanV2#projectsBean}. + * + * @param projectsBean + * The new value of the attribute. + */ public void setProjectsBean(final ProjectsBean projectsBean) { this.projectsBean = projectsBean; } @@ -240,6 +251,9 @@ public final class CurrentAnalysisEditorBeanV2 { } } + /** + * This method initializes this bean, based on the project name and everything. + */ public void initialize() { synchronized (this) { this.project = this.projectsBean.openProject(this.projectName); @@ -616,7 +630,7 @@ public final class CurrentAnalysisEditorBeanV2 { // Make sure that the graph exists in the first place context.execute(CurrentAnalysisEditorBeanV2.JS_CMD_INIT_GRAPH); // Initialize the listener for the clicks on the components - context.execute("graph.addListener(\"onClick\", function(node,info,e){document.getElementById('hiddenNode:clickedNodeID').value = node.id;document.getElementById('hiddenNode:link').click();});"); + context.execute("graph.addListener(\"onClick\", nodeClickListener);"); // Paint all necessary components this.initializeGraphPlugins(); @@ -642,20 +656,33 @@ public final class CurrentAnalysisEditorBeanV2 { // TODO Now the connections between filters and repositories } + private String clickedNodeID; + private String clickedNodeType; + public void setClickedNodeID(final String id) { - System.out.println("clicked: " + id); + this.clickedNodeID = id; } public String getClickedNodeID() { - return ""; + return this.clickedNodeID; } public void setClickedNodeType(final String type) { - System.out.println("clicked: " + type); + this.clickedNodeType = type; } public String getClickedNodeType() { - return ""; + return this.clickedNodeType; + } + + public void nodeClicked() { + if (this.clickedNodeType.equalsIgnoreCase("Filter") || this.clickedNodeType.equalsIgnoreCase("Reader")) { + // Try to find the ID as a filter/reader + this.setSelectedPlugin(this.pluginMap.get(Integer.parseInt(this.clickedNodeID))); + } else { + // Try to find the ID as a repository + this.setSelectedRepository(this.repositoryMap.get(Integer.parseInt(this.clickedNodeID))); + } } /** diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentCockpitEditorBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentCockpitEditorBean.java index 45e9fe519a1ce1328b6b1d434f1e228664c6cb8f..a6df7f6bbbbf934189723bd059f82b92a3bf5fc1 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentCockpitEditorBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentCockpitEditorBean.java @@ -98,10 +98,21 @@ public class CurrentCockpitEditorBean { // No code necessary } + /** + * Getter for the attribute {@link CurrentCockpitEditorBean#projectsBean}. + * + * @return Delivers the value of the attribute. + */ public ProjectsBean getProjectsBean() { return this.projectsBean; } + /** + * Setter for the attribute {@link CurrentCockpitEditorBean#projectsBean}. + * + * @param projectsBean + * The new value of the attribute. + */ public void setProjectsBean(final ProjectsBean projectsBean) { this.projectsBean = projectsBean; } diff --git a/Kieker.WebGUI/src/main/webapp/AnalysisEditor_V2.xhtml b/Kieker.WebGUI/src/main/webapp/AnalysisEditor_V2.xhtml index b999aa2833c9dd041e91967eb52d4dfd6b7e850d..b3ddba4b04b4267e9c5bcaeeecc1931ce1d1e815 100644 --- a/Kieker.WebGUI/src/main/webapp/AnalysisEditor_V2.xhtml +++ b/Kieker.WebGUI/src/main/webapp/AnalysisEditor_V2.xhtml @@ -27,6 +27,12 @@ window.onload = function() { document.getElementById('hidden:link').onclick(); } + + nodeClickListener = function(node, info, e) { + document.getElementById('hiddenNodeProperties:clickedNodeID').value = node.id; + document.getElementById('hiddenNodeProperties:clickedNodeType').value = node.data.$nodeType; + document.getElementById('hiddenNodeProperties:cmdBtnSelection').click(); + } </script> </h:head> @@ -36,10 +42,10 @@ <f:ajax event="click" listener="#{currentAnalysisEditorBeanV2.initializeGraph()}" /> </h:commandLink> </h:form> - <h:form id="hiddenNode" style="display:none"> + <h:form id="hiddenNodeProperties" style="display:none"> <h:inputHidden id="clickedNodeID" value="#{currentAnalysisEditorBeanV2.clickedNodeID}"/> <h:inputHidden id="clickedNodeType" value="#{currentAnalysisEditorBeanV2.clickedNodeType}"/> - <p:commandButton id="link" ajax="true" value="submit"/> + <p:commandButton id="cmdBtnSelection" ajax="true" action="#{currentAnalysisEditorBeanV2.nodeClicked()}" update=":propertiesForm" value="submit"/> </h:form> <p:layout id="layout" fullPage="true">