import java.awt.datatransfer.Transferable;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.KeyEvent;
= "ファイル命名規則入力します。";
private final TargetsTableModel targetModel = new TargetsTableModel();
private final TaskManage taskManager;
- private final Thread videoFileWatcher;
+ private final Thread videoFileWatcherThread;
+ private final FileWatch videoFileWatcher;
/** Creates new form MainFrame */
public MainFrame() {
+ final Config p = Config.INSTANCE;
+
+ // ワーカスレッド生成
+ final int thDownload = p.getSystemDownloadThread();
+ final int secDownload = p.getSystemDownloadWait();
+ final int thConvert = p.getSystemConvertThread();
+ taskManager = new TaskManage(thDownload, secDownload, thConvert, new GuiTaskManageListener());
+
+ // TODO ディレクトリ監視スレッド生成
+ final List<String> videoSearchDirs = p.getSearchVideoDirs();
+ videoSearchDirs.add(p.getVideoDir());
+ final FileSystem fs = FileSystems.getDefault();
+ final Set<Path> videoPaths = new HashSet<>(videoSearchDirs.size());
+ for (String s : videoSearchDirs) {
+ videoPaths.add(fs.getPath(s));
+ }
+ videoFileWatcher = new FileWatch(videoPaths);
+ this.videoFileWatcherThread = new Thread(videoFileWatcher);
+ this.videoFileWatcherThread.setDaemon(true);
+
final URL url = MainFrame_AboutBox.class.getResource("icon.png");
final Image icon1 = Toolkit.getDefaultToolkit().createImage(url);
final URL url32 = MainFrame_AboutBox.class.getResource("icon32.png");
final JTabbedPane tbpInput = new JTabbedPane();
final JPanel pnlInputMain = new JPanel();
final JLabel lblId = new JLabel();
- fldId.setToolTipText(ID_FIELD_TOOLTIP);
final JLabel lblVideo = new JLabel();
cbVideoLocal = new JCheckBox();
cbVideoLocal.setToolTipText(FILE_LOCALBUTTON_TOOLTIP);
lblId.setText("ID");
- fldId.addActionListener(applyListener);
+
+ fldId = new IdComboBox(videoFileWatcher);
+ fldId.setToolTipText(ID_FIELD_TOOLTIP);
+// fldId.addActionListener(applyListener);
fldId.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent evt) {
initInputPanel();
pnlMain.setTransferHandler(new DownloadListTransferHandler());
tblDisplay.setTransferHandler(new TableTransferHandler());
-
- final Config p = Config.INSTANCE;
-
- // ワーカスレッド生成
- final int thDownload = p.getSystemDownloadThread();
- final int secDownload = p.getSystemDownloadWait();
- final int thConvert = p.getSystemConvertThread();
- taskManager = new TaskManage(thDownload, secDownload,thConvert, new GuiTaskManageListener());
-
- // TODO ディレクトリ監視スレッド生成
- final List<String> videoSearchDirs = p.getSearchVideoDirs();
- videoSearchDirs.add(p.getVideoDir());
- final FileSystem fs = FileSystems.getDefault();
- final Set<Path> videoPaths = new HashSet<>(videoSearchDirs.size());
- for(String s : videoSearchDirs) {
- videoPaths.add(fs.getPath(s));
- }
- final FileWatch videoFileWatch = new FileWatch(videoPaths);
- this.videoFileWatcher = new Thread(videoFileWatch);
- this.videoFileWatcher.setDaemon(true);
}
public void startWatcher() {
- videoFileWatcher.start();
+ videoFileWatcherThread.start();
}
private class GuiTaskManageListener implements TaskManageListener {
private final JButton btnStop = new JButton("停止");
private final JButton btnDeselect = new JButton("選択解除");
// 入力領域 - メイン
- private final JTextField fldId = new JTextField();
+ private final IdComboBox fldId;
private final JCheckBox cbBackLogReduce = new JCheckBox("コメ数減少");
private final JCheckBox cbBackLog = new JCheckBox("過去ログ");
private final JTextField fldBackLog = new JTextField();