starting to add classic controller and guitar hero controller support

git-svn-id: http://wiiusej.googlecode.com/svn/trunk@176 ae48ae66-6a45-0410-b38e-211266189506
This commit is contained in:
guilhem.duche
2008-06-05 17:46:19 +00:00
parent 3762ea10c1
commit f7869c0b6d
14 changed files with 770 additions and 178 deletions

View File

@@ -20,7 +20,11 @@ import javax.swing.event.EventListenerList;
import wiiusej.wiiusejevents.utils.WiiUseApiListener; import wiiusej.wiiusejevents.utils.WiiUseApiListener;
import wiiusej.wiiusejevents.utils.WiimoteListener; import wiiusej.wiiusejevents.utils.WiimoteListener;
import wiiusej.wiiusejevents.wiiuseapievents.ClassicControllerInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.ClassicControllerRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.DisconnectionEvent; import wiiusej.wiiusejevents.wiiuseapievents.DisconnectionEvent;
import wiiusej.wiiusejevents.wiiuseapievents.GuitarHeroInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.GuitarHeroRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.NunchukInsertedEvent; import wiiusej.wiiusejevents.wiiuseapievents.NunchukInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.NunchukRemovedEvent; import wiiusej.wiiusejevents.wiiuseapievents.NunchukRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.StatusEvent; import wiiusej.wiiusejevents.wiiuseapievents.StatusEvent;
@@ -315,6 +319,14 @@ public class Wiimote implements WiiUseApiListener {
notifyNunchukInsertedEventListeners((NunchukInsertedEvent) e); notifyNunchukInsertedEventListeners((NunchukInsertedEvent) e);
} else if (e.getEventType() == WiiUseApiEvent.WIIUSE_NUNCHUK_REMOVED) { } else if (e.getEventType() == WiiUseApiEvent.WIIUSE_NUNCHUK_REMOVED) {
notifyNunchukRemovedEventListeners((NunchukRemovedEvent) e); notifyNunchukRemovedEventListeners((NunchukRemovedEvent) e);
} else if (e.getEventType() == WiiUseApiEvent.WIIUSE_GUITAR_HERO_3_CTRL_INSERTED) {
notifyGuitarHeroInsertedEventListeners((GuitarHeroInsertedEvent) e);
} else if (e.getEventType() == WiiUseApiEvent.WIIUSE_GUITAR_HERO_3_CTRL_REMOVED) {
notifyGuitarHeroRemovedEventListeners((GuitarHeroRemovedEvent) e);
} else if (e.getEventType() == WiiUseApiEvent.WIIUSE_CLASSIC_CTRL_INSERTED) {
notifyClassicControllerInsertedEventListeners((ClassicControllerInsertedEvent) e);
} else if (e.getEventType() == WiiUseApiEvent.WIIUSE_CLASSIC_CTRL_REMOVED) {
notifyClassicControllerRemovedEventListeners((ClassicControllerRemovedEvent) e);
} }
/* /*
* events not managed yet || e.getEventType() == WIIUSE_READ_DATA * events not managed yet || e.getEventType() == WIIUSE_READ_DATA
@@ -427,6 +439,54 @@ public class Wiimote implements WiiUseApiListener {
} }
} }
/**
* Notify WiimoteListener that a GuitarHeroInserted Event occured.
*
* @param evt
* GuitarHeroInserted Event occured
*/
private void notifyGuitarHeroInsertedEventListeners(GuitarHeroInsertedEvent evt) {
for (WiimoteListener listener : getWiiMoteEventListeners()) {
listener.onGuitarHeroInsertedEvent(evt);
}
}
/**
* Notify WiimoteListener that a GuitarHeroRemoved Event occured.
*
* @param evt
* GuitarHeroRemoved Event occured
*/
private void notifyGuitarHeroRemovedEventListeners(GuitarHeroRemovedEvent evt) {
for (WiimoteListener listener : getWiiMoteEventListeners()) {
listener.onGuitarHeroRemovedEvent(evt);
}
}
/**
* Notify WiimoteListener that a ClassicControllerInserted Event occured.
*
* @param evt
* ClassicControllerInserted Event occured
*/
private void notifyClassicControllerInsertedEventListeners(ClassicControllerInsertedEvent evt) {
for (WiimoteListener listener : getWiiMoteEventListeners()) {
listener.onClassicControllerInsertedEvent(evt);
}
}
/**
* Notify WiimoteListener that a ClassicControllerRemoved Event occured.
*
* @param evt
* ClassicControllerRemoved Event occured
*/
private void notifyClassicControllerRemovedEventListeners(ClassicControllerRemovedEvent evt) {
for (WiimoteListener listener : getWiiMoteEventListeners()) {
listener.onClassicControllerRemovedEvent(evt);
}
}
@Override @Override
public String toString() { public String toString() {
return "Wiimote with ID : " + id; return "Wiimote with ID : " + id;

View File

@@ -31,7 +31,11 @@ import wiiusej.wiiusejevents.physicalevents.NunchukButtonsEvent;
import wiiusej.wiiusejevents.physicalevents.NunchukEvent; import wiiusej.wiiusejevents.physicalevents.NunchukEvent;
import wiiusej.wiiusejevents.physicalevents.WiimoteButtonsEvent; import wiiusej.wiiusejevents.physicalevents.WiimoteButtonsEvent;
import wiiusej.wiiusejevents.utils.WiimoteListener; import wiiusej.wiiusejevents.utils.WiimoteListener;
import wiiusej.wiiusejevents.wiiuseapievents.ClassicControllerInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.ClassicControllerRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.DisconnectionEvent; import wiiusej.wiiusejevents.wiiuseapievents.DisconnectionEvent;
import wiiusej.wiiusejevents.wiiuseapievents.GuitarHeroInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.GuitarHeroRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.NunchukInsertedEvent; import wiiusej.wiiusejevents.wiiuseapievents.NunchukInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.NunchukRemovedEvent; import wiiusej.wiiusejevents.wiiuseapievents.NunchukRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.StatusEvent; import wiiusej.wiiusejevents.wiiuseapievents.StatusEvent;
@@ -85,192 +89,239 @@ public class NunchukGuiTest extends javax.swing.JFrame implements
* regenerated by the Form Editor. * regenerated by the Form Editor.
*/ */
// <editor-fold defaultstate="collapsed" desc="Generated // <editor-fold defaultstate="collapsed" desc="Generated
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents // <editor-fold defaultstate="collapsed" desc="Generated
private void initComponents() { // Code">//GEN-BEGIN:initComponents
private void initComponents() {
topPanels = new javax.swing.JPanel(); topPanels = new javax.swing.JPanel();
joystickEventsPanel = new NunchukJoystickEventPanel(); joystickEventsPanel = new NunchukJoystickEventPanel();
motionSensingEventsPanel = new javax.swing.JPanel(); motionSensingEventsPanel = new javax.swing.JPanel();
motionSensingEventsTabbedPanels = new javax.swing.JTabbedPane(); motionSensingEventsTabbedPanels = new javax.swing.JTabbedPane();
rawAccelerationPanel = new AccelerationExpansionEventPanel(); rawAccelerationPanel = new AccelerationExpansionEventPanel();
orientationPanel = new OrientationExpansionEventPanel(); orientationPanel = new OrientationExpansionEventPanel();
gForcePanel = new GForceExpansionEventPanel(); gForcePanel = new GForceExpansionEventPanel();
setNunchukValuesPanel = new javax.swing.JPanel(); setNunchukValuesPanel = new javax.swing.JPanel();
nunchukButtonsEventPanel = new javax.swing.JPanel(); nunchukButtonsEventPanel = new javax.swing.JPanel();
cButton = new javax.swing.JButton(); cButton = new javax.swing.JButton();
zButton = new javax.swing.JButton(); zButton = new javax.swing.JButton();
nunchukOrientationPanel = new javax.swing.JPanel(); nunchukOrientationPanel = new javax.swing.JPanel();
nunchukOrientationTextField = new javax.swing.JTextField(); nunchukOrientationTextField = new javax.swing.JTextField();
nunchukOrientationButton = new javax.swing.JButton(); nunchukOrientationButton = new javax.swing.JButton();
nunchukAccelerationPanel = new javax.swing.JPanel(); nunchukAccelerationPanel = new javax.swing.JPanel();
nunchukAccelerationTextField = new javax.swing.JTextField(); nunchukAccelerationTextField = new javax.swing.JTextField();
nunchukAccelerationButton = new javax.swing.JButton(); nunchukAccelerationButton = new javax.swing.JButton();
messagePanel = new javax.swing.JPanel(); messagePanel = new javax.swing.JPanel();
messageText = new javax.swing.JLabel(); messageText = new javax.swing.JLabel();
setTitle("WiiuseJ Nunchuk Test GUI"); setTitle("WiiuseJ Nunchuk Test GUI");
setMinimumSize(new java.awt.Dimension(400, 400)); setMinimumSize(new java.awt.Dimension(400, 400));
getContentPane().setLayout(new javax.swing.BoxLayout(getContentPane(), javax.swing.BoxLayout.Y_AXIS)); getContentPane().setLayout(
new javax.swing.BoxLayout(getContentPane(),
javax.swing.BoxLayout.Y_AXIS));
topPanels.setMinimumSize(new java.awt.Dimension(400, 200)); topPanels.setMinimumSize(new java.awt.Dimension(400, 200));
topPanels.setPreferredSize(new java.awt.Dimension(400, 200)); topPanels.setPreferredSize(new java.awt.Dimension(400, 200));
topPanels.setLayout(new javax.swing.BoxLayout(topPanels, javax.swing.BoxLayout.LINE_AXIS)); topPanels.setLayout(new javax.swing.BoxLayout(topPanels,
javax.swing.BoxLayout.LINE_AXIS));
joystickEventsPanel.setBackground(new java.awt.Color(0, 0, 0)); joystickEventsPanel.setBackground(new java.awt.Color(0, 0, 0));
joystickEventsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(51, 153, 0), 2, true), "Joystick View", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(204, 102, 0))); joystickEventsPanel.setBorder(javax.swing.BorderFactory
joystickEventsPanel.setToolTipText("JoystickEvent"); .createTitledBorder(new javax.swing.border.LineBorder(
joystickEventsPanel.setMinimumSize(new java.awt.Dimension(200, 200)); new java.awt.Color(51, 153, 0), 2, true),
"Joystick View",
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
javax.swing.border.TitledBorder.DEFAULT_POSITION,
new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(
204, 102, 0)));
joystickEventsPanel.setToolTipText("JoystickEvent");
joystickEventsPanel.setMinimumSize(new java.awt.Dimension(200, 200));
javax.swing.GroupLayout joystickEventsPanelLayout = new javax.swing.GroupLayout(joystickEventsPanel); javax.swing.GroupLayout joystickEventsPanelLayout = new javax.swing.GroupLayout(
joystickEventsPanel.setLayout(joystickEventsPanelLayout); joystickEventsPanel);
joystickEventsPanelLayout.setHorizontalGroup( joystickEventsPanel.setLayout(joystickEventsPanelLayout);
joystickEventsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) joystickEventsPanelLayout.setHorizontalGroup(joystickEventsPanelLayout
.addGap(0, 601, Short.MAX_VALUE) .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
); .addGap(0, 601, Short.MAX_VALUE));
joystickEventsPanelLayout.setVerticalGroup( joystickEventsPanelLayout.setVerticalGroup(joystickEventsPanelLayout
joystickEventsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 174, Short.MAX_VALUE) .addGap(0, 174, Short.MAX_VALUE));
);
topPanels.add(joystickEventsPanel); topPanels.add(joystickEventsPanel);
joystickEventsPanel.getAccessibleContext().setAccessibleName("Joystick"); joystickEventsPanel.getAccessibleContext()
.setAccessibleName("Joystick");
motionSensingEventsPanel.setMinimumSize(new java.awt.Dimension(200, 200)); motionSensingEventsPanel
.setMinimumSize(new java.awt.Dimension(200, 200));
rawAccelerationPanel.setToolTipText("Nunchuk MotionSensingEvent"); rawAccelerationPanel.setToolTipText("Nunchuk MotionSensingEvent");
javax.swing.GroupLayout rawAccelerationPanelLayout = new javax.swing.GroupLayout(rawAccelerationPanel); javax.swing.GroupLayout rawAccelerationPanelLayout = new javax.swing.GroupLayout(
rawAccelerationPanel.setLayout(rawAccelerationPanelLayout); rawAccelerationPanel);
rawAccelerationPanelLayout.setHorizontalGroup( rawAccelerationPanel.setLayout(rawAccelerationPanelLayout);
rawAccelerationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) rawAccelerationPanelLayout
.addGap(0, 597, Short.MAX_VALUE) .setHorizontalGroup(rawAccelerationPanelLayout
); .createParallelGroup(
rawAccelerationPanelLayout.setVerticalGroup( javax.swing.GroupLayout.Alignment.LEADING)
rawAccelerationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 597, Short.MAX_VALUE));
.addGap(0, 175, Short.MAX_VALUE) rawAccelerationPanelLayout.setVerticalGroup(rawAccelerationPanelLayout
); .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 175, Short.MAX_VALUE));
motionSensingEventsTabbedPanels.addTab("RawAcceleration", rawAccelerationPanel); motionSensingEventsTabbedPanels.addTab("RawAcceleration",
rawAccelerationPanel);
javax.swing.GroupLayout orientationPanelLayout = new javax.swing.GroupLayout(orientationPanel); javax.swing.GroupLayout orientationPanelLayout = new javax.swing.GroupLayout(
orientationPanel.setLayout(orientationPanelLayout); orientationPanel);
orientationPanelLayout.setHorizontalGroup( orientationPanel.setLayout(orientationPanelLayout);
orientationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) orientationPanelLayout.setHorizontalGroup(orientationPanelLayout
.addGap(0, 597, Short.MAX_VALUE) .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
); .addGap(0, 597, Short.MAX_VALUE));
orientationPanelLayout.setVerticalGroup( orientationPanelLayout.setVerticalGroup(orientationPanelLayout
orientationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 175, Short.MAX_VALUE) .addGap(0, 175, Short.MAX_VALUE));
);
motionSensingEventsTabbedPanels.addTab("Orientation", orientationPanel); motionSensingEventsTabbedPanels.addTab("Orientation", orientationPanel);
javax.swing.GroupLayout gForcePanelLayout = new javax.swing.GroupLayout(gForcePanel); javax.swing.GroupLayout gForcePanelLayout = new javax.swing.GroupLayout(
gForcePanel.setLayout(gForcePanelLayout); gForcePanel);
gForcePanelLayout.setHorizontalGroup( gForcePanel.setLayout(gForcePanelLayout);
gForcePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) gForcePanelLayout.setHorizontalGroup(gForcePanelLayout
.addGap(0, 597, Short.MAX_VALUE) .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
); .addGap(0, 597, Short.MAX_VALUE));
gForcePanelLayout.setVerticalGroup( gForcePanelLayout.setVerticalGroup(gForcePanelLayout
gForcePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 175, Short.MAX_VALUE) .addGap(0, 175, Short.MAX_VALUE));
);
motionSensingEventsTabbedPanels.addTab("GForce", gForcePanel); motionSensingEventsTabbedPanels.addTab("GForce", gForcePanel);
javax.swing.GroupLayout motionSensingEventsPanelLayout = new javax.swing.GroupLayout(motionSensingEventsPanel); javax.swing.GroupLayout motionSensingEventsPanelLayout = new javax.swing.GroupLayout(
motionSensingEventsPanel.setLayout(motionSensingEventsPanelLayout); motionSensingEventsPanel);
motionSensingEventsPanelLayout.setHorizontalGroup( motionSensingEventsPanel.setLayout(motionSensingEventsPanelLayout);
motionSensingEventsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) motionSensingEventsPanelLayout
.addComponent(motionSensingEventsTabbedPanels, javax.swing.GroupLayout.DEFAULT_SIZE, 602, Short.MAX_VALUE) .setHorizontalGroup(motionSensingEventsPanelLayout
); .createParallelGroup(
motionSensingEventsPanelLayout.setVerticalGroup( javax.swing.GroupLayout.Alignment.LEADING)
motionSensingEventsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(motionSensingEventsTabbedPanels,
.addComponent(motionSensingEventsTabbedPanels, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE) javax.swing.GroupLayout.DEFAULT_SIZE, 602,
); Short.MAX_VALUE));
motionSensingEventsPanelLayout
.setVerticalGroup(motionSensingEventsPanelLayout
.createParallelGroup(
javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(motionSensingEventsTabbedPanels,
javax.swing.GroupLayout.DEFAULT_SIZE, 200,
Short.MAX_VALUE));
topPanels.add(motionSensingEventsPanel); topPanels.add(motionSensingEventsPanel);
getContentPane().add(topPanels); getContentPane().add(topPanels);
setNunchukValuesPanel.setMinimumSize(new java.awt.Dimension(400, 200)); setNunchukValuesPanel.setMinimumSize(new java.awt.Dimension(400, 200));
setNunchukValuesPanel.setPreferredSize(new java.awt.Dimension(400, 200)); setNunchukValuesPanel
setNunchukValuesPanel.setLayout(new javax.swing.BoxLayout(setNunchukValuesPanel, javax.swing.BoxLayout.Y_AXIS)); .setPreferredSize(new java.awt.Dimension(400, 200));
setNunchukValuesPanel.setLayout(new javax.swing.BoxLayout(
setNunchukValuesPanel, javax.swing.BoxLayout.Y_AXIS));
nunchukButtonsEventPanel.setToolTipText("Nunchuk ButtonsEvent"); nunchukButtonsEventPanel.setToolTipText("Nunchuk ButtonsEvent");
nunchukButtonsEventPanel.setMinimumSize(new java.awt.Dimension(100, 100)); nunchukButtonsEventPanel
nunchukButtonsEventPanel.setPreferredSize(new java.awt.Dimension(100, 100)); .setMinimumSize(new java.awt.Dimension(100, 100));
nunchukButtonsEventPanel.setLayout(new javax.swing.BoxLayout(nunchukButtonsEventPanel, javax.swing.BoxLayout.LINE_AXIS)); nunchukButtonsEventPanel.setPreferredSize(new java.awt.Dimension(100,
100));
nunchukButtonsEventPanel.setLayout(new javax.swing.BoxLayout(
nunchukButtonsEventPanel, javax.swing.BoxLayout.LINE_AXIS));
cButton.setText("C"); cButton.setText("C");
cButton.setMaximumSize(new java.awt.Dimension(50, 50)); cButton.setMaximumSize(new java.awt.Dimension(50, 50));
cButton.setMinimumSize(new java.awt.Dimension(50, 50)); cButton.setMinimumSize(new java.awt.Dimension(50, 50));
cButton.setPreferredSize(new java.awt.Dimension(50, 50)); cButton.setPreferredSize(new java.awt.Dimension(50, 50));
nunchukButtonsEventPanel.add(cButton); nunchukButtonsEventPanel.add(cButton);
zButton.setText("Z"); zButton.setText("Z");
zButton.setMaximumSize(new java.awt.Dimension(50, 50)); zButton.setMaximumSize(new java.awt.Dimension(50, 50));
zButton.setMinimumSize(new java.awt.Dimension(50, 50)); zButton.setMinimumSize(new java.awt.Dimension(50, 50));
zButton.setPreferredSize(new java.awt.Dimension(50, 50)); zButton.setPreferredSize(new java.awt.Dimension(50, 50));
nunchukButtonsEventPanel.add(zButton); nunchukButtonsEventPanel.add(zButton);
setNunchukValuesPanel.add(nunchukButtonsEventPanel); setNunchukValuesPanel.add(nunchukButtonsEventPanel);
nunchukOrientationTextField.setPreferredSize(new java.awt.Dimension(60, 20)); nunchukOrientationTextField.setPreferredSize(new java.awt.Dimension(60,
nunchukOrientationPanel.add(nunchukOrientationTextField); 20));
nunchukOrientationPanel.add(nunchukOrientationTextField);
nunchukOrientationButton.setText("Set Orientation Threshold"); nunchukOrientationButton.setText("Set Orientation Threshold");
nunchukOrientationButton.addMouseListener(new java.awt.event.MouseAdapter() { nunchukOrientationButton
public void mousePressed(java.awt.event.MouseEvent evt) { .addMouseListener(new java.awt.event.MouseAdapter() {
nunchukOrientationButtonMousePressed(evt); public void mousePressed(java.awt.event.MouseEvent evt) {
} nunchukOrientationButtonMousePressed(evt);
}); }
nunchukOrientationPanel.add(nunchukOrientationButton); });
nunchukOrientationPanel.add(nunchukOrientationButton);
setNunchukValuesPanel.add(nunchukOrientationPanel); setNunchukValuesPanel.add(nunchukOrientationPanel);
nunchukAccelerationTextField.setPreferredSize(new java.awt.Dimension(60, 20)); nunchukAccelerationTextField.setPreferredSize(new java.awt.Dimension(
nunchukAccelerationPanel.add(nunchukAccelerationTextField); 60, 20));
nunchukAccelerationPanel.add(nunchukAccelerationTextField);
nunchukAccelerationButton.setText("Set Acceleration Threshold"); nunchukAccelerationButton.setText("Set Acceleration Threshold");
nunchukAccelerationButton.addMouseListener(new java.awt.event.MouseAdapter() { nunchukAccelerationButton
public void mousePressed(java.awt.event.MouseEvent evt) { .addMouseListener(new java.awt.event.MouseAdapter() {
nunchukAccelerationButtonMousePressed(evt); public void mousePressed(java.awt.event.MouseEvent evt) {
} nunchukAccelerationButtonMousePressed(evt);
}); }
nunchukAccelerationPanel.add(nunchukAccelerationButton); });
nunchukAccelerationPanel.add(nunchukAccelerationButton);
setNunchukValuesPanel.add(nunchukAccelerationPanel); setNunchukValuesPanel.add(nunchukAccelerationPanel);
messageText.setText("Message:"); messageText.setText("Message:");
javax.swing.GroupLayout messagePanelLayout = new javax.swing.GroupLayout(messagePanel); javax.swing.GroupLayout messagePanelLayout = new javax.swing.GroupLayout(
messagePanel.setLayout(messagePanelLayout); messagePanel);
messagePanelLayout.setHorizontalGroup( messagePanel.setLayout(messagePanelLayout);
messagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) messagePanelLayout
.addGap(0, 1216, Short.MAX_VALUE) .setHorizontalGroup(messagePanelLayout
.addGroup(messagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .createParallelGroup(
.addGroup(messagePanelLayout.createSequentialGroup() javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 0, Short.MAX_VALUE) .addGap(0, 1216, Short.MAX_VALUE)
.addComponent(messageText) .addGroup(
.addGap(0, 0, Short.MAX_VALUE))) messagePanelLayout
); .createParallelGroup(
messagePanelLayout.setVerticalGroup( javax.swing.GroupLayout.Alignment.LEADING)
messagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(
.addGap(0, 34, Short.MAX_VALUE) messagePanelLayout
.addGroup(messagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .createSequentialGroup()
.addGroup(messagePanelLayout.createSequentialGroup() .addGap(0, 0,
.addGap(0, 0, Short.MAX_VALUE) Short.MAX_VALUE)
.addComponent(messageText) .addComponent(
.addGap(0, 0, Short.MAX_VALUE))) messageText)
); .addGap(0, 0,
Short.MAX_VALUE))));
messagePanelLayout
.setVerticalGroup(messagePanelLayout
.createParallelGroup(
javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 34, Short.MAX_VALUE)
.addGroup(
messagePanelLayout
.createParallelGroup(
javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(
messagePanelLayout
.createSequentialGroup()
.addGap(0, 0,
Short.MAX_VALUE)
.addComponent(
messageText)
.addGap(0, 0,
Short.MAX_VALUE))));
setNunchukValuesPanel.add(messagePanel); setNunchukValuesPanel.add(messagePanel);
getContentPane().add(setNunchukValuesPanel); getContentPane().add(setNunchukValuesPanel);
pack(); pack();
}// </editor-fold>//GEN-END:initComponents }// </editor-fold>//GEN-END:initComponents
private void nunchukOrientationButtonMousePressed( private void nunchukOrientationButtonMousePressed(
java.awt.event.MouseEvent evt) {// GEN-FIRST:event_nunchukOrientationButtonMousePressed java.awt.event.MouseEvent evt) {// GEN-FIRST:event_nunchukOrientationButtonMousePressed
@@ -353,25 +404,43 @@ public class NunchukGuiTest extends javax.swing.JFrame implements
// nothing // nothing
} }
// Variables declaration - do not modify//GEN-BEGIN:variables public void onGuitarHeroInsertedEvent(GuitarHeroInsertedEvent arg0) {
private javax.swing.JButton cButton; // nothing
private javax.swing.JPanel gForcePanel; }
private javax.swing.JPanel joystickEventsPanel;
private javax.swing.JPanel messagePanel; public void onGuitarHeroRemovedEvent(GuitarHeroRemovedEvent arg0) {
private javax.swing.JLabel messageText; // nothing
private javax.swing.JPanel motionSensingEventsPanel; }
private javax.swing.JTabbedPane motionSensingEventsTabbedPanels;
private javax.swing.JButton nunchukAccelerationButton; public void onClassicControllerInsertedEvent(
private javax.swing.JPanel nunchukAccelerationPanel; ClassicControllerInsertedEvent arg0) {
private javax.swing.JTextField nunchukAccelerationTextField; // nothing
private javax.swing.JPanel nunchukButtonsEventPanel; }
private javax.swing.JButton nunchukOrientationButton;
private javax.swing.JPanel nunchukOrientationPanel; public void onClassicControllerRemovedEvent(
private javax.swing.JTextField nunchukOrientationTextField; ClassicControllerRemovedEvent arg0) {
private javax.swing.JPanel orientationPanel; // nothing
private javax.swing.JPanel rawAccelerationPanel; }
private javax.swing.JPanel setNunchukValuesPanel;
private javax.swing.JPanel topPanels; // Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton zButton; private javax.swing.JButton cButton;
// End of variables declaration//GEN-END:variables private javax.swing.JPanel gForcePanel;
private javax.swing.JPanel joystickEventsPanel;
private javax.swing.JPanel messagePanel;
private javax.swing.JLabel messageText;
private javax.swing.JPanel motionSensingEventsPanel;
private javax.swing.JTabbedPane motionSensingEventsTabbedPanels;
private javax.swing.JButton nunchukAccelerationButton;
private javax.swing.JPanel nunchukAccelerationPanel;
private javax.swing.JTextField nunchukAccelerationTextField;
private javax.swing.JPanel nunchukButtonsEventPanel;
private javax.swing.JButton nunchukOrientationButton;
private javax.swing.JPanel nunchukOrientationPanel;
private javax.swing.JTextField nunchukOrientationTextField;
private javax.swing.JPanel orientationPanel;
private javax.swing.JPanel rawAccelerationPanel;
private javax.swing.JPanel setNunchukValuesPanel;
private javax.swing.JPanel topPanels;
private javax.swing.JButton zButton;
// End of variables declaration//GEN-END:variables
} }

