OSDN Git Service

08b235be39ab11dad8d122096beefb9b48df650f
[coroid/inqubus.git] / frontend / src / saccubus / SavePanel.java
1 /*
2  * SavePanel.java
3  *
4  * Created on 2009/12/04, 21:06:09
5  */
6 package saccubus;
7
8 import java.awt.GridLayout;
9 import java.io.File;
10 import javax.swing.JButton;
11 import javax.swing.JCheckBox;
12 import javax.swing.JFileChooser;
13 import javax.swing.JRadioButton;
14 import javax.swing.JTextField;
15
16 /**
17  *
18  * @author yuki
19  */
20 public class SavePanel extends javax.swing.JPanel {
21     private static final long serialVersionUID = 1L;
22
23     private final VideoSaveInfoPanel videoSaveInfoPanel = new VideoSaveInfoPanel();
24
25     /** Creates new form SavePanel */
26     public SavePanel() {
27         initComponents();
28         inputVideoTab.setLayout(new GridLayout());
29         inputVideoTab.add(videoSaveInfoPanel);
30     }
31
32     /** This method is called from within the constructor to
33      * initialize the form.
34      * WARNING: Do NOT modify this code. The content of this method is
35      * always regenerated by the Form Editor.
36      */
37     @SuppressWarnings("unchecked")
38     // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
39     private void initComponents() {
40
41         inputCommentSaveGroup = new javax.swing.ButtonGroup();
42         outputVideoSaveGroup = new javax.swing.ButtonGroup();
43         inputTcommentSaveGroup = new javax.swing.ButtonGroup();
44         saveTabbedPane = new javax.swing.JTabbedPane();
45         inputVideoTab = new javax.swing.JPanel();
46         inputCommentTab = new javax.swing.JPanel();
47         commentSaveInfoPanel = new javax.swing.JPanel();
48         savingCommentCheckBox = new javax.swing.JCheckBox();
49         jPanel7 = new javax.swing.JPanel();
50         delCommentCheckBox = new javax.swing.JCheckBox();
51         fixCommentNumCheckBox = new javax.swing.JCheckBox();
52         jLabel1 = new javax.swing.JLabel();
53         commentNumField = new javax.swing.JTextField();
54         commentSaveFolderRadioButton = new javax.swing.JRadioButton();
55         commentSavedFolderField = new javax.swing.JTextField();
56         showSavingCommentFolderDialogButton = new javax.swing.JButton();
57         commentSaveFileRadioButton = new javax.swing.JRadioButton();
58         commentSavedFileField = new javax.swing.JTextField();
59         showSavingCommentFileDialogButton = new javax.swing.JButton();
60         inputTcommentTab = new javax.swing.JPanel();
61         tcommentSaveInfoPanel = new javax.swing.JPanel();
62         needDownloadTcomment = new javax.swing.JCheckBox();
63         jPanel8 = new javax.swing.JPanel();
64         delTcomment = new javax.swing.JCheckBox();
65         tcommentSaveInFolder = new javax.swing.JRadioButton();
66         tcommentFolder = new javax.swing.JTextField();
67         tcoomentFolderChooserButton = new javax.swing.JButton();
68         tcommentSaveToFile = new javax.swing.JRadioButton();
69         tcommentFile = new javax.swing.JTextField();
70         tcommentFileChooserButton = new javax.swing.JButton();
71         outputVideoTab = new javax.swing.JPanel();
72         jPanel3 = new javax.swing.JPanel();
73         savingConvertedVideoCheckBox = new javax.swing.JCheckBox();
74         jPanel5 = new javax.swing.JPanel();
75         addComment = new javax.swing.JCheckBox();
76         addTcomment = new javax.swing.JCheckBox();
77         convSaveFolderRadioButton = new javax.swing.JRadioButton();
78         notAddVideoIdConvVideoCheckBox = new javax.swing.JCheckBox();
79         convertedVideoSavedFolderField = new javax.swing.JTextField();
80         showSavingConvertedVideoFolderDialogButton = new javax.swing.JButton();
81         convSaveFileRadioButton = new javax.swing.JRadioButton();
82         convertedVideoSavedFileField = new javax.swing.JTextField();
83         showSavingConvertedVideoFileDialogButton = new javax.swing.JButton();
84
85         saveTabbedPane.setName("saveTabbedPane"); // NOI18N
86
87         javax.swing.GroupLayout inputVideoTabLayout = new javax.swing.GroupLayout(inputVideoTab);
88         inputVideoTab.setLayout(inputVideoTabLayout);
89         inputVideoTabLayout.setHorizontalGroup(
90             inputVideoTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
91             .addGap(0, 369, Short.MAX_VALUE)
92         );
93         inputVideoTabLayout.setVerticalGroup(
94             inputVideoTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
95             .addGap(0, 270, Short.MAX_VALUE)
96         );
97
98         saveTabbedPane.addTab("入力動画", inputVideoTab);
99
100         commentSaveInfoPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("コメント保存設定"));
101
102         savingCommentCheckBox.setText("コメントをダウンロードする");
103         savingCommentCheckBox.setName("savingCommentCheckBox"); // NOI18N
104
105         delCommentCheckBox.setText("変換後にコメントファイルを削除する");
106         delCommentCheckBox.setName("delCommentCheckBox"); // NOI18N
107
108         fixCommentNumCheckBox.setText("コメント取得数は自動で調整する");
109         fixCommentNumCheckBox.setName("fixCommentNumCheckBox"); // NOI18N
110
111         jLabel1.setText("取得コメント数");
112
113         commentNumField.setName("commentNumField"); // NOI18N
114
115         inputCommentSaveGroup.add(commentSaveFolderRadioButton);
116         commentSaveFolderRadioButton.setText("保存するフォルダを指定し、ファイル名は自動で決定する");
117         commentSaveFolderRadioButton.setName("commentSaveFolderRadioButton"); // NOI18N
118
119         commentSavedFolderField.setName("commentSavedFolderField"); // NOI18N
120
121         showSavingCommentFolderDialogButton.setText("参照...");
122         showSavingCommentFolderDialogButton.setName("showSavingCommentFolderDialogButton"); // NOI18N
123
124         inputCommentSaveGroup.add(commentSaveFileRadioButton);
125         commentSaveFileRadioButton.setText("保存するファイル名を指定する");
126         commentSaveFileRadioButton.setName("commentSaveFileRadioButton"); // NOI18N
127
128         commentSavedFileField.setName("commentSavedFileField"); // NOI18N
129
130         showSavingCommentFileDialogButton.setText("参照...");
131         showSavingCommentFileDialogButton.setName("showSavingCommentFileDialogButton"); // NOI18N
132
133         javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
134         jPanel7.setLayout(jPanel7Layout);
135         jPanel7Layout.setHorizontalGroup(
136             jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
137             .addGroup(jPanel7Layout.createSequentialGroup()
138                 .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
139                     .addGroup(jPanel7Layout.createSequentialGroup()
140                         .addGap(21, 21, 21)
141                         .addComponent(jLabel1)
142                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
143                         .addComponent(commentNumField, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE))
144                     .addComponent(delCommentCheckBox)
145                     .addComponent(fixCommentNumCheckBox)
146                     .addComponent(commentSaveFolderRadioButton)
147                     .addComponent(commentSaveFileRadioButton)
148                     .addGroup(jPanel7Layout.createSequentialGroup()
149                         .addGap(21, 21, 21)
150                         .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
151                             .addComponent(commentSavedFileField, javax.swing.GroupLayout.DEFAULT_SIZE, 197, Short.MAX_VALUE)
152                             .addComponent(commentSavedFolderField, javax.swing.GroupLayout.DEFAULT_SIZE, 197, Short.MAX_VALUE))
153                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
154                         .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
155                             .addComponent(showSavingCommentFolderDialogButton)
156                             .addComponent(showSavingCommentFileDialogButton))))
157                 .addContainerGap())
158         );
159         jPanel7Layout.setVerticalGroup(
160             jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
161             .addGroup(jPanel7Layout.createSequentialGroup()
162                 .addContainerGap()
163                 .addComponent(delCommentCheckBox)
164                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
165                 .addComponent(fixCommentNumCheckBox)
166                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
167                 .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
168                     .addComponent(jLabel1)
169                     .addComponent(commentNumField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
170                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
171                 .addComponent(commentSaveFolderRadioButton)
172                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
173                 .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
174                     .addComponent(commentSavedFolderField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
175                     .addComponent(showSavingCommentFolderDialogButton))
176                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
177                 .addComponent(commentSaveFileRadioButton)
178                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
179                 .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
180                     .addComponent(commentSavedFileField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
181                     .addComponent(showSavingCommentFileDialogButton))
182                 .addContainerGap())
183         );
184
185         javax.swing.GroupLayout commentSaveInfoPanelLayout = new javax.swing.GroupLayout(commentSaveInfoPanel);
186         commentSaveInfoPanel.setLayout(commentSaveInfoPanelLayout);
187         commentSaveInfoPanelLayout.setHorizontalGroup(
188             commentSaveInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
189             .addGroup(commentSaveInfoPanelLayout.createSequentialGroup()
190                 .addComponent(savingCommentCheckBox)
191                 .addGap(79, 79, 79))
192             .addGroup(commentSaveInfoPanelLayout.createSequentialGroup()
193                 .addGap(21, 21, 21)
194                 .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
195                 .addContainerGap())
196         );
197         commentSaveInfoPanelLayout.setVerticalGroup(
198             commentSaveInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
199             .addGroup(commentSaveInfoPanelLayout.createSequentialGroup()
200                 .addComponent(savingCommentCheckBox)
201                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
202                 .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
203                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
204         );
205
206         javax.swing.GroupLayout inputCommentTabLayout = new javax.swing.GroupLayout(inputCommentTab);
207         inputCommentTab.setLayout(inputCommentTabLayout);
208         inputCommentTabLayout.setHorizontalGroup(
209             inputCommentTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
210             .addGroup(inputCommentTabLayout.createSequentialGroup()
211                 .addContainerGap()
212                 .addComponent(commentSaveInfoPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
213                 .addContainerGap())
214         );
215         inputCommentTabLayout.setVerticalGroup(
216             inputCommentTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
217             .addGroup(inputCommentTabLayout.createSequentialGroup()
218                 .addContainerGap()
219                 .addComponent(commentSaveInfoPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
220                 .addContainerGap(30, Short.MAX_VALUE))
221         );
222
223         saveTabbedPane.addTab("入力コメント", inputCommentTab);
224
225         tcommentSaveInfoPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("投稿者コメント保存設定"));
226
227         needDownloadTcomment.setText("コメントをダウンロードする");
228         needDownloadTcomment.setName("needDownloadTcomment"); // NOI18N
229
230         delTcomment.setText("変換後にコメントファイルを削除する");
231         delTcomment.setName("delTcomment"); // NOI18N
232
233         inputTcommentSaveGroup.add(tcommentSaveInFolder);
234         tcommentSaveInFolder.setText("保存するフォルダを指定し、ファイル名は自動で決定する");
235         tcommentSaveInFolder.setName("tcommentSaveInFolder"); // NOI18N
236
237         tcommentFolder.setName("tcommentFolder"); // NOI18N
238
239         tcoomentFolderChooserButton.setText("参照...");
240         tcoomentFolderChooserButton.setName("tcoomentFolderChooserButton"); // NOI18N
241         tcoomentFolderChooserButton.addActionListener(new java.awt.event.ActionListener() {
242             public void actionPerformed(java.awt.event.ActionEvent evt) {
243                 tcoomentFolderChooserButtonActionPerformed(evt);
244             }
245         });
246
247         inputTcommentSaveGroup.add(tcommentSaveToFile);
248         tcommentSaveToFile.setText("保存するファイル名を指定する");
249         tcommentSaveToFile.setName("tcommentSaveToFile"); // NOI18N
250
251         tcommentFile.setName("tcommentFile"); // NOI18N
252
253         tcommentFileChooserButton.setText("参照...");
254         tcommentFileChooserButton.setName("tcommentFileChooserButton"); // NOI18N
255         tcommentFileChooserButton.addActionListener(new java.awt.event.ActionListener() {
256             public void actionPerformed(java.awt.event.ActionEvent evt) {
257                 tcommentFileChooserButtonActionPerformed(evt);
258             }
259         });
260
261         javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
262         jPanel8.setLayout(jPanel8Layout);
263         jPanel8Layout.setHorizontalGroup(
264             jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
265             .addGroup(jPanel8Layout.createSequentialGroup()
266                 .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
267                     .addComponent(delTcomment)
268                     .addComponent(tcommentSaveInFolder)
269                     .addGroup(jPanel8Layout.createSequentialGroup()
270                         .addContainerGap()
271                         .addComponent(tcommentFolder, javax.swing.GroupLayout.DEFAULT_SIZE, 206, Short.MAX_VALUE)
272                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
273                         .addComponent(tcoomentFolderChooserButton))
274                     .addComponent(tcommentSaveToFile)
275                     .addGroup(jPanel8Layout.createSequentialGroup()
276                         .addContainerGap()
277                         .addComponent(tcommentFile, javax.swing.GroupLayout.DEFAULT_SIZE, 206, Short.MAX_VALUE)
278                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
279                         .addComponent(tcommentFileChooserButton)))
280                 .addContainerGap())
281         );
282         jPanel8Layout.setVerticalGroup(
283             jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
284             .addGroup(jPanel8Layout.createSequentialGroup()
285                 .addContainerGap()
286                 .addComponent(delTcomment)
287                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
288                 .addComponent(tcommentSaveInFolder)
289                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
290                 .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
291                     .addComponent(tcommentFolder, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
292                     .addComponent(tcoomentFolderChooserButton))
293                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
294                 .addComponent(tcommentSaveToFile)
295                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
296                 .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
297                     .addComponent(tcommentFile, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
298                     .addComponent(tcommentFileChooserButton))
299                 .addContainerGap())
300         );
301
302         javax.swing.GroupLayout tcommentSaveInfoPanelLayout = new javax.swing.GroupLayout(tcommentSaveInfoPanel);
303         tcommentSaveInfoPanel.setLayout(tcommentSaveInfoPanelLayout);
304         tcommentSaveInfoPanelLayout.setHorizontalGroup(
305             tcommentSaveInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
306             .addGroup(tcommentSaveInfoPanelLayout.createSequentialGroup()
307                 .addComponent(needDownloadTcomment)
308                 .addGap(79, 79, 79))
309             .addGroup(tcommentSaveInfoPanelLayout.createSequentialGroup()
310                 .addGap(21, 21, 21)
311                 .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
312                 .addContainerGap())
313         );
314         tcommentSaveInfoPanelLayout.setVerticalGroup(
315             tcommentSaveInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
316             .addGroup(tcommentSaveInfoPanelLayout.createSequentialGroup()
317                 .addComponent(needDownloadTcomment)
318                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
319                 .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
320                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
321         );
322
323         javax.swing.GroupLayout inputTcommentTabLayout = new javax.swing.GroupLayout(inputTcommentTab);
324         inputTcommentTab.setLayout(inputTcommentTabLayout);
325         inputTcommentTabLayout.setHorizontalGroup(
326             inputTcommentTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
327             .addGroup(inputTcommentTabLayout.createSequentialGroup()
328                 .addContainerGap()
329                 .addComponent(tcommentSaveInfoPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
330                 .addContainerGap())
331         );
332         inputTcommentTabLayout.setVerticalGroup(
333             inputTcommentTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
334             .addGroup(inputTcommentTabLayout.createSequentialGroup()
335                 .addContainerGap()
336                 .addComponent(tcommentSaveInfoPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
337                 .addContainerGap(74, Short.MAX_VALUE))
338         );
339
340         saveTabbedPane.addTab("入力投稿者コメント", inputTcommentTab);
341
342         jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("コメント付き動画保存設定"));
343
344         savingConvertedVideoCheckBox.setText("動画を変換する");
345         savingConvertedVideoCheckBox.setName("savingConvertedVideoCheckBox"); // NOI18N
346
347         addComment.setText("コメントをつける");
348         addComment.setName("addComment"); // NOI18N
349
350         addTcomment.setText("投稿者コメントをつける");
351         addTcomment.setName("addTcomment"); // NOI18N
352
353         outputVideoSaveGroup.add(convSaveFolderRadioButton);
354         convSaveFolderRadioButton.setText("保存するフォルダを指定し、ファイル名は自動で決定する");
355         convSaveFolderRadioButton.setName("convSaveFolderRadioButton"); // NOI18N
356
357         notAddVideoIdConvVideoCheckBox.setText("ファイル名に動画IDを付加しない");
358         notAddVideoIdConvVideoCheckBox.setName("notAddVideoIdConvVideoCheckBox"); // NOI18N
359
360         convertedVideoSavedFolderField.setName("convertedVideoSavedFolderField"); // NOI18N
361
362         showSavingConvertedVideoFolderDialogButton.setText("参照...");
363
364         outputVideoSaveGroup.add(convSaveFileRadioButton);
365         convSaveFileRadioButton.setText("保存するファイル名を指定する");
366         convSaveFileRadioButton.setName("convSaveFileRadioButton"); // NOI18N
367
368         convertedVideoSavedFileField.setName("convertedVideoSavedFileField"); // NOI18N
369
370         showSavingConvertedVideoFileDialogButton.setText("参照...");
371
372         javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
373         jPanel5.setLayout(jPanel5Layout);
374         jPanel5Layout.setHorizontalGroup(
375             jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
376             .addGroup(jPanel5Layout.createSequentialGroup()
377                 .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
378                     .addComponent(addComment)
379                     .addComponent(addTcomment)
380                     .addComponent(convSaveFileRadioButton)
381                     .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
382                         .addGap(21, 21, 21)
383                         .addComponent(convertedVideoSavedFileField, javax.swing.GroupLayout.DEFAULT_SIZE, 194, Short.MAX_VALUE)
384                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
385                         .addComponent(showSavingConvertedVideoFileDialogButton))
386                     .addGroup(jPanel5Layout.createSequentialGroup()
387                         .addGap(21, 21, 21)
388                         .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
389                             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
390                                 .addComponent(convertedVideoSavedFolderField, javax.swing.GroupLayout.DEFAULT_SIZE, 194, Short.MAX_VALUE)
391                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
392                                 .addComponent(showSavingConvertedVideoFolderDialogButton))
393                             .addComponent(notAddVideoIdConvVideoCheckBox)))
394                     .addComponent(convSaveFolderRadioButton))
395                 .addContainerGap())
396         );
397         jPanel5Layout.setVerticalGroup(
398             jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
399             .addGroup(jPanel5Layout.createSequentialGroup()
400                 .addComponent(addComment)
401                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
402                 .addComponent(addTcomment)
403                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
404                 .addComponent(convSaveFolderRadioButton)
405                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
406                 .addComponent(notAddVideoIdConvVideoCheckBox)
407                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
408                 .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
409                     .addComponent(convertedVideoSavedFolderField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
410                     .addComponent(showSavingConvertedVideoFolderDialogButton))
411                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
412                 .addComponent(convSaveFileRadioButton)
413                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
414                 .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
415                     .addComponent(convertedVideoSavedFileField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
416                     .addComponent(showSavingConvertedVideoFileDialogButton))
417                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
418         );
419
420         javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
421         jPanel3.setLayout(jPanel3Layout);
422         jPanel3Layout.setHorizontalGroup(
423             jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
424             .addGroup(jPanel3Layout.createSequentialGroup()
425                 .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
426                     .addComponent(savingConvertedVideoCheckBox)
427                     .addGroup(jPanel3Layout.createSequentialGroup()
428                         .addGap(21, 21, 21)
429                         .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
430                 .addContainerGap())
431         );
432         jPanel3Layout.setVerticalGroup(
433             jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
434             .addGroup(jPanel3Layout.createSequentialGroup()
435                 .addComponent(savingConvertedVideoCheckBox)
436                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
437                 .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
438                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
439         );
440
441         javax.swing.GroupLayout outputVideoTabLayout = new javax.swing.GroupLayout(outputVideoTab);
442         outputVideoTab.setLayout(outputVideoTabLayout);
443         outputVideoTabLayout.setHorizontalGroup(
444             outputVideoTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
445             .addGroup(outputVideoTabLayout.createSequentialGroup()
446                 .addContainerGap()
447                 .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
448                 .addContainerGap(15, Short.MAX_VALUE))
449         );
450         outputVideoTabLayout.setVerticalGroup(
451             outputVideoTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
452             .addGroup(outputVideoTabLayout.createSequentialGroup()
453                 .addContainerGap()
454                 .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
455                 .addContainerGap(38, Short.MAX_VALUE))
456         );
457
458         saveTabbedPane.addTab("出力コメント付き動画", outputVideoTab);
459
460         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
461         this.setLayout(layout);
462         layout.setHorizontalGroup(
463             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
464             .addComponent(saveTabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 374, Short.MAX_VALUE)
465         );
466         layout.setVerticalGroup(
467             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
468             .addComponent(saveTabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 297, Short.MAX_VALUE)
469         );
470     }// </editor-fold>//GEN-END:initComponents
471
472     private void tcoomentFolderChooserButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tcoomentFolderChooserButtonActionPerformed
473         showSaveDialog("投稿者コメントの保存先(フォルダ)", tcommentFolder, true, true);
474     }//GEN-LAST:event_tcoomentFolderChooserButtonActionPerformed
475
476     private void tcommentFileChooserButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tcommentFileChooserButtonActionPerformed
477         showSaveDialog("投稿者コメントの保存先(ファイル)", tcommentFile, true, false);
478     }//GEN-LAST:event_tcommentFileChooserButtonActionPerformed
479     // Variables declaration - do not modify//GEN-BEGIN:variables
480     private javax.swing.JCheckBox addComment;
481     private javax.swing.JCheckBox addTcomment;
482     private javax.swing.JTextField commentNumField;
483     private javax.swing.JRadioButton commentSaveFileRadioButton;
484     private javax.swing.JRadioButton commentSaveFolderRadioButton;
485     private javax.swing.JPanel commentSaveInfoPanel;
486     private javax.swing.JTextField commentSavedFileField;
487     private javax.swing.JTextField commentSavedFolderField;
488     private javax.swing.JRadioButton convSaveFileRadioButton;
489     private javax.swing.JRadioButton convSaveFolderRadioButton;
490     private javax.swing.JTextField convertedVideoSavedFileField;
491     private javax.swing.JTextField convertedVideoSavedFolderField;
492     private javax.swing.JCheckBox delCommentCheckBox;
493     private javax.swing.JCheckBox delTcomment;
494     private javax.swing.JCheckBox fixCommentNumCheckBox;
495     private javax.swing.ButtonGroup inputCommentSaveGroup;
496     private javax.swing.JPanel inputCommentTab;
497     private javax.swing.ButtonGroup inputTcommentSaveGroup;
498     private javax.swing.JPanel inputTcommentTab;
499     private javax.swing.JPanel inputVideoTab;
500     private javax.swing.JLabel jLabel1;
501     private javax.swing.JPanel jPanel3;
502     private javax.swing.JPanel jPanel5;
503     private javax.swing.JPanel jPanel7;
504     private javax.swing.JPanel jPanel8;
505     private javax.swing.JCheckBox needDownloadTcomment;
506     private javax.swing.JCheckBox notAddVideoIdConvVideoCheckBox;
507     private javax.swing.ButtonGroup outputVideoSaveGroup;
508     private javax.swing.JPanel outputVideoTab;
509     private javax.swing.JTabbedPane saveTabbedPane;
510     private javax.swing.JCheckBox savingCommentCheckBox;
511     private javax.swing.JCheckBox savingConvertedVideoCheckBox;
512     private javax.swing.JButton showSavingCommentFileDialogButton;
513     private javax.swing.JButton showSavingCommentFolderDialogButton;
514     private javax.swing.JButton showSavingConvertedVideoFileDialogButton;
515     private javax.swing.JButton showSavingConvertedVideoFolderDialogButton;
516     private javax.swing.JTextField tcommentFile;
517     private javax.swing.JButton tcommentFileChooserButton;
518     private javax.swing.JTextField tcommentFolder;
519     private javax.swing.JRadioButton tcommentSaveInFolder;
520     private javax.swing.JPanel tcommentSaveInfoPanel;
521     private javax.swing.JRadioButton tcommentSaveToFile;
522     private javax.swing.JButton tcoomentFolderChooserButton;
523     // End of variables declaration//GEN-END:variables
524
525     /** @return 保存設定-入力コメント「コメントをダウンロードする」チェックボックス. */
526     JCheckBox getSavingCommentCheckBox() {
527         return savingCommentCheckBox;
528     }
529
530     /** @return 保存設定-入力コメント「変換後にコメントファイルを削除する」チェックボックス. */
531     JCheckBox getDelCommentCheckBox() {
532         return delCommentCheckBox;
533     }
534
535     /** @return 保存設定-入力コメント「コメント取得数は自動で調整する」チェックボックス. */
536     JCheckBox getFixCommentNumCheckBox() {
537         return fixCommentNumCheckBox;
538     }
539
540     /** @return 保存設定-入力コメント「取得コメント数」テキストフィールド. */
541     JTextField getCommentNumField() {
542         return commentNumField;
543     }
544
545     /** @return 保存設定-入力コメント「保存するフォルダを指定し、ファイル名は自動で決定する」ラジオボタン. */
546     JRadioButton getCommentSaveFolderRadioButton() {
547         return commentSaveFolderRadioButton;
548     }
549
550     /** @return 保存設定-入力コメント「ファイル名に動画IDを付加しない」チェックボックス. */
551     JCheckBox getNotAddVideoIdConvVideoCheckBox() {
552         return notAddVideoIdConvVideoCheckBox;
553     }
554
555     /** @return 保存設定-入力コメント「保存するフォルダを指定し、ファイル名は自動で決定する」テキストフィールド. */
556     JTextField getCommentSavedFolderField() {
557         return commentSavedFolderField;
558     }
559
560     /** @return 保存設定-入力コメント「保存するフォルダを指定し、ファイル名は自動で決定する」ファイルチューザボタン. */
561     JButton getShowSavingCommentFolderDialogButton() {
562         return showSavingCommentFolderDialogButton;
563     }
564
565     /** @return 保存設定-入力コメント「保存するファイル名を指定する」ラジオボタン. */
566     JRadioButton getCommentSaveFileRadioButton() {
567         return commentSaveFileRadioButton;
568     }
569
570     /** @return 保存設定-入力コメント「保存するファイル名を指定する」テキストフィールド. */
571     JTextField getCommentSavedFileField() {
572         return commentSavedFileField;
573     }
574
575     /** @return 保存設定-入力コメント「保存するファイル名を指定する」ファイルチューザボタン. */
576     JButton getShowSavingCommentFileDialogButton() {
577         return showSavingCommentFileDialogButton;
578     }
579
580     /** @return 保存設定-出力コメント付き動画「動画を変換する」チェックボックス. */
581     JCheckBox getSavingConvertedVideoCheckBox() {
582         return savingConvertedVideoCheckBox;
583     }
584
585     /** @return 保存設定-出力コメント付き動画「コメントをつける」チェックボックス. */
586     JCheckBox getAddCommentCheckBox() {
587         return addComment;
588     }
589
590     /** @return 保存設定-出力コメント付き動画「投稿者コメントをつける」チェックボックス. */
591     JCheckBox getAddTcommentCheckBox() {
592         return addTcomment;
593     }
594
595     /** @return 保存設定-出力コメント付き動画「保存するフォルダを指定し、ファイル名は自動で決定する」ラジオボタン. */
596     JRadioButton getConvSaveFolderRadioButton() {
597         return convSaveFolderRadioButton;
598     }
599
600     /** @return 保存設定-出力コメント付き動画「保存するフォルダを指定し、ファイル名は自動で決定する」テキストフィールド. */
601     JTextField getConvertedVideoSavedFolderField() {
602         return convertedVideoSavedFolderField;
603     }
604
605     /** @return 保存設定-出力コメント付き動画「保存するフォルダを指定し、ファイル名は自動で決定する」ファイルチューザボタン. */
606     JButton getShowSavingConvertedVideoFolderDialogButton() {
607         return showSavingConvertedVideoFolderDialogButton;
608     }
609
610     /** @return 保存設定-出力コメント付き動画「保存するファイル名を指定する」ラジオボタン. */
611     JRadioButton getConvSaveFileRadioButton() {
612         return convSaveFileRadioButton;
613     }
614
615     /** @return 保存設定-出力コメント付き動画「保存するファイル名を指定する」テキストフィールド. */
616     JTextField getConvertedVideoSavedFileField() {
617         return convertedVideoSavedFileField;
618     }
619
620     /** @return 保存設定-出力コメント付き動画「保存するファイル名を指定する」ファイルチューザボタン. */
621     JButton getShowSavingConvertedVideoFileDialogButton() {
622         return showSavingConvertedVideoFileDialogButton;
623     }
624
625     VideoSaveInfoPanel getVideoSaveInfoPanel() {
626         return videoSaveInfoPanel;
627     }
628
629     /** @return 投稿者コメントをダウンロードするのであればtrue. */
630     boolean isTcommentDownload() {
631         return needDownloadTcomment.isSelected();
632     }
633
634     /** 「投稿者コメントをダウンロードする」に設定を行う. */
635     void setTcommentDownload(boolean b) {
636         needDownloadTcomment.setSelected(b);
637     }
638
639     /** @return 変換後に投稿者コメントを削除するのであればtrue. */
640     boolean isTcommentDelete() {
641         return delTcomment.isSelected();
642     }
643
644     /** 「変換後に投稿者コメントを削除する」に設定を行う. */
645     void setTcommentDelete(boolean b) {
646         delTcomment.setSelected(b);
647     }
648
649     /** @return 投稿者コメントのファイル名を自動で設定するのであればtrue, 直接指定するのであればfalse. */
650     boolean isTcommentAutoFileName() {
651         return tcommentSaveInFolder.isSelected();
652     }
653
654     /** @param b 投稿者コメントのファイル名を自動で設定するのであればtrue, 直接指定するのであればfalse. */
655     void setTcommentAutoFileName(boolean b) {
656         tcommentSaveInFolder.setSelected(b);
657         tcommentSaveToFile.setSelected(!b);
658     }
659
660     /** @return 投稿者コメントの「保存するフォルダを指定し、ファイル名は自動で決定する」に設定してある文字列. */
661     String getTcommentDirectoryName() {
662         return tcommentFolder.getText();
663     }
664
665     /** @param t 投稿者コメントの「保存するフォルダを指定し、ファイル名は自動で決定する」に設定してある文字列. */
666     void setTcommentDirectoryName(String t) {
667         tcommentFolder.setText(t);
668     }
669
670     /** @return 投稿者コメントの「保存するファイル名を指定する」に設定してある文字列. */
671     String getTcommentFileName() {
672         return tcommentFile.getText();
673     }
674
675     /** @param b 投稿者コメントの「保存するファイル名を指定する」に設定してある文字列. */
676     void setTcommentFileName(String t) {
677         tcommentFile.setText(t);
678     }
679
680     private void showSaveDialog(String title, JTextField field, boolean isSave,
681             boolean isDir) {
682         File current = new File(field.getText());
683         JFileChooser chooser = new JFileChooser(current);
684         chooser.setDialogTitle(title);
685         int code = 0;
686         if (isDir) {
687             chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
688         }
689         if (isSave) {
690             code = chooser.showSaveDialog(this);
691         } else {
692             code = chooser.showOpenDialog(this);
693         }
694         if (code == JFileChooser.APPROVE_OPTION) {
695             field.setText(chooser.getSelectedFile().getAbsolutePath());
696         }
697     }
698 }