From 820e8ed9ff934f90e76403baf5f0b32c0229f0e0 Mon Sep 17 00:00:00 2001 From: "U-nishio-PC8\\nishio" Date: Thu, 1 Sep 2011 15:08:24 +0900 Subject: [PATCH] =?utf8?q?=E3=83=86=E3=83=BC=E3=83=96=E3=83=AB=E3=81=AE?= =?utf8?q?=E9=AB=98=E3=81=95=E8=AA=BF=E7=AF=80=E3=81=8C=E6=AD=A3=E3=81=97?= =?utf8?q?=E3=81=8F=E8=A1=8C=E3=82=8F=E3=82=8C=E3=81=A6=E3=81=84=E3=81=AA?= =?utf8?q?=E3=81=84=E5=95=8F=E9=A1=8C=E3=82=92=E8=A7=A3=E6=B1=BA=20#26180?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/twitter/gui/action/TweetMainAction.java | 60 ++++++++++++------------- src/twitter/gui/component/TweetTabbedTable.java | 31 +++---------- 2 files changed, 35 insertions(+), 56 deletions(-) diff --git a/src/twitter/gui/action/TweetMainAction.java b/src/twitter/gui/action/TweetMainAction.java index 75227d0..030afcc 100644 --- a/src/twitter/gui/action/TweetMainAction.java +++ b/src/twitter/gui/action/TweetMainAction.java @@ -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通知を行うかどうか設定 */ diff --git a/src/twitter/gui/component/TweetTabbedTable.java b/src/twitter/gui/component/TweetTabbedTable.java index 8ec64f2..74e3d05 100644 --- a/src/twitter/gui/component/TweetTabbedTable.java +++ b/src/twitter/gui/component/TweetTabbedTable.java @@ -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() { -- 2.11.0