OSDN Git Service

ConfigからOutputProfileを生成するためのデフォルト実装クラス
[coroid/inqubus.git] / frontend / src / saccubus / VideoSaveInfoPanel.java
1 /* $Id$ */
2 package saccubus;
3
4 import javax.swing.JButton;
5 import javax.swing.JCheckBox;
6 import javax.swing.JFrame;
7 import javax.swing.JRadioButton;
8 import javax.swing.JTextField;
9 import javax.swing.SwingUtilities;
10 import javax.swing.UIManager;
11
12 /**
13  *
14  * @author yuki
15  */
16 class VideoSaveInfoPanel extends javax.swing.JPanel {
17     private static final long serialVersionUID = 1L;
18
19     /** Creates new form VideoSaveInfoPanel */
20     VideoSaveInfoPanel() {
21         initComponents();
22     }
23
24     /** This method is called from within the constructor to
25      * initialize the form.
26      * WARNING: Do NOT modify this code. The content of this method is
27      * always regenerated by the Form Editor.
28      */
29     @SuppressWarnings("unchecked")
30     // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
31     private void initComponents() {
32
33         videoSavingGroup = new javax.swing.ButtonGroup();
34         videoNamingGroup = new javax.swing.ButtonGroup();
35         videoNoSaveButton = new javax.swing.JRadioButton();
36         videoSaveButton = new javax.swing.JRadioButton();
37         basicSetting = new javax.swing.JPanel();
38         delVideoCheckBox = new javax.swing.JCheckBox();
39         saveFolderRadioButton = new javax.swing.JRadioButton();
40         videoSavedFolderField = new javax.swing.JTextField();
41         showSavingVideoFolderDialogButton = new javax.swing.JButton();
42         saveFileRadioButton = new javax.swing.JRadioButton();
43         videoSavedFileField = new javax.swing.JTextField();
44         showSavingVideoFileDialogButton = new javax.swing.JButton();
45         videoUseNiBrButton = new javax.swing.JRadioButton();
46         nibrExtendSetting = new javax.swing.JPanel();
47         nibrFileField = new javax.swing.JTextField();
48         nibrFileChooserButton = new javax.swing.JButton();
49
50         setBorder(javax.swing.BorderFactory.createTitledBorder("動画保存設定"));
51
52         videoSavingGroup.add(videoNoSaveButton);
53         videoNoSaveButton.setText("動画をダウンロードしない");
54         videoNoSaveButton.setName("videoNoSaveButton"); // NOI18N
55
56         videoSavingGroup.add(videoSaveButton);
57         videoSaveButton.setText("動画をダウンロードする");
58         videoSaveButton.setName("videoSaveButton"); // NOI18N
59
60         delVideoCheckBox.setText("変換後に動画ファイルを削除する");
61         delVideoCheckBox.setName("delVideoCheckBox"); // NOI18N
62
63         videoNamingGroup.add(saveFolderRadioButton);
64         saveFolderRadioButton.setText("保存するフォルダを指定し、ファイル名は自動で決定する");
65         saveFolderRadioButton.setName("saveFolderRadioButton"); // NOI18N
66
67         videoSavedFolderField.setName("videoSavedFolderField"); // NOI18N
68
69         showSavingVideoFolderDialogButton.setText("参照...");
70         showSavingVideoFolderDialogButton.setName("showSavingVideoFolderDialogButton"); // NOI18N
71
72         videoNamingGroup.add(saveFileRadioButton);
73         saveFileRadioButton.setText("保存するファイル名を指定する");
74         saveFileRadioButton.setName("saveFileRadioButton"); // NOI18N
75
76         videoSavedFileField.setName("videoSavedFileField"); // NOI18N
77
78         showSavingVideoFileDialogButton.setText("参照...");
79         showSavingVideoFileDialogButton.setName("showSavingVideoFileDialogButton"); // NOI18N
80
81         javax.swing.GroupLayout basicSettingLayout = new javax.swing.GroupLayout(basicSetting);
82         basicSetting.setLayout(basicSettingLayout);
83         basicSettingLayout.setHorizontalGroup(
84             basicSettingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
85             .addGroup(basicSettingLayout.createSequentialGroup()
86                 .addGroup(basicSettingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
87                     .addComponent(delVideoCheckBox)
88                     .addComponent(saveFolderRadioButton)
89                     .addComponent(saveFileRadioButton)
90                     .addGroup(basicSettingLayout.createSequentialGroup()
91                         .addGap(21, 21, 21)
92                         .addComponent(videoSavedFileField, javax.swing.GroupLayout.DEFAULT_SIZE, 205, Short.MAX_VALUE)
93                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
94                         .addComponent(showSavingVideoFileDialogButton))
95                     .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, basicSettingLayout.createSequentialGroup()
96                         .addGap(21, 21, 21)
97                         .addComponent(videoSavedFolderField, javax.swing.GroupLayout.DEFAULT_SIZE, 205, Short.MAX_VALUE)
98                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
99                         .addComponent(showSavingVideoFolderDialogButton)))
100                 .addContainerGap())
101         );
102         basicSettingLayout.setVerticalGroup(
103             basicSettingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
104             .addGroup(basicSettingLayout.createSequentialGroup()
105                 .addComponent(delVideoCheckBox)
106                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
107                 .addComponent(saveFolderRadioButton)
108                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
109                 .addGroup(basicSettingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
110                     .addComponent(videoSavedFolderField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
111                     .addComponent(showSavingVideoFolderDialogButton))
112                 .addGap(8, 8, 8)
113                 .addComponent(saveFileRadioButton)
114                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
115                 .addGroup(basicSettingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
116                     .addComponent(videoSavedFileField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
117                     .addComponent(showSavingVideoFileDialogButton))
118                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
119         );
120
121         videoSavingGroup.add(videoUseNiBrButton);
122         videoUseNiBrButton.setText("NicoBrowserダウンロードファイルを用いる");
123         videoUseNiBrButton.setName("videoUseNiBrButton"); // NOI18N
124
125         nibrFileField.setName("nibrFileField"); // NOI18N
126
127         nibrFileChooserButton.setText("参照...");
128
129         javax.swing.GroupLayout nibrExtendSettingLayout = new javax.swing.GroupLayout(nibrExtendSetting);
130         nibrExtendSetting.setLayout(nibrExtendSettingLayout);
131         nibrExtendSettingLayout.setHorizontalGroup(
132             nibrExtendSettingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
133             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, nibrExtendSettingLayout.createSequentialGroup()
134                 .addComponent(nibrFileField, javax.swing.GroupLayout.DEFAULT_SIZE, 226, Short.MAX_VALUE)
135                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
136                 .addComponent(nibrFileChooserButton)
137                 .addContainerGap())
138         );
139         nibrExtendSettingLayout.setVerticalGroup(
140             nibrExtendSettingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
141             .addGroup(nibrExtendSettingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
142                 .addComponent(nibrFileField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
143                 .addComponent(nibrFileChooserButton))
144         );
145
146         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
147         this.setLayout(layout);
148         layout.setHorizontalGroup(
149             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
150             .addGroup(layout.createSequentialGroup()
151                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
152                     .addComponent(videoNoSaveButton)
153                     .addComponent(videoSaveButton))
154                 .addContainerGap())
155             .addGroup(layout.createSequentialGroup()
156                 .addComponent(videoUseNiBrButton)
157                 .addContainerGap())
158             .addGroup(layout.createSequentialGroup()
159                 .addGap(21, 21, 21)
160                 .addComponent(basicSetting, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
161             .addGroup(layout.createSequentialGroup()
162                 .addGap(21, 21, 21)
163                 .addComponent(nibrExtendSetting, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
164         );
165         layout.setVerticalGroup(
166             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
167             .addGroup(layout.createSequentialGroup()
168                 .addComponent(videoNoSaveButton)
169                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
170                 .addComponent(videoSaveButton)
171                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
172                 .addComponent(basicSetting, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
173                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
174                 .addComponent(videoUseNiBrButton)
175                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
176                 .addComponent(nibrExtendSetting, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
177         );
178     }// </editor-fold>//GEN-END:initComponents
179     // Variables declaration - do not modify//GEN-BEGIN:variables
180     private javax.swing.JPanel basicSetting;
181     private javax.swing.JCheckBox delVideoCheckBox;
182     private javax.swing.JPanel nibrExtendSetting;
183     private javax.swing.JButton nibrFileChooserButton;
184     private javax.swing.JTextField nibrFileField;
185     private javax.swing.JRadioButton saveFileRadioButton;
186     private javax.swing.JRadioButton saveFolderRadioButton;
187     private javax.swing.JButton showSavingVideoFileDialogButton;
188     private javax.swing.JButton showSavingVideoFolderDialogButton;
189     private javax.swing.ButtonGroup videoNamingGroup;
190     private javax.swing.JRadioButton videoNoSaveButton;
191     private javax.swing.JRadioButton videoSaveButton;
192     private javax.swing.JTextField videoSavedFileField;
193     private javax.swing.JTextField videoSavedFolderField;
194     private javax.swing.ButtonGroup videoSavingGroup;
195     private javax.swing.JRadioButton videoUseNiBrButton;
196     // End of variables declaration//GEN-END:variables
197
198     /** @return 「動画をダウンロードしない」ラジオボタン. */
199     JRadioButton getVideoNoSaveButton() {
200         return videoNoSaveButton;
201     }
202
203     /** @return 「動画をダウンロードする」ラジオボタン. */
204     JRadioButton getVideoSaveButton() {
205         return videoSaveButton;
206     }
207
208     /** @return 「NicoBrowserダウンロードファイルを用いる」ラジオボタン. */
209     JRadioButton getVideoUseNiBrButton() {
210         return videoUseNiBrButton;
211     }
212
213     /** @return 「変換後に動画ファイルを削除する」チェックボックス. */
214     JCheckBox getDelVideoCheckBox() {
215         return delVideoCheckBox;
216     }
217
218     /** @return 「保存するフォルダを指定し、ファイル名は自動で決定する」ラジオボタン. */
219     JRadioButton getSaveFolderRadioButton() {
220         return saveFolderRadioButton;
221     }
222
223     /** @return 「保存するファイル名を指定する」ラジオボタン. */
224     JRadioButton getSaveFileRadioButton() {
225         return saveFileRadioButton;
226     }
227
228     /** @return 「保存するフォルダを指定し、ファイル名は自動で決定する」テキストフィールド. */
229     JTextField getVideoSavedFolderField() {
230         return videoSavedFolderField;
231     }
232
233     /** @return 「保存するフォルダを指定し、ファイル名は自動で決定する」ファイルチューザ起動ボタン. */
234     JButton getShowSavingVideoFolderDialogButton() {
235         return showSavingVideoFolderDialogButton;
236     }
237
238     /** @return 「保存するファイル名を指定する」テキストフィールド. */
239     JTextField getVideoSavedFileField() {
240         return videoSavedFileField;
241     }
242
243     /** @return 「保存するファイル名を指定する」ファイルチューザ起動ボタン. */
244     JButton getShowSavingVideoFileDialogButton() {
245         return showSavingVideoFileDialogButton;
246     }
247
248     /** @return 「NicoBrowserダウンロードファイルを用いる」テキストフィールド. */
249     JTextField getNibrFileField() {
250         return nibrFileField;
251     }
252
253     /** @return 「NicoBrowserダウンロードファイルを用いる」ファイルチューザ起動ボタン. */
254     JButton getNibrFileChooserButton() {
255         return nibrFileChooserButton;
256     }
257
258     public static void main(String[] args) {
259         setLookAndFeel();
260         SwingUtilities.invokeLater(new Runnable() {
261
262             public void run() {
263                 JFrame frame = new JFrame();
264                 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
265                 frame.setContentPane(new VideoSaveInfoPanel());
266                 frame.pack();
267                 frame.setVisible(true);
268             }
269         });
270     }
271
272     private static void setLookAndFeel() {
273         String lafClassName = UIManager.getSystemLookAndFeelClassName();
274         try {
275             UIManager.setLookAndFeel(lafClassName);
276         } catch (Exception e) {
277             throw new RuntimeException(e);
278         }
279     }
280 }