View File

@@ -28,7 +28,11 @@ import wiiusej.wiiusejevents.physicalevents.IREvent;
import wiiusej.wiiusejevents.physicalevents.MotionSensingEvent; import wiiusej.wiiusejevents.physicalevents.MotionSensingEvent;
import wiiusej.wiiusejevents.physicalevents.WiimoteButtonsEvent; import wiiusej.wiiusejevents.physicalevents.WiimoteButtonsEvent;
import wiiusej.wiiusejevents.utils.WiimoteListener; import wiiusej.wiiusejevents.utils.WiimoteListener;
import wiiusej.wiiusejevents.wiiuseapievents.ClassicControllerInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.ClassicControllerRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.DisconnectionEvent; import wiiusej.wiiusejevents.wiiuseapievents.DisconnectionEvent;
import wiiusej.wiiusejevents.wiiuseapievents.GuitarHeroInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.GuitarHeroRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.NunchukInsertedEvent; import wiiusej.wiiusejevents.wiiuseapievents.NunchukInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.NunchukRemovedEvent; import wiiusej.wiiusejevents.wiiuseapievents.NunchukRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.StatusEvent; import wiiusej.wiiusejevents.wiiuseapievents.StatusEvent;
@@ -347,6 +351,23 @@ public class Tests implements WiimoteListener {
System.out.println(e); System.out.println(e);
} }
public void onGuitarHeroInsertedEvent(GuitarHeroInsertedEvent e) {
System.out.println(e);
}
public void onGuitarHeroRemovedEvent(GuitarHeroRemovedEvent e) {
System.out.println(e);
}
public void onClassicControllerInsertedEvent(
ClassicControllerInsertedEvent e) {
System.out.println(e);
}
public void onClassicControllerRemovedEvent(ClassicControllerRemovedEvent e) {
System.out.println(e);
}
/** /**
* @param args * @param args
*/ */

