OSDN Git Service

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