Skip to content

Commit 0ca920f

Browse files
committed
Add an icon for the helper.
1 parent e5fa895 commit 0ca920f

8 files changed

Lines changed: 32 additions & 23 deletions

File tree

src/main/java/fiji/plugin/trackmate/helper/ui/HelperLauncherController.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@
2121
*/
2222
package fiji.plugin.trackmate.helper.ui;
2323

24+
import static fiji.plugin.trackmate.helper.ui.components.GuiUtils.HELPER_ICON;
25+
2426
import java.io.File;
2527

2628
import javax.swing.JFrame;
2729
import javax.swing.JOptionPane;
2830

29-
import fiji.plugin.trackmate.gui.Icons;
3031
import fiji.plugin.trackmate.helper.HelperRunner;
3132
import fiji.plugin.trackmate.helper.HelperRunner.Builder;
3233
import fiji.plugin.trackmate.helper.TrackingMetricsType;
@@ -45,7 +46,7 @@ public HelperLauncherController()
4546
{
4647
final HelperLauncherPanel gui = new HelperLauncherPanel();
4748
final JFrame frame = new JFrame( "TrackMate-Helper Launcher" );
48-
frame.setIconImage( Icons.TRACKMATE_ICON.getImage() );
49+
frame.setIconImage( HELPER_ICON.getImage() );
4950
frame.getContentPane().add( gui );
5051
frame.setSize( 350, 550 );
5152
frame.setLocationRelativeTo( null );
@@ -112,7 +113,7 @@ public HelperLauncherController()
112113
.replaceAll( "/", "/<wbr>" )
113114
+ "</body></html>";
114115
final String title = "TrackMate Helper";
115-
JOptionPane.showMessageDialog( frame, wrappedMessage, title, JOptionPane.ERROR_MESSAGE, Icons.TRACKMATE_ICON );
116+
JOptionPane.showMessageDialog( frame, wrappedMessage, title, JOptionPane.ERROR_MESSAGE, HELPER_ICON );
116117
return;
117118
}
118119

src/main/java/fiji/plugin/trackmate/helper/ui/HelperLauncherPanel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import static fiji.plugin.trackmate.gui.Fonts.BIG_FONT;
2525
import static fiji.plugin.trackmate.gui.Fonts.FONT;
2626
import static fiji.plugin.trackmate.gui.Fonts.SMALL_FONT;
27+
import static fiji.plugin.trackmate.helper.ui.components.GuiUtils.HELPER_ICON;
2728

2829
import java.awt.GridBagConstraints;
2930
import java.awt.GridBagLayout;
@@ -51,7 +52,6 @@
5152
import org.scijava.prefs.PrefService;
5253
import org.scijava.util.VersionUtils;
5354

54-
import fiji.plugin.trackmate.gui.Icons;
5555
import fiji.plugin.trackmate.helper.ui.components.MetricsChooserPanel;
5656
import fiji.plugin.trackmate.util.FileChooser;
5757
import fiji.plugin.trackmate.util.FileChooser.DialogType;
@@ -88,7 +88,7 @@ public HelperLauncherPanel()
8888
gridBagLayout.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE };
8989
setLayout( gridBagLayout );
9090

91-
final Image im = Icons.TRACKMATE_ICON.getImage();
91+
final Image im = HELPER_ICON.getImage();
9292
final Image newimg = im.getScaledInstance( 32, 32, java.awt.Image.SCALE_SMOOTH );
9393
final ImageIcon icon = new ImageIcon( newimg );
9494

src/main/java/fiji/plugin/trackmate/helper/ui/MetricsLauncherController.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,21 @@
88
* it under the terms of the GNU General Public License as
99
* published by the Free Software Foundation, either version 3 of the
1010
* License, or (at your option) any later version.
11-
*
11+
*
1212
* This program is distributed in the hope that it will be useful,
1313
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1414
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1515
* GNU General Public License for more details.
16-
*
16+
*
1717
* You should have received a copy of the GNU General Public
1818
* License along with this program. If not, see
1919
* <http://www.gnu.org/licenses/gpl-3.0.html>.
2020
* #L%
2121
*/
2222
package fiji.plugin.trackmate.helper.ui;
2323

