Fix for Janco

This commit is contained in:
2015-05-03 21:57:46 +02:00
parent 39484a720d
commit 435296b9be
5 changed files with 0 additions and 0 deletions
-27
View File
@@ -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();
}
}
-21
View File
@@ -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();
}
}
-50
View File
@@ -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
}
}