From 9eb7c9fec8cdd7b86520eb98cac9be6f88082729 Mon Sep 17 00:00:00 2001 From: Stefan Hahmann Date: Thu, 19 Sep 2024 16:08:36 +0200 Subject: [PATCH] Set smaller min scale values for in MamutBranchViewGrapher so that further zoom in is possible --- .../mamut/views/grapher/MamutBranchViewGrapher.java | 4 ++++ .../display/InertialScreenTransformEventHandler.java | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/main/java/org/mastodon/mamut/views/grapher/MamutBranchViewGrapher.java b/src/main/java/org/mastodon/mamut/views/grapher/MamutBranchViewGrapher.java index 051477218..55763f057 100644 --- a/src/main/java/org/mastodon/mamut/views/grapher/MamutBranchViewGrapher.java +++ b/src/main/java/org/mastodon/mamut/views/grapher/MamutBranchViewGrapher.java @@ -53,6 +53,7 @@ import org.mastodon.views.grapher.display.FeatureGraphConfig; import org.mastodon.views.grapher.display.FeatureGraphConfig.GraphDataItemsSource; import org.mastodon.views.grapher.display.FeatureSpecPair; +import org.mastodon.views.grapher.display.InertialScreenTransformEventHandler; import java.util.Iterator; import java.util.function.BiConsumer; @@ -75,6 +76,9 @@ public class MamutBranchViewGrapher extends MamutBranchView< DataGraph< BranchSp grapherInitializer = new GrapherInitializer<>( viewGraph, appModel, selectionModel, navigationHandler, focusModel, highlightModel, getGroupHandle() ); grapherInitializer.getFrame().setTitle( "Grapher Branch" ); + InertialScreenTransformEventHandler handler = grapherInitializer.getFrame().getDataDisplayPanel().getTransformEventHandler(); + handler.setMinScaleX( 0.1d ); + handler.setMinScaleY( 0.1d ); grapherInitializer.setOnClose( this ); grapherInitializer.initFeatureConfig( getFeatureGraphConfig() ); setFrame( grapherInitializer.getFrame() ); // this creates viewActions and viewBehaviours thus must be called before installActions diff --git a/src/main/java/org/mastodon/views/grapher/display/InertialScreenTransformEventHandler.java b/src/main/java/org/mastodon/views/grapher/display/InertialScreenTransformEventHandler.java index e3049950e..4b1579800 100644 --- a/src/main/java/org/mastodon/views/grapher/display/InertialScreenTransformEventHandler.java +++ b/src/main/java/org/mastodon/views/grapher/display/InertialScreenTransformEventHandler.java @@ -274,6 +274,16 @@ public synchronized void updateAxesSize( final int width, final int height ) updateTransformScreenSize(); } + public void setMinScaleY( final double minScaleY ) + { + this.minScaleY = minScaleY; + } + + public void setMinScaleX( final double minScaleX ) + { + this.minScaleX = minScaleX; + } + private void updateTransformScreenSize() { final ScreenTransform transform = transformState.get();