OSDN Git Service

テーブルの高さ調節が正しく行われていない問題を解決 #26180
authorU-nishio-PC8\nishio <spark_xp@users.sourceforge.jp>
Thu, 1 Sep 2011 06:08:24 +0000 (15:08 +0900)
committerU-nishio-PC8\nishio <spark_xp@users.sourceforge.jp>
Thu, 1 Sep 2011 06:08:24 +0000 (15:08 +0900)
src/twitter/gui/action/TweetMainAction.java
src/twitter/gui/component/TweetTabbedTable.java

index 75227d0..030afcc 100644 (file)
@@ -147,15 +147,15 @@ public class TweetMainAction implements ConnectionLifeCycleListener{
        // 新しく取得した部分のテーブルカラー
        private Color newTableColor = new Color(224, 255, 255);
        // TLのフォント名
-       private String tlFontName = "Takao Pゴシック";
+       private String tlFontName = "MS Pゴシック";
        // TLのフォントサイズ
        private int tlFontSize = 13;
        // 詳細情報のフォント名
-       private String detailFontName = "Takao Pゴシック";
+       private String detailFontName = "MS Pゴシック";
        // 詳細情報のフォントサイズ
        private int detailFontSize = 13;
        // テーブル1要素の高さ
-       private int tableElementHeight = 50;
+       private int tableElementHeight = 40;
        // メインフレームの幅
        private int mainFrameWidth = 729;
        // メインフレームの高さ
@@ -357,7 +357,7 @@ public class TweetMainAction implements ConnectionLifeCycleListener{
                                this.mainFrameHeight));
                //update通知の更新
                updateNotifyInformation();
-               
+
                //streaming apiの状態listener設定
                this.tweetManager.getStreamManager().addCollectionLifeCycleListener(this);
        }
@@ -459,7 +459,7 @@ public class TweetMainAction implements ConnectionLifeCycleListener{
                        e.printStackTrace();
                }
        }
-       
+
        /**
         * notify通知ウィンドウ情報の更新
         */
