X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.district.network.ui%2Fsrc%2Forg%2Fsimantics%2Fdistrict%2Fnetwork%2Fui%2FDistrictDiagramViewer.java;h=9d07f0378a18e69fd9252200b06a4000b3ff2233;hb=ac6ad8ff2b20a10e85e7b12c1af670500daebdd4;hp=c150654c46039f090b76239cf4cdf0a911b6319e;hpb=00e4eca98cef6d77d5023f4b424f9e8da0487463;p=simantics%2Fdistrict.git diff --git a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/DistrictDiagramViewer.java b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/DistrictDiagramViewer.java index c150654c..9d07f037 100644 --- a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/DistrictDiagramViewer.java +++ b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/DistrictDiagramViewer.java @@ -15,6 +15,7 @@ import org.simantics.g2d.participant.BackgroundPainter; import org.simantics.g2d.participant.GridPainter; import org.simantics.g2d.participant.PanZoomRotateHandler; import org.simantics.g2d.participant.RenderingQualityInteractor; +import org.simantics.g2d.participant.ZoomToAreaHandler; import org.simantics.maps.MapScalingTransform; import org.simantics.maps.eclipse.MapPainter; import org.simantics.modeling.ui.diagramEditor.DiagramViewer; @@ -43,7 +44,7 @@ public class DistrictDiagramViewer extends DiagramViewer { super.initializeCanvasContext(ctx); IHintContext h = ctx.getDefaultHintContext(); h.setHint(PanZoomRotateHandler.KEY_ZOOM_IN_LIMIT, 1000000.0); - h.setHint(PanZoomRotateHandler.KEY_ZOOM_OUT_LIMIT, 0.01); + h.setHint(PanZoomRotateHandler.KEY_ZOOM_OUT_LIMIT, 0.003); } @Override @@ -58,4 +59,13 @@ public class DistrictDiagramViewer extends DiagramViewer { 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()); + } + }