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

Added further comparators

parent 67d5c714
No related branches found
No related tags found
No related merge requests found
......@@ -25,8 +25,10 @@ import kieker.gui.model.Properties;
import kieker.gui.model.domain.AggregatedExecutionEntry;
import kieker.gui.model.domain.ExecutionEntry;
import kieker.gui.model.domain.RecordEntry;
import kieker.gui.view.util.AbstractDirectedComparator;
import kieker.gui.view.util.AggregatedExecutionTracesTreeSetDataListener;
import kieker.gui.view.util.ExecutionEntryComponentComparator;
import kieker.gui.view.util.ExecutionEntryDurationComparator;
import kieker.gui.view.util.ExecutionEntryOperationComparator;
import kieker.gui.view.util.ExecutionTracesTreeSetDataListener;
import kieker.gui.view.util.RecordEntryTimestampComparator;
import kieker.gui.view.util.RecordEntryTypeComparator;
......@@ -366,18 +368,9 @@ public final class MainWindow {
this.recordsTableTypeColumn.addListener(SWT.Selection, new TableColumnSortListener<RecordEntry>(new RecordEntryTypeComparator()));
this.recordsTableRecordColumn.addListener(SWT.Selection, new TableColumnSortListener<RecordEntry>(new RecordEntryTimestampComparator()));
this.treeColumn_11.addListener(SWT.Selection, new TreeColumnSortListener(new AbstractDirectedComparator<ExecutionEntry>() {
@Override
public int compare(final ExecutionEntry arg0, final ExecutionEntry arg1) {
int result = Long.compare(arg0.getDuration(), arg1.getDuration());
if (this.getDirection() == SWT.UP) {
result = -result;
}
return result;
}
}));
this.treeColumn_10.addListener(SWT.Selection, new TreeColumnSortListener<ExecutionEntry>(new ExecutionEntryOperationComparator()));
this.treeColumn_11.addListener(SWT.Selection, new TreeColumnSortListener<ExecutionEntry>(new ExecutionEntryDurationComparator()));
this.treeColumn_8.addListener(SWT.Selection, new TreeColumnSortListener<ExecutionEntry>(new ExecutionEntryComponentComparator()));
this.explorerTree.addSelectionListener(new SelectionAdapter() {
......
package kieker.gui.view.util;
import kieker.gui.model.domain.ExecutionEntry;
import org.eclipse.swt.SWT;
public class ExecutionEntryComponentComparator extends AbstractDirectedComparator<ExecutionEntry> {
@Override
public int compare(final ExecutionEntry arg0, final ExecutionEntry arg1) {
int result = arg0.getComponent().compareTo(arg1.getOperation());
if (this.getDirection() == SWT.UP) {
result = -result;
}
return result;
}
}
package kieker.gui.view.util;
import kieker.gui.model.domain.ExecutionEntry;
import org.eclipse.swt.SWT;
public class ExecutionEntryDurationComparator extends AbstractDirectedComparator<ExecutionEntry> {
@Override
public int compare(final ExecutionEntry arg0, final ExecutionEntry arg1) {
int result = Long.compare(arg0.getDuration(), arg1.getDuration());
if (this.getDirection() == SWT.UP) {
result = -result;
}
return result;
}
}
package kieker.gui.view.util;
import kieker.gui.model.domain.ExecutionEntry;
import org.eclipse.swt.SWT;
public class ExecutionEntryOperationComparator extends AbstractDirectedComparator<ExecutionEntry> {
@Override
public int compare(final ExecutionEntry arg0, final ExecutionEntry arg1) {
int result = arg0.getOperation().compareTo(arg1.getOperation());
if (this.getDirection() == SWT.UP) {
result = -result;
}
return result;
}
}
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