Gewerkt aan items uit de TODO lijst, zie TODO voor details.
This commit is contained in:
@@ -2,13 +2,13 @@ package pm;
|
|||||||
|
|
||||||
import pm.exception.application.ApplicationExitException;
|
import pm.exception.application.ApplicationExitException;
|
||||||
import pm.exception.application.ApplicationInitialiseException;
|
import pm.exception.application.ApplicationInitialiseException;
|
||||||
import pm.task.TaskGatherer;
|
import pm.task.TaskManager;
|
||||||
import pm.task.TaskListener;
|
import pm.task.TaskListener;
|
||||||
|
|
||||||
public abstract class Application extends TaskListener {
|
public abstract class Application extends TaskListener {
|
||||||
public Application() {
|
public Application() {
|
||||||
super();
|
super();
|
||||||
TaskGatherer.add(this);
|
TaskManager.add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import pm.macro.event.Sequence;
|
|||||||
import pm.macro.event.SequenceListener;
|
import pm.macro.event.SequenceListener;
|
||||||
import pm.task.Continuous;
|
import pm.task.Continuous;
|
||||||
import pm.task.Stopper;
|
import pm.task.Stopper;
|
||||||
import pm.task.TaskGatherer;
|
import pm.task.TaskManager;
|
||||||
import pm.task.TaskListener;
|
import pm.task.TaskListener;
|
||||||
|
|
||||||
public abstract class Device extends TaskListener {
|
public abstract class Device extends TaskListener {
|
||||||
@@ -19,7 +19,7 @@ public abstract class Device extends TaskListener {
|
|||||||
public Device() {
|
public Device() {
|
||||||
super();
|
super();
|
||||||
sequenceListener = new SequenceListener();
|
sequenceListener = new SequenceListener();
|
||||||
TaskGatherer.add(this);
|
TaskManager.add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Register macro's */
|
/* Register macro's */
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import pm.device.wiimote.WiimoteDevice;
|
|||||||
import pm.exception.application.ApplicationExitException;
|
import pm.exception.application.ApplicationExitException;
|
||||||
import pm.exception.device.DeviceExitException;
|
import pm.exception.device.DeviceExitException;
|
||||||
import pm.exception.device.DeviceInitialiseException;
|
import pm.exception.device.DeviceInitialiseException;
|
||||||
import pm.task.TaskGatherer;
|
import pm.task.TaskManager;
|
||||||
import pm.task.TaskListener;
|
import pm.task.TaskListener;
|
||||||
|
|
||||||
public class Main extends TaskListener {
|
public class Main extends TaskListener {
|
||||||
@@ -35,18 +35,18 @@ public class Main extends TaskListener {
|
|||||||
"pm.device.wiimote.WiimoteDevice"};*/
|
"pm.device.wiimote.WiimoteDevice"};*/
|
||||||
applicationCycle = new ApplicationCycle();
|
applicationCycle = new ApplicationCycle();
|
||||||
deviceList = new ArrayList<Device>();
|
deviceList = new ArrayList<Device>();
|
||||||
TaskGatherer.initialise(applicationCycle);
|
TaskManager.initialise(applicationCycle);
|
||||||
TaskGatherer.add(this);
|
TaskManager.add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initialise() throws DeviceInitialiseException {
|
public void initialise() throws DeviceInitialiseException {
|
||||||
add(new JIntellitypeDevice());
|
//add(new JIntellitypeDevice());
|
||||||
//add(new PlayerDevice());
|
//add(new PlayerDevice());
|
||||||
//add(new RumblepadDevice());
|
//add(new RumblepadDevice());
|
||||||
//add(new WiimoteDevice());
|
//add(new WiimoteDevice());
|
||||||
//add(new GUIDevice());
|
//add(new GUIDevice());
|
||||||
//add(new TextDevice());
|
//add(new TextDevice());
|
||||||
//add(new LanTextDevice());
|
add(new LanTextDevice());
|
||||||
for (Device device : deviceList) {
|
for (Device device : deviceList) {
|
||||||
try {
|
try {
|
||||||
device.initialise();
|
device.initialise();
|
||||||
@@ -57,9 +57,9 @@ public class Main extends TaskListener {
|
|||||||
|
|
||||||
add(new ExampleApplication());
|
add(new ExampleApplication());
|
||||||
//add(new WMPApplication());
|
//add(new WMPApplication());
|
||||||
add(new GomPlayerApplication());
|
//add(new GomPlayerApplication());
|
||||||
//add(new WinampApplication());
|
//add(new WinampApplication());
|
||||||
//add(new iTunesApplication());
|
add(new iTunesApplication());
|
||||||
for (Application application : applicationCycle) {
|
for (Application application : applicationCycle) {
|
||||||
application.start();
|
application.start();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import javax.swing.JFrame;
|
|||||||
import pm.Action;
|
import pm.Action;
|
||||||
import pm.Target;
|
import pm.Target;
|
||||||
import pm.Task;
|
import pm.Task;
|
||||||
import pm.task.TaskGatherer;
|
import pm.task.TaskManager;
|
||||||
|
|
||||||
import layout.TableLayout;
|
import layout.TableLayout;
|
||||||
import layout.TableLayoutConstraints;
|
import layout.TableLayoutConstraints;
|
||||||
@@ -157,42 +157,42 @@ public class GUIDeviceUI extends JFrame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void playAction(ActionEvent e) {
|
protected void playAction(ActionEvent e) {
|
||||||
TaskGatherer.add(new Task(Action.PLAY, Target.APPLICATION));
|
TaskManager.add(new Task(Action.PLAY, Target.APPLICATION));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void pauseAction(ActionEvent e) {
|
protected void pauseAction(ActionEvent e) {
|
||||||
TaskGatherer.add(new Task(Action.PAUSE, Target.APPLICATION));
|
TaskManager.add(new Task(Action.PAUSE, Target.APPLICATION));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void resumeAction(ActionEvent e) {
|
protected void resumeAction(ActionEvent e) {
|
||||||
TaskGatherer.add(new Task(Action.RESUME, Target.APPLICATION));
|
TaskManager.add(new Task(Action.RESUME, Target.APPLICATION));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void nextAction(ActionEvent e) {
|
protected void nextAction(ActionEvent e) {
|
||||||
TaskGatherer.add(new Task(Action.NEXT, Target.APPLICATION));
|
TaskManager.add(new Task(Action.NEXT, Target.APPLICATION));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void previousAction(ActionEvent e) {
|
protected void previousAction(ActionEvent e) {
|
||||||
TaskGatherer.add(new Task(Action.PREVIOUS, Target.APPLICATION));
|
TaskManager.add(new Task(Action.PREVIOUS, Target.APPLICATION));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void forwardAction(ActionEvent e) {
|
protected void forwardAction(ActionEvent e) {
|
||||||
TaskGatherer.add(new Task(Action.FORWARD, Target.APPLICATION));
|
TaskManager.add(new Task(Action.FORWARD, Target.APPLICATION));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void rewindAction(ActionEvent e) {
|
protected void rewindAction(ActionEvent e) {
|
||||||
TaskGatherer.add(new Task(Action.REWIND, Target.APPLICATION));
|
TaskManager.add(new Task(Action.REWIND, Target.APPLICATION));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void muteAction(ActionEvent e) {
|
protected void muteAction(ActionEvent e) {
|
||||||
TaskGatherer.add(new Task(Action.MUTE, Target.APPLICATION));
|
TaskManager.add(new Task(Action.MUTE, Target.APPLICATION));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void volumeUpAction(ActionEvent e) {
|
protected void volumeUpAction(ActionEvent e) {
|
||||||
TaskGatherer.add(new Task(Action.VOLUME_UP, Target.APPLICATION));
|
TaskManager.add(new Task(Action.VOLUME_UP, Target.APPLICATION));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void volumeDownAction(ActionEvent e) {
|
protected void volumeDownAction(ActionEvent e) {
|
||||||
TaskGatherer.add(new Task(Action.VOLUME_DOWN, Target.APPLICATION));
|
TaskManager.add(new Task(Action.VOLUME_DOWN, Target.APPLICATION));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public class LanTextDevice extends Device implements Runnable {
|
|||||||
new LanTextListener(socket.accept());
|
new LanTextListener(socket.accept());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,20 +4,17 @@ import java.io.IOException;
|
|||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
||||||
import pm.Action;
|
import pm.device.textinput.TextDevice;
|
||||||
import pm.Target;
|
|
||||||
import pm.Task;
|
|
||||||
import pm.task.TaskGatherer;
|
|
||||||
|
|
||||||
public class LanTextListener implements Runnable {
|
public class LanTextListener extends TextDevice {
|
||||||
static final int SLEEP = 100;
|
|
||||||
|
|
||||||
protected boolean run;
|
|
||||||
protected Socket socket;
|
protected Socket socket;
|
||||||
protected Scanner input;
|
|
||||||
|
|
||||||
public LanTextListener(Socket socket){
|
public LanTextListener(Socket socket) {
|
||||||
this.socket = socket;
|
this.socket = socket;
|
||||||
|
initialise();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initialise() {
|
||||||
try {
|
try {
|
||||||
input = new Scanner(socket.getInputStream());
|
input = new Scanner(socket.getInputStream());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -27,25 +24,11 @@ public class LanTextListener implements Runnable {
|
|||||||
new Thread(this).start();
|
new Thread(this).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void run() {
|
protected boolean running() {
|
||||||
while (run && socket.isConnected() && input.hasNext()) {
|
return run && socket.isConnected() && input.hasNext();
|
||||||
String textinput = input.next().toUpperCase();
|
|
||||||
if(textinput != null) {
|
|
||||||
try {
|
|
||||||
TaskGatherer.add(
|
|
||||||
new Task(Action.valueOf(textinput), Target.APPLICATION));
|
|
||||||
} catch (IllegalArgumentException e) {}
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
Thread.sleep(SLEEP);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void exit() {
|
public void exit() {
|
||||||
run = false;
|
run = false;
|
||||||
try {
|
try {
|
||||||
socket.close();
|
socket.close();
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import pm.Action;
|
|||||||
import pm.Device;
|
import pm.Device;
|
||||||
import pm.Target;
|
import pm.Target;
|
||||||
import pm.Task;
|
import pm.Task;
|
||||||
import pm.task.TaskGatherer;
|
import pm.task.TaskManager;
|
||||||
|
|
||||||
public class TextDevice extends Device implements Runnable {
|
public class TextDevice extends Device implements Runnable {
|
||||||
static final int SLEEP = 100;
|
static final int SLEEP = 100;
|
||||||
@@ -21,11 +21,11 @@ public class TextDevice extends Device implements Runnable {
|
|||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
run = true;
|
run = true;
|
||||||
while (run) {
|
while (running()) {
|
||||||
String textinput = input.next().toUpperCase();
|
String textinput = input.next().toUpperCase();
|
||||||
if(textinput != null) {
|
if(textinput != null) {
|
||||||
try {
|
try {
|
||||||
TaskGatherer.add(
|
TaskManager.add(
|
||||||
new Task(Action.valueOf(textinput), Target.APPLICATION));
|
new Task(Action.valueOf(textinput), Target.APPLICATION));
|
||||||
} catch(IllegalArgumentException e) {}
|
} catch(IllegalArgumentException e) {}
|
||||||
}
|
}
|
||||||
@@ -36,4 +36,8 @@ public class TextDevice extends Device implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected boolean running() {
|
||||||
|
return run && input.hasNext();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import pm.Device;
|
|||||||
import pm.Task;
|
import pm.Task;
|
||||||
import pm.macro.Active;
|
import pm.macro.Active;
|
||||||
import pm.macro.Event;
|
import pm.macro.Event;
|
||||||
import pm.task.TaskGatherer;
|
import pm.task.TaskManager;
|
||||||
|
|
||||||
public class SequenceListener {
|
public class SequenceListener {
|
||||||
public ArrayList<Sequence> sequenceList;
|
public ArrayList<Sequence> sequenceList;
|
||||||
@@ -34,7 +34,7 @@ public class SequenceListener {
|
|||||||
if (active.next(event)) {
|
if (active.next(event)) {
|
||||||
if (active.last()) {
|
if (active.last()) {
|
||||||
Task task = taskMap.get(active.getSequence());
|
Task task = taskMap.get(active.getSequence());
|
||||||
TaskGatherer.add(task);
|
TaskManager.add(task);
|
||||||
removeList.add(active);
|
removeList.add(active);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -9,13 +9,13 @@ import pm.Target;
|
|||||||
import pm.Task;
|
import pm.Task;
|
||||||
import pm.application.ApplicationCycle;
|
import pm.application.ApplicationCycle;
|
||||||
|
|
||||||
public class TaskGatherer {
|
public class TaskManager {
|
||||||
protected static ArrayList<TaskListener> taskListenerList;
|
protected static ArrayList<TaskListener> taskListenerList;
|
||||||
protected static ApplicationCycle applicationCycle;
|
protected static ApplicationCycle applicationCycle;
|
||||||
|
|
||||||
public static void initialise(ApplicationCycle applicationCycle) {
|
public static void initialise(ApplicationCycle applicationCycle) {
|
||||||
taskListenerList = new ArrayList<TaskListener>();
|
taskListenerList = new ArrayList<TaskListener>();
|
||||||
TaskGatherer.applicationCycle = applicationCycle;
|
TaskManager.applicationCycle = applicationCycle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void add(TaskListener taskListener) {
|
public static void add(TaskListener taskListener) {
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
|
TODO
|
||||||
|
------------
|
||||||
|
|
||||||
log bijhouden
|
log bijhouden
|
||||||
|
|
||||||
mappings lezen vanuit config bestand
|
mappings lezen vanuit config bestand
|
||||||
@@ -12,16 +15,23 @@ nummerinfo weergeven, waar? via feedback?
|
|||||||
|
|
||||||
javadoc maken, class diagram opstellen enz.....
|
javadoc maken, class diagram opstellen enz.....
|
||||||
|
|
||||||
naamgeving en indeling classes/packages controleren
|
|
||||||
|
|
||||||
meer applicaties implementeren, zoals VLC, WMP, Youtube? (interface naar flash?)
|
meer applicaties implementeren, zoals VLC, WMP, Youtube? (interface naar flash?)
|
||||||
|
|
||||||
logo ontwerpen
|
logo ontwerpen
|
||||||
|
|
||||||
exporteren naar uitvoerbare jar file
|
|
||||||
|
|
||||||
lantextdevice generiek maken met normale textdevice
|
|
||||||
|
|
||||||
client maken die remote devices kan beheren en lokaal acties kan uitvoeren
|
client maken die remote devices kan beheren en lokaal acties kan uitvoeren
|
||||||
|
|
||||||
mogelijkheid tot webstart onderzoeken
|
mogelijkheid tot webstart onderzoeken
|
||||||
|
|
||||||
|
|
||||||
|
IN PROGRESS
|
||||||
|
-------------
|
||||||
|
naamgeving en indeling classes/packages controleren
|
||||||
|
+TaskGatherererer hernoemt naar TaskManager
|
||||||
|
|
||||||
|
exporteren naar uitvoerbare jar file
|
||||||
|
+Eclipse kan exporteren, maar bij uitvoeren gebeurd er niets. Moet er een status scherm komen? (Een swing console bijvoorbeeld)
|
||||||
|
|
||||||
|
DONE
|
||||||
|
-------------
|
||||||
|
lantextdevice generiek maken met normale textdevice
|
||||||
Reference in New Issue
Block a user