@@ -888,7 +888,7 @@ private void updateCmdsOneSelected(final Path p) {
888888 ? "<html>Path has never been fitted:<br>Fit will be computed for the first time"
889889 : "<html>Path has already been fitted:\n Cached properties will be applied" );
890890 }
891- colorMenu .selectSWCColor (new SNTColor (p .getColor (), p . getSWCType () ));
891+ colorMenu .selectSWCColor (new SNTColor (p .getColor ()));
892892 selectSWCTypeMenuEntry (p .getSWCType ());
893893 }
894894
@@ -1714,11 +1714,11 @@ private static class NodeRender extends DefaultTreeCellRenderer {
17141714 final int arc = UIManager .getInt ("Component.arc" );
17151715 CHIP_ARC = (arc > 0 ) ? Math .min (arc , 8 ) : 4 ;
17161716 final Color fg = UIManager .getColor ("Tree.textForeground" ); // Tree.foreground is unused. See formdev.com/flatlaf/components/tree/
1717- final Color base = (fg != null ) ? fg : Color .GRAY ;
1717+ final Color base = (fg != null ) ? fg : Color .DARK_GRAY ;
17181718 final int r = base .getRed (), gn = base .getGreen (), b = base .getBlue ();
17191719 CHIP_BORDER = new Color (r , gn , b , 50 );
17201720 CHIP_TEXT = base ;
1721- CHIP_FILL = new Color (r , gn , b , 10 );
1721+ CHIP_FILL = new Color (r , gn , b , 8 );
17221722 }
17231723
17241724 // Per-cell state populated in getTreeCellRendererComponent
@@ -2858,6 +2858,7 @@ public void actionPerformed(final ActionEvent e) {
28582858 final List <Path > selectedPaths = getSelectedPaths (true );
28592859 if (selectedPaths .isEmpty ()) {
28602860 guiUtils .error ("There are no traced paths." );
2861+ setSelected (false );
28612862 return ;
28622863 }
28632864 removeOrReapplyDefaultTag (selectedPaths , getActionCommand (), isSelected (), true );
@@ -3921,7 +3922,7 @@ public void execute(List<Path> selectedPaths, String cmd) {
39213922 if (tags .isEmpty () && existingTags .isEmpty ()) {
39223923 return ;
39233924 } else if (tags .isEmpty ()) {
3924- deleteCustomTags (selectedPaths );
3925+ deleteCustomTags (selectedPaths , false );
39253926 return ;
39263927 }
39273928
@@ -5183,7 +5184,7 @@ private void removeTagsThroughPrompt(final List<Path> selectedPaths) {
51835184 return ;
51845185 }
51855186 if (choices [1 ].equals (choice )) {
5186- deleteCustomTags (selectedPaths ); // will call refreshManager
5187+ deleteCustomTags (selectedPaths , true ); // will call refreshManager
51875188 return ;
51885189 }
51895190 if (choices [2 ].equals (choice )) {
@@ -5214,8 +5215,8 @@ private void replaceTags(final List<Path> selectedPaths) {
52145215 guiUtils .centeredMsg (counter + " occurrence(s) replaced." , "Operation Completed" );
52155216 }
52165217
5217- private void deleteCustomTags (final List <Path > paths ) {
5218- if (!plugin .getUI ().askUserConfirmation || guiUtils .getConfirmation ("Remove custom tags from "
5218+ private void deleteCustomTags (final List <Path > paths , final boolean deleteWithoutConfirmation ) {
5219+ if (deleteWithoutConfirmation || !plugin .getUI ().askUserConfirmation || guiUtils .getConfirmation ("Remove custom tags from "
52195220 + ((paths .size () == pathAndFillManager .size ()) ? "all " : "the selected " )
52205221 + paths .size () + " paths?" , "Confirm Tag Removal?" )) {
52215222 paths .forEach (p -> p .setName (TAG_CUSTOM_PATTERN .matcher (p .getName ()).replaceAll ("" )));
@@ -5726,7 +5727,7 @@ void sortArbors() {
57265727 }
57275728 final String [] choices = { "Arbor ID" , "Cell label" , "Primary path name" , "Primary path length" ,
57285729 "Primary path mean radius" , "Traced channel" , "Traced frame" };
5729- final String choice = guiUtils .getChoice ("Sorting criterion :" , "Sort Root-level Paths" , choices , choices [0 ]);
5730+ final String choice = guiUtils .getChoice ("Sort by :" , "Sort Root-level Paths" , choices , choices [0 ]);
57305731 if (choice == null )
57315732 return ;
57325733 switch (choice ) {
@@ -6061,19 +6062,27 @@ void addExtras() {
60616062 private void showColorCustomizationDialog () {
60626063 // Create the panel with color chooser buttons
60636064 final JPanel panel = new JPanel (new GridBagLayout ());
6065+ panel .setBackground (ProofReadingTagsToolBar .this .getBackground ());
60646066 final GridBagConstraints c = GuiUtils .defaultGbc ();
6067+ // Align the component to the left edge of its cell
6068+ c .anchor = GridBagConstraints .WEST ;
6069+ // Prevent the component from stretching horizontally
6070+ c .fill = GridBagConstraints .NONE ;
60656071 // Create color selection components for each tag
60666072 c .insets = new Insets (0 , 0 , 5 , 0 );
60676073 final Map <String , ColorChooserButton > colorButtons = new HashMap <>();
60686074 tagsMap .forEach ( (tagName , color ) -> {
6069- final ColorChooserButton colorButton = new ColorChooserButton (color , capitalized (tagName ));
6075+ final ColorChooserButton colorButton = new ColorChooserButton (color , capitalized (tagName )
6076+ , 1f , ColorChooserButton .RIGHT );
6077+ GuiUtils .Buttons .makeBorderless (colorButton );
60706078 panel .add (colorButton , c );
60716079 colorButtons .put (tagName , colorButton );
60726080 c .gridy ++;
60736081 });
60746082 // Add reset button
60756083 c .insets .top += 10 ;
6076- final JButton resetButton = new JButton ("Reset to Defaults" );
6084+ final JButton resetButton = new JButton ("Reset to Defaults" , IconFactory .buttonIcon (IconFactory .GLYPH .UNDO , .9f ));
6085+ GuiUtils .Buttons .makeBorderless (resetButton );
60776086 resetButton .addActionListener (e -> {
60786087 tagsMap .keySet ().forEach ( tagName -> saveTagColor (tagName , null ));
60796088 tagsMap .clear ();
@@ -6084,7 +6093,7 @@ private void showColorCustomizationDialog() {
60846093
60856094 // Show the option pane
60866095 final int result = JOptionPane .showConfirmDialog (PathManagerUI .this ,
6087- panel , "Proofreading Tag Colors " , JOptionPane .OK_CANCEL_OPTION , JOptionPane .PLAIN_MESSAGE );
6096+ panel , "Proofreading Tags " , JOptionPane .OK_CANCEL_OPTION , JOptionPane .PLAIN_MESSAGE );
60886097
60896098 // save the new colors if user pressed OK
60906099 if (result == JOptionPane .OK_OPTION ) {
@@ -6190,13 +6199,12 @@ void summarizeTags() {
61906199 else
61916200 dataset .put ("none" , dataset .get ("none" )+1 );
61926201 });
6193- final SNTChart chart = AnalysisUtils .ringPlot (String .format ("Tags (All %d Paths)" , paths .size ()), dataset , colors );
6202+ final SNTChart chart = AnalysisUtils .ringPlot (String .format ("Proofreading Tags (All %d Paths)" , paths .size ()), dataset , colors );
61946203 if (ringChart != null && ringChart .isVisible ()) {
61956204 ringChart .replace (chart );
6196- ringChart .getFrame ().setTitle (String .format ("Tags (All %d Paths)" , paths .size ()));
61976205 ringChart .show ();
61986206 } else {
6199- chart .getFrame ().setLocationRelativeTo (ProofReadingTagsToolBar .this );
6207+ chart .getFrame ().setLocationRelativeTo (PathManagerUI .this );
62006208 chart .show ();
62016209 ringChart = chart ;
62026210 }
0 commit comments