@@ -490,7 +490,7 @@ public class TweetMainAction implements ConnectionLifeCycleListener{
                                // テーブルを作成
                                final TweetTabbedTable table = new TweetTabbedTable(
                                                tweetGetter, tabTitle, this.tweetMainTab,
-                                               this.tableElementHeight, this.tweetManager, this,
+                                               this.tweetManager, this,
                                                newTableColor, this.tableElementMaxSize, timerID);
 
                                this.tweetTaskManager.addTask(timerID, new TweetUpdateTask() {
@@ -1370,7 +1370,7 @@ public class TweetMainAction implements ConnectionLifeCycleListener{
                // dialog.setLocation(loc);
                dialog.setVisible(true);
        }
-        
+
         /**
          * 最新クライアント情報通知ダイアログを表示
          */
@@ -1857,10 +1857,10 @@ public class TweetMainAction implements ConnectionLifeCycleListener{
                }
                return aboutDialog;
        }
-        
+
         /**
          * update dialog
-         * @return 
+         * @return
          */
         public UpdateNotifyDialog getUpdateNotifyDialog() {
             if( updateDialog == null ) {
@@ -1976,19 +1976,19 @@ public class TweetMainAction implements ConnectionLifeCycleListener{
 
                 //表示可能ツイート数
                 String nost = this.property.getProperty("numOfShowTweet");
-                
+
                 //最新クライアント情報を通知するか
                 String unt = this.property.getProperty("updateNotify");
                 if( unt == null ) {
                     unt = this.isUpdateNotify + "";
                 }
-               
+
                //streamingを利用するか
                String ius = this.property.getProperty("isUsingStreaming");
                if( ius == null ) {
                    ius = this.isUsingStreaming + "";
                }
-               
+
                String fav = this.property.getProperty("isFavNotify");
                if( fav == null ) {
                    fav = this.favNotify + "";
@@ -2023,13 +2023,13 @@ public class TweetMainAction implements ConnectionLifeCycleListener{
 
                         //表示可能ツイート数
                         this.tableElementMaxSize = Integer.parseInt(nost);
-                        
+
                         //update notify
                         this.isUpdateNotify = Boolean.parseBoolean(unt);
-                       
+
                        //using streaming
                        this.isUsingStreaming = Boolean.parseBoolean(ius);
-                       
+
                        //fav
                        this.favNotify = Boolean.parseBoolean(fav);
                } catch (NumberFormatException e) {
@@ -2100,13 +2100,13 @@ public class TweetMainAction implements ConnectionLifeCycleListener{
 
                 //テーブルに表示可能なツイートの数
                 this.property.setProperty("numOfShowTweet", this.getTableElementMaxSize() + "");
-                
+
                 //update notify
                 this.property.setProperty("updateNotify", this.isUpdateNotify + "");
-               
+
                //streaming
                this.property.setProperty("isUsingStreaming", this.isUsingStreaming + "");
-               
+
                //fav通知
                this.property.setProperty("isFavNotify", this.favNotify + "");
 
@@ -2260,14 +2260,14 @@ public class TweetMainAction implements ConnectionLifeCycleListener{
        public void setNotifyDirectMessage(boolean notify) {
                this.isNotifyDirectMessage = notify;
        }
-        
+
         /**
          * 最新クライアント情報を通知するかどうか
          */
         public boolean isUpdateNotify() {
             return this.isUpdateNotify;
         }
-        
+
         /**
          * 最新クライアント情報を通知するかどうか設定
          */
@@ -2401,7 +2401,7 @@ public class TweetMainAction implements ConnectionLifeCycleListener{
         public int getTableElementMaxSize() {
             return this.tableElementMaxSize;
         }
-       
+
        /**
         * ストリーミング開始
         */
@@ -2414,7 +2414,7 @@ public class TweetMainAction implements ConnectionLifeCycleListener{
                Logger.getLogger(TweetMainAction.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
-       
+
        /**
         * ストリーミング処理の停止
         */
@@ -2427,10 +2427,10 @@ public class TweetMainAction implements ConnectionLifeCycleListener{
                Logger.getLogger(TweetMainAction.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
-       
+
        /**
         * ストリーミング処理を利用するかどうか
-        * @return 
+        * @return
         */
        public boolean isUsingStreaming() {
            return this.isUsingStreaming;
@@ -2443,7 +2443,7 @@ public class TweetMainAction implements ConnectionLifeCycleListener{
            this.isCurrentUsingStreaming = true;
            updatePeriodInformationToComponent();
        }
-       
+
        /**
         * streaming api stop
         */
@@ -2452,7 +2452,7 @@ public class TweetMainAction implements ConnectionLifeCycleListener{
            this.isCurrentUsingStreaming = false;
            updatePeriodInformationToComponent();
        }
-       
+
        /**
         * streaming api
         */
@@ -2460,22 +2460,22 @@ public class TweetMainAction implements ConnectionLifeCycleListener{
        public void onCleanUp() {
           //nothing
        }
-       
+
        /**
         * 現在streaming apiが起動しているかどうか
         */
        public boolean isStartedStreamingAPI() {
            return this.isCurrentUsingStreaming;
        }
-       
+
        /**
         * Fav通知を行うかどうか
-        * @return 
+        * @return
         */
        public boolean isFavNotify() {
            return this.favNotify;
        }
-       
+
        /**
         * fav通知を行うかどうか設定
         */
index 8ec64f2..74e3d05 100644 (file)
@@ -57,8 +57,6 @@ public class TweetTabbedTable implements TweetStreamingListener {
        private TweetManager tweetManager;
        // メインアクション
        private TweetMainAction mainAction;
-       // テーブルの高さ
-       private int tableElementHeight;
        // 新しく取得した部分のテーブルの色
        private Color newTableColor = null;
        // テーブルに追加できる要素の最大数
@@ -75,8 +73,6 @@ public class TweetTabbedTable implements TweetStreamingListener {
         *             タブに表示するタイトル
         * @param tabbedPane
         *             テーブルを追加するタブ
-        * @param tableElementHeight
-        *            テーブルの高さ
         * @param tweetManager
         *             ツイート管理クラス
         * @param mainAction
@@ -89,7 +85,7 @@ public class TweetTabbedTable implements TweetStreamingListener {
         *            自動更新につかうタイマーのID
         */
        public TweetTabbedTable(TweetGetter tweetGetter, String title,
-                       JTabbedPane tabbedPane, int tableElementHeight,
+                       JTabbedPane tabbedPane,
                        TweetManager tweetManager, TweetMainAction mainAction,
                        Color newTableColor, int tableElementMaxSize, String timerID) {
                this.tweetGetter = tweetGetter;
@@ -97,7 +93,6 @@ public class TweetTabbedTable implements TweetStreamingListener {
                this.tabbedPane = tabbedPane;
                this.tweetManager = tweetManager;
                this.mainAction = mainAction;
-               this.tableElementHeight = tableElementHeight;
                this.newTableColor = newTableColor;
                this.tableElementMaxSize = tableElementMaxSize;
                this.timerID = timerID;
@@ -160,13 +155,12 @@ public class TweetTabbedTable implements TweetStreamingListener {
                col.setCellRenderer(infoRenderer);
                col.setMaxWidth(200);
                col.setMinWidth(150);
-               // TODO:とりあえず幅指定した部分
-               // あとでファイルに幅情報などを保存しておき,それを読み込んで設定するような仕様に変更する
                // ユーザImageを表示する部分
                col = mdl.getColumn(0);
                col.setCellRenderer(new UserImageRenderer());
-               col.setMinWidth(50);
-               col.setMaxWidth(50);
+               //テーブルの高さ調節
+               col.setMinWidth(mainAction.getTableElementHeight());
+               col.setMaxWidth(mainAction.getTableElementHeight());
                // 選択したセルの情報をDetailInfoへと表示
                // JTableを右クリックでも選択できるようにする
                // また,同じ行を2回クリックできるようにする
@@ -252,7 +246,7 @@ public class TweetTabbedTable implements TweetStreamingListener {
                // ツイートをテーブルに追加
                this.getModel().insertTweet(tweet);
                // テーブルの高さを整える
-               int tableHeight = getTableElementHeight();
+               int tableHeight = mainAction.getTableElementHeight();
                for (int i = 0; i < tweet.size(); i++) {
                        this.getTable().setRowHeight(i, tableHeight);
                }
@@ -640,21 +634,6 @@ public class TweetTabbedTable implements TweetStreamingListener {
        }
 
        /**
-        * @return the tableElementHeight
-        */
-       public int getTableElementHeight() {
-               return tableElementHeight;
-       }
-
-       /**
-        * @param tableElementHeight
-        *            the tableElementHeight to set
-        */
-       public void setTableElementHeight(int tableElementHeight) {
-               this.tableElementHeight = tableElementHeight;
-       }
-
-       /**
         * @return the tableElementMaxSize
         */
        public int getTableElementMaxSize() {