Skip to content

Commit

Permalink
Add descriptions to the export to SVG and PNG commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
tinevez committed Oct 10, 2024
1 parent 72fdc04 commit 42a50b2
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/main/java/org/mastodon/ui/ExportViewActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@

import javax.swing.JFrame;

import org.mastodon.ui.keymap.KeyConfigContexts;
import org.mastodon.ui.keymap.KeyConfigScopes;
import org.mastodon.ui.util.ExportUtils;
import org.scijava.plugin.Plugin;
import org.scijava.ui.behaviour.io.gui.CommandDescriptionProvider;
import org.scijava.ui.behaviour.io.gui.CommandDescriptions;
import org.scijava.ui.behaviour.util.Actions;
import org.scijava.ui.behaviour.util.RunnableAction;

Expand Down Expand Up @@ -41,4 +46,28 @@ private void install( final Actions actions )
actions.namedAction( exportToSvgAction, EXPORT_VIEW_TO_SVG_KEYS );
actions.namedAction( exportToPngAction, EXPORT_VIEW_TO_PNG_KEYS );
}

/*
* Command descriptions for all provided commands
*/
@Plugin( type = CommandDescriptionProvider.class )
public static class Descriptions extends CommandDescriptionProvider
{
public Descriptions()
{
super( KeyConfigScopes.MASTODON,
KeyConfigContexts.BIGDATAVIEWER,
KeyConfigContexts.TRACKSCHEME,
KeyConfigContexts.GRAPHER );
}

@Override
public void getCommandDescriptions( final CommandDescriptions descriptions )
{
descriptions.add( EXPORT_VIEW_TO_SVG, EXPORT_VIEW_TO_SVG_KEYS,
"Capture the current view and export it to a SVG image file." );
descriptions.add( EXPORT_VIEW_TO_PNG, EXPORT_VIEW_TO_PNG_KEYS,
"Capture the current view and export it to a PNG image file." );
}
}
}

0 comments on commit 42a50b2

Please sign in to comment.