Removed Threading in ExecutionTimeSubject because of JavaFX Thread problem
This commit is contained in:
@ -24,29 +24,8 @@ public abstract class ExecutionTimeSubject extends PICComponent implements PICCo
|
||||
}
|
||||
|
||||
protected void notifyObservers(){
|
||||
for (final ExecutionTimeObserver each : observers){
|
||||
notify(each);
|
||||
}
|
||||
}
|
||||
|
||||
protected void notify(final ExecutionTimeObserver observer) {
|
||||
createNotifierFor(observer).start();
|
||||
}
|
||||
|
||||
|
||||
protected Thread createNotifierFor(ExecutionTimeObserver observer) {
|
||||
return new Thread(){
|
||||
public void run(){
|
||||
try {
|
||||
observer.executionTimeChanged();
|
||||
} catch (Exception e){
|
||||
e.printStackTrace();
|
||||
ExecutionTimeSubject.this.observers.remove(observer);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
observers.forEach(o -> o.executionTimeChanged());
|
||||
}
|
||||
|
||||
public double getTotalExecutionTime(){
|
||||
throw new UnsupportedOperationException("No class implements ExecutionTimeSubject correctly!");
|
||||
|
||||
Reference in New Issue
Block a user