private void btnRestore_Click(object sender, EventArgs e)
{
// Get the saved algorithm parameters from the diagram class
TranslateTree newAlgo = GetSavedAlgo();
if (newAlgo == null)
newAlgo = new TranslateTree(); // otherwise revert to default algorithm parameters
// get the values and set the edit boxes
txtXTrans.Text = newAlgo.TranslationFactorX.ToString();
txtYTrans.Text = newAlgo.TranslationFactorY.ToString();
}