X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=frontend%2Fsrc%2Fsaccubus%2FMainFrame.java;h=1b38cab7a139e40cb82d0476d675508d82ea2a76;hb=f2b23e9cc9878a47ff3593096798e71add2abf1d;hp=0d3fd8b5c92717c98d1bab4d3fc6f211e8e0e05c;hpb=7d99109cc8fe2e19468317590a6d47222b03471c;p=coroid%2Finqubus.git diff --git a/frontend/src/saccubus/MainFrame.java b/frontend/src/saccubus/MainFrame.java index 0d3fd8b..1b38cab 100644 --- a/frontend/src/saccubus/MainFrame.java +++ b/frontend/src/saccubus/MainFrame.java @@ -25,6 +25,8 @@ import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JTextField; import java.awt.event.KeyEvent; +import nicobrowser.entity.NicoContent; +import yukihane.nicovideo.NicoDBFinder; /** *

@@ -47,10 +49,8 @@ import java.awt.event.KeyEvent; * @version 1.0 */ public class MainFrame extends JFrame { - /** - * - */ private static final long serialVersionUID = 2564486741331062989L; + public static final String VERSION = "1.22r NicoBrowserŠg’£ 0.0.0"; public static final Image WinIcon = Toolkit.getDefaultToolkit() .createImage(saccubus.MainFrame.class.getResource("icon32.png")); @@ -108,12 +108,6 @@ public class MainFrame extends JFrame { GridBagLayout gridBagLayout4 = new GridBagLayout(); - JCheckBox SavingVideoCheckBox = new JCheckBox(); - - JTextField VideoSavedFileField = new JTextField(); - - JButton ShowSavingVideoFileDialogButton = new JButton(); - JCheckBox SavingCommentCheckBox = new JCheckBox(); JTextField CommentSavedFileField = new JTextField(); @@ -132,8 +126,6 @@ public class MainFrame extends JFrame { GridBagLayout gridBagLayout6 = new GridBagLayout(); - ButtonGroup VideoSaveButtonGroup = new ButtonGroup(); - ButtonGroup CommentSaveButtonGroup = new ButtonGroup(); ButtonGroup ConvSaveButtonGroup = new ButtonGroup(); @@ -457,8 +449,8 @@ public class MainFrame extends JFrame { this.setIconImage(WinIcon); contentPane = (JPanel) this.getContentPane(); contentPane.setLayout(borderLayout1); - setSize(new Dimension(400, 560)); - setTitle("‚³‚«‚ã‚΂·"); + setSize(new Dimension(400, 630)); + setTitle("‚³‚«‚ã‚΂· " + VERSION); this.addWindowListener(new MainFrame_this_windowAdapter(this)); statusBar.setText(" "); jMenuFile.setText("ƒtƒ@ƒCƒ‹"); @@ -486,11 +478,17 @@ public class MainFrame extends JFrame { "ƒRƒƒ“ƒg•Û‘¶Ý’è", TitledBorder.LEADING, TitledBorder.TOP, new Font( "MS UI Gothic", Font.PLAIN, 12), Color.black)); CommentSaveInfoPanel.setLayout(gridBagLayout4); - SavingVideoCheckBox.setText("“®‰æ‚ðƒ_ƒEƒ“ƒ[ƒh‚·‚é"); - ShowSavingVideoFileDialogButton.setText("ŽQÆ"); - ShowSavingVideoFileDialogButton - .addActionListener(new MainFrame_ShowSavingVideoDialogButton_actionAdapter( - this)); + + final ActionListener videoSavePanelButtonListener = new VideoSavePanelButtonListener(); + videoSaveInfoPanel.getShowSavingVideoFolderDialogButton().addActionListener(videoSavePanelButtonListener); + videoSaveInfoPanel.getShowSavingVideoFileDialogButton().addActionListener(videoSavePanelButtonListener); + videoSaveInfoPanel.getNibrFileChooserButton().addActionListener(videoSavePanelButtonListener); + + final ActionListener videoUseRadioButtonListener = new VideoUseRadioButtonListener(); + videoSaveInfoPanel.getVideoNoSaveButton().addActionListener(videoUseRadioButtonListener); + videoSaveInfoPanel.getVideoSaveButton().addActionListener(videoUseRadioButtonListener); + videoSaveInfoPanel.getVideoUseNiBrButton().addActionListener(videoUseRadioButtonListener); + SavingCommentCheckBox.setText("ƒRƒƒ“ƒg‚ðƒ_ƒEƒ“ƒ[ƒh‚·‚é"); ShowSavingCommentFileDialogButton.setText("ŽQÆ"); ShowSavingCommentFileDialogButton @@ -545,12 +543,6 @@ public class MainFrame extends JFrame { ShowSavingConvertedVideoFolderDialogButton .addActionListener(new MainFrame_ShowSavingConvertedVideoFolderDialogButton_actionAdapter( this)); - ShowSavingVideoFolderDialogButton.setText("ŽQÆ"); - ShowSavingVideoFolderDialogButton - .addActionListener(new MainFrame_ShowSavingVideoFolderDialogButton_actionAdapter( - this)); - Video_SaveFolderRadioButton.setText("•Û‘¶‚·‚éƒtƒHƒ‹ƒ_‚ðŽw’肵Aƒtƒ@ƒCƒ‹–¼‚ÍŽ©“®‚ÅŒˆ’è‚·‚é"); - Video_SaveFileRadioButton.setText("•Û‘¶‚·‚éƒtƒ@ƒCƒ‹–¼‚ðŽw’è‚·‚é"); Comment_SaveFileRadioButton.setText("•Û‘¶‚·‚éƒtƒ@ƒCƒ‹–¼‚ðŽw’è‚·‚é"); ShowSavingCommentFolderDialogButton.setText("ŽQÆ"); ShowSavingCommentFolderDialogButton @@ -563,9 +555,6 @@ public class MainFrame extends JFrame { jMenuBar1.add(jMenuHelp); jMenuHelp.add(jMenuHelpAbout); setJMenuBar(jMenuBar1); - /* ƒrƒfƒIƒOƒ‹[ƒv */ - VideoSaveButtonGroup.add(Video_SaveFileRadioButton); - VideoSaveButtonGroup.add(Video_SaveFolderRadioButton); CommentSaveButtonGroup.add(Comment_SaveFileRadioButton); CommentSaveButtonGroup.add(Comment_SaveFolderRadioButton); @@ -701,10 +690,12 @@ public class MainFrame extends JFrame { ConvertedVideoSavedFolderField.addMouseListener(new PopupRightClick( this.ConvertedVideoSavedFolderField)); - VideoSavedFileField.addMouseListener(new PopupRightClick( - this.VideoSavedFileField)); - VideoSavedFolderField.addMouseListener(new PopupRightClick( - this.VideoSavedFolderField)); + videoSaveInfoPanel.getVideoSavedFileField().addMouseListener(new PopupRightClick( + videoSaveInfoPanel.getVideoSavedFileField())); + videoSaveInfoPanel.getVideoSavedFolderField().addMouseListener(new PopupRightClick( + videoSaveInfoPanel.getVideoSavedFolderField())); + videoSaveInfoPanel.getNibrFileField().addMouseListener( + new PopupRightClick(videoSaveInfoPanel.getNibrFileField())); FFmpegPathField.addMouseListener(new PopupRightClick( this.FFmpegPathField)); @@ -733,8 +724,9 @@ public class MainFrame extends JFrame { } private void setDropTarget() { - addTarget(VideoSavedFileField, false); - addTarget(VideoSavedFolderField, true); + addTarget(videoSaveInfoPanel.getVideoSavedFileField(), false); + addTarget(videoSaveInfoPanel.getVideoSavedFolderField(), true); + addTarget(videoSaveInfoPanel.getNibrFileField(), false); addTarget(CommentSavedFileField, false); addTarget(CommentSavedFolderField, true); @@ -748,6 +740,12 @@ public class MainFrame extends JFrame { } + /** + * ƒeƒLƒXƒgƒtƒB[ƒ‹ƒh‚ɑ΂µƒhƒƒbƒv‚ðs‚Á‚½ê‡‚Ƀtƒ@ƒCƒ‹‚à‚µ‚­‚̓fƒBƒŒƒNƒgƒŠ‚Ì•¶Žš—ñ‚ðÝ’è‚Å‚«‚é‚悤‚É‚·‚é. + * @param c Ý’è‘Ώۂ̃eƒLƒXƒgƒtƒB[ƒ‹ƒhƒIƒuƒWƒFƒNƒg. + * @param isDir ƒfƒBƒŒƒNƒgƒŠ‚ðÝ’è‚·‚éê‡‚Ítrue, ƒtƒ@ƒCƒ‹‚̏ꍇ‚Ífalse. + * @return ƒhƒƒbƒvƒ^[ƒQƒbƒg(—p“r–³‚µ). + */ private DropTarget addTarget(JTextField c, boolean isDir) { return new DropTarget(c, DnDConstants.ACTION_COPY, new FileDropTarget( c, isDir), true); @@ -827,10 +825,24 @@ public class MainFrame extends JFrame { } catch (NumberFormatException e) { proxy_port = -1; } + + VideoSaveKind kind; + String savedFileName; + if (videoSaveInfoPanel.getVideoNoSaveButton().isSelected() == true) { + kind = VideoSaveKind.NO_SAVE; + savedFileName = videoSaveInfoPanel.getVideoSavedFileField().getText(); + } else if (videoSaveInfoPanel.getVideoUseNiBrButton().isSelected() == true) { + kind = VideoSaveKind.NICOBROWSER; + savedFileName = videoSaveInfoPanel.getNibrFileField().getText(); + } else { + kind = VideoSaveKind.SAVE; + savedFileName = videoSaveInfoPanel.getVideoSavedFileField().getText(); + } + ConvertingSetting setting = new ConvertingSetting(MailAddrField .getText(), new String(PasswordField.getPassword()), - SavingVideoCheckBox.isSelected(), - VideoSavedFileField.getText(), SavingCommentCheckBox + kind, + savedFileName, SavingCommentCheckBox .isSelected(), CommentSavedFileField.getText(), SavingConvertedVideoCheckBox.isSelected(), ConvertedVideoSavedFileField.getText(), ViewCommentField @@ -840,10 +852,11 @@ public class MainFrame extends JFrame { CommandLineOutOptionField.getText(), Integer .toString(back_comment), FontPathField.getText(), Integer.parseInt(FontIndexField.getText()), - ShowConvVideoCheckBox.isSelected(), DelVideoCheckBox + ShowConvVideoCheckBox.isSelected(), videoSaveInfoPanel.getDelVideoCheckBox() .isSelected(), - Video_SaveFolderRadioButton.isSelected(), VideoSavedFolderField - .getText(), DelCommentCheckBox.isSelected(), + videoSaveInfoPanel.getSaveFolderRadioButton().isSelected(), + videoSaveInfoPanel.getVideoSavedFolderField().getText(), + DelCommentCheckBox.isSelected(), Comment_SaveFolderRadioButton.isSelected(), CommentSavedFolderField.getText(), NotAddVideoID_ConvVideoCheckBox.isSelected(), @@ -859,10 +872,30 @@ public class MainFrame extends JFrame { } private void setSetting(ConvertingSetting setting) { - MailAddrField.setText(setting.getMailAddress()); - PasswordField.setText(setting.getPassword()); - SavingVideoCheckBox.setSelected(setting.isSaveVideo()); - VideoSavedFileField.setText(setting.getVideoFile().getPath()); + MailAddrField.setText(setting.getMailAddress()); + PasswordField.setText(setting.getPassword()); + + JRadioButton activeButton; + switch (setting.getVideoSaveKind()) { + case NO_SAVE: + activeButton = videoSaveInfoPanel.getVideoNoSaveButton(); + break; + case NICOBROWSER: + activeButton = videoSaveInfoPanel.getVideoUseNiBrButton(); + break; + case SAVE: + default: + activeButton = videoSaveInfoPanel.getVideoSaveButton(); + break; + } + activeButton.setSelected(true); + ActionListener[] listeners = activeButton.getActionListeners(); + for (ActionListener l : listeners) { + l.actionPerformed(new ActionEvent(activeButton, ActionEvent.ACTION_PERFORMED, activeButton.getText())); + } + + + videoSaveInfoPanel.getVideoSavedFileField().setText(setting.getVideoFile().getPath()); SavingCommentCheckBox.setSelected(setting.isSaveComment()); CommentSavedFileField.setText(setting.getCommentFile().getPath()); SavingConvertedVideoCheckBox.setSelected(setting.isSaveConverted()); @@ -880,24 +913,22 @@ public class MainFrame extends JFrame { FontIndexField.setText(setting.getFontIndex()); ShowConvVideoCheckBox .setSelected(setting.isVhook_ShowConvertingVideo()); - VideoSavedFolderField.setText(setting.getVideoFixFileNameFolder() + videoSaveInfoPanel.getVideoSavedFolderField().setText(setting.getVideoFixFileNameFolder() .getPath()); CommentSavedFolderField.setText(setting.getCommentFixFileNameFolder() .getPath()); ConvertedVideoSavedFolderField.setText(setting .getConvFixFileNameFolder().getPath()); - DelVideoCheckBox.setSelected(setting.isDeleteVideoAfterConverting()); + videoSaveInfoPanel.getDelVideoCheckBox().setSelected(setting.isDeleteVideoAfterConverting()); DelCommentCheckBox .setSelected(setting.isDeleteCommentAfterConverting()); NotAddVideoID_ConvVideoCheckBox.setSelected(setting .isNotAddVideoID_Conv()); - if (setting.isVideoFixFileName()) { - Video_SaveFileRadioButton.setSelected(false); - Video_SaveFolderRadioButton.setSelected(true); - } else { - Video_SaveFileRadioButton.setSelected(true); - Video_SaveFolderRadioButton.setSelected(false); - } + + boolean videoFixName = setting.isVideoFixFileName(); + videoSaveInfoPanel.getSaveFileRadioButton().setSelected(!videoFixName); + videoSaveInfoPanel.getSaveFolderRadioButton().setSelected(videoFixName); + if (setting.isCommentFixFileName()) { Comment_SaveFileRadioButton.setSelected(false); Comment_SaveFolderRadioButton.setSelected(true); @@ -1001,14 +1032,6 @@ public class MainFrame extends JFrame { JButton ShowSavingConvertedVideoFolderDialogButton = new JButton(); - JTextField VideoSavedFolderField = new JTextField(); - - JButton ShowSavingVideoFolderDialogButton = new JButton(); - - JRadioButton Video_SaveFolderRadioButton = new JRadioButton(); - - JRadioButton Video_SaveFileRadioButton = new JRadioButton(); - JRadioButton Comment_SaveFileRadioButton = new JRadioButton(); JTextField CommentSavedFolderField = new JTextField(); @@ -1047,15 +1070,13 @@ public class MainFrame extends JFrame { private JCheckBox FixFontSizeCheckBox = null; - private JCheckBox DelVideoCheckBox = null; - private JCheckBox DelCommentCheckBox = null; private JCheckBox FixCommentNumCheckBox = null; private JCheckBox OpaqueCommentCheckBox = null; - private JPanel VideoSaveInfoPanel = null; + private VideoSaveInfoPanel videoSaveInfoPanel = new VideoSaveInfoPanel(); private JTabbedPane SaveInfoTabPaneEach = null; @@ -1073,7 +1094,28 @@ public class MainFrame extends JFrame { public void DoButton_actionPerformed(ActionEvent e) { if (Converter == null || Converter.isConverted()) { - Converter = new Converter(VideoID_TextField.getText(), WayBackField + String url; + + // NicoBrowserƒtƒ@ƒCƒ‹‚ð—˜—p‚·‚éê‡‚́Aƒtƒ@ƒCƒ‹–¼‚©‚çƒrƒfƒIID‚ð“Á’è. + if(videoSaveInfoPanel.getVideoUseNiBrButton().isSelected()){ + try { + String fileName = videoSaveInfoPanel.getNibrFileField().getText(); + NicoDBFinder finder = NicoDBFinder.getInstance(); + NicoContent info = finder.findNicoContent(fileName); + if (info != null) { + url = info.getNicoId(); + } else { + url = ""; + } + } catch (Exception ex) { + JOptionPane.showMessageDialog(this, ex.getMessage(), "ƒGƒ‰[", JOptionPane.ERROR_MESSAGE); + return; + } + }else{ + url = VideoID_TextField.getText(); + } + + Converter = new Converter(url, WayBackField .getText(), this.getSetting(), this.statusBar, new ConvertStopFlag(this.DoButton, DoButtonStopString, DoButtonWaitString, DoButtonDefString)); @@ -1086,11 +1128,6 @@ public class MainFrame extends JFrame { } } - /* ƒrƒfƒIEƒZ[ƒuƒ_ƒCƒAƒƒO */ - public void ShowSavingVideoDialogButton_actionPerformed(ActionEvent e) { - showSaveDialog("“®‰æ‚Ì•Û‘¶æ(ƒtƒ@ƒCƒ‹)", VideoSavedFileField, true, false); - } - /* ƒRƒƒ“ƒgEƒZ[ƒuƒ_ƒCƒAƒƒO */ public void ShowSavingCommentDialogButton_actionPerformed(ActionEvent e) { showSaveDialog("ƒRƒƒ“ƒg‚Ì•Û‘¶æ(ƒtƒ@ƒCƒ‹)", CommentSavedFileField, true, false); @@ -1132,10 +1169,6 @@ public class MainFrame extends JFrame { showSaveDialog("ƒRƒƒ“ƒg‚Ì•Û‘¶æ(ƒtƒHƒ‹ƒ_)", CommentSavedFolderField, true, true); } - public void ShowSavingVideoFolderDialogButton_actionPerformed(ActionEvent e) { - showSaveDialog("“®‰æ‚Ì•Û‘¶æ(ƒtƒHƒ‹ƒ_)", VideoSavedFolderField, true, true); - } - /** * This method initializes ConvertingSettingPanel * @@ -1339,19 +1372,6 @@ public class MainFrame extends JFrame { } /** - * This method initializes DelVideoCheckBoc - * - * @return javax.swing.JCheckBox - */ - private JCheckBox getDelVideoCheckBox() { - if (DelVideoCheckBox == null) { - DelVideoCheckBox = new JCheckBox(); - DelVideoCheckBox.setText("•ÏŠ·Œã‚É“®‰æƒtƒ@ƒCƒ‹‚ðíœ‚·‚é"); - } - return DelVideoCheckBox; - } - - /** * This method initializes DelCommentCheckBox * * @return javax.swing.JCheckBox @@ -1391,81 +1411,6 @@ public class MainFrame extends JFrame { } /** - * This method initializes VideoSaveInfoPanel - * - * @return javax.swing.JPanel - */ - private JPanel getVideoSaveInfoPanel() { - if (VideoSaveInfoPanel == null) { - GridBagConstraints gridBagConstraints15 = new GridBagConstraints(); - gridBagConstraints15.fill = GridBagConstraints.HORIZONTAL; - gridBagConstraints15.gridwidth = 4; - gridBagConstraints15.gridx = 0; - gridBagConstraints15.gridy = 1; - gridBagConstraints15.weightx = 1.0; - gridBagConstraints15.insets = new Insets(0, 25, 0, 5); - GridBagConstraints gridBagConstraints32 = new GridBagConstraints(3, - 4, 1, 1, 0.0, 0.0, GridBagConstraints.SOUTH, - GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 0, 0); - gridBagConstraints32.gridx = 3; - gridBagConstraints32.insets = new Insets(0, 0, 5, 5); - gridBagConstraints32.gridy = 5; - GridBagConstraints gridBagConstraints30 = new GridBagConstraints(0, - 4, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER, - GridBagConstraints.BOTH, new Insets(0, 50, 0, 5), 0, 0); - gridBagConstraints30.gridx = 0; - gridBagConstraints30.insets = new Insets(0, 50, 5, 5); - gridBagConstraints30.gridy = 5; - GridBagConstraints gridBagConstraints29 = new GridBagConstraints(0, - 3, 4, 1, 1.0, 0.0, GridBagConstraints.CENTER, - GridBagConstraints.BOTH, new Insets(0, 25, 0, 5), 0, 0); - gridBagConstraints29.gridx = 0; - gridBagConstraints29.gridy = 4; - GridBagConstraints gridBagConstraints28 = new GridBagConstraints(0, - 2, 3, 1, 1.0, 0.0, GridBagConstraints.WEST, - GridBagConstraints.BOTH, new Insets(0, 50, 0, 5), 0, 0); - gridBagConstraints28.gridx = 0; - gridBagConstraints28.gridy = 3; - GridBagConstraints gridBagConstraints27 = new GridBagConstraints(0, - 1, 4, 1, 1.0, 0.0, GridBagConstraints.WEST, - GridBagConstraints.HORIZONTAL, new Insets(0, 25, 0, 5), 0, - 0); - gridBagConstraints27.gridx = 0; - gridBagConstraints27.gridy = 2; - GridBagConstraints gridBagConstraints34 = new GridBagConstraints(); - gridBagConstraints34.insets = new Insets(0, 5, 0, 5); - gridBagConstraints34.gridy = 0; - gridBagConstraints34.weightx = 1.0; - gridBagConstraints34.fill = GridBagConstraints.HORIZONTAL; - gridBagConstraints34.gridx = 0; - GridBagConstraints gridBagConstraints31 = new GridBagConstraints(3, - 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, - GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 0, 0); - gridBagConstraints31.gridy = 3; - gridBagConstraints31.gridx = 3; - VideoSaveInfoPanel = new JPanel(); - VideoSaveInfoPanel.setLayout(new GridBagLayout()); - VideoSaveInfoPanel.setBorder(BorderFactory.createTitledBorder(null, - "“®‰æ•Û‘¶Ý’è", TitledBorder.DEFAULT_JUSTIFICATION, - TitledBorder.DEFAULT_POSITION, new Font("MS UI Gothic", - Font.PLAIN, 12), Color.black)); - VideoSaveInfoPanel.add(SavingVideoCheckBox, gridBagConstraints34); - VideoSaveInfoPanel.add(Video_SaveFolderRadioButton, - gridBagConstraints27); - VideoSaveInfoPanel.add(ShowSavingVideoFolderDialogButton, - gridBagConstraints31); - VideoSaveInfoPanel.add(VideoSavedFolderField, gridBagConstraints28); - VideoSaveInfoPanel.add(Video_SaveFileRadioButton, - gridBagConstraints29); - VideoSaveInfoPanel.add(VideoSavedFileField, gridBagConstraints30); - VideoSaveInfoPanel.add(ShowSavingVideoFileDialogButton, - gridBagConstraints32); - VideoSaveInfoPanel.add(getDelVideoCheckBox(), gridBagConstraints15); - } - return VideoSaveInfoPanel; - } - - /** * This method initializes SaveInfoTabPaneEach * * @return javax.swing.JTabbedPane @@ -1504,7 +1449,7 @@ public class MainFrame extends JFrame { gridBagConstraints37.fill = GridBagConstraints.HORIZONTAL; VideoSavingTabbedPanel = new JPanel(); VideoSavingTabbedPanel.setLayout(new GridBagLayout()); - VideoSavingTabbedPanel.add(getVideoSaveInfoPanel(), + VideoSavingTabbedPanel.add(videoSaveInfoPanel, gridBagConstraints36); VideoSavingTabbedPanel.add(CommentSaveInfoPanel, gridBagConstraints37); @@ -1688,19 +1633,74 @@ public class MainFrame extends JFrame { return ShadowComboBox; } -} - -class MainFrame_ShowSavingVideoFolderDialogButton_actionAdapter implements - ActionListener { - private MainFrame adaptee; - - MainFrame_ShowSavingVideoFolderDialogButton_actionAdapter(MainFrame adaptee) { - this.adaptee = adaptee; - } - - public void actionPerformed(ActionEvent e) { - adaptee.ShowSavingVideoFolderDialogButton_actionPerformed(e); - } + private class VideoSavePanelButtonListener implements ActionListener { + + public void actionPerformed(ActionEvent e) { + final Object source = e.getSource(); + final VideoSaveInfoPanel panel = videoSaveInfoPanel; + String title; + JTextField field; + boolean isSave; + boolean isDir; + + if (source == panel.getShowSavingVideoFolderDialogButton()) { + title = "“®‰æ‚Ì•Û‘¶æ(ƒtƒHƒ‹ƒ_)"; + field = panel.getVideoSavedFolderField(); + isSave = true; + isDir = true; + } else if (source == panel.getShowSavingVideoFileDialogButton()) { + title = "“®‰æ‚Ì•Û‘¶æ(ƒtƒ@ƒCƒ‹)"; + field = panel.getVideoSavedFileField(); + isSave = true; + isDir = false; + } else if (source == panel.getNibrFileChooserButton()) { + title = "NicoBrowserƒtƒ@ƒCƒ‹‘I‘ð"; + field = panel.getNibrFileField(); + isSave = false; + isDir = false; + } else { + return; + } + showSaveDialog(title, field, isSave, isDir); + } + } + + private class VideoUseRadioButtonListener implements ActionListener { + + public void actionPerformed(ActionEvent e) { + Object source = e.getSource(); + if (source == videoSaveInfoPanel.getVideoUseNiBrButton()) { + maskExt(); + } else { + maskBase(); + } + } + + private void maskBase() { + mask(true); + } + + private void maskExt() { + mask(false); + } + + private void mask(boolean b) { + final VideoSaveInfoPanel panel = videoSaveInfoPanel; + VideoID_TextField.setEditable(b); + panel.getDelVideoCheckBox().setEnabled(b); + + panel.getSaveFolderRadioButton().setEnabled(b); + panel.getVideoSavedFolderField().setEnabled(b); + panel.getShowSavingVideoFolderDialogButton().setEnabled(b); + + panel.getSaveFileRadioButton().setEnabled(b); + panel.getVideoSavedFileField().setEnabled(b); + panel.getShowSavingVideoFileDialogButton().setEnabled(b); + + panel.getNibrFileField().setEnabled(!b); + panel.getNibrFileChooserButton().setEnabled(!b); + } + } } class MainFrame_ShowSavingCommentFolderDialogButton_actionAdapter implements @@ -1807,19 +1807,6 @@ class MainFrame_ShowSavingCommentDialogButton_actionAdapter implements } } -class MainFrame_ShowSavingVideoDialogButton_actionAdapter implements - ActionListener { - private MainFrame adaptee; - - MainFrame_ShowSavingVideoDialogButton_actionAdapter(MainFrame adaptee) { - this.adaptee = adaptee; - } - - public void actionPerformed(ActionEvent e) { - adaptee.ShowSavingVideoDialogButton_actionPerformed(e); - } -} - class MainFrame_DoButton_actionAdapter implements ActionListener { private MainFrame adaptee;