Skip to content

Commit

Permalink
redirect [T] to my own manual transform
Browse files Browse the repository at this point in the history
  • Loading branch information
tischi committed Jul 1, 2024
1 parent 35fca8e commit bb5533e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<groupId>org.embl.mobie</groupId>
<artifactId>mobie-viewer-fiji</artifactId>
<version>5.1.1</version>
<version>5.1.2</version>

<!-- force javadoc generation to fetch errors: -->
<!-- mvn javadoc:javadoc | grep error -->
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/org/embl/mobie/lib/bdv/view/SliceViewer.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,17 @@ private void installContextMenuAndKeyboardShortCuts( )
behaviours.behaviour( contextMenu, "Context menu", "button3", "shift P");
behaviours.install( bdvHandle.getTriggerbindings(), "MoBIE" );

bdvHandle.getKeybindings().removeInputMap( "T" );
// get all present action keys
// just to see what's there
// one of them is "toggle manual transformation"
Object[] allKeys = bdvHandle.getKeybindings().getConcatenatedActionMap().allKeys();
// disable the manual transform action
bdvHandle.getKeybindings().getConcatenatedActionMap().get("toggle manual transformation").setEnabled( false );

behaviours.behaviour(
( ClickBehaviour ) ( x, y ) ->
new Thread( () -> {
Services.commandService.run( ManualTransformationCommand.class, true );
System.out.println( "My own manual transform" );
}).start(),
"Manual transform", "T" ) ;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/embl/mobie/lib/view/save/ViewSaver.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public ViewSaver( MoBIE moBIE) {

public boolean saveViewDialog( View view )
{
final GenericDialog gd = new GenericDialog("Save view " + ( view.getName() == null ? "" : view.getName()) );
final GenericDialog gd = new GenericDialog("Save view" + ( view.getName() == null ? "" : ": " + view.getName()) );

gd.addChoice("Save to", new String[]{ FileLocation.CurrentProject.toString(), FileLocation.ExternalJSONFile.toString() }, saveToProjectOrFile );
gd.addFileField( "( External JSON file )", externalJsonPath, 70 );
Expand Down

0 comments on commit bb5533e

Please sign in to comment.