private Runnable dragSegment;
private Runnable refreshLimitsSegment;
private Runnable mouseClickSegment;
private void initPools() {
pool1 = new ThreadPoolExecutor(0, 4, 60L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>(), new ThreadFactory() {
public Thread newThread(Runnable r) {
Thread t = new Thread(r, "VisualizationThreadPool 1");
t.setDaemon(true);
return t;
}
}) {
@Override
protected void afterExecute(Runnable r, Throwable t) {
super.afterExecute(r, t);
pool1Semaphore.release();
}
@Override
public void execute(Runnable command) {
super.execute(command);
}
};
pool2 = new ThreadPoolExecutor(0, 4, 60L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>(), new ThreadFactory() {
public Thread newThread(Runnable r) {
Thread t = new Thread(r, "VisualizationThreadPool 2");
t.setDaemon(true);
return t;