diff --git a/WiiUseJ/src/wiiusej/utils/GuitarHero3ButtonsEventPanel.java b/WiiUseJ/src/wiiusej/utils/GuitarHero3ButtonsEventPanel.java index 907a5dc..fe03337 100644 --- a/WiiUseJ/src/wiiusej/utils/GuitarHero3ButtonsEventPanel.java +++ b/WiiUseJ/src/wiiusej/utils/GuitarHero3ButtonsEventPanel.java @@ -162,10 +162,10 @@ public class GuitarHero3ButtonsEventPanel extends javax.swing.JPanel implements //blue button if (buttons.isButtonBlueJustPressed()) { blueButton.setSelected(true); - orangeButton.setText("X"); + blueButton.setText("X"); } else if (buttons.isButtonBlueJustReleased()) { blueButton.setSelected(false); - orangeButton.setText("O"); + blueButton.setText("O"); } //Yellow button diff --git a/WiiUseJ/src/wiiusej/utils/JoystickEventPanel.java b/WiiUseJ/src/wiiusej/utils/JoystickEventPanel.java index a813df1..2883216 100644 --- a/WiiUseJ/src/wiiusej/utils/JoystickEventPanel.java +++ b/WiiUseJ/src/wiiusej/utils/JoystickEventPanel.java @@ -99,7 +99,7 @@ public abstract class JoystickEventPanel extends javax.swing.JPanel implements // compute coordinates if (lastJoystickEvent != null) { - double xAng = Math.sin(lastJoystickEvent.getAngle() * Math.PI + double xAng = Math.sin(lastJoystickEvent.getAngle() * Math.PI / 180.0) * lastJoystickEvent.getMagnitude(); double yAng = Math.cos(lastJoystickEvent.getAngle() * Math.PI @@ -107,12 +107,12 @@ public abstract class JoystickEventPanel extends javax.swing.JPanel implements * lastJoystickEvent.getMagnitude(); int halfWidth = (int) Math.round(shape.getBounds().getWidth() / 2); int halHeight = (int) Math.round(shape.getBounds().getHeight() / 2); - int xAmplitude = (int)Math.round(xCenter-shape.getBounds().getWidth()); - int yAmplitude = (int)Math.round(xCenter-shape.getBounds().getHeight()); - int xShift = (int)Math.round(xAng * xAmplitude); - int yShift = (int)Math.round(yAng * yAmplitude); - int x = xCenter + xShift - halfWidth; - int y = yCenter - yShift - halHeight; + int xAmplitude = (int) Math.round(xCenter - shape.getBounds().getWidth()); + int yAmplitude = (int) Math.round(xCenter - shape.getBounds().getHeight()); + int xShift = (int) Math.round(xAng * xAmplitude); + int yShift = (int) Math.round(yAng * yAmplitude); + int x = xCenter + xShift - halfWidth; + int y = yCenter - yShift - halHeight; // shape g2.translate(x, y); g2.setPaint(borderColor);