public void actionPerformed(ActionEvent evt) { if (evt.getSource() == showLinesCB) { setLinesEnabled(showLinesCB.isSelected()); } else if (evt.getSource() == showFVisCB) { setFVEnabled(showFVisCB.isSelected()); } else if (evt.getSource() == colorModeCB) { perVertexColor = colorModeCB.isSelected(); manager.setColorMode( colorModeCB.isSelected() ? FieldLine.COLOR_VERTEX : FieldLine.COLOR_VERTEX_FLAT); } else { int cmd = Integer.parseInt(evt.getActionCommand()); if (fconvolution != null) { Cursor cr = null; if (fWork instanceof TFramework) { cr = ((TFramework) fWork).getAppCursor(); ((TFramework) fWork).setAppCursor(new Cursor(Cursor.WAIT_CURSOR)); } Thread.yield(); TSimEngine model = fconvolution.getSimEngine(); if (model != null) { TEngineControl smc = model.getEngineControl(); if (smc.getSimState() == TEngineControl.RUNNING) { smc.stop(); model.refresh(); Thread.yield(); } switch (cmd) { case DLIC.DLIC_FLAG_E: // fconvolution.setField(((EMEngine)model).getEField()); fconvolution.setField(model.getElementByType(EField.class)); fconvolution.generateFieldImage(); break; case DLIC.DLIC_FLAG_B: // fconvolution.setField(((EMEngine)model).getBField()); fconvolution.setField(model.getElementByType(BField.class)); fconvolution.generateFieldImage(); break; case DLIC.DLIC_FLAG_G: // fconvolution.setField(((EMEngine)model).getGField()); fconvolution.setField(model.getElementByType(GField.class)); fconvolution.generateFieldImage(); break; case DLIC.DLIC_FLAG_P: // fconvolution.setField(((EMEngine)model).getPField()); fconvolution.setField(model.getElementByType(PField.class)); fconvolution.generateFieldImage(); break; case DLIC.DLIC_FLAG_EP: // fconvolution.setField(new // Potential(((EMEngine)model).getEField())); fconvolution.setField(new Potential(model.getElementByType(EField.class))); fconvolution.generateFieldImage(); break; case DLIC.DLIC_FLAG_BP: // fconvolution.setField(new // Potential(((EMEngine)model).getBField())); fconvolution.setField(new Potential(model.getElementByType(BField.class))); fconvolution.generateFieldImage(); break; case DLIC.DLIC_FLAG_EF: // fconvolution.setField(((EMEngine)model).getEField()); fconvolution.setField(model.getElementByType(EField.class)); fconvolution.generateColorMappedFluxImage(); break; case DLIC.DLIC_FLAG_BF: // fconvolution.setField(((EMEngine)model).getBField()); fconvolution.setField(model.getElementByType(BField.class)); fconvolution.generateColorMappedFluxImage(); break; default: break; } fconvolution.getImage(); } else { TDebug.println(0, "DLIC model is null"); } if (fWork instanceof TFramework) { ((TFramework) fWork).setAppCursor(cr); } } } }