• R/O
  • HTTP
  • SSH
  • HTTPS

TinyBannavi: Commit

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


Commit MetaInfo

Revisióne2eed26f9322148bc5a8e0c8cbda6b931ae5a3c8 (tree)
Tiempo2014-02-01 13:20:20
Autorpeeweedee <peeweedee@user...>
Commiterpeeweedee

Log Message

予約行の背景色のトグル操作

Cambiar Resumen

Diferencia incremental

--- a/TinyBannavi/src/tainavi/AbsListedView.java
+++ b/TinyBannavi/src/tainavi/AbsListedView.java
@@ -1447,7 +1447,20 @@ public abstract class AbsListedView extends JPanel implements TickTimerListener
14471447 public void setRowHeaderVisible(boolean b) {
14481448 jScrollPane_listed.getRowHeader().setVisible(b);
14491449 }
1450-
1450+
1451+ /**
1452+ * 予約済み背景色の描画(ツールバーからのトグル操作)
1453+ */
1454+ public boolean toggleReservedBackground(boolean b) {
1455+
1456+ // 状態を保存
1457+ bounds.setShowReservedBackground(b);
1458+
1459+ tableModel_listed.fireTableDataChanged();
1460+
1461+ return bounds.getShowReservedBackground();
1462+ }
1463+
14511464 /**
14521465 * スクリーンショット用
14531466 */
@@ -4058,14 +4071,14 @@ public abstract class AbsListedView extends JPanel implements TickTimerListener
40584071 isRowPassed(row);
40594072
40604073 fgColor = (prechknextweek)?(nextweekFgColor):(this.getForeground());
4061-
4074+
40624075 if( prechkpassed && passedColor != null ) {
40634076 bgColor = passedColor;
40644077 }
4065- else if( prechkreserved && reservedColorEven != null ) {
4078+ else if( bounds.getShowReservedBackground() && prechkreserved && reservedColorEven != null ) {
40664079 bgColor = (isSepRowColor && row%2 == 1)?(reservedColorEven):(reservedColorOdd);
40674080 }
4068- else if( prechkpicked && pickedColorEven != null ) {
4081+ else if( bounds.getShowReservedBackground() && prechkpicked && pickedColorEven != null ) {
40694082 bgColor = (isSepRowColor && row%2 == 1)?(pickedColorEven):(pickedColorOdd);
40704083 }
40714084 else if( prechkcurrent && currentColorEven != null ) {
--- a/TinyBannavi/src/tainavi/AbsPaperView.java
+++ b/TinyBannavi/src/tainavi/AbsPaperView.java
@@ -624,10 +624,10 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H
624624 /**
625625 * 予約待機赤枠の描画(ツールバーからのトグル操作)
626626 */
627- public boolean toggleMatchBorder() {
627+ public boolean toggleMatchBorder(boolean b) {
628628
629629 // 状態を保存
630- bounds.setShowMatchedBorder( ! bounds.getShowMatchedBorder());
630+ bounds.setShowMatchedBorder(b);
631631
632632 _updPBorderAll(env, bounds, frameUsed);
633633
--- a/TinyBannavi/src/tainavi/AbsToolBar.java
+++ b/TinyBannavi/src/tainavi/AbsToolBar.java
@@ -81,7 +81,7 @@ public abstract class AbsToolBar extends JToolBar implements HDDRecorderSelectab
8181 protected abstract boolean jumpToNow();
8282 protected abstract boolean jumpToPassed(String passed);
8383 protected abstract boolean redrawByPager();
84- protected abstract void toggleMatchBorder();
84+ protected abstract void toggleMatchBorder(boolean b);
8585 protected abstract void setPaperColorDialogVisible(boolean b);
8686 protected abstract void setPaperZoom(int n);
8787 // 共通
@@ -454,8 +454,13 @@ public abstract class AbsToolBar extends JToolBar implements HDDRecorderSelectab
454454 /**
455455 * ぼだー
456456 */
457- public void setBorderToggleEnabled(boolean b) {
457+ public void setBorderToggleEnabled(boolean b, boolean cond) {
458+ jToggleButton_showmatchborder.removeActionListener(al_showborder);
459+
458460 jToggleButton_showmatchborder.setEnabled(b);
461+ jToggleButton_showmatchborder.setSelected(cond);
462+
463+ jToggleButton_showmatchborder.addActionListener(al_showborder);
459464 }
460465
461466 /**
@@ -1037,8 +1042,9 @@ public abstract class AbsToolBar extends JToolBar implements HDDRecorderSelectab
10371042
10381043 // 新聞形式に予約待機枠を表示させたりしなかったり
10391044 private final ActionListener al_showborder = new ActionListener(){
1045+ @Override
10401046 public void actionPerformed(ActionEvent e){
1041- toggleMatchBorder();
1047+ toggleMatchBorder(((JToggleButton)e.getSource()).isSelected());
10421048 }
10431049 };
10441050
@@ -1384,8 +1390,10 @@ public abstract class AbsToolBar extends JToolBar implements HDDRecorderSelectab
13841390 }
13851391 return jToggleButton_fullScreen;
13861392 }
1387-
1388- // 「設定タブを表示」
1393+
1394+ /**
1395+ * 予約背景色・検索マッチ枠の表示/非表示
1396+ */
13891397 private JToggleButton getJToggleButton_showmatchborder(String s) {
13901398 if (jToggleButton_showmatchborder == null) {
13911399 final ImageIcon icon = new ImageIcon(ICONFILE_SHOWMATCHBORDER);
--- a/TinyBannavi/src/tainavi/Bounds.java
+++ b/TinyBannavi/src/tainavi/Bounds.java
@@ -70,15 +70,23 @@ public class Bounds {
7070 public void setSelectedTab(int t) { selectedTab = t; }
7171
7272 //
73+ @Deprecated
7374 private boolean showSettingTabs;
75+ @Deprecated
7476 public boolean getShowSettingTabs() { return showSettingTabs; }
77+ @Deprecated
7578 public void setShowSettingTabs(boolean b) { showSettingTabs = b; }
7679
77- // 検索マッチ枠を表示する
80+ // 予約済み背景色を描画する(リスト形式)
81+ public boolean getShowReservedBackground() { return showReservedBackground; }
82+ public void setShowReservedBackground(boolean b) { showReservedBackground = b; }
83+ private boolean showReservedBackground = true;
84+
85+ // 検索マッチ枠を表示する(新聞形式)
7886 public boolean getShowMatchedBorder() { return showMatchedBorder; }
7987 public void setShowMatchedBorder(boolean b) { showMatchedBorder = b; }
8088 private boolean showMatchedBorder = true;
81-
89+
8290 // ステータスエリアを表示する
8391 private boolean showStatus;
8492 public boolean getShowStatus() { return showStatus; }
--- a/TinyBannavi/src/tainavi/Viewer.java
+++ b/TinyBannavi/src/tainavi/Viewer.java
@@ -420,6 +420,8 @@ public class Viewer extends JFrame implements ChangeListener,TickTimerListener,H
420420 toolBar.setBatchReservationEnabled(true);
421421 // スナップショットを有効にする
422422 toolBar.setSnapShotEnabled(true);
423+ // 新聞形式以外ではマッチ枠を無効にする
424+ toolBar.setBorderToggleEnabled(true, bounds.getShowReservedBackground());
423425 }
424426
425427 @Override
@@ -430,6 +432,8 @@ public class Viewer extends JFrame implements ChangeListener,TickTimerListener,H
430432 toolBar.setBatchReservationEnabled(false);
431433 // スナップショットを無効にする
432434 toolBar.setSnapShotEnabled(false);
435+ // 新聞形式以外ではマッチ枠を無効にする
436+ toolBar.setBorderToggleEnabled(false, bounds.getShowReservedBackground());
433437 }
434438
435439 @Override
@@ -569,7 +573,7 @@ public class Viewer extends JFrame implements ChangeListener,TickTimerListener,H
569573 // ジャンル別背景色を有効にする
570574 toolBar.setPaperColorDialogEnabled(true);
571575 // マッチ枠を有効にする
572- toolBar.setBorderToggleEnabled(true);
576+ toolBar.setBorderToggleEnabled(true, bounds.getShowMatchedBorder());
573577 }
574578
575579 @Override
@@ -581,7 +585,7 @@ public class Viewer extends JFrame implements ChangeListener,TickTimerListener,H
581585 // 新聞形式以外ではジャンル別背景色を無効にする
582586 toolBar.setPaperColorDialogEnabled(false);
583587 // 新聞形式以外ではマッチ枠を無効にする
584- toolBar.setBorderToggleEnabled(false);
588+ toolBar.setBorderToggleEnabled(false, bounds.getShowMatchedBorder());
585589 }
586590
587591 @Override
@@ -1315,9 +1319,14 @@ public class Viewer extends JFrame implements ChangeListener,TickTimerListener,H
13151319 }
13161320
13171321 @Override
1318- protected void toggleMatchBorder() {
1322+ protected void toggleMatchBorder(boolean b) {
13191323 timer_now.pause();
1320- paper.toggleMatchBorder();
1324+ if ( mainWindow.isTabSelected(MWinTab.LISTED) ) {
1325+ listed.toggleReservedBackground(b);
1326+ }
1327+ else if ( mainWindow.isTabSelected(MWinTab.PAPER) ) {
1328+ paper.toggleMatchBorder(b);
1329+ }
13211330 timer_now.start();
13221331 }
13231332
Show on old repository browser