@Override public void update(Object theObserved, Object changeCode) { if (theObserved.equals(plotConsumer)) { if (changeCode instanceof DataBean) { plotWindow.processPlotUpdate((DataBean) changeCode); notifyDataObservers((DataBean) changeCode); } else if (changeCode instanceof GuiBean) { plotWindow.processGUIUpdate((GuiBean) changeCode); } } else { if (changeCode instanceof String && changeCode.equals(plotName)) { plotConsumer.addJob(new PlotJob(PlotJobType.Data)); } if (changeCode instanceof GuiUpdate) { GuiUpdate gu = (GuiUpdate) changeCode; if (gu.getGuiName().contains(plotName)) { GuiBean bean = gu.getGuiData(); UUID id = (UUID) bean.get(GuiParameters.PLOTID); if (id == null || plotId.compareTo(id) != 0) { // filter out own beans if (guiBean == null) guiBean = bean.copy(); // cache a local copy else guiBean.merge(bean); // or merge it PlotJob job = new PlotJob(PlotJobType.GUI); job.setGuiBean(bean); plotConsumer.addJob(job); } } } } }
@Override public Object execute(ExecutionEvent event) throws ExecutionException { String viewName = event.getParameter(VIEW_NAME_PARAM); PlotWindow.getManager().openView(null, viewName); return null; }