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;
16 class VideoSaveInfoPanel extends javax.swing.JPanel {
17 private static final long serialVersionUID = 1L;
19 /** Creates new form VideoSaveInfoPanel */
20 VideoSaveInfoPanel() {
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.
29 @SuppressWarnings("unchecked")
30 // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
31 private void initComponents() {
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();
50 setBorder(javax.swing.BorderFactory.createTitledBorder("動画保存設定"));
52 videoSavingGroup.add(videoNoSaveButton);
53 videoNoSaveButton.setText("動画をダウンロードしない");
54 videoNoSaveButton.setName("videoNoSaveButton"); // NOI18N
56 videoSavingGroup.add(videoSaveButton);
57 videoSaveButton.setText("動画をダウンロードする");
58 videoSaveButton.setName("videoSaveButton"); // NOI18N
60 delVideoCheckBox.setText("変換後に動画ファイルを削除する");
61 delVideoCheckBox.setName("delVideoCheckBox"); // NOI18N
63 videoNamingGroup.add(saveFolderRadioButton);
64 saveFolderRadioButton.setText("保存するフォルダを指定し、ファイル名は自動で決定する");
65 saveFolderRadioButton.setName("saveFolderRadioButton"); // NOI18N
67 videoSavedFolderField.setName("videoSavedFolderField"); // NOI18N
69 showSavingVideoFolderDialogButton.setText("参照...");
70 showSavingVideoFolderDialogButton.setName("showSavingVideoFolderDialogButton"); // NOI18N
72 videoNamingGroup.add(saveFileRadioButton);
73 saveFileRadioButton.setText("保存するファイル名を指定する");
74 saveFileRadioButton.setName("saveFileRadioButton"); // NOI18N
76 videoSavedFileField.setName("videoSavedFileField"); // NOI18N
78 showSavingVideoFileDialogButton.setText("参照...");
79 showSavingVideoFileDialogButton.setName("showSavingVideoFileDialogButton"); // NOI18N
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()
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()
97 .addComponent(videoSavedFolderField, javax.swing.GroupLayout.DEFAULT_SIZE, 205, Short.MAX_VALUE)
98 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
99 .addComponent(showSavingVideoFolderDialogButton)))
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))
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))
121 videoSavingGroup.add(videoUseNiBrButton);
122 videoUseNiBrButton.setText("NicoBrowserダウンロードファイルを用いる");
123 videoUseNiBrButton.setName("videoUseNiBrButton"); // NOI18N
125 nibrFileField.setName("nibrFileField"); // NOI18N
127 nibrFileChooserButton.setText("参照...");
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)
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))
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))
155 .addGroup(layout.createSequentialGroup()
156 .addComponent(videoUseNiBrButton)
158 .addGroup(layout.createSequentialGroup()
160 .addComponent(basicSetting, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
161 .addGroup(layout.createSequentialGroup()
163 .addComponent(nibrExtendSetting, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
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))
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
198 /** @return 「動画をダウンロードしない」ラジオボタン. */
199 JRadioButton getVideoNoSaveButton() {
200 return videoNoSaveButton;
203 /** @return 「動画をダウンロードする」ラジオボタン. */
204 JRadioButton getVideoSaveButton() {
205 return videoSaveButton;
208 /** @return 「NicoBrowserダウンロードファイルを用いる」ラジオボタン. */
209 JRadioButton getVideoUseNiBrButton() {
210 return videoUseNiBrButton;
213 /** @return 「変換後に動画ファイルを削除する」チェックボックス. */
214 JCheckBox getDelVideoCheckBox() {
215 return delVideoCheckBox;
218 /** @return 「保存するフォルダを指定し、ファイル名は自動で決定する」ラジオボタン. */
219 JRadioButton getSaveFolderRadioButton() {
220 return saveFolderRadioButton;
223 /** @return 「保存するファイル名を指定する」ラジオボタン. */
224 JRadioButton getSaveFileRadioButton() {
225 return saveFileRadioButton;
228 /** @return 「保存するフォルダを指定し、ファイル名は自動で決定する」テキストフィールド. */
229 JTextField getVideoSavedFolderField() {
230 return videoSavedFolderField;
233 /** @return 「保存するフォルダを指定し、ファイル名は自動で決定する」ファイルチューザ起動ボタン. */
234 JButton getShowSavingVideoFolderDialogButton() {
235 return showSavingVideoFolderDialogButton;
238 /** @return 「保存するファイル名を指定する」テキストフィールド. */
239 JTextField getVideoSavedFileField() {
240 return videoSavedFileField;
243 /** @return 「保存するファイル名を指定する」ファイルチューザ起動ボタン. */
244 JButton getShowSavingVideoFileDialogButton() {
245 return showSavingVideoFileDialogButton;
248 /** @return 「NicoBrowserダウンロードファイルを用いる」テキストフィールド. */
249 JTextField getNibrFileField() {
250 return nibrFileField;
253 /** @return 「NicoBrowserダウンロードファイルを用いる」ファイルチューザ起動ボタン. */
254 JButton getNibrFileChooserButton() {
255 return nibrFileChooserButton;
258 public static void main(String[] args) {
260 SwingUtilities.invokeLater(new Runnable() {
263 JFrame frame = new JFrame();
264 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
265 frame.setContentPane(new VideoSaveInfoPanel());
267 frame.setVisible(true);
272 private static void setLookAndFeel() {
273 String lafClassName = UIManager.getSystemLookAndFeelClassName();
275 UIManager.setLookAndFeel(lafClassName);
276 } catch (Exception e) {
277 throw new RuntimeException(e);