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

Minor GUI improvements

parent 8828feb0
......@@ -16,15 +16,12 @@
package kieker.diagnosis.application.gui.about;
import kieker.diagnosis.architecture.gui.AbstractController;
import java.util.Optional;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
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.
*
......@@ -50,13 +47,4 @@ public class AboutDialogController extends AbstractController<AboutDialogView> {
getView( ).getStage( ).hide( );
}
/**
* The action which is performed when the user presses a key.
*/
public void performOnKeyPressed( final KeyEvent aKeyEvent ) {
if ( aKeyEvent.getCode( ) == KeyCode.ESCAPE ) {
performCloseDialog( );
}
}
}
......@@ -16,23 +16,20 @@
package kieker.diagnosis.application.gui.bugreporting;
import kieker.diagnosis.application.service.properties.GitLabURLProperty;
import kieker.diagnosis.application.service.properties.MailingListURLProperty;
import kieker.diagnosis.architecture.gui.AbstractController;
import kieker.diagnosis.architecture.service.properties.PropertiesService;
import java.awt.Desktop;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Optional;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import kieker.diagnosis.application.service.properties.GitLabURLProperty;
import kieker.diagnosis.application.service.properties.MailingListURLProperty;
import kieker.diagnosis.architecture.gui.AbstractController;
import kieker.diagnosis.architecture.service.properties.PropertiesService;
/**
* The controller for the bug reporting dialog.
*
......@@ -70,13 +67,4 @@ public class BugReportingDialogController extends AbstractController<BugReportin
getView( ).getStage( ).hide( );
}
/**
* The action which is performed when the user presses a key.
*/
public void performOnKeyPressed( final KeyEvent aKeyEvent ) {
if ( aKeyEvent.getCode( ) == KeyCode.ESCAPE ) {
performCloseDialog( );
}
}
}
......@@ -16,6 +16,15 @@
package kieker.diagnosis.application.gui.settings;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javafx.beans.binding.BooleanBinding;
import javafx.beans.property.ObjectProperty;
import javafx.collections.FXCollections;
import kieker.diagnosis.application.service.properties.AdditionalLogChecksProperty;
import kieker.diagnosis.application.service.properties.CaseSensitiveProperty;
import kieker.diagnosis.application.service.properties.ComponentNames;
......@@ -37,25 +46,14 @@ import kieker.diagnosis.architecture.exception.BusinessException;
import kieker.diagnosis.architecture.gui.AbstractController;
import kieker.diagnosis.architecture.service.properties.PropertiesService;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
import javafx.beans.binding.BooleanBinding;
import javafx.beans.property.ObjectProperty;
import javafx.collections.FXCollections;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author Nils Christian Ehmke
*/
@Component
public class SettingsDialogController extends AbstractController<SettingsDialogView> {
private static final TimeUnit [] TIME_UNITS = { TimeUnit.NANOSECONDS, TimeUnit.MICROSECONDS, TimeUnit.MILLISECONDS, TimeUnit.SECONDS, TimeUnit.MINUTES, TimeUnit.HOURS };
private static final TimeUnit[] TIME_UNITS = { TimeUnit.NANOSECONDS, TimeUnit.MICROSECONDS, TimeUnit.MILLISECONDS, TimeUnit.SECONDS, TimeUnit.MINUTES,
TimeUnit.HOURS };
@Autowired
private PropertiesService ivPropertiesService;
......@@ -104,9 +102,11 @@ public class SettingsDialogController extends AbstractController<SettingsDialogV
getView( ).getTimeunits( ).getSelectionModel( ).select( ivPropertiesService.loadApplicationProperty( TimeUnitProperty.class ) );
getView( ).getAdditionalLogChecks( ).setSelected( ivPropertiesService.loadApplicationProperty( AdditionalLogChecksProperty.class ) );
getView( ).getActivateRegularExpressions( ).setSelected( ivPropertiesService.loadApplicationProperty( RegularExpressionsProperty.class ) );
getView( ).getTypeOfMethodAggregation( ).getSelectionModel( ).select( ivPropertiesService.loadApplicationProperty( MethodCallAggregationProperty.class ) );
getView( ).getTypeOfMethodAggregation( ).getSelectionModel( )
.select( ivPropertiesService.loadApplicationProperty( MethodCallAggregationProperty.class ) );
getView( ).getThresholdTextField( ).setText( Float.toString( ivPropertiesService.loadApplicationProperty( MethodCallThresholdProperty.class ) ) );
getView( ).getMaxNumberOfMethodCallsTextField( ).setText( Integer.toString( ivPropertiesService.loadApplicationProperty( MaxNumberOfMethodCallsProperty.class ) ) );
getView( ).getMaxNumberOfMethodCallsTextField( )
.setText( Integer.toString( ivPropertiesService.loadApplicationProperty( MaxNumberOfMethodCallsProperty.class ) ) );
getView( ).getCaseSensitive( ).setSelected( ivPropertiesService.loadApplicationProperty( CaseSensitiveProperty.class ) );
getView( ).getPercentageCalculation( ).setSelected( ivPropertiesService.loadApplicationProperty( PercentCalculationProperty.class ) );
getView( ).getTimestamps( ).getSelectionModel( ).select( ivPropertiesService.loadApplicationProperty( TimestampProperty.class ) );
......@@ -123,7 +123,8 @@ public class SettingsDialogController extends AbstractController<SettingsDialogV
ivPropertiesService.saveApplicationProperty( MethodCallAggregationProperty.class, getView( ).getTypeOfMethodAggregation( ).getValue( ) );
ivPropertiesService.saveApplicationProperty( MethodCallThresholdProperty.class, Float.parseFloat( getView( ).getThresholdTextField( ).getText( ) ) );
ivPropertiesService.saveApplicationProperty( MaxNumberOfMethodCallsProperty.class, Integer.parseInt( getView( ).getMaxNumberOfMethodCallsTextField( ).getText( ) ) );
ivPropertiesService.saveApplicationProperty( MaxNumberOfMethodCallsProperty.class,
Integer.parseInt( getView( ).getMaxNumberOfMethodCallsTextField( ).getText( ) ) );
ivPropertiesService.saveApplicationProperty( CaseSensitiveProperty.class, getView( ).getCaseSensitive( ).isSelected( ) );
ivPropertiesService.saveApplicationProperty( PercentCalculationProperty.class, getView( ).getPercentageCalculation( ).isSelected( ) );
......@@ -155,13 +156,4 @@ public class SettingsDialogController extends AbstractController<SettingsDialogV
}
}
/**
* The action which is performed when the user presses a key.
*/
public void performOnKeyPressed( final KeyEvent aKeyEvent ) {
if ( aKeyEvent.getCode( ) == KeyCode.ESCAPE ) {
closeDialog( );
}
}
}
......@@ -2,7 +2,7 @@
<?import javafx.scene.layout.*?>
<?import javafx.scene.control.cell.*?>
<VBox xmlns:fx="http://javafx.com/fxml" fx:id="ivView" onKeyPressed="#performOnKeyPressed">
<VBox xmlns:fx="http://javafx.com/fxml" fx:id="ivView">
<spacing>10</spacing>
......@@ -19,7 +19,7 @@
<javafx.geometry.Insets right="10" />
</VBox.margin>
<buttons>
<Button text="%ok" onAction="#performCloseDialog" id="ivOkay" />
<Button text="%ok" onAction="#performCloseDialog" id="ivOkay" defaultButton="true" cancelButton="true" />
</buttons>
</ButtonBar>
......
......@@ -5,7 +5,7 @@
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.text.TextFlow?>
<VBox xmlns:fx="http://javafx.com/fxml" fx:id="ivView" AnchorPane.bottomAnchor="0.0" AnchorPane.topAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" onKeyPressed="#performOnKeyPressed">
<VBox xmlns:fx="http://javafx.com/fxml" fx:id="ivView" AnchorPane.bottomAnchor="0.0" AnchorPane.topAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">
<spacing>10</spacing>
......@@ -33,7 +33,7 @@
<javafx.geometry.Insets right="10" />
</VBox.margin>
<buttons>
<Button text="%ok" onAction="#performCloseDialog" id="okay" />
<Button text="%ok" onAction="#performCloseDialog" id="okay" defaultButton="true" cancelButton="true" />
</buttons>
</ButtonBar>
......
......@@ -6,6 +6,8 @@
<?import javafx.scene.control.Separator?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.TabPane?>
<?import javafx.scene.control.Tab?>
<VBox fx:id="ivView" xmlns:fx="http://javafx.com/fxml">
......
......@@ -5,7 +5,7 @@
<?import javafx.scene.control.TextField?>
<?import kieker.diagnosis.application.gui.components.converter.*?>
<VBox fx:id="ivView" xmlns:fx="http://javafx.com/fxml" onKeyPressed="#performOnKeyPressed">
<VBox fx:id="ivView" xmlns:fx="http://javafx.com/fxml">
<spacing>10</spacing>
......@@ -82,8 +82,8 @@
<javafx.geometry.Insets right="10" />
</VBox.margin>
<buttons>
<Button text="%ok" onAction="#saveAndCloseDialog" id="ivOkay" />
<Button text="%cancel" onAction="#closeDialog" id="ivCancel" />
<Button text="%ok" onAction="#saveAndCloseDialog" id="ivOkay" defaultButton="true" />
<Button text="%cancel" onAction="#closeDialog" id="ivCancel" cancelButton="true" />
</buttons>
</ButtonBar>
......
......@@ -4,6 +4,7 @@
<?import jfxtras.scene.control.*?>
<?import kieker.diagnosis.application.gui.components.treetable.*?>
<GridPane fx:id="view" xmlns:fx="http://javafx.com/fxml"
AnchorPane.bottomAnchor="0.0" AnchorPane.topAnchor="0.0"
AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">
......
......@@ -16,26 +16,27 @@
package kieker.diagnosis.architecture.gui;
import kieker.diagnosis.architecture.gui.components.AutowireCandidate;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanInitializationException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import org.springframework.stereotype.Component;
import javafx.scene.Node;
import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.TitledPane;
import javafx.scene.control.TreeTableColumn;
import javafx.scene.control.TreeTableView;
import javafx.scene.layout.Pane;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanInitializationException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import org.springframework.stereotype.Component;
import kieker.diagnosis.architecture.gui.components.AutowireCandidate;
/**
* @author Nils Christian Ehmke
......@@ -96,6 +97,10 @@ final class ViewInitializer {
candidates.add( tableColumn.getCellFactory( ) );
candidates.add( tableColumn.getCellValueFactory( ) );
}
} else if ( aNode instanceof TabPane ) {
for ( final Tab tab : ( (TabPane) aNode ).getTabs( ) ) {
candidates.add( findAutowireCandidates( tab.getContent( ) ) );
}
}
candidates = candidates.stream( ).filter( o -> ( o instanceof AutowireCandidate ) ).collect( Collectors.toList( ) );
......
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