View File

@@ -39,7 +39,11 @@ import wiiusej.wiiusejevents.physicalevents.IREvent;
import wiiusej.wiiusejevents.physicalevents.MotionSensingEvent; import wiiusej.wiiusejevents.physicalevents.MotionSensingEvent;
import wiiusej.wiiusejevents.physicalevents.WiimoteButtonsEvent; import wiiusej.wiiusejevents.physicalevents.WiimoteButtonsEvent;
import wiiusej.wiiusejevents.utils.WiimoteListener; import wiiusej.wiiusejevents.utils.WiimoteListener;
import wiiusej.wiiusejevents.wiiuseapievents.ClassicControllerInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.ClassicControllerRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.DisconnectionEvent; import wiiusej.wiiusejevents.wiiuseapievents.DisconnectionEvent;
import wiiusej.wiiusejevents.wiiuseapievents.GuitarHeroInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.GuitarHeroRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.NunchukInsertedEvent; import wiiusej.wiiusejevents.wiiuseapievents.NunchukInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.NunchukRemovedEvent; import wiiusej.wiiusejevents.wiiuseapievents.NunchukRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.StatusEvent; import wiiusej.wiiusejevents.wiiuseapievents.StatusEvent;
@@ -294,6 +298,24 @@ public class WiiuseJGuiTest extends javax.swing.JFrame implements
} }
} }
public void onGuitarHeroInsertedEvent(GuitarHeroInsertedEvent arg0) {
// nothing
}
public void onGuitarHeroRemovedEvent(GuitarHeroRemovedEvent arg0) {
// nothing
}
public void onClassicControllerInsertedEvent(
ClassicControllerInsertedEvent arg0) {
// nothing
}
public void onClassicControllerRemovedEvent(
ClassicControllerRemovedEvent arg0) {
// nothing
}
/** /**
* This method is called from within the constructor to initialize the form. * This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always * WARNING: Do NOT modify this code. The content of this method is always

View File

@@ -32,7 +32,11 @@ import wiiusej.wiiusejevents.physicalevents.IREvent;
import wiiusej.wiiusejevents.physicalevents.MotionSensingEvent; import wiiusej.wiiusejevents.physicalevents.MotionSensingEvent;
import wiiusej.wiiusejevents.physicalevents.WiimoteButtonsEvent; import wiiusej.wiiusejevents.physicalevents.WiimoteButtonsEvent;
import wiiusej.wiiusejevents.utils.WiimoteListener; import wiiusej.wiiusejevents.utils.WiimoteListener;
import wiiusej.wiiusejevents.wiiuseapievents.ClassicControllerInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.ClassicControllerRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.DisconnectionEvent; import wiiusej.wiiusejevents.wiiuseapievents.DisconnectionEvent;
import wiiusej.wiiusejevents.wiiuseapievents.GuitarHeroInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.GuitarHeroRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.NunchukInsertedEvent; import wiiusej.wiiusejevents.wiiuseapievents.NunchukInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.NunchukRemovedEvent; import wiiusej.wiiusejevents.wiiuseapievents.NunchukRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.StatusEvent; import wiiusej.wiiusejevents.wiiuseapievents.StatusEvent;
@@ -197,6 +201,24 @@ public abstract class AccelerationPanel extends javax.swing.JPanel implements
public void onNunchukRemovedEvent(NunchukRemovedEvent arg0) { public void onNunchukRemovedEvent(NunchukRemovedEvent arg0) {
// nothing // nothing
} }
public void onGuitarHeroInsertedEvent(GuitarHeroInsertedEvent arg0) {
// nothing
}
public void onGuitarHeroRemovedEvent(GuitarHeroRemovedEvent arg0) {
// nothing
}
public void onClassicControllerInsertedEvent(
ClassicControllerInsertedEvent arg0) {
// nothing
}
public void onClassicControllerRemovedEvent(
ClassicControllerRemovedEvent arg0) {
// nothing
}
private void draw(GenericEvent arg0) { private void draw(GenericEvent arg0) {
if (values.size() >= getWidth()) { if (values.size() >= getWidth()) {

View File

@@ -31,7 +31,11 @@ import wiiusej.wiiusejevents.physicalevents.IREvent;
import wiiusej.wiiusejevents.physicalevents.MotionSensingEvent; import wiiusej.wiiusejevents.physicalevents.MotionSensingEvent;
import wiiusej.wiiusejevents.physicalevents.WiimoteButtonsEvent; import wiiusej.wiiusejevents.physicalevents.WiimoteButtonsEvent;
import wiiusej.wiiusejevents.utils.WiimoteListener; import wiiusej.wiiusejevents.utils.WiimoteListener;
import wiiusej.wiiusejevents.wiiuseapievents.ClassicControllerInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.ClassicControllerRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.DisconnectionEvent; import wiiusej.wiiusejevents.wiiuseapievents.DisconnectionEvent;
import wiiusej.wiiusejevents.wiiuseapievents.GuitarHeroInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.GuitarHeroRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.NunchukInsertedEvent; import wiiusej.wiiusejevents.wiiuseapievents.NunchukInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.NunchukRemovedEvent; import wiiusej.wiiusejevents.wiiuseapievents.NunchukRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.StatusEvent; import wiiusej.wiiusejevents.wiiuseapievents.StatusEvent;
@@ -303,6 +307,24 @@ public class ButtonsEventPanel extends javax.swing.JPanel implements
// nothing // nothing
} }
public void onGuitarHeroInsertedEvent(GuitarHeroInsertedEvent arg0) {
// nothing
}
public void onGuitarHeroRemovedEvent(GuitarHeroRemovedEvent arg0) {
// nothing
}
public void onClassicControllerInsertedEvent(
ClassicControllerInsertedEvent arg0) {
// nothing
}
public void onClassicControllerRemovedEvent(
ClassicControllerRemovedEvent arg0) {
// nothing
}
public Color getHeldColor() { public Color getHeldColor() {
return heldColor; return heldColor;
} }

View File

@@ -32,7 +32,11 @@ import wiiusej.wiiusejevents.physicalevents.IREvent;
import wiiusej.wiiusejevents.physicalevents.MotionSensingEvent; import wiiusej.wiiusejevents.physicalevents.MotionSensingEvent;
import wiiusej.wiiusejevents.physicalevents.WiimoteButtonsEvent; import wiiusej.wiiusejevents.physicalevents.WiimoteButtonsEvent;
import wiiusej.wiiusejevents.utils.WiimoteListener; import wiiusej.wiiusejevents.utils.WiimoteListener;
import wiiusej.wiiusejevents.wiiuseapievents.ClassicControllerInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.ClassicControllerRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.DisconnectionEvent; import wiiusej.wiiusejevents.wiiuseapievents.DisconnectionEvent;
import wiiusej.wiiusejevents.wiiuseapievents.GuitarHeroInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.GuitarHeroRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.NunchukInsertedEvent; import wiiusej.wiiusejevents.wiiuseapievents.NunchukInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.NunchukRemovedEvent; import wiiusej.wiiusejevents.wiiuseapievents.NunchukRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.StatusEvent; import wiiusej.wiiusejevents.wiiuseapievents.StatusEvent;
@@ -200,6 +204,24 @@ public abstract class GForcePanel extends javax.swing.JPanel implements
// nothing // nothing
} }
public void onGuitarHeroInsertedEvent(GuitarHeroInsertedEvent arg0) {
// nothing
}
public void onGuitarHeroRemovedEvent(GuitarHeroRemovedEvent arg0) {
// nothing
}
public void onClassicControllerInsertedEvent(
ClassicControllerInsertedEvent arg0) {
// nothing
}
public void onClassicControllerRemovedEvent(
ClassicControllerRemovedEvent arg0) {
// nothing
}
private void draw(GenericEvent arg0) { private void draw(GenericEvent arg0) {
if (values.size() >= getWidth()) { if (values.size() >= getWidth()) {
// if there are as many values as pixels in the width // if there are as many values as pixels in the width

View File

@@ -30,7 +30,11 @@ import wiiusej.wiiusejevents.physicalevents.IREvent;
import wiiusej.wiiusejevents.physicalevents.MotionSensingEvent; import wiiusej.wiiusejevents.physicalevents.MotionSensingEvent;
import wiiusej.wiiusejevents.physicalevents.WiimoteButtonsEvent; import wiiusej.wiiusejevents.physicalevents.WiimoteButtonsEvent;
import wiiusej.wiiusejevents.utils.WiimoteListener; import wiiusej.wiiusejevents.utils.WiimoteListener;
import wiiusej.wiiusejevents.wiiuseapievents.ClassicControllerInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.ClassicControllerRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.DisconnectionEvent; import wiiusej.wiiusejevents.wiiuseapievents.DisconnectionEvent;
import wiiusej.wiiusejevents.wiiuseapievents.GuitarHeroInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.GuitarHeroRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.NunchukInsertedEvent; import wiiusej.wiiusejevents.wiiuseapievents.NunchukInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.NunchukRemovedEvent; import wiiusej.wiiusejevents.wiiuseapievents.NunchukRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.StatusEvent; import wiiusej.wiiusejevents.wiiuseapievents.StatusEvent;
@@ -193,6 +197,24 @@ public class IRPanel extends javax.swing.JPanel implements WiimoteListener {
// nothing // nothing
} }
public void onGuitarHeroInsertedEvent(GuitarHeroInsertedEvent arg0) {
// nothing
}
public void onGuitarHeroRemovedEvent(GuitarHeroRemovedEvent arg0) {
// nothing
}
public void onClassicControllerInsertedEvent(
ClassicControllerInsertedEvent arg0) {
// nothing
}
public void onClassicControllerRemovedEvent(
ClassicControllerRemovedEvent arg0) {
// nothing
}
public Color getBackgroundColor() { public Color getBackgroundColor() {
return backgroundColor; return backgroundColor;
} }

View File

@@ -30,7 +30,11 @@ import wiiusej.wiiusejevents.physicalevents.JoystickEvent;
import wiiusej.wiiusejevents.physicalevents.MotionSensingEvent; import wiiusej.wiiusejevents.physicalevents.MotionSensingEvent;
import wiiusej.wiiusejevents.physicalevents.WiimoteButtonsEvent; import wiiusej.wiiusejevents.physicalevents.WiimoteButtonsEvent;
import wiiusej.wiiusejevents.utils.WiimoteListener; import wiiusej.wiiusejevents.utils.WiimoteListener;
import wiiusej.wiiusejevents.wiiuseapievents.ClassicControllerInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.ClassicControllerRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.DisconnectionEvent; import wiiusej.wiiusejevents.wiiuseapievents.DisconnectionEvent;
import wiiusej.wiiusejevents.wiiuseapievents.GuitarHeroInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.GuitarHeroRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.NunchukInsertedEvent; import wiiusej.wiiusejevents.wiiuseapievents.NunchukInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.NunchukRemovedEvent; import wiiusej.wiiusejevents.wiiuseapievents.NunchukRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.StatusEvent; import wiiusej.wiiusejevents.wiiuseapievents.StatusEvent;
@@ -174,6 +178,24 @@ public abstract class JoystickEventPanel extends javax.swing.JPanel implements
// nothing // nothing
} }
public void onGuitarHeroInsertedEvent(GuitarHeroInsertedEvent arg0) {
// nothing
}
public void onGuitarHeroRemovedEvent(GuitarHeroRemovedEvent arg0) {
// nothing
}
public void onClassicControllerInsertedEvent(
ClassicControllerInsertedEvent arg0) {
// nothing
}
public void onClassicControllerRemovedEvent(
ClassicControllerRemovedEvent arg0) {
// nothing
}
public Color getBackgroundColor() { public Color getBackgroundColor() {
return backgroundColor; return backgroundColor;
} }

View File

@@ -32,7 +32,11 @@ import wiiusej.wiiusejevents.physicalevents.IREvent;
import wiiusej.wiiusejevents.physicalevents.MotionSensingEvent; import wiiusej.wiiusejevents.physicalevents.MotionSensingEvent;
import wiiusej.wiiusejevents.physicalevents.WiimoteButtonsEvent; import wiiusej.wiiusejevents.physicalevents.WiimoteButtonsEvent;
import wiiusej.wiiusejevents.utils.WiimoteListener; import wiiusej.wiiusejevents.utils.WiimoteListener;
import wiiusej.wiiusejevents.wiiuseapievents.ClassicControllerInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.ClassicControllerRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.DisconnectionEvent; import wiiusej.wiiusejevents.wiiuseapievents.DisconnectionEvent;
import wiiusej.wiiusejevents.wiiuseapievents.GuitarHeroInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.GuitarHeroRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.NunchukInsertedEvent; import wiiusej.wiiusejevents.wiiuseapievents.NunchukInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.NunchukRemovedEvent; import wiiusej.wiiusejevents.wiiuseapievents.NunchukRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.StatusEvent; import wiiusej.wiiusejevents.wiiuseapievents.StatusEvent;
@@ -201,6 +205,24 @@ public abstract class OrientationPanel extends javax.swing.JPanel implements
// nothing // nothing
} }
public void onGuitarHeroInsertedEvent(GuitarHeroInsertedEvent arg0) {
// nothing
}
public void onGuitarHeroRemovedEvent(GuitarHeroRemovedEvent arg0) {
// nothing
}
public void onClassicControllerInsertedEvent(
ClassicControllerInsertedEvent arg0) {
// nothing
}
public void onClassicControllerRemovedEvent(
ClassicControllerRemovedEvent arg0) {
// nothing
}
private void draw(GenericEvent arg0) { private void draw(GenericEvent arg0) {
if (values.size() >= getWidth()) { if (values.size() >= getWidth()) {
// if there are as many values as pixels in the width // if there are as many values as pixels in the width

View File

@@ -16,7 +16,13 @@
*/ */
package wiiusej.wiiusejevents.utils; package wiiusej.wiiusejevents.utils;
import wiiusej.wiiusejevents.physicalevents.ClassicControllerEvent;
import wiiusej.wiiusejevents.physicalevents.GuitarHeroEvent;
import wiiusej.wiiusejevents.wiiuseapievents.ClassicControllerInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.ClassicControllerRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.DisconnectionEvent; import wiiusej.wiiusejevents.wiiuseapievents.DisconnectionEvent;
import wiiusej.wiiusejevents.wiiuseapievents.GuitarHeroInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.GuitarHeroRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.NunchukInsertedEvent; import wiiusej.wiiusejevents.wiiuseapievents.NunchukInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.NunchukRemovedEvent; import wiiusej.wiiusejevents.wiiuseapievents.NunchukRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.StatusEvent; import wiiusej.wiiusejevents.wiiuseapievents.StatusEvent;
@@ -182,7 +188,7 @@ public class EventsGatherer {
} }
/** /**
* Set a NunchukEvent to the prepared . * Set a NunchukEvent to the prepared WiimoteEvent.
* *
* @param buttonsJustPressed * @param buttonsJustPressed
* buttons just pressed. * buttons just pressed.
@@ -256,6 +262,108 @@ public class EventsGatherer {
} }
} }
/**
* Set a GuitarHeroEvent to the prepared WiimoteEvent.
*
* @param buttonsJustPressed
* buttons just pressed.
* @param buttonsJustReleased
* buttons just released.
* @param buttonsHeld
* buttons just pressed.
* @param whammyBar
* whammy bar (range 0-1).
* @param angle
* angle the joystick is being held.
* @param magnitude
* magnitude of the joystick (range 0-1).
* @param max1
* maximum joystick value 1.
* @param max2
* maximum joystick value 2.
* @param min1
* minimum joystick value 1.
* @param min2
* minimum joystick value 2.
* @param center1
* center joystick value 1.
* @param center2
* center joystick value 2.
*/
public void addGuitarHeroEventToPreparedWiimoteEvent(
short buttonsJustPressed, short buttonsJustReleased,
short buttonsHeld, float whammyBar, float angle, float magnitude,
short max1, short max2, short min1, short min2, short center1,
short center2) {
if (genericEvent != null) {
genericEvent.setGuitarHeroEvent(buttonsJustPressed,
buttonsJustReleased, buttonsHeld, whammyBar, angle,
magnitude, max1, max2, min1, min2, center1, center2);
}
}
/**
* Set a ClassicControllerEvent to the prepared WiimoteEvent.
*
* @param buttonsJustPressed
* buttons just pressed.
* @param buttonsJustReleased
* buttons just released.
* @param buttonsHeld
* buttons just pressed.
* @param rightShoulder
* right shoulder button (range 0-1).
* @param leftShoulder
* left shoulder button (range 0-1).
* @param langle
* angle the left joystick is being held.
* @param lmagnitude
* magnitude of the left joystick (range 0-1).
* @param lmax1
* maximum left joystick value 1.
* @param lmax2
* maximum left joystick value 2.
* @param lmin1
* minimum left joystick value 1.
* @param lmin2
* minimum left joystick value 2.
* @param lcenter1
* center left joystick value 1.
* @param lcenter2
* center left joystick value 2.
* @param rangle
* angle the right joystick is being held.
* @param rmagnitude
* magnitude of the right joystick (range 0-1).
* @param rmax1
* maximum right joystick value 1.
* @param rmax2
* maximum right joystick value 2.
* @param rmin1
* minimum right joystick value 1.
* @param rmin2
* minimum right joystick value 2.
* @param rcenter1
* center right joystick value 1.
* @param rcenter2
* center right joystick value 2.
*/
public void setClassicControllerEvent(short buttonsJustPressed,
short buttonsJustReleased, short buttonsHeld, float rightShoulder,
float leftShoulder, float langle, float lmagnitude, short lmax1,
short lmax2, short lmin1, short lmin2, short lcenter1,
short lcenter2, float rangle, float rmagnitude, short rmax1,
short rmax2, short rmin1, short rmin2, short rcenter1,
short rcenter2) {
if (genericEvent != null) {
genericEvent.setClassicControllerEvent(buttonsJustPressed,
buttonsJustReleased, buttonsHeld, rightShoulder,
leftShoulder, langle, lmagnitude, lmax1, lmax2, lmin1,
lmin2, lcenter1, lcenter2, rangle, rmagnitude, rmax1,
rmax2, rmin1, rmin2, rcenter1, rcenter2);
}
}
/** /**
* Add the prepared WiimoteEvent to the gatherer. * Add the prepared WiimoteEvent to the gatherer.
*/ */
@@ -332,6 +440,52 @@ public class EventsGatherer {
addEvent(evt); addEvent(evt);
} }
/**
* Add a GuitarHeroInsertedEvent to the gatherer.
*
* @param id
* id of the wiimote.
*/
public void addGuitarHeroInsertedEvent(int id) {
GuitarHeroInsertedEvent evt = new GuitarHeroInsertedEvent(id);
addEvent(evt);
}
/**
* Add a GuitarHeroRemovedEvent to the gatherer.
*
* @param id
* id of the wiimote.
*/
public void addGuitarHeroRemovedEvent(int id) {
GuitarHeroRemovedEvent evt = new GuitarHeroRemovedEvent(id);
addEvent(evt);
}
/**
* Add a ClassicControllerInsertedEvent to the gatherer.
*
* @param id
* id of the wiimote.
*/
public void addClassicControllerInsertedEvent(int id) {
ClassicControllerInsertedEvent evt = new ClassicControllerInsertedEvent(
id);
addEvent(evt);
}
/**
* Add a ClassicControllerRemovedEvent to the gatherer.
*
* @param id
* id of the wiimote.
*/
public void addClassicControllerRemovedEvent(int id) {
ClassicControllerRemovedEvent evt = new ClassicControllerRemovedEvent(
id);
addEvent(evt);
}
/** /**
* Return an array containing the events. * Return an array containing the events.
* *

View File

@@ -20,7 +20,11 @@ import wiiusej.wiiusejevents.physicalevents.ExpansionEvent;
import wiiusej.wiiusejevents.physicalevents.IREvent; import wiiusej.wiiusejevents.physicalevents.IREvent;
import wiiusej.wiiusejevents.physicalevents.MotionSensingEvent; import wiiusej.wiiusejevents.physicalevents.MotionSensingEvent;
import wiiusej.wiiusejevents.physicalevents.WiimoteButtonsEvent; import wiiusej.wiiusejevents.physicalevents.WiimoteButtonsEvent;
import wiiusej.wiiusejevents.wiiuseapievents.ClassicControllerInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.ClassicControllerRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.DisconnectionEvent; import wiiusej.wiiusejevents.wiiuseapievents.DisconnectionEvent;
import wiiusej.wiiusejevents.wiiuseapievents.GuitarHeroInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.GuitarHeroRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.NunchukInsertedEvent; import wiiusej.wiiusejevents.wiiuseapievents.NunchukInsertedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.NunchukRemovedEvent; import wiiusej.wiiusejevents.wiiuseapievents.NunchukRemovedEvent;
import wiiusej.wiiusejevents.wiiuseapievents.StatusEvent; import wiiusej.wiiusejevents.wiiuseapievents.StatusEvent;
@@ -104,4 +108,38 @@ public interface WiimoteListener extends java.util.EventListener {
* the NunchukRemovedEvent. * the NunchukRemovedEvent.
*/ */
void onNunchukRemovedEvent(NunchukRemovedEvent e); void onNunchukRemovedEvent(NunchukRemovedEvent e);
/**
* This is the method called when a GuitarHeroInsertedEvent occurs.
*
* @param e
* the GuitarHeroInsertedEvent.
*/
void onGuitarHeroInsertedEvent(GuitarHeroInsertedEvent e);
/**
* This is the method called when a GuitarHeroRemovedEvent occurs.
*
* @param e
* the GuitarHeroRemovedEvent.
*/
void onGuitarHeroRemovedEvent(GuitarHeroRemovedEvent e);
/**
* This is the method called when a ClassicControllerInsertedEvent occurs.
*
* @param e
* the ClassicControllerInsertedEvent.
*/
void onClassicControllerInsertedEvent(ClassicControllerInsertedEvent e);
/**
* This is the method called when a ClassicControllerRemovedEvent occurs.
*
* @param e
* the ClassicControllerRemovedEvent.
*/
void onClassicControllerRemovedEvent(ClassicControllerRemovedEvent e);
} }