24+
import static fiji.plugin.trackmate.helper.ui.components.GuiUtils.HELPER_ICON;
25+
2426
import java.io.File;
2527
import java.io.FileWriter;
2628
import java.io.IOException;
@@ -37,7 +39,6 @@
3739
import fiji.plugin.trackmate.Model;
3840
import fiji.plugin.trackmate.Settings;
3941
import fiji.plugin.trackmate.TrackMate;
40-
import fiji.plugin.trackmate.gui.Icons;
4142
import fiji.plugin.trackmate.helper.MetricsRunner;
4243
import fiji.plugin.trackmate.helper.TrackingMetrics;
4344
import fiji.plugin.trackmate.helper.TrackingMetricsType;
@@ -60,7 +61,7 @@ public MetricsLauncherController()
6061
{
6162
final MetricsLauncherPanel gui = new MetricsLauncherPanel();
6263
final JFrame frame = new JFrame( "TrackMate tracking metrics" );
63-
frame.setIconImage( Icons.TRACKMATE_ICON.getImage() );
64+
frame.setIconImage( HELPER_ICON.getImage() );
6465
frame.getContentPane().add( gui );
6566
frame.setSize( 350, 550 );
6667
frame.setLocationRelativeTo( null );
@@ -115,7 +116,7 @@ private void computeMetrics( final boolean ctcSelected, final String gtPath, fin
115116
final String gtName = FilenameUtils.removeExtension( new File( gtPath ).getName() );
116117
final String csvFileName = type.csvSuffix() + "_" + gtName + ".csv";
117118
final File csvFile = new File( saveFolder, csvFileName );
118-
119+
119120
// Echo info
120121
logger.log( "Performing tracking metrics measurements.\n"
121122
+ " - Tracking metrics type: " + ( ctcSelected ? "Cell Tracking Challenge" : "Single-Particle Tracking Challenge" ) + "\n"
@@ -125,7 +126,7 @@ private void computeMetrics( final boolean ctcSelected, final String gtPath, fin
125126
for ( int i = 0; i < type.metrics().size(); i++ )
126127
str.append( " - " + type.metrics().get( i ).key + ": " + type.metrics().get( i ).description + '\n' );
127128
logger.log( str.toString() );
128-
129+
129130
// Save CSV header.
130131
final String[] csvHeader = new String[ 1 + type.metrics().size() ];
131132
csvHeader[ 0 ] = "File";

src/main/java/fiji/plugin/trackmate/helper/ui/MetricsLauncherPanel.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
* it under the terms of the GNU General Public License as
99
* published by the Free Software Foundation, either version 3 of the
1010
* License, or (at your option) any later version.
11-
*
11+
*
1212
* This program is distributed in the hope that it will be useful,
1313
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1414
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1515
* GNU General Public License for more details.
16-
*
16+
*
1717
* You should have received a copy of the GNU General Public
1818
* License along with this program. If not, see
1919
* <http://www.gnu.org/licenses/gpl-3.0.html>.
@@ -25,6 +25,7 @@
2525
import static fiji.plugin.trackmate.gui.Fonts.FONT;
2626
import static fiji.plugin.trackmate.gui.Fonts.SMALL_FONT;
2727
import static fiji.plugin.trackmate.helper.ui.HelperLauncherPanel.GT_PATH_KEY;
28+
import static fiji.plugin.trackmate.helper.ui.components.GuiUtils.HELPER_ICON;
2829

2930
import java.awt.GridBagConstraints;
3031
import java.awt.GridBagLayout;
@@ -46,7 +47,6 @@
4647

4748
import fiji.plugin.trackmate.Logger;
4849
import fiji.plugin.trackmate.Model;
49-
import fiji.plugin.trackmate.gui.Icons;
5050
import fiji.plugin.trackmate.helper.ui.HelperLauncherPanel.SetFileDropTarget;
5151
import fiji.plugin.trackmate.helper.ui.components.MetricsChooserPanel;
5252
import fiji.plugin.trackmate.io.TmXmlReader;
@@ -83,7 +83,7 @@ public MetricsLauncherPanel()
8383
gridBagLayout.columnWeights = new double[] { 1., 0. };
8484
setLayout( gridBagLayout );
8585

86-
final Image im = Icons.TRACKMATE_ICON.getImage();
86+
final Image im = HELPER_ICON.getImage();
8787
final Image newimg = im.getScaledInstance( 32, 32, java.awt.Image.SCALE_SMOOTH );
8888
final ImageIcon icon = new ImageIcon( newimg );
8989

@@ -239,7 +239,7 @@ public MetricsLauncherPanel()
239239
/*
240240
* Listeners & co.
241241
*/
242-
242+
243243
this.logger = labelLogger.getLogger();
244244
final PrefService prefService = TMUtils.getContext().getService( PrefService.class );
245245

src/main/java/fiji/plugin/trackmate/helper/ui/ParameterSweepPanel.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import static fiji.plugin.trackmate.gui.Icons.CANCEL_ICON;
2828
import static fiji.plugin.trackmate.gui.Icons.EXECUTE_ICON;
2929
import static fiji.plugin.trackmate.gui.Icons.REVERT_ICON;
30-
import static fiji.plugin.trackmate.gui.Icons.TRACKMATE_ICON_16x16;
30+
import static fiji.plugin.trackmate.helper.ui.components.GuiUtils.HELPER_ICON;
3131

3232
import java.awt.BorderLayout;
3333
import java.awt.Desktop;
@@ -64,6 +64,8 @@
6464
import fiji.plugin.trackmate.Spot;
6565
import fiji.plugin.trackmate.features.track.TrackBranchingAnalyzer;
6666
import fiji.plugin.trackmate.gui.Fonts;
67+
import fiji.plugin.trackmate.gui.GuiUtils;
68+
import fiji.plugin.trackmate.gui.Icons;
6769
import fiji.plugin.trackmate.gui.components.LogPanel;
6870
import fiji.plugin.trackmate.helper.ResultsCrawler;
6971
import fiji.plugin.trackmate.helper.model.AbstractSweepModelBase.ModelListener;
@@ -134,15 +136,15 @@ public ParameterSweepPanel(
134136
tabbedPane.addTab( "Log", null, panelLog, null );
135137

136138
final CrawlerResultsPanel bestParamsPanel = new CrawlerResultsPanel( crawler, imp );
137-
tabbedPane.addTab( "Best params", null, bestParamsPanel, null );
139+
tabbedPane.addTab( "Best params", HELPER_ICON, bestParamsPanel, null );
138140

139141
panelSpotFilters = new SpotFilterConfigPanel( Spot.QUALITY, imp, model );
140-
tabbedPane.addTab( "Spot filters", null, panelSpotFilters, null );
142+
tabbedPane.addTab( "Spot filters", Icons.SPOT_ICON_16x16, panelSpotFilters, null );
141143
// Enabler.
142144
enablers.add( new EverythingDisablerAndReenabler( panelSpotFilters, new Class[] { JLabel.class } ) );
143145

144146
panelTrackFilters = new TrackFilterConfigPanel( TrackBranchingAnalyzer.NUMBER_SPOTS, imp, model );
145-
tabbedPane.addTab( "Track filters", null, panelTrackFilters, null );
147+
tabbedPane.addTab( "Track filters", Icons.TRACK_ICON_64x64, panelTrackFilters, null );
146148
// Enabler.
147149
enablers.add( new EverythingDisablerAndReenabler( panelTrackFilters, new Class[] { JLabel.class } ) );
148150

@@ -171,8 +173,9 @@ public ParameterSweepPanel(
171173
final JLabel lblTitle = new JLabel( "<html><center>TrackMate Helper <small>v"
172174
+ VersionUtils.getVersion( ParameterSweepPanel.class )
173175
+ "</small></center></html>" );
174-
lblTitle.setIcon( TRACKMATE_ICON_16x16 );
176+
lblTitle.setIcon( GuiUtils.scaleImage( HELPER_ICON, 32, 32 ) );
175177
lblTitle.setFont( BIG_FONT );
178+
lblTitle.setHorizontalAlignment( JLabel.CENTER );
176179
final GridBagConstraints gbcLblTitle = new GridBagConstraints();
177180
gbcLblTitle.insets = new Insets( 0, 0, 5, 0 );
178181
gbcLblTitle.fill = GridBagConstraints.BOTH;

src/main/java/fiji/plugin/trackmate/helper/ui/components/GuiUtils.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
* it under the terms of the GNU General Public License as
99
* published by the Free Software Foundation, either version 3 of the
1010
* License, or (at your option) any later version.
11-
*
11+
*
1212
* This program is distributed in the hope that it will be useful,
1313
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1414
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1515
* GNU General Public License for more details.
16-
*
16+
*
1717
* You should have received a copy of the GNU General Public
1818
* License along with this program. If not, see
1919
* <http://www.gnu.org/licenses/gpl-3.0.html>.
@@ -25,9 +25,13 @@
2525
import java.awt.Container;
2626
import java.awt.Font;
2727

28+
import javax.swing.ImageIcon;
29+
2830
public class GuiUtils
2931
{
3032

33+
public static final ImageIcon HELPER_ICON = new ImageIcon( GuiUtils.class.getResource( "/images/TrackMate-Helper-logo-64px.png" ) );
34+
3135
public static void changeFont( final Component component, final Font font )
3236
{
3337
component.setFont( font );
8.97 KB
Loading
60.2 KB
Loading

0 commit comments

Comments
 (0)