Commit eb3067b9 authored by Nils Christian Ehmke's avatar Nils Christian Ehmke

Added the about dialog

parent 315ff3ca
package kieker.diagnosis.ui.about;
import com.google.inject.Singleton;
import kieker.diagnosis.architecture.ui.ControllerBase;
@Singleton
public class AboutDialogController extends ControllerBase<AboutDialogViewModel> {
public void performClose( ) {
getViewModel( ).close( );
}
}
package kieker.diagnosis.ui.about;
import java.io.InputStream;
import com.google.inject.Singleton;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.ButtonBar;
import javafx.scene.control.Label;
import javafx.scene.control.Separator;
import javafx.scene.image.Image;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import javafx.stage.Window;
import jfxtras.scene.layout.VBox;
import kieker.diagnosis.architecture.ui.ViewBase;
@Singleton
public class AboutDialogView extends ViewBase<AboutDialogController> {
public AboutDialogView( ) {
setSpacing( 10 );
{
final Label label = new Label( );
label.setText( getLocalizedString( "description" ) );
VBox.setMargin( label, new Insets( 10, 10, 0, 10 ) );
getChildren( ).add( label );
}
{
final Separator separator = new Separator( );
getChildren( ).add( separator );
}
{
final ButtonBar buttonBar = new ButtonBar( );
VBox.setMargin( buttonBar, new Insets( 0, 10, 0, 0 ) );
{
final Button button = new Button( );
button.setText( getLocalizedString( "ok" ) );
button.setDefaultButton( true );
button.setCancelButton( true );
button.setOnAction( e -> getController( ).performClose( ) );
buttonBar.getButtons( ).add( button );
}
getChildren( ).add( buttonBar );
}
}
@Override
public void setParameter( final Object aParameter ) {
}
public void open( final Window aParent ) {
// Create a scene if necessary
Scene scene = getScene( );
if ( scene == null ) {
scene = new Scene( this );
}
// Load the icon
final String iconPath = getLocalizedString( "icon" );
final InputStream iconStream = getClass( ).getClassLoader( ).getResourceAsStream( iconPath );
final Image icon = new Image( iconStream );
// Prepare and show the stage
final Stage stage = new Stage( );
stage.setResizable( false );
stage.initModality( Modality.WINDOW_MODAL );
stage.initStyle( StageStyle.DECORATED );
stage.initOwner( aParent );
stage.getIcons( ).add( icon );
stage.setTitle( getLocalizedString( "title" ) );
stage.setScene( scene );
stage.showAndWait( );
}
}
package kieker.diagnosis.ui.about;
import com.google.inject.Singleton;
import kieker.diagnosis.architecture.ui.ViewModelBase;
@Singleton
public class AboutDialogViewModel extends ViewModelBase<AboutDialogView> {
}
......@@ -27,6 +27,7 @@ import kieker.diagnosis.service.data.MethodCall;
import kieker.diagnosis.service.data.MonitoringLogService;
import kieker.diagnosis.service.export.CSVData;
import kieker.diagnosis.service.export.ExportService;
import kieker.diagnosis.ui.about.AboutDialogView;
import kieker.diagnosis.ui.main.properties.LastImportPathProperty;
import kieker.diagnosis.ui.methods.MethodsView;
import kieker.diagnosis.ui.progress.ProgressDialog;
......@@ -39,6 +40,9 @@ public class MainController extends ControllerBase<MainViewModel> {
@Inject
SettingsDialogView ivSettingsDialogView;
@Inject
AboutDialogView ivAboutDialogView;
/**
* This action is performed, when the user wants to import a monitoring log.
*/
......@@ -78,6 +82,10 @@ public class MainController extends ControllerBase<MainViewModel> {
}
}
public void performAbout( ) {
ivAboutDialogView.open( getViewModel( ).getWindow( ) );
}
/**
* This action is performed, when the user tries to close the application.
*/
......
......@@ -94,6 +94,21 @@ public class MainView extends ViewBase<MainController> {
menuBar.getMenus( ).add( ivFavorites );
}
{
final Menu menu = new Menu( );
menu.setText( getLocalizedString( "help" ) );
{
final MenuItem menuItem = new MenuItem( );
menuItem.setText( getLocalizedString( "about" ) );
menuItem.setOnAction( e -> getController( ).performAbout( ) );
menu.getItems( ).add( menuItem );
}
menuBar.getMenus( ).add( menu );
}
getChildren( ).add( menuBar );
}
......
title=About Kieker Trace Diagnosis
icon=kieker-logo.png
description=Kieker Trace Diagnosis - ${version}\nCopyright 2015-2017 Kieker Project (http://kieker-monitoring.net)\n\nThis tool is licensed under the Apache License 2.0.
ok=OK
title=ber Kieker Trace Diagnosis
description=Kieker Trace Diagnosis - ${version}\nCopyright 2015-2017 Kieker Project (http://kieker-monitoring.net)\n\nDieses Werkzeug ist unter der Apache License 2.0 lizenziert.
ok=OK
\ No newline at end of file
......@@ -3,6 +3,9 @@ importLog=Import monitoring log
settings=Settings
close=Close
help=Help
about=About Kieker Trace Diagnosis
favorites=Favorites
traces=Traces
......
......@@ -3,6 +3,9 @@ importLog=Monitoring Log Importieren
settings=Einstellungen
close=Beenden
help=Hilfe
about=ber Kieker Trace Diagnosis
favorites=Favoriten
traces=Traces
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment