Commit 778f2ff9 authored by Nils Christian Ehmke's avatar Nils Christian Ehmke

Initial commit of the new version

parent f9e548e6
......@@ -2,9 +2,4 @@ target
.settings
.project
.classpath
logs
/kieker-trace-diagnosis-release-engineering/manual/*.log
/kieker-trace-diagnosis-release-engineering/manual/*.pdf
/kieker-trace-diagnosis-release-engineering/manual/*.aux
/kieker-trace-diagnosis-release-engineering/manual/Manual_DE.out
/kieker-trace-diagnosis-release-engineering/manual/Manual_EN.out
logs
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>kieker-trace-diagnosis-new</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
......@@ -10,102 +9,21 @@
<relativePath>../kieker-trace-diagnosis-parent</relativePath>
</parent>
<properties>
<project.build.sourceEncoding>ISO8859_1</project.build.sourceEncoding>
</properties>
<artifactId>kieker-trace-diagnosis-application</artifactId>
<name>Kieker Trace Diagnosis Application</name>
<dependencies>
<dependency>
<groupId>net.kieker-monitoring</groupId>
<artifactId>kieker-trace-diagnosis-architecture</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<groupId>com.carrotsearch</groupId>
<artifactId>hppc</artifactId>
</dependency>
<dependency>
<groupId>org.jfxtras</groupId>
<artifactId>jfxtras-controls</artifactId>
</dependency>
<dependency>
<groupId>net.sourceforge.teetime</groupId>
<artifactId>teetime</artifactId>
</dependency>
<dependency>
<groupId>net.sourceforge.teetime-stages</groupId>
<artifactId>teetime-stages</artifactId>
</dependency>
<dependency>
<groupId>net.kieker-monitoring</groupId>
<artifactId>kieker</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<!-- We need this for Spring -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/views</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</project>
</project>
\ No newline at end of file
package kieker.diagnosis;
import java.io.InputStream;
import java.util.ResourceBundle;
import com.google.inject.Guice;
import com.google.inject.Injector;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import kieker.diagnosis.ui.main.MainController;
import kieker.diagnosis.ui.main.MainView;
/**
* This is the application's main class.
*
* @author Nils Christian Ehmke
*/
public class KiekerTraceDiagnosis extends Application {
public static void main( final String[] aArgs ) {
Application.launch( aArgs );
}
@Override
public void start( final Stage aPrimaryStage ) throws Exception {
// Load the CDI container
final KiekerTraceDiagnosisModule module = new KiekerTraceDiagnosisModule( );
final Injector injector = Guice.createInjector( com.google.inject.Stage.PRODUCTION, module );
final MainView mainView = injector.getInstance( MainView.class );
final MainController mainController = injector.getInstance( MainController.class );
// Load the icon for the window
final ResourceBundle resourceBundle = ResourceBundle.getBundle( getClass( ).getCanonicalName( ) );
final String iconPath = resourceBundle.getString( "icon" );
final InputStream iconStream = getClass( ).getClassLoader( ).getResourceAsStream( iconPath );
final Image icon = new Image( iconStream );
// Prepare the stage and show the window
final Scene scene = new Scene( mainView );
aPrimaryStage.getIcons( ).add( icon );
aPrimaryStage.setTitle( resourceBundle.getString( "title" ) );
aPrimaryStage.setScene( scene );
aPrimaryStage.setMaximized( true );
// Catch the default close event
aPrimaryStage.setOnCloseRequest( e -> {
e.consume( );
mainController.performClose( );
} );
aPrimaryStage.show( );
}
}
package kieker.diagnosis;
import com.google.inject.AbstractModule;
import kieker.diagnosis.architecture.KiekerTraceDiagnosisArchitectureModule;
/**
* This is the Guice module for the application.
*
* @author Nils Christian Ehmke
*/
public class KiekerTraceDiagnosisModule extends AbstractModule {
@Override
protected void configure( ) {
// We need to make sure that the Guice module from the architecture sub-project is installed
install( new KiekerTraceDiagnosisArchitectureModule( ) );
}
}
/***************************************************************************
* Copyright 2015-2017 Kieker Project (http://kieker-monitoring.net)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
***************************************************************************/
package kieker.diagnosis.application;
import kieker.diagnosis.application.gui.main.MainController;
import kieker.diagnosis.application.service.data.DataService;
import kieker.diagnosis.architecture.gui.GuiLoader;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.image.ImageView;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import org.springframework.boot.Banner.Mode;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.NestedRuntimeException;
import com.google.common.collect.Iterables;
/**
* This class contains the main method of this application.
*
* @author Nils Christian Ehmke
*/
@SpringBootApplication
public class Main extends Application {
private DataService ivDataService;
/**
* The main method of this application.
*
* @param aArgs
* The command line arguments. They are currently not intended to be used.
*/
public static void main( final String[] aArgs ) {
Application.launch( aArgs );
}
@Override
public void start( final Stage aPrimaryStage ) throws InterruptedException, ExecutionException {
// Load the spring context
final ConfigurableApplicationContext context = initializeApplicationAndShowSplashScreen( );
// Now load the main view
final GuiLoader guiLoader = context.getBean( GuiLoader.class );
guiLoader.loadAsMainView( MainController.class, aPrimaryStage );
// Load the dataservice. This is just for the GUI test as the dialogs can not be handled by TestFX
ivDataService = context.getBean( DataService.class );
}
private ConfigurableApplicationContext initializeApplicationAndShowSplashScreen( ) throws InterruptedException, ExecutionException {
final ImageView imageView = new ImageView( "splashscreen.png" );
imageView.setSmooth( true );
final Label progressText = new Label( "Starting..." );
progressText.setAlignment( Pos.CENTER_LEFT );
final Pane parent = new VBox( 5.0 );
parent.getChildren( ).addAll( imageView, progressText );
final Scene scene = new Scene( parent );
final Stage stage = new Stage( );
stage.setResizable( false );
stage.initStyle( StageStyle.UNDECORATED );
stage.initModality( Modality.WINDOW_MODAL );
stage.setScene( scene );
final ExecutorService executorService = Executors.newSingleThreadExecutor( );
final Future<ConfigurableApplicationContext> springInitializer = executorService.submit( ( ) -> {
try {
Platform.runLater( ( ) -> progressText.setText( "Initializing Spring..." ) );
final SpringApplicationBuilder springApplicationBuilder = new SpringApplicationBuilder( getClass( ) );
final ConfigurableApplicationContext context = springApplicationBuilder.bannerMode( Mode.OFF ).logStartupInfo( false ).run( getArguments( ) );
Platform.runLater( ( ) -> stage.hide( ) );
return context;
} catch ( final NestedRuntimeException ex ) {
Platform.runLater( ( ) -> progressText.setText( "Critical error" ) );
Platform.exit( );
return null;
}
} );
stage.showAndWait( );
executorService.shutdown( );
return springInitializer.get( );
}
private String[] getArguments( ) {
final Parameters parameters = getParameters( );
if ( parameters != null ) {
final List<String> rawParameters = parameters.getRaw( );
return Iterables.toArray( rawParameters, String.class );
} else {
return new String[0];
}
}
public DataService getDataService( ) {
return ivDataService;
}
}
/***************************************************************************
* Copyright 2015-2017 Kieker Project (http://kieker-monitoring.net)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
***************************************************************************/
package kieker.diagnosis.application.gui.about;
import java.util.Optional;
import org.springframework.stereotype.Component;
import kieker.diagnosis.architecture.gui.AbstractController;
/**
* The controller for the about dialog. The about dialog shows some information about the application, like the version number and the copyright information.
*
* @author Nils Christian Ehmke
*/
@Component
public class AboutDialogController extends AbstractController<AboutDialogView> {
@Override
protected void doInitialize( final boolean aFirstInitialization, final Optional<?> aParameter ) {
// Nothing to initialize
}
@Override
public void doRefresh( ) {
// Nothing to refresh
}
/**
* The action which is performed when the user clicks the {@code ok} button.
*/
public void performCloseDialog( ) {
getView( ).getStage( ).hide( );
}
}
/***************************************************************************
* Copyright 2015-2017 Kieker Project (http://kieker-monitoring.net)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
***************************************************************************/
package kieker.diagnosis.application.gui.about;
import kieker.diagnosis.architecture.gui.AbstractView;
import kieker.diagnosis.architecture.gui.AutowiredElement;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.stage.Window;
import org.springframework.stereotype.Component;
/**
* The view for the about dialog. The about dialog shows some information about the application, like the version number and the copyright information.
*
* @author Nils Christian Ehmke