View File

@@ -17,7 +17,7 @@
package wiiusej.wiiusejevents.wiiuseapievents; package wiiusej.wiiusejevents.wiiuseapievents;
/** /**
* Event that represents the connection of a nunchuk to a wiimote. * Event that represents the disconnection of a nunchuk from a wiimote.
* *
* @author guiguito * @author guiguito
*/ */

View File

@@ -16,7 +16,9 @@
*/ */
package wiiusej.wiiusejevents.wiiuseapievents; package wiiusej.wiiusejevents.wiiuseapievents;
import wiiusej.wiiusejevents.physicalevents.ClassicControllerEvent;
import wiiusej.wiiusejevents.physicalevents.ExpansionEvent; import wiiusej.wiiusejevents.physicalevents.ExpansionEvent;
import wiiusej.wiiusejevents.physicalevents.GuitarHeroEvent;
import wiiusej.wiiusejevents.physicalevents.IREvent; import wiiusej.wiiusejevents.physicalevents.IREvent;
import wiiusej.wiiusejevents.physicalevents.MotionSensingEvent; import wiiusej.wiiusejevents.physicalevents.MotionSensingEvent;
import wiiusej.wiiusejevents.physicalevents.NunchukEvent; import wiiusej.wiiusejevents.physicalevents.NunchukEvent;
@@ -305,8 +307,102 @@ public class WiimoteEvent extends WiiUseApiEvent {
min1, min2, center1, center2); min1, min2, center1, center2);
} }
public void setClassicControllerEvent() { /**
// @TODO * Set a ClassicControllerEvent for the expansionEvent.
*
* @param buttonsJustPressed
* buttons just pressed.
* @param buttonsJustReleased
* buttons just released.
* @param buttonsHeld
* buttons just pressed.
* @param rightShoulder
* right shoulder button (range 0-1).
* @param leftShoulder
* left shoulder button (range 0-1).
* @param langle
* angle the left joystick is being held.
* @param lmagnitude
* magnitude of the left joystick (range 0-1).
* @param lmax1
* maximum left joystick value 1.
* @param lmax2
* maximum left joystick value 2.
* @param lmin1
* minimum left joystick value 1.
* @param lmin2
* minimum left joystick value 2.
* @param lcenter1
* center left joystick value 1.
* @param lcenter2
* center left joystick value 2.
* @param rangle
* angle the right joystick is being held.
* @param rmagnitude
* magnitude of the right joystick (range 0-1).
* @param rmax1
* maximum right joystick value 1.
* @param rmax2
* maximum right joystick value 2.
* @param rmin1
* minimum right joystick value 1.
* @param rmin2
* minimum right joystick value 2.
* @param rcenter1
* center right joystick value 1.
* @param rcenter2
* center right joystick value 2.
*/
public void setClassicControllerEvent(short buttonsJustPressed,
short buttonsJustReleased, short buttonsHeld, float rightShoulder,
float leftShoulder, float langle, float lmagnitude, short lmax1,
short lmax2, short lmin1, short lmin2, short lcenter1,
short lcenter2, float rangle, float rmagnitude, short rmax1,
short rmax2, short rmin1, short rmin2, short rcenter1,
short rcenter2) {
expansionEvent = new ClassicControllerEvent(getWiimoteId(),
buttonsJustPressed, buttonsJustReleased, buttonsHeld,
rightShoulder, leftShoulder, langle, lmagnitude, lmax1, lmax2,
lmin1, lmin2, lcenter1, lcenter2, rangle, rmagnitude, rmax1,
rmax2, rmin1, rmin2, rcenter1, rcenter2);
}
/**
* Set a GuitarHeroEvent for the expansionEvent.
*
* @param buttonsJustPressed
* buttons just pressed.
* @param buttonsJustReleased
* buttons just released.
* @param buttonsHeld
* buttons just pressed.
* @param whammyBar
* whammy bar (range 0-1).
* @param angle
* angle the joystick is being held.
* @param magnitude
* magnitude of the joystick (range 0-1).
* @param max1
* maximum joystick value 1.
* @param max2
* maximum joystick value 2.
* @param min1
* minimum joystick value 1.
* @param min2
* minimum joystick value 2.
* @param center1
* center joystick value 1.
* @param center2
* center joystick value 2.
*/
public void setGuitarHeroEvent(short buttonsJustPressed,
short buttonsJustReleased, short buttonsHeld, float whammyBar,
float angle, float magnitude, short max1, short max2, short min1,
short min2, short center1, short center2) {
expansionEvent = new GuitarHeroEvent(getWiimoteId(),
buttonsJustPressed, buttonsJustReleased, buttonsHeld,
whammyBar, angle, magnitude, max1, max2, min1, min2, center1,
center2);
} }
@Override @Override