De Selector generiek gemaakt en een instantie ApplicationSelector toegevoegd. Hierbij komen twee problemen kijken:...
This commit is contained in:
@@ -17,7 +17,7 @@ package de.hardcode.jxinput;
|
|||||||
* provides a basis for other interfaces.
|
* provides a basis for other interfaces.
|
||||||
*
|
*
|
||||||
* @see Axis
|
* @see Axis
|
||||||
* @see Button
|
* @see SelectButton
|
||||||
* @see Directional
|
* @see Directional
|
||||||
*
|
*
|
||||||
* @author Herkules
|
* @author Herkules
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import java.awt.event.KeyEvent;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Associates a keycode with a Button and handles the current state of that button.
|
* Associates a keycode with a SelectButton and handles the current state of that button.
|
||||||
*
|
*
|
||||||
* @author Herkules
|
* @author Herkules
|
||||||
*/
|
*/
|
||||||
@@ -48,7 +48,7 @@ class KeyButton
|
|||||||
|
|
||||||
//*********************************************************************************************
|
//*********************************************************************************************
|
||||||
//
|
//
|
||||||
// Implement Button
|
// Implement SelectButton
|
||||||
//
|
//
|
||||||
//*********************************************************************************************
|
//*********************************************************************************************
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public class ButtonListener implements JXInputButtonEventListener
|
|||||||
|
|
||||||
public void changed( JXInputButtonEvent ev )
|
public void changed( JXInputButtonEvent ev )
|
||||||
{
|
{
|
||||||
System.out.println( "Button " + ev.getButton().getName() + " changed : state=" + ev.getButton().getState() );
|
System.out.println( "SelectButton " + ev.getButton().getName() + " changed : state=" + ev.getButton().getState() );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ public class VirtualAxis
|
|||||||
public final void setIncreaseButton( Button b )
|
public final void setIncreaseButton( Button b )
|
||||||
{
|
{
|
||||||
if ( null == b )
|
if ( null == b )
|
||||||
throw new InvalidParameterException( "Button may not be null!" );
|
throw new InvalidParameterException( "SelectButton may not be null!" );
|
||||||
|
|
||||||
mButtonIncrease = b;
|
mButtonIncrease = b;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ public class WiimoteWiigee extends Wiigee {
|
|||||||
/**
|
/**
|
||||||
* Sets the Trainbutton for all wiimotes;
|
* Sets the Trainbutton for all wiimotes;
|
||||||
*
|
*
|
||||||
* @param b Button encoding, see static Wiimote values
|
* @param b SelectButton encoding, see static Wiimote values
|
||||||
*/
|
*/
|
||||||
public void setTrainButton(int b) {
|
public void setTrainButton(int b) {
|
||||||
for (int i = 0; i < this.devices.size(); i++) {
|
for (int i = 0; i < this.devices.size(); i++) {
|
||||||
@@ -171,7 +171,7 @@ public class WiimoteWiigee extends Wiigee {
|
|||||||
/**
|
/**
|
||||||
* Sets the Recognitionbutton for all wiimotes;
|
* Sets the Recognitionbutton for all wiimotes;
|
||||||
*
|
*
|
||||||
* @param b Button encoding, see static Wiimote values
|
* @param b SelectButton encoding, see static Wiimote values
|
||||||
*/
|
*/
|
||||||
public void setRecognitionButton(int b) {
|
public void setRecognitionButton(int b) {
|
||||||
for (int i = 0; i < this.devices.size(); i++) {
|
for (int i = 0; i < this.devices.size(); i++) {
|
||||||
@@ -182,7 +182,7 @@ public class WiimoteWiigee extends Wiigee {
|
|||||||
/**
|
/**
|
||||||
* Sets the CloseGesturebutton for all wiimotes;
|
* Sets the CloseGesturebutton for all wiimotes;
|
||||||
*
|
*
|
||||||
* @param b Button encoding, see static Wiimote values
|
* @param b SelectButton encoding, see static Wiimote values
|
||||||
*/
|
*/
|
||||||
public void setCloseGestureButton(int b) {
|
public void setCloseGestureButton(int b) {
|
||||||
for (int i = 0; i < this.devices.size(); i++) {
|
for (int i = 0; i < this.devices.size(); i++) {
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ public class Device {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a ButtonListener to the Device. Everytime a Button has been
|
* Adds a ButtonListener to the Device. Everytime a SelectButton has been
|
||||||
* pressed or released, the Listener would be notified about this via
|
* pressed or released, the Listener would be notified about this via
|
||||||
* the corresponding Events.
|
* the corresponding Events.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public class WiimoteStreamer extends Thread {
|
|||||||
if((b[1] & 0xFF) == 0x31) {
|
if((b[1] & 0xFF) == 0x31) {
|
||||||
this.handleButtonData(new byte[] { b[2], b[3] });
|
this.handleButtonData(new byte[] { b[2], b[3] });
|
||||||
this.handleAccelerationData(new byte[] { b[4], b[5], b[6] });
|
this.handleAccelerationData(new byte[] { b[4], b[5], b[6] });
|
||||||
//Log.write("0x31: Button + Acc");
|
//Log.write("0x31: SelectButton + Acc");
|
||||||
}
|
}
|
||||||
else if ((b[1] & 0xFF) == 0x33) {
|
else if ((b[1] & 0xFF) == 0x33) {
|
||||||
this.handleButtonData(new byte[] { b[2], b[3] });
|
this.handleButtonData(new byte[] { b[2], b[3] });
|
||||||
@@ -90,7 +90,7 @@ public class WiimoteStreamer extends Thread {
|
|||||||
b[10], b[11], b[12],
|
b[10], b[11], b[12],
|
||||||
b[13], b[14], b[15],
|
b[13], b[14], b[15],
|
||||||
b[16], b[17], b[18]});
|
b[16], b[17], b[18]});
|
||||||
//Log.write("0x33: Button + Acc + Irda");
|
//Log.write("0x33: SelectButton + Acc + Irda");
|
||||||
}
|
}
|
||||||
else if ((b[1] & 0xFF) == 0x37) {
|
else if ((b[1] & 0xFF) == 0x37) {
|
||||||
this.handleButtonData(new byte[] { b[2], b[3] });
|
this.handleButtonData(new byte[] { b[2], b[3] });
|
||||||
@@ -100,7 +100,7 @@ public class WiimoteStreamer extends Thread {
|
|||||||
b[13], b[14], b[15], b[16]});
|
b[13], b[14], b[15], b[16]});
|
||||||
this.handleWiiMotionPlusData(
|
this.handleWiiMotionPlusData(
|
||||||
new byte[]{b[17], b[18], b[19], b[20], b[21], b[22]});
|
new byte[]{b[17], b[18], b[19], b[20], b[21], b[22]});
|
||||||
//Log.write("0x37: Button + Acc + Ext");
|
//Log.write("0x37: SelectButton + Acc + Ext");
|
||||||
}
|
}
|
||||||
else if ((b[1] & 0xFF) == 0x21) {
|
else if ((b[1] & 0xFF) == 0x21) {
|
||||||
this.handleButtonData(new byte[] { b[2], b[3] });
|
this.handleButtonData(new byte[] { b[2], b[3] });
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class ButtonPressedEvent extends ActionStartEvent {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a WiimoteButtonPressedEvent with the Wiimote source whose
|
* Create a WiimoteButtonPressedEvent with the Wiimote source whose
|
||||||
* Button has been pressed and the integer representation of the button.
|
* SelectButton has been pressed and the integer representation of the button.
|
||||||
*
|
*
|
||||||
* @param source
|
* @param source
|
||||||
* @param button
|
* @param button
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ package pm;
|
|||||||
import pm.event.EventHandler;
|
import pm.event.EventHandler;
|
||||||
import pm.exception.application.ApplicationExitException;
|
import pm.exception.application.ApplicationExitException;
|
||||||
import pm.exception.application.ApplicationInitialiseException;
|
import pm.exception.application.ApplicationInitialiseException;
|
||||||
|
import pm.selector.Selectable;
|
||||||
|
|
||||||
public abstract class Application extends EventHandler {
|
public abstract class Application extends EventHandler implements Selectable {
|
||||||
public void initialise() throws ApplicationInitialiseException {}
|
public void initialise() throws ApplicationInitialiseException {}
|
||||||
|
|
||||||
public void exit() throws ApplicationExitException {
|
public void exit() throws ApplicationExitException {
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
package pm;
|
|
||||||
|
|
||||||
import java.awt.event.ItemEvent;
|
|
||||||
import java.awt.event.ItemListener;
|
|
||||||
|
|
||||||
import javax.swing.JToggleButton;
|
|
||||||
|
|
||||||
public class ApplicationButton extends JToggleButton implements ItemListener {
|
|
||||||
protected Application application;
|
|
||||||
|
|
||||||
public ApplicationButton(Application application) {
|
|
||||||
this.application = application;
|
|
||||||
addItemListener(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void itemStateChanged(ItemEvent itemEvent) {
|
|
||||||
int state = itemEvent.getStateChange();
|
|
||||||
if (state == ItemEvent.SELECTED) {
|
|
||||||
System.out.println("Selected");
|
|
||||||
} else {
|
|
||||||
System.out.println("Deselected");
|
|
||||||
}
|
|
||||||
//System.out.println(itemEvent.getSource());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
package pm;
|
|
||||||
|
|
||||||
import java.awt.GridLayout;
|
|
||||||
import javax.swing.JFrame;
|
|
||||||
import javax.swing.JPanel;
|
|
||||||
import javax.swing.JToggleButton;
|
|
||||||
import pm.util.ArrayCycle;
|
|
||||||
|
|
||||||
public class ApplicationSelector extends JFrame {
|
|
||||||
protected static final long serialVersionUID = 1L;
|
|
||||||
protected final static String TITLE = "MIMIS Application Selector";
|
|
||||||
|
|
||||||
protected ArrayCycle<Application> applicationCycle;
|
|
||||||
|
|
||||||
protected JToggleButton gomPlayer;
|
|
||||||
protected JToggleButton windowsMediaPlayer;
|
|
||||||
protected JToggleButton iTunes;
|
|
||||||
protected JToggleButton mediaPlayerClassic;
|
|
||||||
protected JToggleButton vlc;
|
|
||||||
protected JToggleButton winamp;
|
|
||||||
|
|
||||||
protected JToggleButton[] applicationButtons = {gomPlayer, windowsMediaPlayer, iTunes, mediaPlayerClassic, vlc, winamp};
|
|
||||||
protected String[] applicationNames = {"GOM Player", "Windows Media Player", "iTunes", "Media Player Classic", "VLC", "Winamp"};
|
|
||||||
|
|
||||||
public ApplicationSelector(ArrayCycle<Application> applicationCycle) {
|
|
||||||
super(TITLE);
|
|
||||||
System.out.println("Application Selector started");
|
|
||||||
this.applicationCycle = applicationCycle;
|
|
||||||
createButtons();
|
|
||||||
layoutButtons();
|
|
||||||
pack();
|
|
||||||
setResizable(false);
|
|
||||||
setVisible(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void createButtons() {
|
|
||||||
for (int i = 0; i < applicationButtons.length; i++) {
|
|
||||||
try {
|
|
||||||
String applicationName = applicationNames[i];
|
|
||||||
Application application = null;
|
|
||||||
applicationButtons[i] = new ApplicationButton(application);
|
|
||||||
applicationButtons[i].setText(applicationName);
|
|
||||||
Class.forName(applicationName).newInstance();
|
|
||||||
|
|
||||||
System.out.println("App added");
|
|
||||||
} catch (ClassNotFoundException e) {e.printStackTrace();
|
|
||||||
} catch (InstantiationException e) {e.printStackTrace();
|
|
||||||
} catch (IllegalAccessException e) {e.printStackTrace();}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void layoutButtons() {
|
|
||||||
JPanel applicationPanel = new JPanel(new GridLayout(0, 1));
|
|
||||||
for (int i = 0; i < applicationButtons.length; i++) {
|
|
||||||
System.out.println(applicationButtons[i]);
|
|
||||||
applicationPanel.add(applicationButtons[i]);
|
|
||||||
}
|
|
||||||
add(applicationPanel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,6 +5,8 @@ import pm.exception.device.DeviceInitialiseException;
|
|||||||
import pm.exception.event.spreader.NetworkSpreaderException;
|
import pm.exception.event.spreader.NetworkSpreaderException;
|
||||||
|
|
||||||
public class Client extends Manager {
|
public class Client extends Manager {
|
||||||
|
public static final String TITLE = "Client";
|
||||||
|
|
||||||
public static final String IP = "192.168.1.100";
|
public static final String IP = "192.168.1.100";
|
||||||
public static final int PORT = 6789;
|
public static final int PORT = 6789;
|
||||||
|
|
||||||
@@ -31,4 +33,8 @@ public class Client extends Manager {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String title() {
|
||||||
|
return TITLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,29 @@
|
|||||||
package pm;
|
package pm;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import pm.application.cmd.windows.gomplayer.GomPlayerApplication;
|
||||||
|
import pm.application.cmd.windows.wmp.WMPApplication;
|
||||||
|
import pm.application.itunes.iTunesApplication;
|
||||||
|
import pm.application.mpc.MPCApplication;
|
||||||
|
import pm.application.vlc.VLCApplication;
|
||||||
|
import pm.application.winamp.WinampApplication;
|
||||||
import pm.event.spreader.LocalSpreader;
|
import pm.event.spreader.LocalSpreader;
|
||||||
import pm.exception.application.ApplicationExitException;
|
|
||||||
import pm.exception.application.ApplicationInitialiseException;
|
|
||||||
import pm.exception.device.DeviceInitialiseException;
|
import pm.exception.device.DeviceInitialiseException;
|
||||||
|
import pm.selector.ApplicationSelector;
|
||||||
import pm.util.ArrayCycle;
|
import pm.util.ArrayCycle;
|
||||||
import pm.value.Action;
|
import pm.value.Action;
|
||||||
|
|
||||||
public class Main extends Manager {
|
public class Main extends Manager {
|
||||||
|
public static final String TITLE = "Mimis Main";
|
||||||
|
|
||||||
protected ArrayCycle<Application> applicationCycle;
|
protected ArrayCycle<Application> applicationCycle;
|
||||||
protected ApplicationSelector applicationSelector;
|
protected ApplicationSelector applicationSelector;
|
||||||
|
|
||||||
public Main() {
|
public Main() {
|
||||||
super(new LocalSpreader());
|
super(new LocalSpreader());
|
||||||
applicationCycle = new ArrayCycle<Application>();
|
applicationCycle = new ArrayCycle<Application>();
|
||||||
|
addApplications();
|
||||||
applicationSelector = new ApplicationSelector(applicationCycle);
|
applicationSelector = new ApplicationSelector(applicationCycle);
|
||||||
|
eventSpreader.set(applicationCycle.current());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void action(Action action) {
|
protected void action(Action action) {
|
||||||
@@ -48,6 +55,15 @@ public class Main extends Manager {
|
|||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void addApplications() {
|
||||||
|
applicationCycle.add(new GomPlayerApplication());
|
||||||
|
applicationCycle.add(new WMPApplication());
|
||||||
|
applicationCycle.add(new iTunesApplication());
|
||||||
|
applicationCycle.add(new MPCApplication());
|
||||||
|
applicationCycle.add(new VLCApplication());
|
||||||
|
applicationCycle.add(new WinampApplication());
|
||||||
|
}
|
||||||
|
|
||||||
/*protected void startApplications() {
|
/*protected void startApplications() {
|
||||||
ArrayList<Application> removeList = new ArrayList<Application>();
|
ArrayList<Application> removeList = new ArrayList<Application>();
|
||||||
for (Application application : applicationCycle) {
|
for (Application application : applicationCycle) {
|
||||||
@@ -94,4 +110,8 @@ public class Main extends Manager {
|
|||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
new Main().start();
|
new Main().start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String title() {
|
||||||
|
return TITLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
19
java/src/pm/Test.java
Normal file
19
java/src/pm/Test.java
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
package pm;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.Enumeration;
|
||||||
|
|
||||||
|
public class Test {
|
||||||
|
|
||||||
|
public void start() throws IOException {
|
||||||
|
Class<Application> application = Application.class;
|
||||||
|
Class<?> test = application.getEnclosingClass();
|
||||||
|
System.out.println(test);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] argv) throws IOException {
|
||||||
|
new Test().start(); }
|
||||||
|
|
||||||
|
}
|
||||||
@@ -7,7 +7,7 @@ import pm.exception.application.ApplicationExitException;
|
|||||||
import pm.exception.application.ApplicationInitialiseException;
|
import pm.exception.application.ApplicationInitialiseException;
|
||||||
import pm.util.Native;
|
import pm.util.Native;
|
||||||
|
|
||||||
public class CMDApplication extends Application {
|
public abstract class CMDApplication extends Application {
|
||||||
protected final static String REGISTRY = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths";
|
protected final static String REGISTRY = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths";
|
||||||
|
|
||||||
protected String program;
|
protected String program;
|
||||||
@@ -39,4 +39,6 @@ public class CMDApplication extends Application {
|
|||||||
}
|
}
|
||||||
super.exit();
|
super.exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
abstract public String title();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,4 +35,8 @@ public class GomPlayerApplication extends WindowsApplication {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String title() {
|
||||||
|
return TITLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,4 +49,8 @@ public class WMPApplication extends WindowsApplication {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String title() {
|
||||||
|
return TITLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ import com.dt.iTunesController.iTunes;
|
|||||||
import com.dt.iTunesController.iTunesEventsInterface;
|
import com.dt.iTunesController.iTunesEventsInterface;
|
||||||
|
|
||||||
public class iTunesApplication extends Application implements iTunesEventsInterface {
|
public class iTunesApplication extends Application implements iTunesEventsInterface {
|
||||||
|
protected static final String NAME = "iTunes";
|
||||||
|
|
||||||
protected static final int POSTION_CHANGE_RATE = 1;
|
protected static final int POSTION_CHANGE_RATE = 1;
|
||||||
protected static final int VOLUME_CHANGE_RATE = 5;
|
protected static final int VOLUME_CHANGE_RATE = 5;
|
||||||
protected static final String PLAYLIST_LIKE = "Like";
|
protected static final String PLAYLIST_LIKE = "Like";
|
||||||
@@ -102,4 +104,8 @@ public class iTunesApplication extends Application implements iTunesEventsInterf
|
|||||||
public void onQuittingEvent() {}
|
public void onQuittingEvent() {}
|
||||||
public void onAboutToPromptUserToQuitEvent() {}
|
public void onAboutToPromptUserToQuitEvent() {}
|
||||||
public void onSoundVolumeChangedEvent(int newVolume) {}
|
public void onSoundVolumeChangedEvent(int newVolume) {}
|
||||||
|
|
||||||
|
public String title() {
|
||||||
|
return NAME;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -46,4 +46,8 @@ public class MPCApplication extends WindowsApplication {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String title() {
|
||||||
|
return TITLE;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,4 +100,8 @@ public class VLCApplication extends CMDApplication {
|
|||||||
muted =! muted;
|
muted =! muted;
|
||||||
return muted ? 0 : volume;
|
return muted ? 0 : volume;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String title() {
|
||||||
|
return TITLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import com.qotsa.exception.InvalidParameter;
|
|||||||
import com.qotsa.jni.controller.WinampController;
|
import com.qotsa.jni.controller.WinampController;
|
||||||
|
|
||||||
public class WinampApplication extends Application {
|
public class WinampApplication extends Application {
|
||||||
|
protected static final String TITLE = "Winamp";
|
||||||
|
|
||||||
protected boolean muted;
|
protected boolean muted;
|
||||||
protected int volume;
|
protected int volume;
|
||||||
|
|
||||||
@@ -73,4 +75,8 @@ public class WinampApplication extends Application {
|
|||||||
} catch (InvalidParameter e) {}
|
} catch (InvalidParameter e) {}
|
||||||
muted = !muted;
|
muted = !muted;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String title() {
|
||||||
|
return TITLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,18 +5,18 @@ import pm.Button;
|
|||||||
import pm.exception.button.UnknownButtonException;
|
import pm.exception.button.UnknownButtonException;
|
||||||
|
|
||||||
public enum Extreme3DButton implements Button {
|
public enum Extreme3DButton implements Button {
|
||||||
ONE ("Button 0"),
|
ONE ("SelectButton 0"),
|
||||||
TWO ("Button 1"),
|
TWO ("SelectButton 1"),
|
||||||
THREE ("Button 2"),
|
THREE ("SelectButton 2"),
|
||||||
FOUR ("Button 3"),
|
FOUR ("SelectButton 3"),
|
||||||
FIVE ("Button 4"),
|
FIVE ("SelectButton 4"),
|
||||||
SIX ("Button 5"),
|
SIX ("SelectButton 5"),
|
||||||
SEVEN ("Button 6"),
|
SEVEN ("SelectButton 6"),
|
||||||
EIGHT ("Button 7"),
|
EIGHT ("SelectButton 7"),
|
||||||
NINE ("Button 8"),
|
NINE ("SelectButton 8"),
|
||||||
TEN ("Button 9"),
|
TEN ("SelectButton 9"),
|
||||||
ELEVEN ("Button 10"),
|
ELEVEN ("SelectButton 10"),
|
||||||
TWELVE ("Button 11");
|
TWELVE ("SelectButton 11");
|
||||||
|
|
||||||
protected String code;
|
protected String code;
|
||||||
|
|
||||||
|
|||||||
@@ -5,16 +5,16 @@ import pm.Button;
|
|||||||
import pm.exception.button.UnknownButtonException;
|
import pm.exception.button.UnknownButtonException;
|
||||||
|
|
||||||
public enum RumblepadButton implements Button {
|
public enum RumblepadButton implements Button {
|
||||||
ONE ("Button 0"),
|
ONE ("SelectButton 0"),
|
||||||
TWO ("Button 1"),
|
TWO ("SelectButton 1"),
|
||||||
THREE ("Button 2"),
|
THREE ("SelectButton 2"),
|
||||||
FOUR ("Button 3"),
|
FOUR ("SelectButton 3"),
|
||||||
FIVE ("Button 4"),
|
FIVE ("SelectButton 4"),
|
||||||
SIX ("Button 5"),
|
SIX ("SelectButton 5"),
|
||||||
SEVEN ("Button 6"),
|
SEVEN ("SelectButton 6"),
|
||||||
EIGHT ("Button 7"),
|
EIGHT ("SelectButton 7"),
|
||||||
NINE ("Button 8"),
|
NINE ("SelectButton 8"),
|
||||||
TEN ("Button 9");
|
TEN ("SelectButton 9");
|
||||||
|
|
||||||
protected String code;
|
protected String code;
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,10 @@ package pm.event;
|
|||||||
import pm.Event;
|
import pm.Event;
|
||||||
import pm.event.task.Continuous;
|
import pm.event.task.Continuous;
|
||||||
import pm.exception.InitialiseException;
|
import pm.exception.InitialiseException;
|
||||||
|
import pm.selector.Selectable;
|
||||||
import pm.value.Action;
|
import pm.value.Action;
|
||||||
|
|
||||||
public abstract class EventHandler extends EventListener {
|
public abstract class EventHandler extends EventListener implements Selectable {
|
||||||
protected static EventSpreader eventSpreader;
|
protected static EventSpreader eventSpreader;
|
||||||
|
|
||||||
public static void initialise(EventSpreader eventSpreader) {
|
public static void initialise(EventSpreader eventSpreader) {
|
||||||
|
|||||||
16
java/src/pm/selector/ApplicationSelector.java
Normal file
16
java/src/pm/selector/ApplicationSelector.java
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
package pm.selector;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import pm.Application;
|
||||||
|
|
||||||
|
public class ApplicationSelector extends Selector<Application> {
|
||||||
|
|
||||||
|
protected static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
protected final static String TITLE = "MIMIS Application Selector";
|
||||||
|
|
||||||
|
public ApplicationSelector(ArrayList<Application> items) {
|
||||||
|
super(items);
|
||||||
|
}
|
||||||
|
}
|
||||||
39
java/src/pm/selector/SelectButton.java
Normal file
39
java/src/pm/selector/SelectButton.java
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
package pm.selector;
|
||||||
|
|
||||||
|
import java.awt.event.ItemEvent;
|
||||||
|
import java.awt.event.ItemListener;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import javax.swing.JToggleButton;
|
||||||
|
|
||||||
|
import pm.event.EventHandler;
|
||||||
|
import pm.exception.InitialiseException;
|
||||||
|
|
||||||
|
public class SelectButton<T extends EventHandler> extends JToggleButton implements ItemListener {
|
||||||
|
|
||||||
|
protected static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
protected EventHandler eventHandler;
|
||||||
|
|
||||||
|
public SelectButton(EventHandler eventHandler) {
|
||||||
|
this.eventHandler = eventHandler;
|
||||||
|
addItemListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void itemStateChanged(ItemEvent itemEvent) {
|
||||||
|
int state = itemEvent.getStateChange();
|
||||||
|
if (state == ItemEvent.SELECTED) {
|
||||||
|
System.out.println("Selected");
|
||||||
|
try {
|
||||||
|
eventHandler.initialise();
|
||||||
|
eventHandler.start();
|
||||||
|
} catch (InitialiseException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
System.out.println("Deselected");
|
||||||
|
eventHandler.stop();
|
||||||
|
}
|
||||||
|
//System.out.println(itemEvent.getSource());
|
||||||
|
}
|
||||||
|
}
|
||||||
5
java/src/pm/selector/Selectable.java
Normal file
5
java/src/pm/selector/Selectable.java
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
package pm.selector;
|
||||||
|
|
||||||
|
public interface Selectable {
|
||||||
|
public String title();
|
||||||
|
}
|
||||||
40
java/src/pm/selector/Selector.java
Normal file
40
java/src/pm/selector/Selector.java
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
package pm.selector;
|
||||||
|
|
||||||
|
import java.awt.GridLayout;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import javax.swing.JFrame;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
|
||||||
|
import pm.event.EventHandler;
|
||||||
|
|
||||||
|
public class Selector<T extends EventHandler> extends JFrame {
|
||||||
|
|
||||||
|
protected static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
protected final static String TITLE = "MIMIS <T> Selector";
|
||||||
|
|
||||||
|
private ArrayList<T> items;
|
||||||
|
|
||||||
|
public Selector(ArrayList<T> items) {
|
||||||
|
super(TITLE);
|
||||||
|
this.items = items;
|
||||||
|
System.out.println("Selector started");
|
||||||
|
createPanel();
|
||||||
|
pack();
|
||||||
|
setResizable(false);
|
||||||
|
setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void createPanel() {
|
||||||
|
JPanel panel = new JPanel(new GridLayout(0, 1));
|
||||||
|
for (T t : items) {
|
||||||
|
String name = t.title();
|
||||||
|
SelectButton<T> button = new SelectButton<T>(t);
|
||||||
|
button.setText(name);
|
||||||
|
panel.add(button);
|
||||||
|
System.out.println("Item added");
|
||||||
|
}
|
||||||
|
add(panel);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -56,7 +56,7 @@ public class ClassicControllerButtonsEvent extends ButtonsEvent{
|
|||||||
super(id, buttonsJustPressed, buttonsJustReleased, buttonsHeld);
|
super(id, buttonsJustPressed, buttonsJustReleased, buttonsHeld);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button LEFT */
|
/* SelectButton LEFT */
|
||||||
|
|
||||||
public boolean isButtonLeftJustPressed() {
|
public boolean isButtonLeftJustPressed() {
|
||||||
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_LEFT);
|
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_LEFT);
|
||||||
@@ -74,7 +74,7 @@ public class ClassicControllerButtonsEvent extends ButtonsEvent{
|
|||||||
return isButtonPressed(CLASSIC_CTRL_BUTTON_LEFT);
|
return isButtonPressed(CLASSIC_CTRL_BUTTON_LEFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button RIGHT */
|
/* SelectButton RIGHT */
|
||||||
|
|
||||||
public boolean isButtonRightJustPressed() {
|
public boolean isButtonRightJustPressed() {
|
||||||
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_RIGHT);
|
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_RIGHT);
|
||||||
@@ -92,7 +92,7 @@ public class ClassicControllerButtonsEvent extends ButtonsEvent{
|
|||||||
return isButtonPressed(CLASSIC_CTRL_BUTTON_RIGHT);
|
return isButtonPressed(CLASSIC_CTRL_BUTTON_RIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button UP */
|
/* SelectButton UP */
|
||||||
|
|
||||||
public boolean isButtonUpJustPressed() {
|
public boolean isButtonUpJustPressed() {
|
||||||
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_UP);
|
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_UP);
|
||||||
@@ -110,7 +110,7 @@ public class ClassicControllerButtonsEvent extends ButtonsEvent{
|
|||||||
return isButtonPressed(CLASSIC_CTRL_BUTTON_UP);
|
return isButtonPressed(CLASSIC_CTRL_BUTTON_UP);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button DOWN */
|
/* SelectButton DOWN */
|
||||||
|
|
||||||
public boolean isButtonDownJustPressed() {
|
public boolean isButtonDownJustPressed() {
|
||||||
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_DOWN);
|
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_DOWN);
|
||||||
@@ -128,7 +128,7 @@ public class ClassicControllerButtonsEvent extends ButtonsEvent{
|
|||||||
return isButtonPressed(CLASSIC_CTRL_BUTTON_DOWN);
|
return isButtonPressed(CLASSIC_CTRL_BUTTON_DOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button A */
|
/* SelectButton A */
|
||||||
|
|
||||||
public boolean isButtonAJustPressed() {
|
public boolean isButtonAJustPressed() {
|
||||||
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_A);
|
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_A);
|
||||||
@@ -146,7 +146,7 @@ public class ClassicControllerButtonsEvent extends ButtonsEvent{
|
|||||||
return isButtonPressed(CLASSIC_CTRL_BUTTON_A);
|
return isButtonPressed(CLASSIC_CTRL_BUTTON_A);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button B */
|
/* SelectButton B */
|
||||||
|
|
||||||
public boolean isButtonBJustPressed() {
|
public boolean isButtonBJustPressed() {
|
||||||
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_B);
|
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_B);
|
||||||
@@ -164,7 +164,7 @@ public class ClassicControllerButtonsEvent extends ButtonsEvent{
|
|||||||
return isButtonPressed(CLASSIC_CTRL_BUTTON_B);
|
return isButtonPressed(CLASSIC_CTRL_BUTTON_B);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button X */
|
/* SelectButton X */
|
||||||
|
|
||||||
public boolean isButtonXJustPressed() {
|
public boolean isButtonXJustPressed() {
|
||||||
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_X);
|
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_X);
|
||||||
@@ -182,7 +182,7 @@ public class ClassicControllerButtonsEvent extends ButtonsEvent{
|
|||||||
return isButtonPressed(CLASSIC_CTRL_BUTTON_X);
|
return isButtonPressed(CLASSIC_CTRL_BUTTON_X);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button Y */
|
/* SelectButton Y */
|
||||||
|
|
||||||
public boolean isButtonYJustPressed() {
|
public boolean isButtonYJustPressed() {
|
||||||
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_Y);
|
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_Y);
|
||||||
@@ -200,7 +200,7 @@ public class ClassicControllerButtonsEvent extends ButtonsEvent{
|
|||||||
return isButtonPressed(CLASSIC_CTRL_BUTTON_Y);
|
return isButtonPressed(CLASSIC_CTRL_BUTTON_Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button FullLeft */
|
/* SelectButton FullLeft */
|
||||||
|
|
||||||
public boolean isButtonFullLeftJustPressed() {
|
public boolean isButtonFullLeftJustPressed() {
|
||||||
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_FULL_L);
|
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_FULL_L);
|
||||||
@@ -218,7 +218,7 @@ public class ClassicControllerButtonsEvent extends ButtonsEvent{
|
|||||||
return isButtonPressed(CLASSIC_CTRL_BUTTON_FULL_L);
|
return isButtonPressed(CLASSIC_CTRL_BUTTON_FULL_L);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button FullRight */
|
/* SelectButton FullRight */
|
||||||
|
|
||||||
public boolean isButtonFullRightJustPressed() {
|
public boolean isButtonFullRightJustPressed() {
|
||||||
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_FULL_R);
|
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_FULL_R);
|
||||||
@@ -236,7 +236,7 @@ public class ClassicControllerButtonsEvent extends ButtonsEvent{
|
|||||||
return isButtonPressed(CLASSIC_CTRL_BUTTON_FULL_R);
|
return isButtonPressed(CLASSIC_CTRL_BUTTON_FULL_R);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button Home */
|
/* SelectButton Home */
|
||||||
|
|
||||||
public boolean isButtonHomeJustPressed() {
|
public boolean isButtonHomeJustPressed() {
|
||||||
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_HOME);
|
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_HOME);
|
||||||
@@ -254,7 +254,7 @@ public class ClassicControllerButtonsEvent extends ButtonsEvent{
|
|||||||
return isButtonPressed(CLASSIC_CTRL_BUTTON_HOME);
|
return isButtonPressed(CLASSIC_CTRL_BUTTON_HOME);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button Minus */
|
/* SelectButton Minus */
|
||||||
|
|
||||||
public boolean isButtonMinusJustPressed() {
|
public boolean isButtonMinusJustPressed() {
|
||||||
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_MINUS);
|
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_MINUS);
|
||||||
@@ -272,7 +272,7 @@ public class ClassicControllerButtonsEvent extends ButtonsEvent{
|
|||||||
return isButtonPressed(CLASSIC_CTRL_BUTTON_MINUS);
|
return isButtonPressed(CLASSIC_CTRL_BUTTON_MINUS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button Plus */
|
/* SelectButton Plus */
|
||||||
|
|
||||||
public boolean isButtonPlusJustPressed() {
|
public boolean isButtonPlusJustPressed() {
|
||||||
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_PLUS);
|
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_PLUS);
|
||||||
@@ -290,7 +290,7 @@ public class ClassicControllerButtonsEvent extends ButtonsEvent{
|
|||||||
return isButtonPressed(CLASSIC_CTRL_BUTTON_PLUS);
|
return isButtonPressed(CLASSIC_CTRL_BUTTON_PLUS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button ZL */
|
/* SelectButton ZL */
|
||||||
|
|
||||||
public boolean isButtonZLJustPressed() {
|
public boolean isButtonZLJustPressed() {
|
||||||
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_ZL);
|
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_ZL);
|
||||||
@@ -308,7 +308,7 @@ public class ClassicControllerButtonsEvent extends ButtonsEvent{
|
|||||||
return isButtonPressed(CLASSIC_CTRL_BUTTON_ZL);
|
return isButtonPressed(CLASSIC_CTRL_BUTTON_ZL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button ZR */
|
/* SelectButton ZR */
|
||||||
|
|
||||||
public boolean isButtonZRJustPressed() {
|
public boolean isButtonZRJustPressed() {
|
||||||
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_ZR);
|
return isButtonJustPressed(CLASSIC_CTRL_BUTTON_ZR);
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class GuitarHeroButtonsEvent extends ButtonsEvent {
|
|||||||
super(id, buttonsJustPressed, buttonsJustReleased, buttonsHeld);
|
super(id, buttonsJustPressed, buttonsJustReleased, buttonsHeld);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button Strum Up */
|
/* SelectButton Strum Up */
|
||||||
|
|
||||||
public boolean isButtonStrumUpJustPressed() {
|
public boolean isButtonStrumUpJustPressed() {
|
||||||
return isButtonJustPressed(GUITAR_HERO_3_BUTTON_STRUM_UP);
|
return isButtonJustPressed(GUITAR_HERO_3_BUTTON_STRUM_UP);
|
||||||
@@ -68,7 +68,7 @@ public class GuitarHeroButtonsEvent extends ButtonsEvent {
|
|||||||
return isButtonPressed(GUITAR_HERO_3_BUTTON_STRUM_UP);
|
return isButtonPressed(GUITAR_HERO_3_BUTTON_STRUM_UP);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button Strum Down */
|
/* SelectButton Strum Down */
|
||||||
|
|
||||||
public boolean isButtonStrumDownJustPressed() {
|
public boolean isButtonStrumDownJustPressed() {
|
||||||
return isButtonJustPressed(GUITAR_HERO_3_BUTTON_STRUM_DOWN);
|
return isButtonJustPressed(GUITAR_HERO_3_BUTTON_STRUM_DOWN);
|
||||||
@@ -86,7 +86,7 @@ public class GuitarHeroButtonsEvent extends ButtonsEvent {
|
|||||||
return isButtonPressed(GUITAR_HERO_3_BUTTON_STRUM_DOWN);
|
return isButtonPressed(GUITAR_HERO_3_BUTTON_STRUM_DOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button blue */
|
/* SelectButton blue */
|
||||||
|
|
||||||
public boolean isButtonBlueJustPressed() {
|
public boolean isButtonBlueJustPressed() {
|
||||||
return isButtonJustPressed(GUITAR_HERO_3_BUTTON_BLUE);
|
return isButtonJustPressed(GUITAR_HERO_3_BUTTON_BLUE);
|
||||||
@@ -104,7 +104,7 @@ public class GuitarHeroButtonsEvent extends ButtonsEvent {
|
|||||||
return isButtonPressed(GUITAR_HERO_3_BUTTON_BLUE);
|
return isButtonPressed(GUITAR_HERO_3_BUTTON_BLUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button Green */
|
/* SelectButton Green */
|
||||||
|
|
||||||
public boolean isButtonGreenJustPressed() {
|
public boolean isButtonGreenJustPressed() {
|
||||||
return isButtonJustPressed(GUITAR_HERO_3_BUTTON_GREEN);
|
return isButtonJustPressed(GUITAR_HERO_3_BUTTON_GREEN);
|
||||||
@@ -122,7 +122,7 @@ public class GuitarHeroButtonsEvent extends ButtonsEvent {
|
|||||||
return isButtonPressed(GUITAR_HERO_3_BUTTON_GREEN);
|
return isButtonPressed(GUITAR_HERO_3_BUTTON_GREEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button Minus */
|
/* SelectButton Minus */
|
||||||
|
|
||||||
public boolean isButtonMinusJustPressed() {
|
public boolean isButtonMinusJustPressed() {
|
||||||
return isButtonJustPressed(GUITAR_HERO_3_BUTTON_MINUS);
|
return isButtonJustPressed(GUITAR_HERO_3_BUTTON_MINUS);
|
||||||
@@ -140,7 +140,7 @@ public class GuitarHeroButtonsEvent extends ButtonsEvent {
|
|||||||
return isButtonPressed(GUITAR_HERO_3_BUTTON_MINUS);
|
return isButtonPressed(GUITAR_HERO_3_BUTTON_MINUS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button Orange */
|
/* SelectButton Orange */
|
||||||
|
|
||||||
public boolean isButtonOrangeJustPressed() {
|
public boolean isButtonOrangeJustPressed() {
|
||||||
return isButtonJustPressed(GUITAR_HERO_3_BUTTON_ORANGE);
|
return isButtonJustPressed(GUITAR_HERO_3_BUTTON_ORANGE);
|
||||||
@@ -158,7 +158,7 @@ public class GuitarHeroButtonsEvent extends ButtonsEvent {
|
|||||||
return isButtonPressed(GUITAR_HERO_3_BUTTON_ORANGE);
|
return isButtonPressed(GUITAR_HERO_3_BUTTON_ORANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button Plus */
|
/* SelectButton Plus */
|
||||||
|
|
||||||
public boolean isButtonPlusJustPressed() {
|
public boolean isButtonPlusJustPressed() {
|
||||||
return isButtonJustPressed(GUITAR_HERO_3_BUTTON_PLUS);
|
return isButtonJustPressed(GUITAR_HERO_3_BUTTON_PLUS);
|
||||||
@@ -176,7 +176,7 @@ public class GuitarHeroButtonsEvent extends ButtonsEvent {
|
|||||||
return isButtonPressed(GUITAR_HERO_3_BUTTON_PLUS);
|
return isButtonPressed(GUITAR_HERO_3_BUTTON_PLUS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button Red */
|
/* SelectButton Red */
|
||||||
|
|
||||||
public boolean isButtonRedJustPressed() {
|
public boolean isButtonRedJustPressed() {
|
||||||
return isButtonJustPressed(GUITAR_HERO_3_BUTTON_RED);
|
return isButtonJustPressed(GUITAR_HERO_3_BUTTON_RED);
|
||||||
@@ -194,7 +194,7 @@ public class GuitarHeroButtonsEvent extends ButtonsEvent {
|
|||||||
return isButtonPressed(GUITAR_HERO_3_BUTTON_RED);
|
return isButtonPressed(GUITAR_HERO_3_BUTTON_RED);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button Yellow */
|
/* SelectButton Yellow */
|
||||||
|
|
||||||
public boolean isButtonYellowJustPressed() {
|
public boolean isButtonYellowJustPressed() {
|
||||||
return isButtonJustPressed(GUITAR_HERO_3_BUTTON_YELLOW);
|
return isButtonJustPressed(GUITAR_HERO_3_BUTTON_YELLOW);
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public class NunchukButtonsEvent extends ButtonsEvent {
|
|||||||
super(id, buttonsJustPressed, buttonsJustReleased, buttonsHeld);
|
super(id, buttonsJustPressed, buttonsJustReleased, buttonsHeld);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button Z */
|
/* SelectButton Z */
|
||||||
|
|
||||||
public boolean isButtonZJustPressed() {
|
public boolean isButtonZJustPressed() {
|
||||||
return isButtonJustPressed(NUNCHUK_BUTTON_Z);
|
return isButtonJustPressed(NUNCHUK_BUTTON_Z);
|
||||||
@@ -62,7 +62,7 @@ public class NunchukButtonsEvent extends ButtonsEvent {
|
|||||||
return isButtonPressed(NUNCHUK_BUTTON_Z);
|
return isButtonPressed(NUNCHUK_BUTTON_Z);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button Z */
|
/* SelectButton Z */
|
||||||
|
|
||||||
public boolean isButtonCJustPressed() {
|
public boolean isButtonCJustPressed() {
|
||||||
return isButtonJustPressed(NUNCHUK_BUTTON_C);
|
return isButtonJustPressed(NUNCHUK_BUTTON_C);
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ public class WiimoteButtonsEvent extends ButtonsEvent {
|
|||||||
super(id, buttonsJustPressed, buttonsJustReleased, buttonsHeld);
|
super(id, buttonsJustPressed, buttonsJustReleased, buttonsHeld);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button ONE */
|
/* SelectButton ONE */
|
||||||
|
|
||||||
public boolean isButtonOneJustPressed() {
|
public boolean isButtonOneJustPressed() {
|
||||||
return isButtonJustPressed(WIIMOTE_BUTTON_ONE);
|
return isButtonJustPressed(WIIMOTE_BUTTON_ONE);
|
||||||
@@ -78,7 +78,7 @@ public class WiimoteButtonsEvent extends ButtonsEvent {
|
|||||||
return isButtonPressed(WIIMOTE_BUTTON_ONE);
|
return isButtonPressed(WIIMOTE_BUTTON_ONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button TWO */
|
/* SelectButton TWO */
|
||||||
|
|
||||||
public boolean isButtonTwoJustPressed() {
|
public boolean isButtonTwoJustPressed() {
|
||||||
return isButtonJustPressed(WIIMOTE_BUTTON_TWO);
|
return isButtonJustPressed(WIIMOTE_BUTTON_TWO);
|
||||||
@@ -96,7 +96,7 @@ public class WiimoteButtonsEvent extends ButtonsEvent {
|
|||||||
return isButtonPressed(WIIMOTE_BUTTON_TWO);
|
return isButtonPressed(WIIMOTE_BUTTON_TWO);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button A */
|
/* SelectButton A */
|
||||||
|
|
||||||
public boolean isButtonAJustPressed() {
|
public boolean isButtonAJustPressed() {
|
||||||
return isButtonJustPressed(WIIMOTE_BUTTON_A);
|
return isButtonJustPressed(WIIMOTE_BUTTON_A);
|
||||||
@@ -114,7 +114,7 @@ public class WiimoteButtonsEvent extends ButtonsEvent {
|
|||||||
return isButtonPressed(WIIMOTE_BUTTON_A);
|
return isButtonPressed(WIIMOTE_BUTTON_A);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button B */
|
/* SelectButton B */
|
||||||
|
|
||||||
public boolean isButtonBJustPressed() {
|
public boolean isButtonBJustPressed() {
|
||||||
return isButtonJustPressed(WIIMOTE_BUTTON_B);
|
return isButtonJustPressed(WIIMOTE_BUTTON_B);
|
||||||
@@ -132,7 +132,7 @@ public class WiimoteButtonsEvent extends ButtonsEvent {
|
|||||||
return isButtonPressed(WIIMOTE_BUTTON_B);
|
return isButtonPressed(WIIMOTE_BUTTON_B);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button LEFT */
|
/* SelectButton LEFT */
|
||||||
|
|
||||||
public boolean isButtonLeftJustPressed() {
|
public boolean isButtonLeftJustPressed() {
|
||||||
return isButtonJustPressed(WIIMOTE_BUTTON_LEFT);
|
return isButtonJustPressed(WIIMOTE_BUTTON_LEFT);
|
||||||
@@ -150,7 +150,7 @@ public class WiimoteButtonsEvent extends ButtonsEvent {
|
|||||||
return isButtonPressed(WIIMOTE_BUTTON_LEFT);
|
return isButtonPressed(WIIMOTE_BUTTON_LEFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button RIGHT */
|
/* SelectButton RIGHT */
|
||||||
|
|
||||||
public boolean isButtonRightJustPressed() {
|
public boolean isButtonRightJustPressed() {
|
||||||
return isButtonJustPressed(WIIMOTE_BUTTON_RIGHT);
|
return isButtonJustPressed(WIIMOTE_BUTTON_RIGHT);
|
||||||
@@ -168,7 +168,7 @@ public class WiimoteButtonsEvent extends ButtonsEvent {
|
|||||||
return isButtonPressed(WIIMOTE_BUTTON_RIGHT);
|
return isButtonPressed(WIIMOTE_BUTTON_RIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button UP */
|
/* SelectButton UP */
|
||||||
|
|
||||||
public boolean isButtonUpJustPressed() {
|
public boolean isButtonUpJustPressed() {
|
||||||
return isButtonJustPressed(WIIMOTE_BUTTON_UP);
|
return isButtonJustPressed(WIIMOTE_BUTTON_UP);
|
||||||
@@ -186,7 +186,7 @@ public class WiimoteButtonsEvent extends ButtonsEvent {
|
|||||||
return isButtonPressed(WIIMOTE_BUTTON_UP);
|
return isButtonPressed(WIIMOTE_BUTTON_UP);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button DOWN */
|
/* SelectButton DOWN */
|
||||||
|
|
||||||
public boolean isButtonDownJustPressed() {
|
public boolean isButtonDownJustPressed() {
|
||||||
return isButtonJustPressed(WIIMOTE_BUTTON_DOWN);
|
return isButtonJustPressed(WIIMOTE_BUTTON_DOWN);
|
||||||
@@ -204,7 +204,7 @@ public class WiimoteButtonsEvent extends ButtonsEvent {
|
|||||||
return isButtonPressed(WIIMOTE_BUTTON_DOWN);
|
return isButtonPressed(WIIMOTE_BUTTON_DOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button - */
|
/* SelectButton - */
|
||||||
|
|
||||||
public boolean isButtonMinusJustPressed() {
|
public boolean isButtonMinusJustPressed() {
|
||||||
return isButtonJustPressed(WIIMOTE_BUTTON_MINUS);
|
return isButtonJustPressed(WIIMOTE_BUTTON_MINUS);
|
||||||
@@ -222,7 +222,7 @@ public class WiimoteButtonsEvent extends ButtonsEvent {
|
|||||||
return isButtonPressed(WIIMOTE_BUTTON_MINUS);
|
return isButtonPressed(WIIMOTE_BUTTON_MINUS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button + */
|
/* SelectButton + */
|
||||||
|
|
||||||
public boolean isButtonPlusJustPressed() {
|
public boolean isButtonPlusJustPressed() {
|
||||||
return isButtonJustPressed(WIIMOTE_BUTTON_PLUS);
|
return isButtonJustPressed(WIIMOTE_BUTTON_PLUS);
|
||||||
@@ -240,7 +240,7 @@ public class WiimoteButtonsEvent extends ButtonsEvent {
|
|||||||
return isButtonPressed(WIIMOTE_BUTTON_PLUS);
|
return isButtonPressed(WIIMOTE_BUTTON_PLUS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button HOME */
|
/* SelectButton HOME */
|
||||||
|
|
||||||
public boolean isButtonHomeJustPressed() {
|
public boolean isButtonHomeJustPressed() {
|
||||||
return isButtonJustPressed(WIIMOTE_BUTTON_HOME);
|
return isButtonJustPressed(WIIMOTE_BUTTON_HOME);
|
||||||
|
|||||||
Reference in New Issue
Block a user