• R/O
  • HTTP
  • SSH
  • HTTPS

TinyBannavi: Commit

タイニー番組ナビゲータ本体


Commit MetaInfo

Revisión3f86aa815738a75db6c774bc17f8687505b75f09 (tree)
Tiempo2014-03-13 22:43:22
Autorpeeweedee <peeweedee@user...>
Commiterpeeweedee

Log Message

キーボードショートカットの追加

Cambiar Resumen

Diferencia incremental

--- a/TinyBannavi/05_history.txt
+++ b/TinyBannavi/05_history.txt
@@ -10,6 +10,12 @@
1010 2chの番ナビスレ:http://toro.2ch.net/test/read.cgi/av/1352223253/
1111 ★☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆★
1212
13+3.22.16β+1.5.12(2014-03-XX)
14+■変更点
15+ ・(その他) CTRL+Fで検索ボックスに移動などのキーボードショートカットの追加(>>375.)
16+■バグ修正
17+ ・(リスト形式) 一部のカラムのサイズ変更が維持されない問題を修正(>>733.)
18+
1319 3.22.15β+1.5.12(2014-02-22)
1420 ■変更点
1521  ・(その他) sfのサイト構成変更にオンラインバージョンアップのコードを対応
--- a/TinyBannavi/src/tainavi/AbsToolBar.java
+++ b/TinyBannavi/src/tainavi/AbsToolBar.java
@@ -425,7 +425,11 @@ public abstract class AbsToolBar extends JToolBar implements HDDRecorderSelectab
425425 return search;
426426 }
427427 }
428-
428+
429+ public void setFocusInSearchBox() {
430+ jTextField_keyword.requestFocusInWindow();
431+ }
432+
429433 /**
430434 *
431435 */
--- a/TinyBannavi/src/tainavi/Viewer.java
+++ b/TinyBannavi/src/tainavi/Viewer.java
@@ -20,14 +20,7 @@ import java.awt.Toolkit;
2020 import java.awt.TrayIcon;
2121 import java.awt.datatransfer.Clipboard;
2222 import java.awt.datatransfer.StringSelection;
23-import java.awt.event.ActionEvent;
24-import java.awt.event.ActionListener;
25-import java.awt.event.ComponentAdapter;
26-import java.awt.event.ComponentEvent;
27-import java.awt.event.MouseAdapter;
28-import java.awt.event.MouseEvent;
29-import java.awt.event.WindowAdapter;
30-import java.awt.event.WindowEvent;
23+import java.awt.event.*;
3124 import java.io.File;
3225 import java.io.IOException;
3326 import java.io.UnsupportedEncodingException;
@@ -50,16 +43,7 @@ import java.util.regex.Matcher;
5043 import java.util.regex.Pattern;
5144
5245 import javax.imageio.ImageIO;
53-import javax.swing.ImageIcon;
54-import javax.swing.JComponent;
55-import javax.swing.JFrame;
56-import javax.swing.JLabel;
57-import javax.swing.JMenuItem;
58-import javax.swing.JOptionPane;
59-import javax.swing.JPopupMenu;
60-import javax.swing.SwingUtilities;
61-import javax.swing.ToolTipManager;
62-import javax.swing.UIManager;
46+import javax.swing.*;
6347 import javax.swing.event.ChangeEvent;
6448 import javax.swing.event.ChangeListener;
6549
@@ -4770,7 +4754,80 @@ public class Viewer extends JFrame implements ChangeListener,TickTimerListener,H
47704754 listed.saveTreeExpansion();
47714755 paper.saveTreeExpansion();
47724756 }
4773-
4757+
4758+ private void setKeyboardShortCut() {
4759+ class ShortCut {
4760+ final String action;
4761+ final int key;
4762+ final int mask;
4763+ final Action callback;
4764+
4765+ public ShortCut(String aAction, int aKey, int aMask, Action aCallback) {
4766+ action = aAction;
4767+ key = aKey;
4768+ mask = aMask;
4769+ callback = aCallback;
4770+ }
4771+ }
4772+
4773+ final String FIND_ACTION = "find";
4774+ final String SELECT_ACTION_LISTTAB = "listtab";
4775+ final String SELECT_ACTION_PAPERTAB = "papertab";
4776+ final String SELECT_ACTION_RSVEDTAB = "rsvedtab";
4777+ final String SELECT_ACTION_RECEDTAB = "recedtab";
4778+ final String SELECT_ACTION_AUTORESTAB = "autorestab";
4779+
4780+ final Action find_action = new AbstractAction() {
4781+ @Override
4782+ public void actionPerformed(ActionEvent e) {
4783+ toolBar.setFocusInSearchBox();
4784+ }
4785+ };
4786+ final Action select_action_listtab = new AbstractAction() {
4787+ @Override
4788+ public void actionPerformed(ActionEvent e) {
4789+ mainWindow.setSelectedTab(MWinTab.LISTED);
4790+ }
4791+ };
4792+ final Action select_action_papertab = new AbstractAction() {
4793+ @Override
4794+ public void actionPerformed(ActionEvent e) {
4795+ mainWindow.setSelectedTab(MWinTab.PAPER);
4796+ }
4797+ };
4798+ final Action select_action_rsvedtab = new AbstractAction() {
4799+ @Override
4800+ public void actionPerformed(ActionEvent e) {
4801+ mainWindow.setSelectedTab(MWinTab.RSVED);
4802+ }
4803+ };
4804+ final Action select_action_recedtab = new AbstractAction() {
4805+ @Override
4806+ public void actionPerformed(ActionEvent e) {
4807+ mainWindow.setSelectedTab(MWinTab.RECED);
4808+ }
4809+ };
4810+ final Action select_action_autorestab = new AbstractAction() {
4811+ @Override
4812+ public void actionPerformed(ActionEvent e) {
4813+ mainWindow.setSelectedTab(MWinTab.AUTORES);
4814+ }
4815+ };
4816+
4817+ ArrayList<ShortCut> sca = new ArrayList<ShortCut>();
4818+ sca.add(new ShortCut(FIND_ACTION, KeyEvent.VK_F, KeyEvent.CTRL_DOWN_MASK, find_action));
4819+ sca.add(new ShortCut(SELECT_ACTION_LISTTAB, KeyEvent.VK_1, KeyEvent.ALT_DOWN_MASK, select_action_listtab));
4820+ sca.add(new ShortCut(SELECT_ACTION_PAPERTAB, KeyEvent.VK_2, KeyEvent.ALT_DOWN_MASK, select_action_papertab));
4821+ sca.add(new ShortCut(SELECT_ACTION_RSVEDTAB, KeyEvent.VK_3, KeyEvent.ALT_DOWN_MASK, select_action_rsvedtab));
4822+ sca.add(new ShortCut(SELECT_ACTION_RECEDTAB, KeyEvent.VK_4, KeyEvent.ALT_DOWN_MASK, select_action_recedtab));
4823+ sca.add(new ShortCut(SELECT_ACTION_AUTORESTAB, KeyEvent.VK_5, KeyEvent.ALT_DOWN_MASK, select_action_autorestab));
4824+
4825+ InputMap imap = getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
4826+ for ( ShortCut sc : sca ) {
4827+ imap.put(KeyStroke.getKeyStroke(sc.key, sc.mask), sc.action);
4828+ getRootPane().getActionMap().put(sc.action, sc.callback);
4829+ }
4830+ }
47744831
47754832 /*******************************************************************************
47764833 * main()
@@ -5092,7 +5149,9 @@ public class Viewer extends JFrame implements ChangeListener,TickTimerListener,H
50925149 setTitleBar(); // タイトルバー更新
50935150
50945151 ShowInitTab(); // 前回開いていたタブを開く
5095-
5152+
5153+ setKeyboardShortCut();
5154+
50965155 // ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
50975156 // タイマーを起動する
50985157 // ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
Show on old repository browser