タイニー番組ナビゲータ本体
Révision | f620b36bedfe280fecb3883eae229d0bb5d7647c (tree) |
---|---|
l'heure | 2014-04-08 02:25:10 |
Auteur | peeweedee <peeweedee@user...> |
Commiter | peeweedee |
・番組詳細欄のロック機能追加
@@ -10,9 +10,10 @@ | ||
10 | 10 | 2chの番ナビスレ:http://toro.2ch.net/test/read.cgi/av/1352223253/ |
11 | 11 | ★☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆★ |
12 | 12 | |
13 | -3.22.16β+1.5.12(2014-03-XX) | |
13 | +3.22.16β+1.5.12(2014-04-08) | |
14 | 14 | ■変更点 |
15 | - ・(その他) CTRL+Fで検索ボックスに移動などのキーボードショートカットの追加(>>375.) | |
15 | + ・(その他) CTRL+Fで検索ボックスに移動などのキーボードショートカットの追加(>>735.) | |
16 | + ・(新聞形式) 番組詳細欄のロック(>>379.) ※番組枠上での左クリックによるトグル、あるいは番組詳細欄の左ダブルクリックによる解除 | |
16 | 17 | ■バグ修正 |
17 | 18 | ・(リスト形式) 一部のカラムのサイズ変更が維持されない問題を修正(>>733.) |
18 | 19 |
@@ -251,7 +251,10 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
251 | 251 | private final DashBorder dborder = new DashBorder(Color.RED,env.getMatchedBorderThickness(),DASHBORDER_LENGTH,DASHBORDER_SPACE); |
252 | 252 | private final DashBorder dborderK = new DashBorder(Color.MAGENTA,env.getMatchedBorderThickness(),DASHBORDER_LENGTH,DASHBORDER_SPACE); |
253 | 253 | private final LineBorder lborder = new ChippedBorder(Color.BLACK,1); |
254 | - | |
254 | + | |
255 | + private final LineBorder detailInfoLockedBorder = new LineBorder(Color.RED, 1); | |
256 | + private final LineBorder detailInfoFreeBorder = new LineBorder(new Color(0,0,0,0), 1); | |
257 | + | |
255 | 258 | private float paperHeightZoom = 1.0F; |
256 | 259 | |
257 | 260 | /** |
@@ -274,6 +277,16 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
274 | 277 | return timeline; |
275 | 278 | } |
276 | 279 | } |
280 | + | |
281 | + // | |
282 | + private class DetailInfo { | |
283 | + String label; | |
284 | + String text; | |
285 | + } | |
286 | + | |
287 | + private ProgDetailList detailInfoData = null; | |
288 | + | |
289 | + private boolean isDetailInfoLocked() { return detailInfoData != null; } | |
277 | 290 | |
278 | 291 | /******************************************************************************* |
279 | 292 | * コンストラクタ |
@@ -1104,7 +1117,7 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
1104 | 1117 | |
1105 | 1118 | // 古いタイマーの削除 |
1106 | 1119 | stopTimer(); |
1107 | - | |
1120 | + | |
1108 | 1121 | cur_tuner = tuner; |
1109 | 1122 | |
1110 | 1123 | if (date == null) { |
@@ -1272,7 +1285,7 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
1272 | 1285 | { |
1273 | 1286 | // 古いタイマーの削除 |
1274 | 1287 | stopTimer(); |
1275 | - | |
1288 | + | |
1276 | 1289 | // ページャーは効かないよ |
1277 | 1290 | if ( env.isPagerEnabled() ) { |
1278 | 1291 | setPagerEnabled(false); |
@@ -1657,7 +1670,6 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
1657 | 1670 | |
1658 | 1671 | /** |
1659 | 1672 | * 現在時刻線の位置を変える |
1660 | - * @param minpos : MINPOS.RESET=初回、MINPOS.UPDATE=自動更新時 | |
1661 | 1673 | */ |
1662 | 1674 | private int setTimelinePos(boolean reset) { |
1663 | 1675 | if ( vport != null && jLabel_timeline != null && jLabel_timeline.isVisible() ) { |
@@ -1724,8 +1736,28 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
1724 | 1736 | |
1725 | 1737 | return clickedDateTime; |
1726 | 1738 | } |
1727 | - | |
1728 | - | |
1739 | + | |
1740 | + /** | |
1741 | + * 番組詳細欄に情報を設定する | |
1742 | + * @param tvd | |
1743 | + * @param locking | |
1744 | + */ | |
1745 | + private void setDetailInfo(ProgDetailList tvd, boolean locking) { | |
1746 | + if ( locking ) { | |
1747 | + detailInfoData = tvd; | |
1748 | + jTextPane_detail.setBorder(detailInfoLockedBorder); | |
1749 | + } | |
1750 | + else { | |
1751 | + detailInfoData = null; | |
1752 | + jTextPane_detail.setBorder(detailInfoFreeBorder); | |
1753 | + } | |
1754 | + if ( tvd != null ) { | |
1755 | + jTextPane_detail.setLabel(tvd.start, tvd.end, tvd.title); | |
1756 | + jTextPane_detail.setText(tvd.detail + "\n" + tvd.getAddedDetail()); | |
1757 | + } | |
1758 | + } | |
1759 | + | |
1760 | + | |
1729 | 1761 | /******************************************************************************* |
1730 | 1762 | * ハンドラ―メソッド |
1731 | 1763 | ******************************************************************************/ |
@@ -1874,8 +1906,12 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
1874 | 1906 | |
1875 | 1907 | return; |
1876 | 1908 | } |
1877 | - | |
1878 | - if (e.getClickCount() == 2) { | |
1909 | + | |
1910 | + if ( e.getClickCount() == 1 ) { | |
1911 | + // 番組詳細表示のロック or 解除(トグル) | |
1912 | + setDetailInfo(tvd, tvd != detailInfoData); | |
1913 | + } | |
1914 | + else if (e.getClickCount() == 2) { | |
1879 | 1915 | // 左ダブルクリックで予約ウィンドウを開く |
1880 | 1916 | openReserveDialog(tvd); |
1881 | 1917 | } |
@@ -1885,7 +1921,7 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
1885 | 1921 | addToPickup(tvd); |
1886 | 1922 | } |
1887 | 1923 | } |
1888 | - | |
1924 | + | |
1889 | 1925 | private void openReserveDialog(ProgDetailList tvd) { |
1890 | 1926 | |
1891 | 1927 | // レコーダが登録されていない場合はなにもしない |
@@ -1923,7 +1959,7 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
1923 | 1959 | */ |
1924 | 1960 | @Override |
1925 | 1961 | public void mouseEntered(MouseEvent e) { |
1926 | - | |
1962 | + | |
1927 | 1963 | JTXTButton b = (JTXTButton) e.getSource(); |
1928 | 1964 | ProgDetailList tvd = b.getInfo(); |
1929 | 1965 |
@@ -1931,8 +1967,11 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
1931 | 1967 | bgcolor = ((JTXTButton)e.getSource()).getBackground(); |
1932 | 1968 | ((JTXTButton)e.getSource()).setBackground(env.getHighlightColor()); |
1933 | 1969 | } |
1934 | - jTextPane_detail.setLabel(tvd.start,tvd.end,tvd.title); | |
1935 | - jTextPane_detail.setText(tvd.detail+"\n"+tvd.getAddedDetail()); | |
1970 | + | |
1971 | + if ( ! isDetailInfoLocked() ) { | |
1972 | + setDetailInfo(tvd, false); | |
1973 | + } | |
1974 | + | |
1936 | 1975 | } |
1937 | 1976 | |
1938 | 1977 | @Override |
@@ -1966,7 +2005,19 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
1966 | 2005 | public void mouseMoved(MouseEvent e) { |
1967 | 2006 | } |
1968 | 2007 | }; |
1969 | - | |
2008 | + | |
2009 | + private final MouseListener ml_detailInfoClick = new MouseAdapter() { | |
2010 | + @Override | |
2011 | + public void mouseClicked(MouseEvent e) { | |
2012 | + if (e.getButton() == MouseEvent.BUTTON1) { | |
2013 | + if (e.getClickCount() == 2) { | |
2014 | + // 番組詳細表示のロック解除 | |
2015 | + setDetailInfo(null, false); | |
2016 | + } | |
2017 | + } | |
2018 | + } | |
2019 | + }; | |
2020 | + | |
1970 | 2021 | /** |
1971 | 2022 | * サイドツリーにつけるリスナー(ツリーの展開状態を記憶する) |
1972 | 2023 | */ |
@@ -2178,6 +2229,8 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
2178 | 2229 | if (jTextPane_detail == null) { |
2179 | 2230 | jTextPane_detail = new JDetailPanel(); |
2180 | 2231 | jTextPane_detail.setRows(bounds.getDetailRows()); |
2232 | + jTextPane_detail.setBorder(detailInfoFreeBorder); | |
2233 | + jTextPane_detail.addMouseListener(ml_detailInfoClick); | |
2181 | 2234 | //Dimension d = jTextPane_detail.getMaximumSize(); |
2182 | 2235 | //d.height = bounds.getDetailAreaHeight(); |
2183 | 2236 | //jTextPane_detail.setPreferredSize(d); |
@@ -3,6 +3,7 @@ package tainavi; | ||
3 | 3 | import java.awt.BorderLayout; |
4 | 4 | import java.awt.Color; |
5 | 5 | import java.awt.Font; |
6 | +import java.awt.event.MouseListener; | |
6 | 7 | |
7 | 8 | import javax.swing.JLabel; |
8 | 9 | import javax.swing.JPanel; |
@@ -63,7 +64,12 @@ public class JDetailPanel extends JPanel { | ||
63 | 64 | jta.setText(s); |
64 | 65 | jta.setCaretPosition(0); |
65 | 66 | } |
66 | - | |
67 | + | |
68 | + public void clear() { | |
69 | + setLabel(null,null,null); | |
70 | + setText(""); | |
71 | + } | |
72 | + | |
67 | 73 | public int getRows() { |
68 | 74 | return jta.getRows(); |
69 | 75 | } |
@@ -71,4 +77,18 @@ public class JDetailPanel extends JPanel { | ||
71 | 77 | public void setRows(int rows) { |
72 | 78 | jta.setRows(rows); |
73 | 79 | } |
80 | + | |
81 | + @Override | |
82 | + public void addMouseListener(MouseListener l) { | |
83 | + jlabel_time.addMouseListener(l); | |
84 | + jlabel_title.addMouseListener(l); | |
85 | + jta.addMouseListener(l); | |
86 | + } | |
87 | + | |
88 | + @Override | |
89 | + public void removeMouseListener(MouseListener l) { | |
90 | + jlabel_time.removeMouseListener(l); | |
91 | + jlabel_title.removeMouseListener(l); | |
92 | + jta.removeMouseListener(l); | |
93 | + } | |
74 | 94 | } |