src/pendulum/view/ExperimentLayoutController.java
/**
     * Private method responsible for Property saving.
     *
     * @return the saved Property containing fields related to the pendulum.
     */
Private method responsible for Property saving.
@return the saved Property containing fields related to the pendulum.
Private method responsible for Property saving . @return the saved Property containing fields related to the pendulum .
private Properties backupProperties ()
    {
	Properties pendulumProperties = new Properties ();
	NumberFormat numberFormat = NumberFormat.getInstance (Locale.forLanguageTag ("hu-HU"));
	Number stringLengthNumber = null;
	Number gravityAccelerationNumber = null;
	Number angleNumber = null;
	Number massNumber = null;
	double stringLengthValue = 0;
	double gravityAccelerationValue = 0;
	double angleValue = 0;
	double massValue = 0;
	try
	{
	    stringLengthNumber = numberFormat.parse (getStringLengthTextField ().getText ());
	    stringLengthValue = stringLengthNumber.doubleValue ();
	    gravityAccelerationNumber = numberFormat.parse (getGravityAccelerationTextField ().getText ());
	    gravityAccelerationValue = gravityAccelerationNumber.doubleValue ();
	    angleNumber = numberFormat.parse (getAngleTextField ().getText ());
	    angleValue = angleNumber.doubleValue ();
	    massNumber = numberFormat.parse (getMassTextField ().getText ());
	    massValue = massNumber.doubleValue ();
	}
	catch (ParseException pe)
	{
	    String stringLengthTransformed = stringLengthTextField.getText ().replaceAll (",", ".");
	    String gravityAccelerationTransformed = gravityAccelerationTextField.getText ().replaceAll (",", ".");
	    String angleTransformed = angleTextField.getText ().replaceAll (",", ".");
	    String massTransformed = massTextField.getText ().replaceAll (",", ".");
	    stringLengthValue = Double.parseDouble (stringLengthTransformed);
	    gravityAccelerationValue = Double.parseDouble (gravityAccelerationTransformed);
	    angleValue = Double.parseDouble (angleTransformed);
	    massValue = Double.parseDouble (massTransformed);
	}
	pendulumProperties.setProperty ("length", Double.toString (stringLengthValue));
	pendulumProperties.setProperty ("acceleration", Double.toString (gravityAccelerationValue));
	pendulumProperties.setProperty ("angle", Double.toString (angleValue));
	pendulumProperties.setProperty ("mass", Double.toString (massValue));
	return pendulumProperties;
    }
private Properties backupProperties ( ) { Properties pendulumProperties = new Properties ( ) ; NumberFormat numberFormat = NumberFormat . getInstance ( Locale . forLanguageTag ( "hu-HU" ) ) ; Number stringLengthNumber = null ; Number gravityAccelerationNumber = null ; Number angleNumber = null ; Number massNumber = null ; double stringLengthValue = 0 ; double gravityAccelerationValue = 0 ; double angleValue = 0 ; double massValue = 0 ; try { stringLengthNumber = numberFormat . parse ( getStringLengthTextField ( ) . getText ( ) ) ; stringLengthValue = stringLengthNumber . doubleValue ( ) ; gravityAccelerationNumber = numberFormat . parse ( getGravityAccelerationTextField ( ) . getText ( ) ) ; gravityAccelerationValue = gravityAccelerationNumber . doubleValue ( ) ; angleNumber = numberFormat . parse ( getAngleTextField ( ) . getText ( ) ) ; angleValue = angleNumber . doubleValue ( ) ; massNumber = numberFormat . parse ( getMassTextField ( ) . getText ( ) ) ; massValue = massNumber . doubleValue ( ) ; } catch ( ParseException pe ) { String stringLengthTransformed = stringLengthTextField . getText ( ) . replaceAll ( "," , "." ) ; String gravityAccelerationTransformed = gravityAccelerationTextField . getText ( ) . replaceAll ( "," , "." ) ; String angleTransformed = angleTextField . getText ( ) . replaceAll ( "," , "." ) ; String massTransformed = massTextField . getText ( ) . replaceAll ( "," , "." ) ; stringLengthValue = Double . parseDouble ( stringLengthTransformed ) ; gravityAccelerationValue = Double . parseDouble ( gravityAccelerationTransformed ) ; angleValue = Double . parseDouble ( angleTransformed ) ; massValue = Double . parseDouble ( massTransformed ) ; } pendulumProperties . setProperty ( "length" , Double . toString ( stringLengthValue ) ) ; pendulumProperties . setProperty ( "acceleration" , Double . toString ( gravityAccelerationValue ) ) ; pendulumProperties . setProperty ( "angle" , Double . toString ( angleValue ) ) ; pendulumProperties . setProperty ( "mass" , Double . toString ( massValue ) ) ; return pendulumProperties ; }
Private method responsible for Property saving.
Private method responsible for Property saving .