Skip to content

Commit 0c0476c

Browse files
committed
BlenderSetupView minor UI changes
1 parent 14b849a commit 0c0476c

1 file changed

Lines changed: 25 additions & 22 deletions

File tree

mastodon-plugin/src/main/java/org/mastodon/blender/setup/BlenderSetupView.java

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -82,56 +82,53 @@ public class BlenderSetupView extends JDialog
8282
setLayout( new MigLayout("insets dialog, fill", "[][grow]") );
8383

8484
final String introText = "<html><body>"
85-
+ "Mastodon can use Blender to visualise cell trackings in 3D. "
85+
+ "Mastodon can use Blender to visualise a cell tracking in 3D. "
8686
+ "In order to achieve this, it is required to install "
8787
+ "the \"mastodon_blender_view\" addon to Blender.<br><br>"
88-
+ "This dialog will guide you through the installation."
88+
+ "This dialog will guide you through the installation process."
8989
+ "</body></html>";
90-
add( setFonStyle( new JLabel( introText ), Font.PLAIN ), "span, wrap, grow, width 0:0:pref" );
90+
add( newJLabel( Font.PLAIN, introText ), "span, wrap, grow, width 0:0:pref" );
9191

92-
add( new JLabel( "1."), "gaptop unrelated" );
93-
add( new JLabel("Install Blender:"), "wrap, wmin 0" );
92+
add( newJLabel( Font.BOLD, "1." ), "gaptop unrelated" );
93+
add( newJLabel( Font.BOLD, "Install Blender:" ), "wrap, wmin 0" );
9494
final String blenderInstallText = "<html><body>"
9595
+ "The first step is to install Blender. This needs to be done manually by you.<br>"
9696
+ "Mastodon only supports the portable version of Blender.<br>"
9797
+ "Go to the official blender webpage, and:<br>"
9898
+ "<br>"
9999
+ "Please download and install the <b>portable version of Blender</b>!"
100100
+ "</body></html>";
101-
add( setFonStyle( new JLabel( blenderInstallText ), Font.PLAIN ), "skip, wrap, grow, wmin 0" );
101+
add( newJLabel( Font.PLAIN, blenderInstallText ), "skip, wrap, grow, wmin 0" );
102102
add( initializeLinkButton(), "skip, wrap");
103-
add( new JLabel( "2."), "gaptop unrelated" );
104-
add( new JLabel("Select the path of your Blender installation:"), "wrap, wmin 0" );
103+
add( newJLabel( Font.BOLD, "2." ), "gaptop unrelated" );
104+
add( newJLabel( Font.BOLD, "Select the path of your Blender installation:" ), "wrap, wmin 0" );
105105
pathTextArea = new JTextArea( 2, 50 );
106106
pathTextArea.setBorder( BorderFactory.createLineBorder( Color.LIGHT_GRAY ) );
107107
pathTextArea.setEditable( false );
108108
add( pathTextArea, "skip, wrap, grow, wmin 0" );
109109
selectPathButton = new JButton( "select" );
110110
selectPathButton.addActionListener( ignore -> onSelectPathClicked() );
111111
add( selectPathButton, "skip, wrap");
112-
pathFeedback = new JLabel( "" );
113-
setFonStyle( pathFeedback, Font.ITALIC );
112+
pathFeedback = newJLabel( Font.ITALIC, "" );
114113
add( pathFeedback, "skip, wrap, wmin 0" );
115114

116-
add( new JLabel( "3."), "gaptop unrelated");
117-
add( new JLabel("Install / update Blender addon"), "wrap, wmin 0" );
115+
add( newJLabel( Font.BOLD, "3." ), "gaptop unrelated");
116+
add( newJLabel( Font.BOLD, "Install / update Blender addon" ), "wrap, wmin 0" );
118117
installAddonButton = new JButton( "install addon" );
119118
installAddonButton.addActionListener( ignore -> listener.installAddonClicked() );
120119
add( installAddonButton, "skip, wrap");
121-
addonFeedback = new JLabel( "" );
122-
setFonStyle( addonFeedback, Font.ITALIC );
120+
addonFeedback = newJLabel( Font.ITALIC, "" );
123121
add( addonFeedback, "skip, wrap, wmin 0" );
124122

125-
add( new JLabel( "4."), "gaptop unrelated");
126-
add( new JLabel("Test Blender addon"), "wrap, wmin 0" );
123+
add( newJLabel( Font.BOLD, "4." ), "gaptop unrelated");
124+
add( newJLabel( Font.BOLD, "Test Blender addon" ), "wrap, wmin 0" );
127125
testAddonButton = new JButton("test addon");
128126
testAddonButton.addActionListener( ignore -> listener.testAddonClicked() );
129127
add( testAddonButton, "skip, wrap" );
130-
testFeedback = new JLabel( "" );
131-
setFonStyle( testFeedback, Font.ITALIC );
128+
testFeedback = newJLabel( Font.ITALIC, "" );
132129
add( testFeedback, "skip, wrap, wmin 0" );
133130

134-
add( new JLabel(""), "push, wrap");
131+
add( newJLabel( Font.PLAIN, "<html><body><br><br></body></html>" ), "push, wrap, hmin 0");
135132

136133
finishButton = new JButton( "Finish" );
137134
finishButton.addActionListener( ignore -> listener.finishClicked() );
@@ -141,10 +138,17 @@ public class BlenderSetupView extends JDialog
141138
add( cancelButton );
142139
}
143140

141+
private JLabel newJLabel( int fontStyle, String introText )
142+
{
143+
JLabel label = new JLabel( introText );
144+
setFontStyle( label, fontStyle );
145+
return label;
146+
}
147+
144148
private JButton initializeLinkButton()
145149
{
146150
JButton linkButton = new JButton( "<html><bode><a href=\"dummy\">https://blender.org/download</a></body></html>" );
147-
setFonStyle( linkButton, Font.PLAIN );
151+
setFontStyle( linkButton, Font.PLAIN );
148152
linkButton.addActionListener( ignore -> onLinkClicked() );
149153
linkButton.setBackground( new Color( 0, true ) );
150154
linkButton.setBorder( BorderFactory.createEmptyBorder() );
@@ -165,12 +169,11 @@ private void onLinkClicked()
165169
}
166170
}
167171

168-
private JComponent setFonStyle( JComponent component, int style )
172+
private void setFontStyle( JComponent component, int style )
169173
{
170174
Font boldFont = component.getFont();
171175
Font normalFont = boldFont.deriveFont( style );
172176
component.setFont( normalFont );
173-
return component;
174177
}
175178

176179
private void onSelectPathClicked()

0 commit comments

Comments
 (0)