• R/O
  • HTTP
  • SSH
  • HTTPS

提交

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythongamewindowsbathyscaphephpguic翻訳omegattwitterframeworktestbtronarduinovb.net計画中(planning stage)directxpreviewerゲームエンジンdom

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


Commit MetaInfo

修订版f620b36bedfe280fecb3883eae229d0bb5d7647c (tree)
时间2014-04-08 02:25:10
作者peeweedee <peeweedee@user...>
Commiterpeeweedee

Log Message

・番組詳細欄のロック機能追加

更改概述

差异

--- a/TinyBannavi/05_history.txt
+++ b/TinyBannavi/05_history.txt
@@ -10,9 +10,10 @@
1010 2chの番ナビスレ:http://toro.2ch.net/test/read.cgi/av/1352223253/
1111 ★☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆★
1212
13-3.22.16β+1.5.12(2014-03-XX)
13+3.22.16β+1.5.12(2014-04-08)
1414 ■変更点
15- ・(その他) CTRL+Fで検索ボックスに移動などのキーボードショートカットの追加(>>375.)
15+ ・(その他) CTRL+Fで検索ボックスに移動などのキーボードショートカットの追加(>>735.)
16+ ・(新聞形式) 番組詳細欄のロック(>>379.) ※番組枠上での左クリックによるトグル、あるいは番組詳細欄の左ダブルクリックによる解除
1617 ■バグ修正
1718  ・(リスト形式) 一部のカラムのサイズ変更が維持されない問題を修正(>>733.)
1819
--- a/TinyBannavi/src/tainavi/AbsPaperView.java
+++ b/TinyBannavi/src/tainavi/AbsPaperView.java
@@ -251,7 +251,10 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H
251251 private final DashBorder dborder = new DashBorder(Color.RED,env.getMatchedBorderThickness(),DASHBORDER_LENGTH,DASHBORDER_SPACE);
252252 private final DashBorder dborderK = new DashBorder(Color.MAGENTA,env.getMatchedBorderThickness(),DASHBORDER_LENGTH,DASHBORDER_SPACE);
253253 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+
255258 private float paperHeightZoom = 1.0F;
256259
257260 /**
@@ -274,6 +277,16 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H
274277 return timeline;
275278 }
276279 }
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; }
277290
278291 /*******************************************************************************
279292 * コンストラクタ
@@ -1104,7 +1117,7 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H
11041117
11051118 // 古いタイマーの削除
11061119 stopTimer();
1107-
1120+
11081121 cur_tuner = tuner;
11091122
11101123 if (date == null) {
@@ -1272,7 +1285,7 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H
12721285 {
12731286 // 古いタイマーの削除
12741287 stopTimer();
1275-
1288+
12761289 // ページャーは効かないよ
12771290 if ( env.isPagerEnabled() ) {
12781291 setPagerEnabled(false);
@@ -1657,7 +1670,6 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H
16571670
16581671 /**
16591672 * 現在時刻線の位置を変える
1660- * @param minpos : MINPOS.RESET=初回、MINPOS.UPDATE=自動更新時
16611673 */
16621674 private int setTimelinePos(boolean reset) {
16631675 if ( vport != null && jLabel_timeline != null && jLabel_timeline.isVisible() ) {
@@ -1724,8 +1736,28 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H
17241736
17251737 return clickedDateTime;
17261738 }
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+
17291761 /*******************************************************************************
17301762 * ハンドラ―メソッド
17311763 ******************************************************************************/
@@ -1874,8 +1906,12 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H
18741906
18751907 return;
18761908 }
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) {
18791915 // 左ダブルクリックで予約ウィンドウを開く
18801916 openReserveDialog(tvd);
18811917 }
@@ -1885,7 +1921,7 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H
18851921 addToPickup(tvd);
18861922 }
18871923 }
1888-
1924+
18891925 private void openReserveDialog(ProgDetailList tvd) {
18901926
18911927 // レコーダが登録されていない場合はなにもしない
@@ -1923,7 +1959,7 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H
19231959 */
19241960 @Override
19251961 public void mouseEntered(MouseEvent e) {
1926-
1962+
19271963 JTXTButton b = (JTXTButton) e.getSource();
19281964 ProgDetailList tvd = b.getInfo();
19291965
@@ -1931,8 +1967,11 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H
19311967 bgcolor = ((JTXTButton)e.getSource()).getBackground();
19321968 ((JTXTButton)e.getSource()).setBackground(env.getHighlightColor());
19331969 }
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+
19361975 }
19371976
19381977 @Override
@@ -1966,7 +2005,19 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H
19662005 public void mouseMoved(MouseEvent e) {
19672006 }
19682007 };
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+
19702021 /**
19712022 * サイドツリーにつけるリスナー(ツリーの展開状態を記憶する)
19722023 */
@@ -2178,6 +2229,8 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H
21782229 if (jTextPane_detail == null) {
21792230 jTextPane_detail = new JDetailPanel();
21802231 jTextPane_detail.setRows(bounds.getDetailRows());
2232+ jTextPane_detail.setBorder(detailInfoFreeBorder);
2233+ jTextPane_detail.addMouseListener(ml_detailInfoClick);
21812234 //Dimension d = jTextPane_detail.getMaximumSize();
21822235 //d.height = bounds.getDetailAreaHeight();
21832236 //jTextPane_detail.setPreferredSize(d);
--- a/TinyBannavi/src/tainavi/JDetailPanel.java
+++ b/TinyBannavi/src/tainavi/JDetailPanel.java
@@ -3,6 +3,7 @@ package tainavi;
33 import java.awt.BorderLayout;
44 import java.awt.Color;
55 import java.awt.Font;
6+import java.awt.event.MouseListener;
67
78 import javax.swing.JLabel;
89 import javax.swing.JPanel;
@@ -63,7 +64,12 @@ public class JDetailPanel extends JPanel {
6364 jta.setText(s);
6465 jta.setCaretPosition(0);
6566 }
66-
67+
68+ public void clear() {
69+ setLabel(null,null,null);
70+ setText("");
71+ }
72+
6773 public int getRows() {
6874 return jta.getRows();
6975 }
@@ -71,4 +77,18 @@ public class JDetailPanel extends JPanel {
7177 public void setRows(int rows) {
7278 jta.setRows(rows);
7379 }
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+ }
7494 }