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

Added status bars and an about dialog

parent e7a4c1db
No related branches found
No related tags found
No related merge requests found
...@@ -109,6 +109,10 @@ public final class Controller implements SelectionListener { ...@@ -109,6 +109,10 @@ public final class Controller implements SelectionListener {
if (e.widget == this.mainView.getMntmExit()) { if (e.widget == this.mainView.getMntmExit()) {
this.mainView.close(); this.mainView.close();
} }
if (e.widget == this.mainView.getMntmAbout()) {
this.mainView.getAboutDialog().open();
}
} }
private void handlePotentialTreeSelection(final SelectionEvent e) { private void handlePotentialTreeSelection(final SelectionEvent e) {
......
...@@ -32,9 +32,11 @@ import org.eclipse.swt.widgets.DirectoryDialog; ...@@ -32,9 +32,11 @@ import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Menu; import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem; import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Tree; import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem; import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.swt.widgets.Widget;
/** /**
* The main view of the application. For the most part it uses sub-views to show data. * The main view of the application. For the most part it uses sub-views to show data.
...@@ -52,6 +54,7 @@ public final class View implements Observer { ...@@ -52,6 +54,7 @@ public final class View implements Observer {
private Composite subViewComposite; private Composite subViewComposite;
private StackLayout subViewLayout; private StackLayout subViewLayout;
private MessageBox aboutDialog;
private DirectoryDialog dialog; private DirectoryDialog dialog;
private MenuItem mntmExit; private MenuItem mntmExit;
...@@ -70,6 +73,7 @@ public final class View implements Observer { ...@@ -70,6 +73,7 @@ public final class View implements Observer {
private TreeItem trtmJustTracesContaining; private TreeItem trtmJustTracesContaining;
private TreeItem trtmJustFailedAggTraces; private TreeItem trtmJustFailedAggTraces;
private TreeItem trtmJustAggTracesContaining; private TreeItem trtmJustAggTracesContaining;
private MenuItem mntmAbout;
public View(final DataModel dataModel, final Model mainViewModel, final Controller controller, final Map<String, ISubView> subViews) { public View(final DataModel dataModel, final Model mainViewModel, final Controller controller, final Map<String, ISubView> subViews) {
this.dataModel = dataModel; this.dataModel = dataModel;
...@@ -134,6 +138,10 @@ public final class View implements Observer { ...@@ -134,6 +138,10 @@ public final class View implements Observer {
return this.mntmExit; return this.mntmExit;
} }
public Widget getMntmAbout() {
return this.mntmAbout;
}
public MenuItem getMntmShortOperationNames() { public MenuItem getMntmShortOperationNames() {
return this.mntmShortOperationNames; return this.mntmShortOperationNames;
} }
...@@ -158,6 +166,10 @@ public final class View implements Observer { ...@@ -158,6 +166,10 @@ public final class View implements Observer {
return this.dialog; return this.dialog;
} }
public MessageBox getAboutDialog() {
return this.aboutDialog;
}
/** /**
* @wbp.parser.entryPoint * @wbp.parser.entryPoint
*/ */
...@@ -169,6 +181,10 @@ public final class View implements Observer { ...@@ -169,6 +181,10 @@ public final class View implements Observer {
this.shell.setLayout(new FillLayout(SWT.HORIZONTAL)); this.shell.setLayout(new FillLayout(SWT.HORIZONTAL));
this.dialog = new DirectoryDialog(this.shell); this.dialog = new DirectoryDialog(this.shell);
this.aboutDialog = new MessageBox(this.shell, SWT.ICON_INFORMATION);
this.aboutDialog.setText("About...");
this.aboutDialog.setMessage("Kieker's GUI - 1.0-SNAPSHOT\n\nCopyright 2014 Kieker Project (http://kieker-monitoring.net)");
final SashForm sashForm = new SashForm(this.shell, SWT.NONE); final SashForm sashForm = new SashForm(this.shell, SWT.NONE);
...@@ -248,6 +264,15 @@ public final class View implements Observer { ...@@ -248,6 +264,15 @@ public final class View implements Observer {
this.mntmLongComponentNames = new MenuItem(menu_2, SWT.RADIO); this.mntmLongComponentNames = new MenuItem(menu_2, SWT.RADIO);
this.mntmLongComponentNames.setSelection(true); this.mntmLongComponentNames.setSelection(true);
this.mntmLongComponentNames.setText("Long Component Names"); this.mntmLongComponentNames.setText("Long Component Names");
final MenuItem mntmHelp = new MenuItem(menu, SWT.CASCADE);
mntmHelp.setText("Help");
final Menu menu_3 = new Menu(mntmHelp);
mntmHelp.setMenu(menu_3);
this.mntmAbout = new MenuItem(menu_3, SWT.NONE);
this.mntmAbout.setText("About...");
} }
private void addLogic() { private void addLogic() {
...@@ -258,6 +283,7 @@ public final class View implements Observer { ...@@ -258,6 +283,7 @@ public final class View implements Observer {
this.mntmExit.addSelectionListener(this.controller); this.mntmExit.addSelectionListener(this.controller);
this.mntmOpenMonitoringLog.addSelectionListener(this.controller); this.mntmOpenMonitoringLog.addSelectionListener(this.controller);
this.mntmAbout.addSelectionListener(this.controller);
this.mntmShortOperationNames.addSelectionListener(this.controller); this.mntmShortOperationNames.addSelectionListener(this.controller);
this.mntmLongOperationNames.addSelectionListener(this.controller); this.mntmLongOperationNames.addSelectionListener(this.controller);
...@@ -284,4 +310,5 @@ public final class View implements Observer { ...@@ -284,4 +310,5 @@ public final class View implements Observer {
this.subViewLayout.topControl = compositeToShow; this.subViewLayout.topControl = compositeToShow;
this.subViewComposite.layout(); this.subViewComposite.layout();
} }
} }
...@@ -38,7 +38,7 @@ import org.eclipse.swt.SWT; ...@@ -38,7 +38,7 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm; import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Display;
...@@ -71,6 +71,8 @@ public final class View implements Observer, ISubView { ...@@ -71,6 +71,8 @@ public final class View implements Observer, ISubView {
private Label lblFailed; private Label lblFailed;
private final PropertiesModel propertiesModel; private final PropertiesModel propertiesModel;
private Label lblTotalDurationDisplay; private Label lblTotalDurationDisplay;
private Composite statusBar;
private Label lblTraceEquivalence;
public View(final IModel<AggregatedExecution> model, final Model aggregatedTracesSubViewModel, final PropertiesModel propertiesModel, public View(final IModel<AggregatedExecution> model, final Model aggregatedTracesSubViewModel, final PropertiesModel propertiesModel,
final SelectionListener controller) { final SelectionListener controller) {
...@@ -94,9 +96,15 @@ public final class View implements Observer, ISubView { ...@@ -94,9 +96,15 @@ public final class View implements Observer, ISubView {
} }
this.composite = new Composite(parent, SWT.NONE); this.composite = new Composite(parent, SWT.NONE);
this.composite.setLayout(new FillLayout(SWT.HORIZONTAL)); final GridLayout gl_composite = new GridLayout(1, false);
gl_composite.verticalSpacing = 0;
gl_composite.marginHeight = 0;
gl_composite.marginWidth = 0;
gl_composite.horizontalSpacing = 0;
this.composite.setLayout(gl_composite);
final SashForm sashForm = new SashForm(this.composite, SWT.VERTICAL); final SashForm sashForm = new SashForm(this.composite, SWT.VERTICAL);
sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
this.tree = new Tree(sashForm, SWT.BORDER | SWT.FULL_SELECTION | SWT.VIRTUAL); this.tree = new Tree(sashForm, SWT.BORDER | SWT.FULL_SELECTION | SWT.VIRTUAL);
this.tree.setHeaderVisible(true); this.tree.setHeaderVisible(true);
...@@ -226,6 +234,12 @@ public final class View implements Observer, ISubView { ...@@ -226,6 +234,12 @@ public final class View implements Observer, ISubView {
this.lblTraceSizeDisplay.setText("N/A"); this.lblTraceSizeDisplay.setText("N/A");
sashForm.setWeights(new int[] { 2, 1 }); sashForm.setWeights(new int[] { 2, 1 });
this.statusBar = new Composite(this.composite, SWT.NONE);
this.statusBar.setLayout(new GridLayout(1, false));
this.lblTraceEquivalence = new Label(this.statusBar, SWT.NONE);
this.lblTraceEquivalence.setText("0 Trace Equivalence Classes");
this.tree.addSelectionListener(this.controller); this.tree.addSelectionListener(this.controller);
this.tree.addListener(SWT.SetData, new DataProvider()); this.tree.addListener(SWT.SetData, new DataProvider());
...@@ -248,6 +262,7 @@ public final class View implements Observer, ISubView { ...@@ -248,6 +262,7 @@ public final class View implements Observer, ISubView {
public void update(final Observable observable, final Object obj) { public void update(final Observable observable, final Object obj) {
if (observable == this.model) { if (observable == this.model) {
this.updateTree(); this.updateTree();
this.updateStatusBar();
} }
if (observable == this.aggregatedTracesSubViewModel) { if (observable == this.aggregatedTracesSubViewModel) {
this.updateDetailComposite(); this.updateDetailComposite();
...@@ -257,6 +272,11 @@ public final class View implements Observer, ISubView { ...@@ -257,6 +272,11 @@ public final class View implements Observer, ISubView {
} }
} }
private void updateStatusBar() {
this.lblTraceEquivalence.setText(this.model.getContent().size() + " Trace Equivalence Class(es)");
this.statusBar.getParent().layout();
}
private void updateTree() { private void updateTree() {
final List<AggregatedExecution> records = this.model.getContent(); final List<AggregatedExecution> records = this.model.getContent();
......
...@@ -29,9 +29,11 @@ import kieker.gui.subview.util.TableColumnSortListener; ...@@ -29,9 +29,11 @@ import kieker.gui.subview.util.TableColumnSortListener;
import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.TableColumn;
...@@ -42,6 +44,8 @@ public final class View implements Observer, ISubView { ...@@ -42,6 +44,8 @@ public final class View implements Observer, ISubView {
private final IModel<Record> model; private final IModel<Record> model;
private Composite composite; private Composite composite;
private Table table; private Table table;
private Label lblRecords;
private Composite statusBar;
public View(final IModel<Record> model, final Controller controller) { public View(final IModel<Record> model, final Controller controller) {
this.model = model; this.model = model;
...@@ -59,10 +63,16 @@ public final class View implements Observer, ISubView { ...@@ -59,10 +63,16 @@ public final class View implements Observer, ISubView {
} }
this.composite = new Composite(parent, SWT.NONE); this.composite = new Composite(parent, SWT.NONE);
this.composite.setLayout(new FillLayout(SWT.HORIZONTAL)); final GridLayout gl_composite = new GridLayout(1, false);
gl_composite.verticalSpacing = 0;
gl_composite.marginHeight = 0;
gl_composite.marginWidth = 0;
gl_composite.horizontalSpacing = 0;
this.composite.setLayout(gl_composite);
final TableViewer tableViewer = new TableViewer(this.composite, SWT.BORDER | SWT.FULL_SELECTION | SWT.VIRTUAL); final TableViewer tableViewer = new TableViewer(this.composite, SWT.BORDER | SWT.FULL_SELECTION | SWT.VIRTUAL);
this.table = tableViewer.getTable(); this.table = tableViewer.getTable();
this.table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
this.table.setHeaderVisible(true); this.table.setHeaderVisible(true);
this.table.setLinesVisible(true); this.table.setLinesVisible(true);
...@@ -78,6 +88,12 @@ public final class View implements Observer, ISubView { ...@@ -78,6 +88,12 @@ public final class View implements Observer, ISubView {
tblclmnRecordContent.setWidth(100); tblclmnRecordContent.setWidth(100);
tblclmnRecordContent.setText("Record Content"); tblclmnRecordContent.setText("Record Content");
this.statusBar = new Composite(this.composite, SWT.NONE);
this.statusBar.setLayout(new GridLayout(1, false));
this.lblRecords = new Label(this.statusBar, SWT.NONE);
this.lblRecords.setText("0 Records");
this.table.addListener(SWT.SetData, new DataProvider()); this.table.addListener(SWT.SetData, new DataProvider());
tblclmnTimestamp.addSelectionListener(new TableColumnSortListener<>(new RecordTimestampComparator())); tblclmnTimestamp.addSelectionListener(new TableColumnSortListener<>(new RecordTimestampComparator()));
...@@ -98,9 +114,15 @@ public final class View implements Observer, ISubView { ...@@ -98,9 +114,15 @@ public final class View implements Observer, ISubView {
public void update(final Observable observable, final Object obj) { public void update(final Observable observable, final Object obj) {
if (observable == this.model) { if (observable == this.model) {
this.updateTable(); this.updateTable();
this.updateStatusBar();
} }
} }
private void updateStatusBar() {
this.lblRecords.setText(this.model.getContent().size() + " Record(s)");
this.statusBar.getParent().layout();
}
private void updateTable() { private void updateTable() {
final List<Record> records = this.model.getContent(); final List<Record> records = this.model.getContent();
...@@ -135,5 +157,4 @@ public final class View implements Observer, ISubView { ...@@ -135,5 +157,4 @@ public final class View implements Observer, ISubView {
} }
} }
} }
...@@ -35,7 +35,7 @@ import org.eclipse.swt.SWT; ...@@ -35,7 +35,7 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm; import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Display;
...@@ -65,6 +65,8 @@ public class View implements Observer, ISubView { ...@@ -65,6 +65,8 @@ public class View implements Observer, ISubView {
private Label lblExecutionContainerDisplay; private Label lblExecutionContainerDisplay;
private Label lblFailed; private Label lblFailed;
private final PropertiesModel propertiesModel; private final PropertiesModel propertiesModel;
private Label lblTraces;
private Composite statusBar;
public View(final IModel<Execution> model, final Model tracesSubViewModel, final PropertiesModel propertiesModel, final SelectionListener controller) { public View(final IModel<Execution> model, final Model tracesSubViewModel, final PropertiesModel propertiesModel, final SelectionListener controller) {
this.model = model; this.model = model;
...@@ -87,9 +89,15 @@ public class View implements Observer, ISubView { ...@@ -87,9 +89,15 @@ public class View implements Observer, ISubView {
} }
this.composite = new Composite(parent, SWT.NONE); this.composite = new Composite(parent, SWT.NONE);
this.composite.setLayout(new FillLayout(SWT.HORIZONTAL)); final GridLayout gl_composite = new GridLayout(1, false);
gl_composite.verticalSpacing = 0;
gl_composite.marginHeight = 0;
gl_composite.marginWidth = 0;
gl_composite.horizontalSpacing = 0;
this.composite.setLayout(gl_composite);
final SashForm sashForm = new SashForm(this.composite, SWT.VERTICAL); final SashForm sashForm = new SashForm(this.composite, SWT.VERTICAL);
sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
this.tree = new Tree(sashForm, SWT.BORDER | SWT.FULL_SELECTION | SWT.VIRTUAL); this.tree = new Tree(sashForm, SWT.BORDER | SWT.FULL_SELECTION | SWT.VIRTUAL);
this.tree.setHeaderVisible(true); this.tree.setHeaderVisible(true);
...@@ -189,6 +197,13 @@ public class View implements Observer, ISubView { ...@@ -189,6 +197,13 @@ public class View implements Observer, ISubView {
sashForm.setWeights(new int[] { 2, 1 }); sashForm.setWeights(new int[] { 2, 1 });
this.statusBar = new Composite(this.composite, SWT.NONE);
this.statusBar.setLayout(new GridLayout(1, false));
this.lblTraces = new Label(this.statusBar, SWT.NONE);
this.lblTraces.setText("0 Traces");
this.tree.addSelectionListener(this.controller); this.tree.addSelectionListener(this.controller);
this.tree.addListener(SWT.SetData, new DataProvider()); this.tree.addListener(SWT.SetData, new DataProvider());
...@@ -212,6 +227,7 @@ public class View implements Observer, ISubView { ...@@ -212,6 +227,7 @@ public class View implements Observer, ISubView {
public void update(final Observable observable, final Object obj) { public void update(final Observable observable, final Object obj) {
if (observable == this.model) { if (observable == this.model) {
this.updateTree(); this.updateTree();
this.updateStatusBar();
} }
if (observable == this.tracesSubViewModel) { if (observable == this.tracesSubViewModel) {
this.updateDetailComposite(); this.updateDetailComposite();
...@@ -221,6 +237,11 @@ public class View implements Observer, ISubView { ...@@ -221,6 +237,11 @@ public class View implements Observer, ISubView {
} }
} }
private void updateStatusBar() {
this.lblTraces.setText(this.model.getContent().size() + " Trace(s)");
this.statusBar.getParent().layout();
}
private void updateTree() { private void updateTree() {
final List<Execution> records = this.model.getContent(); final List<Execution> records = this.model.getContent();
......
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