+ @Override
+ protected void loadPageSettings(ICanvasContext ctx) {
+ super.loadPageSettings(ctx);
+ // this might be the wrong place to start such listening but at least
+ // super.loadPageSettings() does async-db-operations
+ sessionContext.getSession().asyncRequest(new UniqueRead<Boolean>() {
+
+ @Override
+ public Boolean perform(ReadGraph graph) throws DatabaseException {
+ return DistrictNetworkUtil.drawMapEnabled(graph, getInputResource());
+ }
+ }, new Listener<Boolean>() {
+
+ @Override
+ public void execute(Boolean result) {
+ canvasContext.getEventQueue().queueEvent(new CommandEvent(canvasContext, System.currentTimeMillis(), result ? Commands.MAP_ENABLE : Commands.MAP_DISABLE));
+ }
+
+ @Override
+ public void exception(Throwable t) {
+ LOGGER.error("Could not listen draw map for {}", getInputResource(), t);
+ }
+
+ @Override
+ public boolean isDisposed() {
+ return DistrictDiagramViewer.this.isDisposed();
+ }
+ });
+ }