Fix for Janco
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
package view;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
interface ButtonListener {
|
||||
public void buttonPressed();
|
||||
public void buttonReleased();
|
||||
}
|
||||
|
||||
class Button {
|
||||
List<ButtonListener> listeners = new ArrayList<ButtonListener>();
|
||||
|
||||
public void addButtonListener(ButtonListener toAdd) {
|
||||
listeners.add(toAdd);
|
||||
}
|
||||
|
||||
public void buttonPress() {
|
||||
for (ButtonListener bt : listeners)
|
||||
bt.buttonPressed();
|
||||
}
|
||||
|
||||
public void buttonRelease() {
|
||||
for (ButtonListener bt : listeners)
|
||||
bt.buttonReleased();
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package view;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
interface JoyStickListener {
|
||||
public void onJoyStickMoved();
|
||||
}
|
||||
|
||||
class JoyStick {
|
||||
List<JoyStickListener> listeners = new ArrayList<JoyStickListener>();
|
||||
|
||||
public void addJoyStickListener(JoyStickListener toAdd) {
|
||||
listeners.add(toAdd);
|
||||
}
|
||||
|
||||
public void onJoyStickMoved() {
|
||||
for (JoyStickListener yst : listeners)
|
||||
yst.onJoyStickMoved();
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package view;
|
||||
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.Timer;
|
||||
|
||||
public class Panel extends JPanel implements ActionListener, ButtonListener, JoyStickListener{
|
||||
|
||||
Timer t;
|
||||
|
||||
public Panel()
|
||||
{
|
||||
//addButtonListener(this);
|
||||
|
||||
t = new Timer(1000/30, this);
|
||||
t.start();
|
||||
}
|
||||
|
||||
public void actionPerformed(ActionEvent arg0) {
|
||||
repaint();
|
||||
}
|
||||
|
||||
public void paintComponent(Graphics g)
|
||||
{
|
||||
super.paintComponent(g);
|
||||
Graphics2D g2d = (Graphics2D) g;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buttonPressed() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buttonReleased() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onJoyStickMoved() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user