// Path: src/org/jergometer/translation/I18n.java
// public class I18n {
//   @NonNls
//   public static final ResourceBundle bundle = Utf8ResourceBundle.getBundle("org.jergometer.translation.jergometer");
// 
//   public static String getString(@PropertyKey(resourceBundle = "org.jergometer.translation.jergometer") String key, Object... params) {
//     String value = bundle.getString(key);
//     if (params.length == 0) {
//       return value;
//     } else {
//       return String.format(value, params);
//     }
//   }
// 
//   public static char getMnemonic(@PropertyKey(resourceBundle = "org.jergometer.translation.jergometer") String key) {
//     String value = getString(key);
//     if (value == null) {
//       return '!';
//     }
//     return value.charAt(0);
//   }
// }


import org.jergometer.translation.I18n;
import javax.swing.*;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.awt.*;
import java.util.Enumeration;
import gnu.io.SerialPort;
import gnu.io.CommPortIdentifier;
import gnu.io.PortInUseException;
import gnu.io.UnsupportedCommOperationException;
	}

	public void close() throws IOException {
		// stop reader and writer
		if(reader != null) {
			reader.close();
			reader = null;
		}
		if(writer != null) {
			writer = null;
		}

		// close streams and socket
		if(serialPort != null) {
			serialPort.getOutputStream().close();
			serialPort.getInputStream().close();
			serialPort.removeEventListener();
			serialPort.close();
		}
	}

	/**
	 * Tests the connection and returns the ergometer id in case of success.
	 *
	 * @return ergometer id in case of success
	 */
	public String test() {
		// start connection
		this.start();

// Path: src/org/jergometer/translation/I18n.java
// public class I18n {
//   @NonNls
//   public static final ResourceBundle bundle = Utf8ResourceBundle.getBundle("org.jergometer.translation.jergometer");
// 
//   public static String getString(@PropertyKey(resourceBundle = "org.jergometer.translation.jergometer") String key, Object... params) {
//     String value = bundle.getString(key);
//     if (params.length == 0) {
//       return value;
//     } else {
//       return String.format(value, params);
//     }
//   }
// 
//   public static char getMnemonic(@PropertyKey(resourceBundle = "org.jergometer.translation.jergometer") String key) {
//     String value = getString(key);
//     if (value == null) {
//       return '!';
//     }
//     return value.charAt(0);
//   }
// }


// Path: src/org/jergometer/communication/BikeConnectionTester.java
import org.jergometer.translation.I18n;
import javax.swing.*;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.awt.*;
import java.util.Enumeration;
import gnu.io.SerialPort;
import gnu.io.CommPortIdentifier;
import gnu.io.PortInUseException;
import gnu.io.UnsupportedCommOperationException;

	}

	public void close() throws IOException {
		// stop reader and writer
		if(reader != null) {
			reader.close();
			reader = null;
		}
		if(writer != null) {
			writer = null;
		}

		// close streams and socket
		if(serialPort != null) {
			serialPort.getOutputStream().close();
			serialPort.getInputStream().close();
			serialPort.removeEventListener();
			serialPort.close();
		}
	}

	/**
	 * Tests the connection and returns the ergometer id in case of success.
	 *
	 * @return ergometer id in case of success
	 */
	public String test() {
		// start connection
		this.start();

		pm = new ProgressMonitor(owner, I18n.getString("connection_tester.testing_connection_to_ergometer"), "", 0, 100);