@SuppressWarnings("unchecked") private void createMonitor() { String monitorClassName = sim.getEnvironment().getPreferredMonitor(); Class<? extends SwingOutputMonitor<T>> monitorClass; if (monitorClassName == null) { monitorClass = (Class<? extends SwingOutputMonitor<T>>) DEFAULT_MONITOR_CLASS; } else { if (!monitorClassName.contains(".")) { monitorClassName = DEFAULT_MONITOR_PACKAGE + monitorClassName; } try { monitorClass = (Class<SwingOutputMonitor<T>>) Class.forName(monitorClassName); } catch (final ClassNotFoundException e) { L.warn(e); monitorClass = (Class<? extends SwingOutputMonitor<T>>) DEFAULT_MONITOR_CLASS; } } try { final SwingOutputMonitor<T> display = monitorClass.getConstructor().newInstance(); setMainDisplay(display); } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { L.error(e); } }
private void processError(final Throwable e) { SwingUtilities.invokeLater( () -> { bar.setFileOK(false); bar.setProcessOK(false); status.setText(r(Res.FILE_NOT_VALID) + " " + xml.getAbsolutePath()); status.setNo(); L.error(e); }); }