OSDN Git Service

TableのGrid線を削除し、代わりに一行ずつ背景色を変えるようにした
authorU-nishio-PC8\nishio <spark_xp@users.sourceforge.jp>
Thu, 1 Sep 2011 07:31:28 +0000 (16:31 +0900)
committerU-nishio-PC8\nishio <spark_xp@users.sourceforge.jp>
Thu, 1 Sep 2011 07:31:28 +0000 (16:31 +0900)
src/twitter/gui/action/TweetMainAction.java
src/twitter/gui/component/TweetCommentRenderer.java
src/twitter/gui/component/TweetTabbedTable.java

index 030afcc..6266b51 100644 (file)
@@ -145,7 +145,7 @@ public class TweetMainAction implements ConnectionLifeCycleListener{
        // hashtag search dialog
        private HashtagSearchDialog hashtagSearchDialog = null;
        // 新しく取得した部分のテーブルカラー
-       private Color newTableColor = new Color(224, 255, 255);
+       private Color newTableColor = new Color(230,230,250);
        // TLのフォント名
        private String tlFontName = "MS Pゴシック";
        // TLのフォントサイズ
@@ -1971,17 +1971,17 @@ public class TweetMainAction implements ConnectionLifeCycleListener{
                String podm = this.property.getProperty("openDirectMessageTab");
                String posdmt = this.property.getProperty("openSendDirectMessageTab");
 
-                //ログ
-                String log = this.property.getProperty("saveLog");
+               // ログ
+               String log = this.property.getProperty("saveLog");
 
-                //表示可能ツイート数
-                String nost = this.property.getProperty("numOfShowTweet");
+               // 表示可能ツイート数
+               String nost = this.property.getProperty("numOfShowTweet");
 
-                //最新クライアント情報を通知するか
-                String unt = this.property.getProperty("updateNotify");
-                if( unt == null ) {
-                    unt = this.isUpdateNotify + "";
-                }
+               // 最新クライアント情報を通知するか
+               String unt = this.property.getProperty("updateNotify");
+               if (unt == null) {
+                       unt = this.isUpdateNotify + "";
+               }
 
                //streamingを利用するか
                String ius = this.property.getProperty("isUsingStreaming");
@@ -2018,14 +2018,14 @@ public class TweetMainAction implements ConnectionLifeCycleListener{
                        this.isTempOpenedDMTab = Boolean.parseBoolean(podm);
                        this.isTempOpenedSendDMTab = Boolean.parseBoolean(posdmt);
 
-                        //ログ
-                        this.saveLog = Boolean.parseBoolean(log);
+                       // ログ
+                       this.saveLog = Boolean.parseBoolean(log);
 
-                        //表示可能ツイート数
-                        this.tableElementMaxSize = Integer.parseInt(nost);
+                       // 表示可能ツイート数
+                       this.tableElementMaxSize = Integer.parseInt(nost);
 
-                        //update notify
-                        this.isUpdateNotify = Boolean.parseBoolean(unt);
+                       // update notify
+                       this.isUpdateNotify = Boolean.parseBoolean(unt);
 
                        //using streaming
                        this.isUsingStreaming = Boolean.parseBoolean(ius);
index bc6539c..3e35a23 100644 (file)
@@ -19,9 +19,9 @@ import javax.swing.text.html.HTMLDocument;
 import javax.swing.text.html.StyleSheet;
 
 /**
- * 
+ *
  * @author nishio
- * 
+ *
  */
 public class TweetCommentRenderer extends JEditorPane implements
                TableCellRenderer, MouseListener, MouseMotionListener {
@@ -31,12 +31,12 @@ public class TweetCommentRenderer extends JEditorPane implements
        // デフォルトのテーブルカラー
        private final Color currentTableColor = Color.WHITE;
        // あたらしく取得したTweetのセルを塗りつぶす色
-       private Color newTableColor = new Color(224, 255, 255);
+       private Color newTableColor = new Color(230, 230, 250);
        // あたらしく取得したセルが何行目までか
        private int newTableRow = -1;
 
        /**
-        * 
+        *
         */
        public TweetCommentRenderer() {
                super();
@@ -56,12 +56,24 @@ public class TweetCommentRenderer extends JEditorPane implements
                 * setForeground(table.getForeground());
                 * setBackground(table.getBackground()); }
                 */
+
+
+               //一行ずつTableの色を変更する
+               //TODO: ここも後で色を変更できるようにする
+               if( row % 2 == 0 ) {
+                       setBackground(new Color(240,240,255));
+               }else {
+                       setBackground(Color.white);
+               }
+
                // TODO: あとでここのカラーを変える
                // NewCell
-               if (this.newTableRow >= 0 && row < this.newTableRow) {
-                       setBackground(newTableColor);
-               } else {
-                       setBackground(currentTableColor);
+               if( column >= 2 ) {
+                       if (this.newTableRow >= 0 && row < this.newTableRow) {
+                               setBackground(newTableColor);
+                       } else {
+                               setBackground(currentTableColor);
+                       }
                }
 
                // フォントを変更
@@ -96,7 +108,7 @@ public class TweetCommentRenderer extends JEditorPane implements
 
        /**
         * 何行目までのセルを新しいセルとしてnewTableColorで塗りつぶすか
-        * 
+        *
         * @param row
         *            0以上の値で新しいセルとして指定した行を塗りつぶす
         * @param newTableColor
index 74e3d05..a4ffbb1 100644 (file)
@@ -237,6 +237,8 @@ public class TweetTabbedTable implements TweetStreamingListener {
                }
                // まだ見ていないtweet数を追加
                this.setUncheckedTweet(this.getUncheckedTweet() + tweet.size());
+               //grid線を削除する
+               this.getTable().setShowGrid(false);
 
                // まだチェックしていないtweetの数をタブにも表示
                if (this.getUncheckedTweet() > 0) {