@@ -0,0 +1,2241 @@
+import java.awt.event.ActionListener;%0A%0Aimport javax.swing.Timer;%0A%0A%0A/**%0A * %0A * PauseTimer extends the javax.swing.Timer class. It adds a String variable to%0A * denote the type of input this timer will be used to regulate, along with a%0A * series of static, final String variables that are used to set the type variable.%0A * %0A * When using a regular swing timer to get input from a gamepad and translate that%0A * into mouse and keyboard input, what was meant to only be a single input can become%0A * multiple inputs, i.e., pressing a button once to print the character 'a' may sometimes%0A * print 'aa', and this is not as easy to address as simply changing the timer delay.%0A * %0A * This class is used to temporarily %22turn off%22 an input timer for a few ms after it is%0A * pressed to ensure that what was meant to be a single input doesn't get doubled.%0A * %0A * @author Steven Raines%0A *%0A */%0Apublic class PauseTimer extends Timer %7B%0A%09public static final String BUTTON_TYPE = %22button%22;%0A%09public static final String STICK_BUTTON_TYPE = %22stick%22;%0A%09public static final String D_PAD_TYPE = %22dPad%22;%0A%09public static final String TRIGGER_TYPE = %22trigger%22;%0A%09private String type;%0A%09%0A%0A%09/**%0A%09 * The default swing timer super constructor.%0A%09 * %0A%09 * @param delay The delay interval for the timer.%0A%09 * @param listener The ActionListener that will watch for events generated by this timer.%0A%09 */%0A%09public PauseTimer(int delay, ActionListener listener) %7B%0A%09%09super(delay, listener);%0A%09%7D%0A%09%0A%09%0A%09/**%0A%09 * Specifies a delay, an action listener, and the type of input this timer will regulate.%0A%09 * %0A%09 * @param delay The delay interval for the timer.%0A%09 * @param listener The ActionListener that will watch for events generated by this timer.%0A%09 * @param type The type of input this timer will regulate.%0A%09 */%0A%09public PauseTimer(int delay, ActionListener listener, String type) %7B%0A%09%09super(delay, listener);%0A%09%09this.type = type;%0A%09%7D%0A%09%0A%09%0A%09/**%0A%09 * Mutator for the String type variable.%0A%09 * %0A%09 * @param type The value to specify the type of input this timer will regulate.%0A%09 */%0A%09public void setType(String type) %7B%0A%09%09this.type = type;%0A%09%7D%0A%09%0A%09%0A%09/**%0A%09 * Accessor for the String type variable.%0A%09 * %0A%09 * @return The type of input this timer will regulate.%0A%09 */%0A%09public String getType() %7B%0A%09%09return type;%0A%09%7D%0A%7D%0A

Create PauseTimer.java