1 package twitter.gui.action;
4 import java.awt.Desktop;
5 import java.awt.Dimension;
8 import java.awt.TrayIcon;
9 import java.awt.event.ActionEvent;
11 import java.io.FileInputStream;
12 import java.io.FileNotFoundException;
13 import java.io.FileOutputStream;
14 import java.io.IOException;
15 import java.io.UnsupportedEncodingException;
18 import java.net.URLEncoder;
19 import java.text.DateFormat;
20 import java.util.ArrayList;
21 import java.util.Comparator;
22 import java.util.List;
23 import java.util.Properties;
25 import java.util.TreeSet;
26 import java.util.logging.Level;
27 import java.util.logging.Logger;
28 import java.util.regex.Matcher;
29 import java.util.regex.Pattern;
30 import javax.swing.ImageIcon;
31 import javax.swing.JCheckBoxMenuItem;
33 import javax.swing.JEditorPane;
34 import javax.swing.JFrame;
35 import javax.swing.JLabel;
36 import javax.swing.JOptionPane;
37 import javax.swing.JPanel;
38 import javax.swing.JTabbedPane;
39 import javax.swing.JTable;
40 import javax.swing.JTextPane;
41 import javax.swing.JToggleButton;
42 import javax.swing.table.TableModel;
43 import javax.swing.text.Style;
44 import javax.swing.text.StyleConstants;
45 import javax.swing.text.html.HTMLDocument;
46 import javax.swing.text.html.StyleSheet;
47 import twitter.action.TweetDirectMessageGetter;
48 import twitter.action.TweetFavoriteGetter;
49 import twitter.action.TweetGetter;
50 import twitter.action.TweetListGetter;
51 import twitter.action.TweetMentionGetter;
52 import twitter.action.TweetSearchResultGetter;
53 import twitter.action.TweetSendDirectMessageGetter;
54 import twitter.action.TweetTimelineGetter;
55 import twitter.action.TweetUserTimelineGetter;
56 import twitter.action.list.ListGetterSelection;
57 import twitter.action.list.UserListGetter;
58 import twitter.action.list.UserListMembershipsGetter;
59 import twitter.action.list.UserListSpecificUserListsGetter;
60 import twitter.action.list.UserListSubscriptionGetter;
61 import twitter.cache.TwitterImageCache;
62 import twitter.gui.component.DnDTabbedPane;
64 import twitter.gui.component.TweetTabbedTable;
65 import twitter.gui.component.TweetTableModel;
66 import twitter.gui.form.AboutDialog;
67 import twitter.gui.form.AccountDialog;
68 import twitter.gui.form.ConfigurationDialog;
69 import twitter.gui.form.DirectMessageDialog;
70 import twitter.gui.form.HashtagSearchDialog;
71 import twitter.gui.form.KeywordSearchDialog;
72 import twitter.gui.form.UserListDialog;
73 import twitter.manage.TweetConfiguration;
74 import twitter.manage.TweetManager;
75 import twitter.task.ExistTimerIDException;
76 import twitter.task.TimerID;
77 import twitter.task.TweetTaskException;
78 import twitter.task.TweetTaskManager;
79 import twitter.task.TweetUpdateTask;
80 import twitter.util.HTMLEncode;
81 import twitter4j.Status;
82 import twitter4j.TwitterException;
90 public class TweetMainAction {
93 public static final String BASIC_SETTING_FILENAME = TweetConfiguration.BASIC_SETTING_FILENAME;
95 private static final Pattern convURLLinkPtn = Pattern.compile(
96 "(http://|https://){1}[\\w\\.\\-/:\\#\\?\\=\\&\\;\\%\\~\\+]+",
97 Pattern.CASE_INSENSITIVE);
98 // default char encoding
99 private static final String DEFAULT_CHARACTER_ENCODING = "UTF-8";
100 // 設定ファイルを保存するディレクトリ名
101 public static final String PROPERTIES_DIRECTORY = "properties";
102 // search twitterのクエリ
103 private static final String SEARCH_QUERY = "search?q=";
104 // search twitterのURL
105 private static final String SEARCH_TWITTER_URL = "http://"
106 + TweetConfiguration.SEARCH_TWITTER_HOSTNAME + "/";
107 // Direct Messageタブに表示する文字
108 public static final String TAB_DIRECT_MESSAGE_STRING = "Message";
110 public static final String TAB_MENTION_STRING = "Mention";
112 public static final String TAB_TIMELINE_STRING = "Timeline";
113 // Send Direct Messageタブに表示する文字
114 public static final String TAB_SEND_DIRECT_MESSAGE_STRING = "Send";
115 // テーブルのデータ量が以下の値を超えたら古いデータから削除
116 private static final int TABLE_ELEMENT_MAX_SIZE = 200;
118 private static final String TWITTER_URL = "http://twitter.com/";
120 private ConfigurationDialog configurationDialog = null;
122 private Status currentStatus = null;
124 private Status replyStatus = null;
126 private JPanel detailInfoPanel = null;
127 // ダイレクトメッセージ送信用ダイアログ
128 private DirectMessageDialog directMessageDialog = null;
129 // Twitter全体からキーワード検索ダイアログ
130 private KeywordSearchDialog keywordSearchDialog = null;
131 // hashtag search dialog
132 private HashtagSearchDialog hashtagSearchDialog = null;
134 private Color newTableColor = new Color(224, 255, 255);
136 private String tlFontName = "Takao Pゴシック";
138 private int tlFontSize = 13;
140 private String detailFontName = "Takao Pゴシック";
142 private int detailFontSize = 13;
144 private int tableElementHeight = 50;
146 private int mainFrameWidth = 729;
148 private int mainFrameHeight = 629;
150 private JFrame mainFrame = null;
152 private Properties property = null;
153 // 現在テーブルで選択しているユーザ画像のURL
154 private URL selectedUserImageURL = null;
155 // 現在テーブルで選択しているユーザの名前
156 private String selectedUsername = null;
158 private JLabel statusBarLabel = null;
160 private JTextPane tweetBoxPane = null;
161 // 自分がつぶやきを書く領域のスクロールペーン
162 private JPanel tweetBoxRegionPane = null;
164 private JTabbedPane tweetMainTab = null;
166 private TweetManager tweetManager = null;
167 // tweetを表示するTextPane
168 private JEditorPane tweetMessageBox = null;
169 // つぶやくことができる文字数を表示するラベル
170 private JLabel tweetMessageCountLabel = null;
171 private int uncheckedDirectMessageCount = 0;
172 private int uncheckedMentionTweetCount = 0;
173 // 自分宛のメッセージを通知バーに表示するか
174 private boolean isNotifyMentionMessage = true;
175 private boolean isNotifyDirectMessage = true;
178 private JLabel userImageLabel = null;
179 private JLabel userNameLabel = null;
180 private JLabel updateTimeLabel = null;
181 private JLabel followerLabel = null;
182 private JLabel followingLabel = null;
183 private JLabel locationLabel = null;
184 private JEditorPane clientNameLabel = null;
185 private JLabel updateLabel = null;
186 private JEditorPane userIntroBox = null;
187 private JEditorPane userWebBox = null;
189 private TrayIcon trayIcon = null;
192 private javax.swing.JToggleButton timelineToggleButton;
193 private javax.swing.JToggleButton mentionToggleButton;
194 private javax.swing.JToggleButton dmToggleButton;
195 private javax.swing.JToggleButton sendDMToggleButton;
197 private javax.swing.JCheckBoxMenuItem timelineCheckBoxMenuItem;
198 private javax.swing.JCheckBoxMenuItem mentionCheckBoxMenuItem;
199 private javax.swing.JCheckBoxMenuItem dmCheckBoxMenuItem;
200 private javax.swing.JCheckBoxMenuItem sendCheckBoxMenuItem;
202 // 新しく取得したtweetでまだ参照していない数
203 private int uncheckedTimelineTweetCount = 0;
204 private AboutDialog aboutDialog = null;
206 private AccountDialog accountDialog;
208 private List<TweetTabbedTable> tweetTabbedTableList = new ArrayList<TweetTabbedTable>();
209 // ツイートテーブルの情報を一定間隔で更新するクラスを作成
210 private TweetTaskManager tweetTaskManager = new TweetTaskManager();
213 private UserListDialog userListDialog = null;
216 private int getTimelinePeriod = 60;
217 private int getMentionPeriod = 60 * 3;
218 private int getDirectMessagePeriod = 60 * 15;
219 private int getSendDirectMessagePeriod = 60 * 30;
224 * @param tweetManager
225 * @param statusBarLabel
226 * @param tweetTableModel
227 * @param mentionTableModel
228 * @param directMessageTableModel
229 * @param sendDirectMessageTableModel
230 * @param mainTweetTable
231 * @param mentionTable
232 * @param directMessageTable
233 * @param sendDirectMessageTable
234 * @param tweetBoxPane
235 * @param tweetBoxScrollPane
236 * @param tweetMessageCountLabel
237 * @param detailInfoPanel
238 * @param tweetMainTab
239 * @param tweetMessageBox
240 * @param userImageLabel
241 * @param userNameLabel
242 * @param updateTimeLabel
243 * @param followerLabel
244 * @param followingLabel
245 * @param locationLabel
246 * @param clientNameLabel
248 * @param userIntroBox
251 public TweetMainAction(JFrame mainFrame, TweetManager tweetManager,
252 JLabel statusBarLabel, JTextPane tweetBoxPane,
253 JPanel tweetBoxScrollPane, JLabel tweetMessageCountLabel,
254 JPanel detailInfoPanel, JTabbedPane tweetMainTab,
255 JEditorPane tweetMessageBox, JLabel userImageLabel,
256 JLabel userNameLabel, JLabel updateTimeLabel, JLabel followerLabel,
257 JLabel followingLabel, JLabel locationLabel,
258 JEditorPane clientNameLabel, JLabel updateLabel,
259 JEditorPane userIntroBox, JEditorPane userWebBox,
260 JToggleButton timelineToggleButton,
261 JToggleButton mentionToggleButton, JToggleButton dmToggleButton,
262 JToggleButton sendToggleButton,
263 JCheckBoxMenuItem timelineCheckBoxMenuItem,
264 JCheckBoxMenuItem mentionCheckBoxMenuItem,
265 JCheckBoxMenuItem dmCheckBoxMenuItem,
266 JCheckBoxMenuItem sendCheckBoxMenuItem, TrayIcon trayIcon) {
267 this.mainFrame = mainFrame;
268 this.tweetManager = tweetManager;
269 this.statusBarLabel = statusBarLabel;
270 this.tweetBoxPane = tweetBoxPane;
271 this.tweetMessageCountLabel = tweetMessageCountLabel;
272 this.detailInfoPanel = detailInfoPanel;
273 this.tweetMainTab = tweetMainTab;
274 this.tweetMessageBox = tweetMessageBox;
275 this.tweetBoxRegionPane = tweetBoxScrollPane;
278 this.userImageLabel = userImageLabel;
279 this.userNameLabel = userNameLabel;
280 this.updateTimeLabel = updateTimeLabel;
281 this.userIntroBox = userIntroBox;
282 this.followerLabel = followerLabel;
283 this.followingLabel = followingLabel;
284 this.locationLabel = locationLabel;
285 this.userWebBox = userWebBox;
286 this.clientNameLabel = clientNameLabel;
287 this.updateLabel = updateLabel;
289 this.timelineCheckBoxMenuItem = timelineCheckBoxMenuItem;
290 this.timelineToggleButton = timelineToggleButton;
291 this.mentionCheckBoxMenuItem = mentionCheckBoxMenuItem;
292 this.mentionToggleButton = mentionToggleButton;
293 this.dmCheckBoxMenuItem = dmCheckBoxMenuItem;
294 this.dmToggleButton = dmToggleButton;
295 this.sendCheckBoxMenuItem = sendCheckBoxMenuItem;
296 this.sendDMToggleButton = sendToggleButton;
299 this.trayIcon = trayIcon;
302 if (this.tweetMainTab instanceof DnDTabbedPane) {
303 ((DnDTabbedPane) this.tweetMainTab).setMainAction(this);
309 } catch (FileNotFoundException e) {
311 } catch (IOException e) {
315 updateFontInformationToComponent();
318 mainFrame.setSize(this.mainFrameWidth, this.mainFrameHeight);
319 mainFrame.setPreferredSize(new Dimension(this.mainFrameWidth,
320 this.mainFrameHeight));
326 public void updateCheckboxInformation() {
327 boolean timeline = this.isExistTimelineTab();
328 boolean mention = this.isExistMentionTab();
329 boolean dm = this.isExistDirectMessageTab();
330 boolean send = this.isExistSendDirectMessageTab();
332 this.timelineCheckBoxMenuItem.setSelected(timeline);
333 this.timelineToggleButton.setSelected(timeline);
334 this.mentionCheckBoxMenuItem.setSelected(mention);
335 this.mentionToggleButton.setSelected(mention);
336 this.dmCheckBoxMenuItem.setSelected(dm);
337 this.dmToggleButton.setSelected(dm);
338 this.sendCheckBoxMenuItem.setSelected(send);
339 this.sendDMToggleButton.setSelected(send);
343 * Timeline, Mention , DM, SendDMの情報更新間隔を取得し,その情報をテーブルに反映
345 public void updatePeriodInformationToComponent() {
346 // すべてのテーブルにフォント情報を反映
347 for (TweetTabbedTable t : this.tweetTabbedTableList) {
348 String timerID = t.getTimerID();
349 if (timerID.equals(TimerID.createTimelineID())) {
351 this.tweetTaskManager.updateTaskPeriod(timerID, this
352 .getGetTimelinePeriod(), false);
353 } else if (timerID.equals(TimerID.createMentionID())) {
355 this.tweetTaskManager.updateTaskPeriod(timerID, this
356 .getGetMentionPeriod(), false);
357 } else if (timerID.equals(TimerID.createDirectMessageID())) {
359 this.tweetTaskManager.updateTaskPeriod(timerID, this
360 .getGetDirectMessagePeriod(), false);
361 } else if (timerID.equals(TimerID.createSendDirectMessageID())) {
363 this.tweetTaskManager.updateTaskPeriod(timerID, this
364 .getGetSendDirectMessagePeriod(), false);
370 public void updateFontInformationToComponent() {
373 if (this.tlFontName != null) {
374 tlFont = new Font(this.tlFontName, Font.PLAIN, this.tlFontSize);
376 Font detailFont = null;
377 if (this.detailFontName != null) {
378 detailFont = new Font(this.detailFontName, Font.PLAIN,
379 this.detailFontSize);
382 // すべてのテーブルにフォント情報を反映
383 for (TweetTabbedTable t : this.tweetTabbedTableList) {
384 t.getTable().setFont(tlFont);
387 // tweetメッセージボックスのフォントはhtmlレベルで変更する必要がある
388 this.tweetMessageBox.setFont(detailFont);
390 HTMLDocument doc = (HTMLDocument) this.tweetMessageBox
392 StyleSheet[] style = doc.getStyleSheet().getStyleSheets();
393 for (int i = style.length - 1; i >= 0; i--) {
394 Style body = style[i].getStyle("body");
397 .setFontFamily(body, detailFont.getFontName());
398 StyleConstants.setFontSize(body, detailFont.getSize());
402 } catch (Exception e) {
411 * TimerIDクラスで生成したタイマーID
419 public void actionAddTab(String timerID, int period,
420 TweetGetter tweetGetter, String tabTitle) {
425 final TweetTabbedTable table = new TweetTabbedTable(
426 tweetGetter, tabTitle, this.tweetMainTab,
427 this.tableElementHeight, this.tweetManager, this,
428 newTableColor, TABLE_ELEMENT_MAX_SIZE, timerID);
430 this.tweetTaskManager.addTask(timerID, new TweetUpdateTask() {
433 public void runTask() throws TweetTaskException {
435 table.updateTweetTable();
439 this.tweetTaskManager.startTask(timerID, period * 1000L);
442 table.addTableToTab();
444 this.tweetTabbedTableList.add(table);
445 // searchTable.updateTweetTable();
447 this.actionRequestForusToLastTab();
448 } catch (TweetTaskException ex) {
449 Logger.getLogger(TweetMainAction.class.getName()).log(
450 Level.SEVERE, null, ex);
455 this.updateFontInformationToComponent();
457 this.updateTableHeight(this.getTableElementHeight());
466 public void actionAddMentionTab(int period) {
467 TimerID timerID = TimerID.getInstance();
468 String id = TimerID.createMentionID();
470 // 既にIDが存在していたらここで例外発生
473 if (this.isNotifyMentionMessage) {
475 actionAddTab(id, period, new TweetMentionGetter(tweetManager,
476 this.trayIcon), TweetMainAction.TAB_MENTION_STRING);
478 actionAddTab(id, period, new TweetMentionGetter(tweetManager),
479 TweetMainAction.TAB_MENTION_STRING);
481 } catch (ExistTimerIDException ex) {
482 JOptionPane.showMessageDialog(null, "そのタブは既に存在しています", "Error",
483 JOptionPane.ERROR_MESSAGE);
491 * nullで自分自身を取得,指定するとscreenNameのFav取得
493 public void actionAddFavoriteTab(String screenName) {
494 TimerID timerID = TimerID.getInstance();
495 String id = TimerID.createFavoriteID(screenName);
497 // 既にIDが存在していたらここで例外発生
500 if (screenName == null) {
503 favTitle = screenName + "のお気に入り";
506 actionAddTab(id, Integer.MAX_VALUE, new TweetFavoriteGetter(
507 tweetManager, screenName), favTitle);
508 } catch (ExistTimerIDException ex) {
509 JOptionPane.showMessageDialog(null, "そのタブは既に存在しています", "Error",
510 JOptionPane.ERROR_MESSAGE);
520 public void actionAddTimelineTab(int period) {
521 TimerID timerID = TimerID.getInstance();
522 String id = TimerID.createTimelineID();
524 // 既にIDが存在していたらここで例外発生
527 actionAddTab(id, period, new TweetTimelineGetter(tweetManager),
528 TweetMainAction.TAB_TIMELINE_STRING);
529 } catch (ExistTimerIDException ex) {
530 JOptionPane.showMessageDialog(null, "そのタブは既に存在しています", "Error",
531 JOptionPane.ERROR_MESSAGE);
541 public void actionAddDirectMessageTab(int period) {
542 TimerID timerID = TimerID.getInstance();
543 String id = TimerID.createDirectMessageID();
545 // 既にIDが存在していたらここで例外発生
548 if (this.isNotifyDirectMessage == true) {
549 actionAddTab(id, period, new TweetDirectMessageGetter(
550 tweetManager, this.trayIcon),
551 TweetMainAction.TAB_DIRECT_MESSAGE_STRING);
553 actionAddTab(id, period, new TweetDirectMessageGetter(
555 TweetMainAction.TAB_DIRECT_MESSAGE_STRING);
557 } catch (ExistTimerIDException ex) {
558 JOptionPane.showMessageDialog(null, "そのタブは既に存在しています", "Error",
559 JOptionPane.ERROR_MESSAGE);
568 public void actionAddSendDirectMessageTab(int period) {
569 TimerID timerID = TimerID.getInstance();
570 String id = TimerID.createSendDirectMessageID();
572 // 既にIDが存在していたらここで例外発生
575 actionAddTab(id, period, new TweetSendDirectMessageGetter(
577 TweetMainAction.TAB_SEND_DIRECT_MESSAGE_STRING);
578 } catch (ExistTimerIDException ex) {
579 JOptionPane.showMessageDialog(null, "そのタブは既に存在しています", "Error",
580 JOptionPane.ERROR_MESSAGE);
589 * @param listFullname
592 public void actionAddListTab(String username, int listID,
593 String listFullname, int period) {
594 TimerID timerID = TimerID.getInstance();
595 String id = TimerID.createUserListID(username, listID);
597 // 既にIDが存在していたらここで例外発生
600 actionAddTab(id, period, new TweetListGetter(tweetManager,
601 username, listID), listFullname);
602 } catch (ExistTimerIDException ex) {
603 JOptionPane.showMessageDialog(null, "そのタブは既に存在しています", "Error",
604 JOptionPane.ERROR_MESSAGE);
609 * ツイート検索結果を表示するタブを新しく追加
613 * 更新周期[sec] 0以下の場合は更新しない
615 public void actionAddNewSearchResultTab(String searchWord, int period) {
616 TimerID timerID = TimerID.getInstance();
617 String id = TimerID.createSearchTimerID(searchWord);
619 // 既にIDが存在していたらここで例外発生
622 actionAddTab(id, period, new TweetSearchResultGetter(
623 this.tweetManager, searchWord), searchWord);
624 } catch (ExistTimerIDException ex) {
625 JOptionPane.showMessageDialog(null, "そのタブは既に存在しています", "Error",
626 JOptionPane.ERROR_MESSAGE);
640 public void actionAddUserTimelineTab(String username, long userID,
642 TimerID timerID = TimerID.getInstance();
643 String id = TimerID.createUserTimelineID(userID);
645 // 既にIDが存在していたらここで例外発生
648 actionAddTab(id, period, new TweetUserTimelineGetter(tweetManager,
649 userID), username + "の発言");
650 } catch (ExistTimerIDException ex) {
651 JOptionPane.showMessageDialog(null, "そのタブは既に存在しています", "Error",
652 JOptionPane.ERROR_MESSAGE);
661 public boolean isExistTimelineTab() {
662 TimerID timerID = TimerID.getInstance();
663 String id = TimerID.createTimelineID();
664 return timerID.contains(id);
672 public boolean isExistMentionTab() {
673 TimerID timerID = TimerID.getInstance();
674 String id = TimerID.createMentionID();
675 return timerID.contains(id);
683 public boolean isExistDirectMessageTab() {
684 TimerID timerID = TimerID.getInstance();
685 String id = TimerID.createDirectMessageID();
686 return timerID.contains(id);
694 public boolean isExistSendDirectMessageTab() {
695 TimerID timerID = TimerID.getInstance();
696 String id = TimerID.createSendDirectMessageID();
697 return timerID.contains(id);
703 public void actionBasicSettingDialog() {
704 // ダイレクトメッセージ送信用ダイアログを開く
705 Point loc = getConfigurationDialog().getLocation();
706 loc.translate(20, 20);
707 ConfigurationDialog dialog = getConfigurationDialog();
708 dialog.setLocation(loc);
709 dialog.setVisible(true);
715 public void actionSetReplyStatusToTweetBoxPane() {
717 this.setReplyStatus(currentStatus);
719 Status s = this.getCurrentStatus();
721 s = s.getRetweetedStatus();
724 String username = s.getUser().getScreenName();
725 this.tweetBoxPane.setText("@" + username + " ");
728 this.information(username + "さんに返信");
734 public void actionSetReplyAllStatusToTweetBoxPane() {
736 this.setReplyStatus(null);
738 Status s = this.getCurrentStatus();
740 s = s.getRetweetedStatus();
743 String username = s.getUser().getScreenName();
744 this.tweetBoxPane.setText("@" + username + " ");
747 this.information(username + "さんに返信");
753 public void actionSetQuoteStatusToTweetBoxPane() {
755 this.setReplyStatus(currentStatus);
756 Status s = this.getCurrentStatus();
758 s = s.getRetweetedStatus();
761 String username = s.getUser().getScreenName();
763 String message = s.getText();
764 this.tweetBoxPane.setText("QT @" + username + ": " + message);
767 this.information(username + "さんのメッセージを引用ツイート");
773 public void actionCopySelectedStatusToTweetBoxPane() {
774 Status s = this.getCurrentStatus();
776 s = s.getRetweetedStatus();
779 String username = s.getUser().getScreenName();
781 String message = s.getText();
782 this.tweetBoxPane.setText("RT @" + username + ": " + message);
790 public void actionDetailInfoButton(ActionEvent e) {
791 if (detailInfoPanel.isVisible()) {
792 detailInfoPanel.setVisible(false);
794 detailInfoPanel.setVisible(true);
803 public boolean isDetailInfoPanelVisible() {
804 return detailInfoPanel.isVisible();
808 * 書き込みメッセージボックスの表示ONOFFボタンを押した時の動作
812 public void actionShowTweetboxButton(ActionEvent e) {
813 if (this.tweetBoxRegionPane.isVisible()) {
814 this.tweetBoxRegionPane.setVisible(false);
816 this.tweetBoxRegionPane.setVisible(true);
821 * 書き込みメッセージボックス領域が表示されているか
823 public boolean isShowTweetBoxVisible() {
824 return this.tweetBoxRegionPane.isVisible();
830 public void actionRemoveFocusedTabbedTable() {
831 int selected = this.tweetMainTab.getSelectedIndex();
832 actionRemoveTabbedTable(selected);
840 public void actionRemoveTabbedTable(String timerID) {
841 int deleteTabIndex = -1;
843 for (int i = 0; i < tweetTabbedTableList.size(); i++) {
844 TweetTabbedTable table = tweetTabbedTableList.get(i);
845 if (table.getTimerID().equals(timerID)) {
852 if (deleteTabIndex >= 0) {
853 int selected = this.tweetTabbedTableList.get(deleteTabIndex)
856 this.tweetMainTab.remove(selected);
858 this.tweetTabbedTableList.remove(deleteTabIndex);
860 this.tweetTaskManager.shutdownTask(timerID);
862 TimerID idManager = TimerID.getInstance();
863 idManager.removeID(timerID);
866 this.updateCheckboxInformation();
873 * @param removeTabIndex
875 public void actionRemoveTabbedTable(int removeTabIndex) {
876 int selected = removeTabIndex;
877 // タブの何番目に消したいテーブルがあるのかと,tweetTabbedTableListの何番目に消したいテーブルがあるのかは違う
881 int deleteTabIndex = -1;
882 for (int i = 0; i < tweetTabbedTableList.size(); i++) {
883 TweetTabbedTable table = tweetTabbedTableList.get(i);
884 if (selected == table.getTabSetNum()) {
891 if (deleteTabIndex >= 0) {
893 this.tweetMainTab.remove(selected);
895 String timerID = this.tweetTabbedTableList.get(deleteTabIndex)
898 this.tweetTabbedTableList.remove(deleteTabIndex);
900 this.tweetTaskManager.shutdownTask(timerID);
902 TimerID idManager = TimerID.getInstance();
903 idManager.removeID(timerID);
906 this.updateCheckboxInformation();
915 public void actionExitButton(ActionEvent e) {
922 public void actionOpenStatusURL() {
925 String userName = this.getCurrentStatus().getUser().getScreenName();
927 long statusID = this.getCurrentStatus().getId();
928 Desktop.getDesktop().browse(
929 new URI(TWITTER_URL + userName + "/statuses/" + statusID));
930 } catch (Exception ex) {
931 ex.printStackTrace();
932 JOptionPane.showMessageDialog(null, "エラーによりブラウザを起動できませんでした.",
933 "Error", JOptionPane.ERROR_MESSAGE);
940 public void actionOpenUserFav() {
942 Status s = this.getCurrentStatus();
944 s = s.getRetweetedStatus();
946 String userName = s.getUser().getScreenName();
947 this.actionAddFavoriteTab(userName);
948 } catch (Exception ex) {
949 ex.printStackTrace();
956 public void actionOpenFav() {
957 String username = this.tweetManager.getScreenName();
958 this.actionAddFavoriteTab(username);
964 public void actionOpenUserURL() {
966 Status s = this.getCurrentStatus();
968 s = s.getRetweetedStatus();
970 String userName = s.getUser().getScreenName();
971 Desktop.getDesktop().browse(new URI(TWITTER_URL + userName));
972 } catch (Exception ex) {
973 ex.printStackTrace();
974 JOptionPane.showMessageDialog(null, "エラーによりブラウザを起動できませんでした.",
975 "Error", JOptionPane.ERROR_MESSAGE);
982 public void actionRefreshTime() {
984 for (TweetTabbedTable t : this.tweetTabbedTableList) {
985 TweetTableModel model = t.getModel();
993 * TweetMessageBox内にある#ハッシュタグ の部分をa hrefリンクに変換
997 public String actionReplaceTweetMessageBoxHashTab(String message) {
999 Pattern userPtn = Pattern.compile("#[0-9A-Z_]+",
1000 Pattern.CASE_INSENSITIVE);
1001 Matcher matcher = userPtn.matcher(message);
1004 Set<String> findList = new TreeSet<String>();
1005 while (matcher.find()) {
1006 findList.add(matcher.group(0));
1009 for (String f : findList) {
1011 message = message.replaceAll(f + "$|" + f + "\\s", "<a href=\""
1012 + SEARCH_TWITTER_URL + SEARCH_QUERY
1013 + URLEncoder.encode(f, DEFAULT_CHARACTER_ENCODING)
1014 + "\">" + "$0</a>");
1015 } catch (UnsupportedEncodingException e) {
1016 e.printStackTrace();
1023 * TweetMessageBox内にあるリンクをa hrefリンクに変換
1027 public String actionReplaceTweetMessageBoxURLLink(String message) {
1028 Matcher matcher = convURLLinkPtn.matcher(message);
1029 return matcher.replaceAll("<a href=\"$0\">$0</a>");
1033 * @ユーザ名の部分をa hrefリンクに変換
1036 public String actionReplaceTweetMessageBoxUserInfo(String message) {
1038 Pattern userPtn = Pattern.compile("@[0-9A-Z_]+",
1039 Pattern.CASE_INSENSITIVE);
1040 Matcher matcher = userPtn.matcher(message);
1042 Set<String> findList = new TreeSet<String>();
1043 while (matcher.find()) {
1044 findList.add(matcher.group(0));
1046 // 指定したユーザ名をすべてリンクへ変更
1047 for (String f : findList) {
1048 message = message.replaceAll(f, "<a href=\"" + TWITTER_URL
1049 + f.substring(1) + "\">" + f + "</a>");
1055 * まだ見ていないdirectMessage数を0にする
1057 public void actionResetUncheckedDirectMessageCount() {
1058 uncheckedDirectMessageCount = 0;
1059 tweetMainTab.setTitleAt(2, TAB_DIRECT_MESSAGE_STRING);
1063 * まだ見ていないmention数を0にする
1065 public void actionResetUncheckedMentionTweetCount() {
1066 uncheckedMentionTweetCount = 0;
1067 tweetMainTab.setTitleAt(1, TAB_MENTION_STRING);
1071 * まだ見ていないtweet数を0にする
1073 public void actionResetUncheckedTimelineTweetCount() {
1074 uncheckedTimelineTweetCount = 0;
1075 tweetMainTab.setTitleAt(0, TAB_TIMELINE_STRING);
1081 public void actionSelectedUserTimeline() {
1082 Status status = null;
1083 if (this.getCurrentStatus().isRetweet()) {
1084 status = this.getCurrentStatus().getRetweetedStatus();
1086 status = this.getCurrentStatus();
1088 String username = status.getUser().getScreenName();
1089 long userID = status.getUser().getId();
1091 actionAddUserTimelineTab(username, userID, this.getGetTimelinePeriod());
1095 * 選択したユーザが作成したリスト一覧を表示
1099 public void actionShowSelectedUserList(ListGetterSelection selection) {
1100 Status status = null;
1101 if (this.getCurrentStatus().isRetweet()) {
1102 status = this.getCurrentStatus().getRetweetedStatus();
1104 status = this.getCurrentStatus();
1106 String username = status.getUser().getScreenName();
1107 actionShowUserListDialog(status.getUser().getScreenName(), selection);
1111 * 選択しているツイートをお気に入りに追加
1113 public void actionCreateFavorite() {
1114 Status status = null;
1115 if (this.getCurrentStatus().isRetweet()) {
1116 status = this.getCurrentStatus().getRetweetedStatus();
1118 status = this.getCurrentStatus();
1120 // 選択しているtweetのstatus id
1121 long statusID = status.getId();
1123 String username = status.getUser().getScreenName();
1125 String message = status.getText();
1127 if (message.length() > 30) {
1128 message = message.substring(0, 30) + " ...(以下略)";
1130 // Retweetしていいかどうかの確認
1131 int ret = JOptionPane.showConfirmDialog(mainFrame, username + " さんの発言:"
1132 + message + "\nをお気に入りに追加しますか?", "Favの確認",
1133 JOptionPane.YES_NO_OPTION);
1134 if (ret == JOptionPane.YES_OPTION) {
1137 this.tweetManager.createFavorite(statusID);
1138 } catch (TwitterException e) {
1139 JOptionPane.showMessageDialog(null, "エラーによりお気に入りに追加できませんでした.",
1140 "Fav Error", JOptionPane.ERROR_MESSAGE);
1146 * 選択しているツイートをお気に入りから外す
1148 public void actionDestroyFavorite() {
1149 Status status = null;
1150 if (this.getCurrentStatus().isRetweet()) {
1151 status = this.getCurrentStatus().getRetweetedStatus();
1153 status = this.getCurrentStatus();
1155 // 選択しているtweetのstatus id
1156 long statusID = status.getId();
1158 String username = status.getUser().getScreenName();
1160 String message = status.getText();
1162 if (message.length() > 30) {
1163 message = message.substring(0, 30) + " ...(以下略)";
1165 // Retweetしていいかどうかの確認
1166 int ret = JOptionPane.showConfirmDialog(mainFrame, username + " さんの発言:"
1167 + message + "\nをお気に入りから削除しますか?", "Favの確認",
1168 JOptionPane.YES_NO_OPTION);
1169 if (ret == JOptionPane.YES_OPTION) {
1172 this.tweetManager.destroyFavorite(statusID);
1173 } catch (TwitterException e) {
1174 JOptionPane.showMessageDialog(null, "エラーによりお気に入りから削除できませんでした.",
1175 "Fav Error", JOptionPane.ERROR_MESSAGE);
1181 * 現在選択しているステータスを公式Retweet
1183 public void actionRetweet() {
1184 Status status = null;
1185 if (this.getCurrentStatus().isRetweet()) {
1186 status = this.getCurrentStatus().getRetweetedStatus();
1188 status = this.getCurrentStatus();
1191 // 選択しているtweetのstatus id
1192 long statusID = status.getId();
1194 String username = status.getUser().getScreenName();
1196 String message = status.getText();
1198 if (message.length() > 30) {
1199 message = message.substring(0, 30) + " ...(以下略)";
1201 // Retweetしていいかどうかの確認
1202 int ret = JOptionPane.showConfirmDialog(mainFrame, username + " さんの発言:"
1203 + message + "\nをRetweetしますか?", "Retweetの確認",
1204 JOptionPane.YES_NO_OPTION);
1205 if (ret == JOptionPane.YES_OPTION) {
1208 this.tweetManager.retweet(statusID);
1209 } catch (TwitterException e) {
1210 JOptionPane.showMessageDialog(null, "エラーによりRetweetできませんでした.",
1211 "Retweet Error", JOptionPane.ERROR_MESSAGE);
1221 public void updateTableHeight(int height) {
1222 this.tableElementHeight = height;
1223 for (TweetTabbedTable t : this.tweetTabbedTableList) {
1224 t.getTable().setRowHeight(tableElementHeight);
1231 public void actionShowDirectMessageDialog() {
1232 // ダイレクトメッセージ送信用ダイアログを開く
1233 Point loc = getDirectMessageDialog().getLocation();
1234 // loc.translate(20, 20);
1235 DirectMessageDialog dialog = getDirectMessageDialog();
1236 // dialog.setLocation(loc);
1237 dialog.setLocationRelativeTo(null);
1238 dialog.setVisible(true);
1239 dialog.setUserInformation(this.selectedUsername,
1240 this.selectedUserImageURL, this.tweetManager);
1246 public void actionShowAboutDialog() {
1247 Point loc = getDirectMessageDialog().getLocation();
1248 // loc.translate(20, 20);
1249 AboutDialog dialog = getAboutDialog();
1250 dialog.setLocationRelativeTo(null);
1251 // dialog.setLocation(loc);
1252 dialog.setVisible(true);
1258 public void actionShowAccountDialog() {
1259 // TODO: location取得のコードおかしい
1260 Point loc = getDirectMessageDialog().getLocation();
1261 // loc.translate(20, 20);
1262 AccountDialog dialog = getAccountDialog();
1263 dialog.setLocationRelativeTo(null);
1264 // dialog.setLocation(loc);
1265 dialog.setVisible(true);
1269 * Twitter全体からキーワード検索ダイアログを表示
1271 public void actionShowKeywordSearchDialog() {
1272 Point loc = getDirectMessageDialog().getLocation();
1273 KeywordSearchDialog dialog = getKeywordSearchDialog();
1274 dialog.setSearchWord("");
1275 dialog.setLocationRelativeTo(null);
1276 dialog.setVisible(true);
1280 * Twitter全体からキーワード検索ダイアログを表示
1283 * searchwordボックスに予め設定するワード
1285 public void actionShowKeywordSearchDialog(String searchWord) {
1286 Point loc = getDirectMessageDialog().getLocation();
1287 KeywordSearchDialog dialog = getKeywordSearchDialog();
1288 dialog.setSearchWord(searchWord);
1289 dialog.setLocationRelativeTo(null);
1290 dialog.setVisible(true);
1296 public void actionShowHashtagSearchDialog() {
1297 Point loc = getDirectMessageDialog().getLocation();
1298 HashtagSearchDialog dialog = getHashtagSearchDialog();
1299 dialog.setLocationRelativeTo(null);
1300 dialog.setVisible(true);
1306 * @param listUserName
1309 * CREATED: 指定したユーザが作成したリスト SUBSCRIPTION: 指定したユーザがフォローしているリスト
1310 * MEMBERSHIPS: 指定したユーザが追加されているリスト
1312 public void actionShowUserListDialog(String listUserName,
1313 ListGetterSelection selection) {
1314 UserListDialog dialog = getUserListDialog(listUserName, selection);
1315 Point loc = dialog.getLocation();
1316 dialog.setLocationRelativeTo(null);
1317 dialog.setVisible(true);
1321 * tweetBoxPaneに書かれた文字をつぶやく
1323 public void actionTweet() {
1324 if (this.replyStatus != null) {
1325 tweetManager.replyTweet(tweetBoxPane.getText(), this.replyStatus
1328 tweetManager.tweet(tweetBoxPane.getText());
1331 this.information("メッセージをつぶやきました. 発言:" + tweetBoxPane.getText());
1333 tweetBoxPane.setText(""); // テキストをクリア
1342 public void actionUpdateButton(java.awt.event.ActionEvent e) {
1344 // タブ上に存在するテーブルの情報を更新
1345 for (TweetTabbedTable t : this.tweetTabbedTableList) {
1346 String timerID = t.getTimerID();
1347 this.tweetTaskManager.resetTask(timerID, true);
1351 int remainingHits = tweetManager.getRateLimitStatus()
1352 .getRemainingHits();
1353 // 取得したコメント数をステータスバーに表示
1354 information("新しいツイートを取得しました. (APIリクエスト残数は" + remainingHits + "回です)");
1355 } catch (Exception e1) {
1356 e1.printStackTrace();
1361 * 新しく追加したタブにフォーカスを移す
1363 public void actionRequestForusToLastTab() {
1364 int lasttab = this.tweetMainTab.getTabCount() - 1;
1366 this.tweetMainTab.setSelectedIndex(lasttab);
1371 * 指定した番号のタブにフォーカスを移す
1375 public void actionRequestFocusToTab(int index) {
1377 this.tweetMainTab.setSelectedIndex(index);
1382 * 選択しているタブにあるテーブル情報だけを更新
1384 public void actionFocusedTableUpdate() {
1385 int selected = this.tweetMainTab.getSelectedIndex();
1387 if (selected >= 0) {
1388 // タブ上に存在するテーブルの情報を更新
1389 TweetTabbedTable t = this.tweetTabbedTableList.get(selected);
1390 String timerID = t.getTimerID();
1391 this.tweetTaskManager.resetTask(timerID, true);
1393 int remainingHits = tweetManager.getRateLimitStatus()
1394 .getRemainingHits();
1395 // 取得したコメント数をステータスバーに表示
1396 information(t.getTitle() + "タブのツイートを" + t.getUncheckedTweet()
1397 + "件取得しました. (APIリクエスト残数は" + remainingHits + "回です)");
1399 } catch (Exception e1) {
1400 e1.printStackTrace();
1409 public void actionUpdateTweetMessageCount() {
1410 int len = 140 - (tweetBoxPane.getText().length());
1414 tweetMessageCountLabel.setText(len + "");
1416 // 残りつぶやき数140の場合,reply状態も解除する
1418 this.setReplyStatus(null);
1427 public ConfigurationDialog getConfigurationDialog() {
1428 if (configurationDialog == null) {
1429 configurationDialog = new ConfigurationDialog(mainFrame, true, this);
1431 return configurationDialog;
1437 * @param listUserName
1442 public UserListDialog getUserListDialog(String listUserName,
1443 ListGetterSelection selection) {
1444 UserListGetter getter = null;
1445 switch (selection) {
1447 getter = new UserListSpecificUserListsGetter(tweetManager);
1450 getter = new UserListMembershipsGetter(tweetManager);
1452 case SUBSCRIPTION: /* fall through */
1454 getter = new UserListSubscriptionGetter(tweetManager);
1457 userListDialog = new UserListDialog(mainFrame, true, this, getter,
1459 return userListDialog;
1467 public String getScreenName() {
1468 return tweetManager.getScreenName();
1472 * twitter全体からキーワード検索ダイアログを表示
1476 public KeywordSearchDialog getKeywordSearchDialog() {
1477 if (keywordSearchDialog == null) {
1478 keywordSearchDialog = new KeywordSearchDialog(mainFrame, true, this);
1480 return keywordSearchDialog;
1488 public HashtagSearchDialog getHashtagSearchDialog() {
1489 if (hashtagSearchDialog == null) {
1490 hashtagSearchDialog = new HashtagSearchDialog(mainFrame, true,
1491 this, tweetManager);
1493 return hashtagSearchDialog;
1501 public AccountDialog getAccountDialog() {
1502 if (accountDialog == null) {
1503 accountDialog = new AccountDialog(mainFrame, true, tweetManager,
1506 return accountDialog;
1510 * ダイレクトメッセージ送信用ダイアログを取得
1514 public DirectMessageDialog getDirectMessageDialog() {
1515 if (directMessageDialog == null) {
1516 directMessageDialog = new DirectMessageDialog(mainFrame);
1517 directMessageDialog.setTitle("ダイレクトメッセージを送信");
1519 return directMessageDialog;
1523 * テーブルで選択したツイートを詳細情報としてセット
1527 public void setDetailInformationFromTable(JTable table) {
1528 int sc = table.getSelectedRowCount();
1529 String infoMessage = "";
1531 // 選択している行が1行だけの場合,情報を表示する
1532 if (sc == 1 && table != null) {
1533 Status st = getTweetTableInformation(table, table.getModel());
1535 if (st.isRetweet()) {
1536 st = st.getRetweetedStatus();
1538 infoMessage = st.getText();
1539 // メッセージのHTMLエンコードを行う
1540 infoMessage = HTMLEncode.encode(infoMessage);
1541 // tweetMessageBox内のURLをhtmlリンクへ変換
1542 infoMessage = actionReplaceTweetMessageBoxURLLink(infoMessage);
1543 // @ユーザ情報をhtmlリンクへ変換
1544 infoMessage = actionReplaceTweetMessageBoxUserInfo(infoMessage);
1545 // #ハッシュタグ情報をhtmlリンクへ変換
1546 infoMessage = actionReplaceTweetMessageBoxHashTab(infoMessage);
1547 // 詳細情報にテーブルで選択した人のツイート情報を表示
1548 tweetMessageBox.setText(infoMessage);
1551 ImageIcon icon = TwitterImageCache.getInstance().getProfileImage( st.getUser().getProfileImageURL().toString() );
1552 userImageLabel.setIcon( icon );
1554 userNameLabel.setText(st.getUser().getName() + " / "
1555 + st.getUser().getScreenName());
1557 updateTimeLabel.setText(DateFormat.getInstance().format(
1558 st.getCreatedAt()));
1560 userIntroBox.setText(st.getUser().getDescription());
1562 followerLabel.setText(st.getUser().getFollowersCount() + "");
1564 followingLabel.setText(st.getUser().getFriendsCount() + "");
1566 locationLabel.setText(st.getUser().getLocation());
1568 if (st.getUser().getURL() != null) {
1569 userWebBox.setText("<a href=\"" + st.getUser().getURL() + "\">"
1570 + st.getUser().getScreenName() + "のWebを開く" + "</a>");
1572 userWebBox.setText("");
1575 clientNameLabel.setText(" via " + st.getSource());
1577 updateLabel.setText(st.getUser().getStatusesCount() + "");
1585 public AboutDialog getAboutDialog() {
1586 if (aboutDialog == null) {
1587 aboutDialog = new AboutDialog(mainFrame, true);
1593 * テーブルで選択した場所のTweet情報を取得
1597 public Status getTweetTableInformation(JTable table, TableModel model) {
1598 int index = table.convertRowIndexToModel(table.getSelectedRow());
1599 Status status = null;
1600 if (model instanceof TweetTableModel) {
1601 status = ((TweetTableModel) model).getTweetStatus(index);
1602 // 現在選択したセルのユーザ名を保存しておく
1603 this.selectedUsername = status.getUser().getScreenName();
1604 // 現在選択したセルのユーザURLを保存しておく
1605 this.selectedUserImageURL = status.getUser().getProfileImageURL();
1606 // 選択したStatusを保存しておく
1607 this.setCurrentStatus(status);
1617 public void information(String message) {
1618 statusBarLabel.setText(message);
1624 * @throws IOException
1625 * @throws FileNotFoundException
1627 public void loadProperties() throws FileNotFoundException, IOException {
1628 if (property == null) {
1629 this.property = new Properties();
1631 property.load(new FileInputStream("./" + PROPERTIES_DIRECTORY + "/"
1632 + BASIC_SETTING_FILENAME));
1634 String gtp = this.property.getProperty("getTimelinePeriod");
1635 String gmp = this.property.getProperty("getMentionPeriod");
1636 String gdmp = this.property.getProperty("getDirectMessagePeriod");
1637 String gsdmp = this.property.getProperty("getSendDirectMessagePeriod");
1639 String ntrgb = this.property.getProperty("newTableColorRGB");
1641 this.tlFontName = this.property.getProperty("tlFontName");
1642 this.detailFontName = this.property.getProperty("detailFontName");
1644 String tfs = this.property.getProperty("tlFontSize");
1645 String dfs = this.property.getProperty("detailFontSize");
1646 String teh = this.property.getProperty("tableElementHeight");
1649 String mfw = this.property.getProperty("mainFrameWidth");
1650 String mfh = this.property.getProperty("mainFrameHeight");
1653 String nm = this.property.getProperty("notifyMessage");
1654 String ndm = this.property.getProperty("notifyDirectMessage");
1657 this.newTableColor = new Color(Integer.parseInt(ntrgb));
1658 this.tlFontSize = Integer.parseInt(tfs);
1659 this.detailFontSize = Integer.parseInt(dfs);
1660 this.tableElementHeight = Integer.parseInt(teh);
1661 this.mainFrameWidth = Integer.parseInt(mfw);
1662 this.mainFrameHeight = Integer.parseInt(mfh);
1665 this.getTimelinePeriod = Integer.parseInt(gtp);
1666 this.getMentionPeriod = Integer.parseInt(gmp);
1667 this.getDirectMessagePeriod = Integer.parseInt(gdmp);
1668 this.getSendDirectMessagePeriod = Integer.parseInt(gsdmp);
1671 this.isNotifyMentionMessage = Boolean.parseBoolean(nm);
1672 this.isNotifyMentionMessage = Boolean.parseBoolean(ndm);
1673 } catch (NumberFormatException e) {
1674 e.printStackTrace();
1681 * @throws IOException
1683 public void saveProperties() throws IOException {
1685 File logDir = new File("./" + PROPERTIES_DIRECTORY);
1686 if (!logDir.exists()) {
1687 // ディレクトリが存在しないので作成する
1688 if (logDir.mkdir() == false) {
1689 throw new IOException(PROPERTIES_DIRECTORY
1690 + "ディレクトリを作成できませんでした.");
1693 if (property == null) {
1694 this.property = new Properties();
1698 this.property.setProperty("getTimelinePeriod", this.getTimelinePeriod
1700 this.property.setProperty("getMentionPeriod", this.getMentionPeriod
1702 this.property.setProperty("getDirectMessagePeriod",
1703 this.getDirectMessagePeriod + "");
1704 this.property.setProperty("getSendDirectMessagePeriod",
1705 this.getSendDirectMessagePeriod + "");
1707 this.property.setProperty("newTableColorRGB", newTableColor.getRGB()
1709 this.property.setProperty("tlFontName", this.tlFontName);
1710 this.property.setProperty("tlFontSize", this.tlFontSize + "");
1711 this.property.setProperty("detailFontName", this.detailFontName);
1712 this.property.setProperty("detailFontSize", this.detailFontSize + "");
1713 this.property.setProperty("tableElementHeight", this.tableElementHeight
1717 if (this.mainFrame.getExtendedState() == JFrame.NORMAL) {
1718 this.mainFrameWidth = this.mainFrame.getWidth();
1719 this.mainFrameHeight = this.mainFrame.getHeight();
1721 this.property.setProperty("mainFrameWidth", this.mainFrameWidth + "");
1722 this.property.setProperty("mainFrameHeight", this.mainFrameHeight + "");
1725 this.property.setProperty("notifyMention", this.isNotifyMentionMessage
1727 this.property.setProperty("notifyDirectMessage",
1728 this.isNotifyDirectMessage + "");
1731 property.store(new FileOutputStream("./" + PROPERTIES_DIRECTORY + "/"
1732 + BASIC_SETTING_FILENAME), null);
1736 * newTableColorを取得します。
1738 * @return newTableColor
1740 public Color getNewTableColor() {
1741 return newTableColor;
1745 * newTableColorを設定します。
1747 * @param newTableColor
1750 public void setNewTableColor(Color newTableColor) {
1751 this.newTableColor = newTableColor;
1757 * @return tlFontName
1759 public String getTlFontName() {
1769 public void setTlFontName(String tlFontName) {
1770 this.tlFontName = tlFontName;
1776 * @return tlFontSize
1778 public int getTlFontSize() {
1788 public void setTlFontSize(int tlFontSize) {
1789 this.tlFontSize = tlFontSize;
1793 * detailFontNameを取得します。
1795 * @return detailFontName
1797 public String getDetailFontName() {
1798 return detailFontName;
1802 * detailFontNameを設定します。
1804 * @param detailFontName
1807 public void setDetailFontName(String detailFontName) {
1808 this.detailFontName = detailFontName;
1812 * detailFontSizeを取得します。
1814 * @return detailFontSize
1816 public int getDetailFontSize() {
1817 return detailFontSize;
1821 * detailFontSizeを設定します。
1823 * @param detailFontSize
1826 public void setDetailFontSize(int detailFontSize) {
1827 this.detailFontSize = detailFontSize;
1831 * tableElementHeightを取得します。
1833 * @return tableElementHeight
1835 public int getTableElementHeight() {
1836 return tableElementHeight;
1840 * tableElementHeightを設定します。
1842 * @param tableElementHeight
1843 * tableElementHeight
1845 public void setTableElementHeight(int tableElementHeight) {
1846 this.tableElementHeight = tableElementHeight;
1850 * @return the getTimelinePeriod
1852 public int getGetTimelinePeriod() {
1853 return getTimelinePeriod;
1857 * @param getTimelinePeriod
1858 * the getTimelinePeriod to set
1860 public void setGetTimelinePeriod(int getTimelinePeriod) {
1861 this.getTimelinePeriod = getTimelinePeriod;
1865 * @return the getMentionPeriod
1867 public int getGetMentionPeriod() {
1868 return getMentionPeriod;
1872 * @param getMentionPeriod
1873 * the getMentionPeriod to set
1875 public void setGetMentionPeriod(int getMentionPeriod) {
1876 this.getMentionPeriod = getMentionPeriod;
1880 * @return the getDirectMessagePeriod
1882 public int getGetDirectMessagePeriod() {
1883 return getDirectMessagePeriod;
1887 * @param getDirectMessagePeriod
1888 * the getDirectMessagePeriod to set
1890 public void setGetDirectMessagePeriod(int getDirectMessagePeriod) {
1891 this.getDirectMessagePeriod = getDirectMessagePeriod;
1895 * @return the getSendDirectMessagePeriod
1897 public int getGetSendDirectMessagePeriod() {
1898 return getSendDirectMessagePeriod;
1902 * @param getSendDirectMessagePeriod
1903 * the getSendDirectMessagePeriod to set
1905 public void setGetSendDirectMessagePeriod(int getSendDirectMessagePeriod) {
1906 this.getSendDirectMessagePeriod = getSendDirectMessagePeriod;
1910 * @return the currentStatus
1912 public Status getCurrentStatus() {
1913 return currentStatus;
1917 * @param currentStatus
1918 * the currentStatus to set
1920 public void setCurrentStatus(Status currentStatus) {
1921 this.currentStatus = currentStatus;
1928 public Status getReplyStatus() {
1937 public void setReplyStatus(Status status) {
1938 this.replyStatus = status;