+
+ @Override
+ protected void addGridRulerBackgroundParticipants(CanvasContext ctx) {
+ ctx.add(new GridPainter());
+ ctx.add(new MapRulerPainter());
+ ctx.add(new BackgroundPainter());
+ }
+
+ protected void addViewManipulationParticipants(CanvasContext ctx) {
+ ctx.add(new DistrictPanZoomRotateHandler());
+ //ctx.add(new MousePanZoomInteractor());
+ //ctx.add(new MultitouchPanZoomRotateInteractor());
+ // ctx.add( new OrientationRestorer() );
+ ctx.add(new ZoomToAreaHandler());
+ }
+
+ @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();
+ }
+ });
+ }