()
| 201 | } |
| 202 | |
| 203 | private void setupWorkers() { |
| 204 | // Add actor thread: Consume the working queue and add the actor into |
| 205 | // the render inside the EDT thread |
| 206 | final AddActorRunnable adderRunnable = new AddActorRunnable(); |
| 207 | adderRunnable.setRenderer(panel3d); |
| 208 | new Thread() { |
| 209 | public void run() { |
| 210 | for (int i = 0; i < NUMBER_OF_PIPLINE_TO_BUILD; i++) { |
| 211 | try { |
| 212 | adderRunnable.setActor(exec.take().get()); |
| 213 | SwingUtilities.invokeAndWait(adderRunnable); |
| 214 | panel3d.repaint(); |
| 215 | } catch (InterruptedException e) { |
| 216 | return; |
| 217 | } catch (ExecutionException e) { |
| 218 | e.printStackTrace(); |
| 219 | } catch (InvocationTargetException e) { |
| 220 | e.printStackTrace(); |
| 221 | } |
| 222 | } |
| 223 | }; |
| 224 | }.start(); |
| 225 | } |
| 226 | |
| 227 | public void startWorking() { |
| 228 | for (int i = 0; i < NUMBER_OF_PIPLINE_TO_BUILD; i++) { |
no test coverage detected