diff --git a/src/main/java/kieker/gui/model/AggregatedExecutionEntry.java b/src/main/java/kieker/gui/model/AggregatedExecutionEntry.java index f366ffad31e0bdf88f3ea012c17f028bb5a625ec..efc6ef1aaa9b9a165662cc5e7bdba7b657bc97f8 100644 --- a/src/main/java/kieker/gui/model/AggregatedExecutionEntry.java +++ b/src/main/java/kieker/gui/model/AggregatedExecutionEntry.java @@ -1,16 +1,30 @@ package kieker.gui.model; +import java.util.ArrayList; +import java.util.List; + public final class AggregatedExecutionEntry { + private final List<AggregatedExecutionEntry> children = new ArrayList<>(); + private final String failedCause; private final String container; private final String component; private final String operation; private int calls; - public AggregatedExecutionEntry(final String container, final String component, final String operation) { - this.container = container; - this.component = component; - this.operation = operation; + public AggregatedExecutionEntry(final ExecutionEntry execEntry) { + this.container = execEntry.getContainer(); + this.component = execEntry.getComponent(); + this.operation = execEntry.getOperation(); + this.failedCause = execEntry.getFailedCause(); + + for (final ExecutionEntry child : execEntry.getChildren()) { + this.children.add(new AggregatedExecutionEntry(child)); + } + } + + public List<AggregatedExecutionEntry> getChildren() { + return this.children; } public String getContainer() { @@ -33,4 +47,11 @@ public final class AggregatedExecutionEntry { return this.calls; } + public String getFailedCause() { + return this.failedCause; + } + + public boolean isFailed() { + return (this.failedCause != null); + } } diff --git a/src/main/java/kieker/gui/model/Properties.java b/src/main/java/kieker/gui/model/Properties.java index 6661c236e119c055ebee66c0c0299268b3699854..b52fb21c5a7da62397f255a12560bbc8faf48778 100644 --- a/src/main/java/kieker/gui/model/Properties.java +++ b/src/main/java/kieker/gui/model/Properties.java @@ -20,14 +20,14 @@ import java.util.Observable; /** * An observable singleton container for properties used within this application. - * + * * @author Nils Christian Ehmke */ public final class Properties extends Observable { private static final Properties INSTANCE = new Properties(); private boolean shortComponentNames = false; - private boolean shortOperationParameters = false; + private boolean shortOperationParameters = true; private Properties() {} diff --git a/src/main/java/kieker/gui/model/importer/filter/TraceAggregator.java b/src/main/java/kieker/gui/model/importer/filter/TraceAggregator.java index 22f72ea506de06e042d7d576e08c603e663fbc04..d852bab3bd6e2e4835ce0537ab1c7f4602cc3f9e 100644 --- a/src/main/java/kieker/gui/model/importer/filter/TraceAggregator.java +++ b/src/main/java/kieker/gui/model/importer/filter/TraceAggregator.java @@ -35,7 +35,7 @@ public final class TraceAggregator extends AbstractConsumerStage<ExecutionEntry> @Override protected void execute(final ExecutionEntry execEntry) { if (!this.aggregationMap.containsKey(execEntry)) { - final AggregatedExecutionEntry aggregatedExecutionEntry = new AggregatedExecutionEntry(execEntry.getContainer(), execEntry.getComponent(), execEntry.getOperation()); + final AggregatedExecutionEntry aggregatedExecutionEntry = new AggregatedExecutionEntry(execEntry); this.aggregationMap.put(execEntry, aggregatedExecutionEntry); } this.aggregationMap.get(execEntry).incrementCalls(); diff --git a/src/main/java/kieker/gui/view/AggregatedExecutionTracesTreeSetDataListener.java b/src/main/java/kieker/gui/view/AggregatedExecutionTracesTreeSetDataListener.java index b6d1bb6b3cf3916deb632b29d412593b7b251c0b..e1a354cb9eee0e4a09c5bc2daa92542907f4b420 100644 --- a/src/main/java/kieker/gui/view/AggregatedExecutionTracesTreeSetDataListener.java +++ b/src/main/java/kieker/gui/view/AggregatedExecutionTracesTreeSetDataListener.java @@ -5,6 +5,9 @@ import java.util.List; import kieker.gui.model.AggregatedExecutionEntry; import kieker.gui.model.Properties; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Tree; @@ -25,8 +28,7 @@ class AggregatedExecutionTracesTreeSetDataListener implements Listener { if (parent == null) { executionEntry = ((List<AggregatedExecutionEntry>) tree.getData()).get(tableIndex); } else { - // executionEntry = ((AggregatedExecutionEntry) parent.getData()).getChildren().get(tableIndex); - executionEntry = null; + executionEntry = ((AggregatedExecutionEntry) parent.getData()).getChildren().get(tableIndex); } String componentName = executionEntry.getComponent(); @@ -41,15 +43,18 @@ class AggregatedExecutionTracesTreeSetDataListener implements Listener { final int lastPointPos = operationString.lastIndexOf('.', operationString.length() - 5); operationString = operationString.substring(lastPointPos + 1); } - item.setText(new String[] { executionEntry.getContainer(), componentName, operationString, Integer.toString(executionEntry.getCalls()) }); + if (parent != null) { + item.setText(new String[] { executionEntry.getContainer(), componentName, operationString, "" }); + } else { + item.setText(new String[] { executionEntry.getContainer(), componentName, operationString, Integer.toString(executionEntry.getCalls()) }); + } - // if (executionEntry.isFailed()) { - // final Color colorRed = Display.getCurrent().getSystemColor(SWT.COLOR_RED); - // item.setForeground(colorRed); - // } + if (executionEntry.isFailed()) { + final Color colorRed = Display.getCurrent().getSystemColor(SWT.COLOR_RED); + item.setForeground(colorRed); + } item.setData(executionEntry); - item.setItemCount(0); - // item.setItemCount(executionEntry.getChildren().size()); + item.setItemCount(executionEntry.getChildren().size()); } -} \ No newline at end of file +} diff --git a/src/main/java/kieker/gui/view/MainWindow.java b/src/main/java/kieker/gui/view/MainWindow.java index 22c3be9d945dc93123d7dafe5b2c7e15d6d7ec15..46be0975095090bc8cbc4354d28e487d905226b4 100644 --- a/src/main/java/kieker/gui/view/MainWindow.java +++ b/src/main/java/kieker/gui/view/MainWindow.java @@ -301,6 +301,7 @@ public class MainWindow { this.tree_1 = new Tree(this.sashForm, SWT.BORDER | SWT.FULL_SELECTION | SWT.VIRTUAL); this.tree_1.setHeaderVisible(true); this.tree_1.addListener(SWT.SetData, new AggregatedExecutionTracesTreeSetDataListener()); + Properties.getInstance().addObserver(new TreeUpdateObserver(this.tree_1)); this.treeColumn = new TreeColumn(this.tree_1, SWT.NONE); this.treeColumn.setWidth(100); @@ -396,6 +397,7 @@ public class MainWindow { this.mntmView_1.setMenu(this.menu); this.mntmShortOperationParameters = new MenuItem(this.menu, SWT.RADIO); + this.mntmShortOperationParameters.setSelection(true); this.mntmShortOperationParameters.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent e) { @@ -411,7 +413,6 @@ public class MainWindow { Properties.getInstance().setShortOperationParameters(false); } }); - this.mntmLongOperationParameters.setSelection(true); this.mntmLongOperationParameters.setText("Long Operation Parameters"); new MenuItem(this.menu, SWT.SEPARATOR);