@Override public void initSubPanel() { renderersPopups = getConsole().getSubPanelsOfInterface(IMapPopup.class); for (IMapPopup str2d : renderersPopups) { str2d.addMenuExtension(this); } renderers = getConsole().getSubPanelsOfInterface(ILayerPainter.class); for (ILayerPainter str2d : renderers) { str2d.addPostRenderPainter(this, I18n.text("My location")); } }
/* * (non-Javadoc) * * @see pt.up.fe.dceg.neptus.consolebase.SubPanelChangeListener#subPanelChanged(pt.up.fe.dceg.neptus.consolebase. * SubPanelChangeEvent) */ @Override public void subPanelChanged(SubPanelChangeEvent panelChange) { if (panelChange == null) return; renderersPopups = getConsole().getSubPanelsOfInterface(IMapPopup.class); if (ReflectionUtil.hasInterface(panelChange.getPanel().getClass(), IMapPopup.class)) { IMapPopup sub = (IMapPopup) panelChange.getPanel(); if (panelChange.added()) { renderersPopups.add(sub); IMapPopup str2d = sub; if (str2d != null) { str2d.addMenuExtension(this); } } if (panelChange.removed()) { renderersPopups.remove(sub); IMapPopup str2d = sub; if (str2d != null) { str2d.removeMenuExtension(this); } } } if (ReflectionUtil.hasInterface(panelChange.getPanel().getClass(), ILayerPainter.class)) { ILayerPainter sub = (ILayerPainter) panelChange.getPanel(); if (panelChange.added()) { renderers.add(sub); ILayerPainter str2d = sub; if (str2d != null) { str2d.addPostRenderPainter(this, "My location"); } } if (panelChange.removed()) { renderers.remove(sub); ILayerPainter str2d = sub; if (str2d != null) { str2d.removePostRenderPainter(this); } } } }