src/pendulum/view/ExperimentLayoutController.java
/**
     * Event handler for the Node Animation ToggleButton
     */
Event handler for the Node Animation ToggleButton
Event handler for the Node Animation ToggleButton
@SuppressWarnings ("UnnecessaryReturnStatement")
    public void handleAnimateNode ()
    {
	boolean isNodeSelected = nodeToggleButton.isSelected ();
	double length = view.getController ().getModel ().getStringLength ();
	double acceleration = view.getController ().getModel ().getGravityAcceleration ();
	double angle = Model.convertDegreeToRadian (view.getController ().getModel ().getAngle ());
	double mass = view.getController ().getModel ().getMass ();
	if (isNodeSelected)
	{
	    nodePendulum = new NodeDrawThread (length, acceleration, angle, mass, pendulumBall, pendulumString);
	    nodePendulum.start ();
	    logger.info ("Node Animation started...");
	}
	else
	{
	    nodePendulum.interrupt ();
	    logger.info ("Node Animation stopped...");
	}
	logger.debug ("Length: " + length);
	logger.debug ("Acceleration: " + acceleration);
	logger.debug ("Angle: " + angle);
	logger.debug ("Mass: " + mass);
	return;
    }
@ SuppressWarnings ( "UnnecessaryReturnStatement" ) public void handleAnimateNode ( ) { boolean isNodeSelected = nodeToggleButton . isSelected ( ) ; double length = view . getController ( ) . getModel ( ) . getStringLength ( ) ; double acceleration = view . getController ( ) . getModel ( ) . getGravityAcceleration ( ) ; double angle = Model . convertDegreeToRadian ( view . getController ( ) . getModel ( ) . getAngle ( ) ) ; double mass = view . getController ( ) . getModel ( ) . getMass ( ) ; if ( isNodeSelected ) { nodePendulum = new NodeDrawThread ( length , acceleration , angle , mass , pendulumBall , pendulumString ) ; nodePendulum . start ( ) ; logger . info ( "Node Animation started..." ) ; } else { nodePendulum . interrupt ( ) ; logger . info ( "Node Animation stopped..." ) ; } logger . debug ( "Length: " + length ) ; logger . debug ( "Acceleration: " + acceleration ) ; logger . debug ( "Angle: " + angle ) ; logger . debug ( "Mass: " + mass ) ; return ; }
Event handler for the Node Animation ToggleButton
Event handler for the Node Animation ToggleButton
// Start animation // Stop animation