OSDN Git Service

TL, DM, SendDMの処理を変更.検索結果を表示するテーブルとの共通部分を統一
[nt-manager/nt-manager.git] / src / twitter / gui / form / NishioTweetManager.java
1 /*
2  * To change this template, choose Tools | Templates
3  * and open the template in the editor.
4  */
5
6 /*
7  * NishioTweetManager.java
8  *
9  * Created on 2010/09/06, 3:32:04
10  */
11 package twitter.gui.form;
12
13 import java.awt.AWTException;
14 import java.awt.Image;
15 import java.awt.MenuItem;
16 import java.awt.Point;
17 import java.awt.PopupMenu;
18 import java.awt.SystemTray;
19 import java.awt.TrayIcon;
20 import java.awt.event.ActionEvent;
21 import java.awt.event.ActionListener;
22 import java.awt.event.MouseAdapter;
23 import java.awt.event.MouseEvent;
24 import java.awt.image.BufferedImage;
25 import java.net.URL;
26 import javax.swing.ImageIcon;
27 import javax.swing.JFrame;
28 import javax.swing.JMenuItem;
29 import javax.swing.JPopupMenu;
30 import javax.swing.JTable;
31 import javax.swing.UIManager;
32 import javax.swing.WindowConstants;
33 import javax.swing.event.ListSelectionEvent;
34 import javax.swing.event.ListSelectionListener;
35 import javax.swing.table.TableColumn;
36 import javax.swing.table.TableColumnModel;
37 import javax.swing.text.Style;
38 import javax.swing.text.StyleConstants;
39 import javax.swing.text.html.HTMLDocument;
40 import javax.swing.text.html.StyleSheet;
41 import twitter.gui.action.TweetMainAction;
42 import twitter.gui.component.TweetCommentRenderer;
43 import twitter.gui.component.TweetHyperlinkHandler;
44 import twitter.gui.component.TweetTableModel;
45 import twitter.gui.component.UserImageRenderer;
46 import twitter.manage.TweetManager;
47 import twitter4j.Status;
48
49 /**
50  *
51  * @author nishio
52  */
53 public class NishioTweetManager extends javax.swing.JFrame {
54
55     private SystemTray systemTray;
56     private TrayIcon trayIcon;
57
58     /** Creates new form NishioTweetManager */
59     public NishioTweetManager() {
60         initComponents();
61         //component初期化
62         initComponents2();
63         //twitterコード初期化
64         init();
65     }
66
67     /**
68      * コンポーネント初期化
69      */
70     private void initComponents2() {
71         Image image = null;
72         try {
73             //トレイイメージ
74             /*URL resource = getClass().getResource("icon.png");
75             image = new ImageIcon(resource).getImage();*/
76             image = new ImageIcon("resources/icon.png").getImage();
77             //フレームのアイコン設定
78             this.setIconImage(image);
79         } catch (Exception e) {
80             e.printStackTrace();
81             image = new BufferedImage(32, 32, BufferedImage.TYPE_INT_RGB);
82         }
83         //システムトライ関係
84         systemTray = SystemTray.getSystemTray();
85         final JFrame frame = this;
86         final PopupMenu popup = new PopupMenu();
87         trayIcon = new TrayIcon(image, "Nishio Tweet Manager", popup);
88
89         //左クリックした時に「画面を開く」アクションをする
90         trayIcon.addMouseListener(new MouseAdapter() {
91
92             @Override
93             public void mousePressed(MouseEvent me) {
94                 //左クリック
95                 if (me.getButton() == MouseEvent.BUTTON1) {
96                     frame.setVisible(true);
97                 }
98             }
99         });
100
101         //右クリック時のポップアップメニュー
102         MenuItem item1 = new MenuItem("画面を開く");
103         item1.addActionListener(new ActionListener() {
104
105             public void actionPerformed(ActionEvent e) {
106                 frame.setVisible(true);
107             }
108         });
109         MenuItem item2 = new MenuItem("終了");
110         item2.addActionListener(new ActionListener() {
111
112             public void actionPerformed(ActionEvent e) {
113                 systemTray.remove(trayIcon);
114                 frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
115                 frame.dispose();
116                 System.exit(0);
117             }
118         });
119         popup.add(item1);
120         popup.add(item2);
121
122         try {
123             systemTray.add(trayIcon);
124         } catch (AWTException e) {
125             e.printStackTrace();
126         }
127     }
128
129     /** This method is called from within the constructor to
130      * initialize the form.
131      * WARNING: Do NOT modify this code. The content of this method is
132      * always regenerated by the Form Editor.
133      */
134     @SuppressWarnings("unchecked")
135     // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
136     private void initComponents() {
137
138         jTabbedPane1 = new javax.swing.JTabbedPane();
139         jScrollPane1 = new javax.swing.JScrollPane();
140         jTable = new javax.swing.JTable();
141         jScrollPane2 = new javax.swing.JScrollPane();
142         jTable1 = new javax.swing.JTable();
143         jScrollPane3 = new javax.swing.JScrollPane();
144         jTable2 = new javax.swing.JTable();
145         jScrollPane4 = new javax.swing.JScrollPane();
146         jTable3 = new javax.swing.JTable();
147         jPanel1 = new javax.swing.JPanel();
148         userImageLabel = new javax.swing.JLabel();
149         jScrollPane5 = new javax.swing.JScrollPane();
150         tweetMessageBox = new javax.swing.JEditorPane();
151         jLabel3 = new javax.swing.JLabel();
152         jLabel4 = new javax.swing.JLabel();
153         jLabel5 = new javax.swing.JLabel();
154         userNameLabel = new javax.swing.JLabel();
155         updateTimeLabel = new javax.swing.JLabel();
156         locationLabel = new javax.swing.JLabel();
157         jLabel9 = new javax.swing.JLabel();
158         followingLabel = new javax.swing.JLabel();
159         followerLabel = new javax.swing.JLabel();
160         jLabel12 = new javax.swing.JLabel();
161         jLabel13 = new javax.swing.JLabel();
162         updateLabel = new javax.swing.JLabel();
163         jScrollPane6 = new javax.swing.JScrollPane();
164         userIntroBox = new javax.swing.JEditorPane();
165         jScrollPane7 = new javax.swing.JScrollPane();
166         userWebBox = new javax.swing.JEditorPane();
167         jScrollPane8 = new javax.swing.JScrollPane();
168         clientNameLabel = new javax.swing.JEditorPane();
169         jButton1 = new javax.swing.JButton();
170         jButton2 = new javax.swing.JButton();
171         jScrollPane9 = new javax.swing.JScrollPane();
172         jTextPane = new javax.swing.JTextPane();
173         jLabel15 = new javax.swing.JLabel();
174         tweetLengthLabel = new javax.swing.JLabel();
175         jButton4 = new javax.swing.JButton();
176         jToggleButton1 = new javax.swing.JToggleButton();
177         statusBar = new javax.swing.JLabel();
178         jToggleButton2 = new javax.swing.JToggleButton();
179         jMenuBar1 = new javax.swing.JMenuBar();
180         jMenu1 = new javax.swing.JMenu();
181         jMenuItem1 = new javax.swing.JMenuItem();
182         jMenu6 = new javax.swing.JMenu();
183         jMenuItem7 = new javax.swing.JMenuItem();
184         jMenuItem8 = new javax.swing.JMenuItem();
185         jMenu4 = new javax.swing.JMenu();
186         jMenuItem5 = new javax.swing.JMenuItem();
187         jMenuItem9 = new javax.swing.JMenuItem();
188         jMenu5 = new javax.swing.JMenu();
189         jMenuItem6 = new javax.swing.JMenuItem();
190         jMenu2 = new javax.swing.JMenu();
191         jMenuItem2 = new javax.swing.JMenuItem();
192         jMenuItem4 = new javax.swing.JMenuItem();
193         jMenu3 = new javax.swing.JMenu();
194         jMenuItem3 = new javax.swing.JMenuItem();
195
196         setTitle("Nishio Tweet Manager");
197
198         jTable.setModel(tweetTableModel);
199         jTable.getTableHeader().setReorderingAllowed(false);
200         jTable.addMouseListener(new java.awt.event.MouseAdapter() {
201             public void mousePressed(java.awt.event.MouseEvent evt) {
202                 jTableMousePressed(evt);
203             }
204             public void mouseReleased(java.awt.event.MouseEvent evt) {
205                 jTableMouseReleased(evt);
206             }
207         });
208         jTable.addFocusListener(new java.awt.event.FocusAdapter() {
209             public void focusGained(java.awt.event.FocusEvent evt) {
210                 jTableFocusGained(evt);
211             }
212         });
213         jScrollPane1.setViewportView(jTable);
214
215         jTabbedPane1.addTab("Timeline", jScrollPane1);
216
217         jTable1.setModel(mentionTableModel);
218         jTable1.getTableHeader().setReorderingAllowed(false);
219         jTable1.addMouseListener(new java.awt.event.MouseAdapter() {
220             public void mousePressed(java.awt.event.MouseEvent evt) {
221                 jTable1MousePressed(evt);
222             }
223             public void mouseReleased(java.awt.event.MouseEvent evt) {
224                 jTable1MouseReleased(evt);
225             }
226         });
227         jTable1.addFocusListener(new java.awt.event.FocusAdapter() {
228             public void focusGained(java.awt.event.FocusEvent evt) {
229                 jTable1FocusGained(evt);
230             }
231         });
232         jScrollPane2.setViewportView(jTable1);
233
234         jTabbedPane1.addTab("Mention", jScrollPane2);
235
236         jTable2.setModel(messageTableModel);
237         jTable2.getTableHeader().setReorderingAllowed(false);
238         jTable2.addMouseListener(new java.awt.event.MouseAdapter() {
239             public void mousePressed(java.awt.event.MouseEvent evt) {
240                 jTable2MousePressed(evt);
241             }
242             public void mouseReleased(java.awt.event.MouseEvent evt) {
243                 jTable2MouseReleased(evt);
244             }
245         });
246         jTable2.addFocusListener(new java.awt.event.FocusAdapter() {
247             public void focusGained(java.awt.event.FocusEvent evt) {
248                 jTable2FocusGained(evt);
249             }
250         });
251         jScrollPane3.setViewportView(jTable2);
252
253         jTabbedPane1.addTab("Message", jScrollPane3);
254
255         jTable3.setModel(sendMessageTableModel);
256         jTable3.getTableHeader().setReorderingAllowed(false);
257         jScrollPane4.setViewportView(jTable3);
258
259         jTabbedPane1.addTab("Send", jScrollPane4);
260
261         jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
262
263         userImageLabel.setBackground(java.awt.Color.black);
264         userImageLabel.setOpaque(true);
265
266         jScrollPane5.setHorizontalScrollBar(null);
267
268         tweetMessageBox.setContentType("text/html");
269         tweetMessageBox.setEditable(false);
270         tweetMessageBox.addComponentListener(new java.awt.event.ComponentAdapter() {
271             public void componentResized(java.awt.event.ComponentEvent evt) {
272                 tweetMessageBoxComponentResized(evt);
273             }
274         });
275         tweetMessageBox.addHyperlinkListener(new TweetHyperlinkHandler());
276         jScrollPane5.setViewportView(tweetMessageBox);
277
278         jLabel3.setText("ユーザ名");
279
280         jLabel4.setText("更新日");
281
282         jLabel5.setText("現在地");
283
284         userNameLabel.setText("UserName");
285
286         updateTimeLabel.setText("Date");
287
288         locationLabel.setText("Information");
289
290         jLabel9.setText("Following");
291
292         followingLabel.setText("0");
293
294         followerLabel.setText("0");
295
296         jLabel12.setText("Follower");
297
298         jLabel13.setText("更新回数");
299
300         updateLabel.setText("0");
301
302         jScrollPane6.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
303
304         userIntroBox.setContentType("text/html");
305         userIntroBox.setEditable(false);
306         userIntroBox.setMinimumSize(new java.awt.Dimension(120, 20));
307         jScrollPane6.setViewportView(userIntroBox);
308
309         jScrollPane7.setBorder(null);
310         jScrollPane7.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
311         jScrollPane7.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
312
313         userWebBox.setBorder(null);
314         userWebBox.setContentType("text/html");
315         userWebBox.setEditable(false);
316         userWebBox.setEditable(false);
317         userWebBox.addHyperlinkListener(new TweetHyperlinkHandler());
318         try {
319             // htmlフォント変更
320             HTMLDocument doc = (HTMLDocument) userWebBox.getDocument();
321             StyleSheet[] style = doc.getStyleSheet().getStyleSheets();
322             for (int i = style.length - 1; i >= 0; i--) {
323                 Style body = style[i].getStyle("body");
324                 if (body != null) {
325                     // TODO: change default font size
326                     StyleConstants.setFontSize(body, 13);
327                 }
328             }
329         } catch (Exception e) {
330             e.printStackTrace();
331         }
332         jScrollPane7.setViewportView(userWebBox);
333
334         jScrollPane8.setBorder(null);
335         jScrollPane8.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
336         jScrollPane8.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
337
338         clientNameLabel.setBorder(null);
339         clientNameLabel.setContentType("text/html");
340         clientNameLabel.setEditable(false);
341         clientNameLabel.setEditable(false);
342         clientNameLabel.addHyperlinkListener(new TweetHyperlinkHandler());
343         try {
344             // htmlフォント変更
345             HTMLDocument doc = (HTMLDocument) clientNameLabel.getDocument();
346             StyleSheet[] style = doc.getStyleSheet().getStyleSheets();
347             for (int i = style.length - 1; i >= 0; i--) {
348                 Style body = style[i].getStyle("body");
349                 if (body != null) {
350                     // TODO: default font size
351                     StyleConstants.setFontSize(body, 13);
352                 }
353             }
354         } catch (Exception e) {
355             e.printStackTrace();
356         }
357         jScrollPane8.setViewportView(clientNameLabel);
358
359         javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
360         jPanel1.setLayout(jPanel1Layout);
361         jPanel1Layout.setHorizontalGroup(
362             jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
363             .addGroup(jPanel1Layout.createSequentialGroup()
364                 .addComponent(userImageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
365                 .addGap(3, 3, 3)
366                 .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 674, Short.MAX_VALUE))
367             .addGroup(jPanel1Layout.createSequentialGroup()
368                 .addContainerGap()
369                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
370                     .addGroup(jPanel1Layout.createSequentialGroup()
371                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
372                             .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
373                             .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
374                             .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
375                         .addGap(18, 18, 18)
376                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
377                             .addComponent(locationLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE)
378                             .addComponent(userNameLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE)
379                             .addComponent(updateTimeLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE))
380                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
381                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
382                             .addComponent(jLabel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
383                             .addComponent(jLabel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
384                             .addComponent(jLabel9))
385                         .addGap(18, 18, 18)
386                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
387                             .addComponent(updateLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
388                             .addComponent(followerLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 68, Short.MAX_VALUE)
389                             .addComponent(followingLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
390                     .addGroup(jPanel1Layout.createSequentialGroup()
391                         .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)
392                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
393                         .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE)))
394                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
395                 .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 292, Short.MAX_VALUE))
396         );
397         jPanel1Layout.setVerticalGroup(
398             jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
399             .addGroup(jPanel1Layout.createSequentialGroup()
400                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
401                     .addComponent(userImageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
402                     .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE))
403                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
404                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
405                     .addGroup(jPanel1Layout.createSequentialGroup()
406                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
407                             .addGroup(jPanel1Layout.createSequentialGroup()
408                                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
409                                     .addComponent(jLabel3)
410                                     .addComponent(userNameLabel))
411                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
412                                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
413                                     .addComponent(jLabel4)
414                                     .addComponent(updateTimeLabel))
415                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
416                                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
417                                     .addComponent(jLabel5)
418                                     .addComponent(locationLabel)))
419                             .addGroup(jPanel1Layout.createSequentialGroup()
420                                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
421                                     .addComponent(jLabel9)
422                                     .addComponent(followingLabel))
423                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
424                                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
425                                     .addComponent(jLabel12)
426                                     .addComponent(followerLabel))
427                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
428                                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
429                                     .addComponent(jLabel13)
430                                     .addComponent(updateLabel))))
431                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
432                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
433                             .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
434                             .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)))
435                     .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE))
436                 .addContainerGap())
437         );
438
439         jButton1.setText("今すぐ更新");
440         jButton1.addActionListener(new java.awt.event.ActionListener() {
441             public void actionPerformed(java.awt.event.ActionEvent evt) {
442                 jButton1ActionPerformed(evt);
443             }
444         });
445
446         jButton2.setText("リフレッシュ");
447         jButton2.addActionListener(new java.awt.event.ActionListener() {
448             public void actionPerformed(java.awt.event.ActionEvent evt) {
449                 jButton2ActionPerformed(evt);
450             }
451         });
452
453         jScrollPane9.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
454         jScrollPane9.setMaximumSize(new java.awt.Dimension(32767, 80));
455         jScrollPane9.setMinimumSize(new java.awt.Dimension(26, 80));
456
457         jTextPane.setMaximumSize(new java.awt.Dimension(2147483647, 20));
458         jTextPane.addFocusListener(new java.awt.event.FocusAdapter() {
459             public void focusGained(java.awt.event.FocusEvent evt) {
460                 jTextPaneFocusGained(evt);
461             }
462             public void focusLost(java.awt.event.FocusEvent evt) {
463                 jTextPaneFocusLost(evt);
464             }
465         });
466         jTextPane.addKeyListener(new java.awt.event.KeyAdapter() {
467             public void keyReleased(java.awt.event.KeyEvent evt) {
468                 jTextPaneKeyReleased(evt);
469             }
470         });
471         jScrollPane9.setViewportView(jTextPane);
472
473         jLabel15.setText("残り文字数");
474
475         tweetLengthLabel.setText("140");
476
477         jButton4.setText("つぶやく");
478         jButton4.addActionListener(new java.awt.event.ActionListener() {
479             public void actionPerformed(java.awt.event.ActionEvent evt) {
480                 jButton4ActionPerformed(evt);
481             }
482         });
483
484         jToggleButton1.setSelected(true);
485         jToggleButton1.setText("詳細情報");
486         jToggleButton1.setMaximumSize(new java.awt.Dimension(73, 26));
487         jToggleButton1.setMinimumSize(new java.awt.Dimension(73, 26));
488         jToggleButton1.addActionListener(new java.awt.event.ActionListener() {
489             public void actionPerformed(java.awt.event.ActionEvent evt) {
490                 jToggleButton1ActionPerformed(evt);
491             }
492         });
493
494         statusBar.setText("Status");
495         statusBar.setBorder(javax.swing.BorderFactory.createEtchedBorder());
496
497         jToggleButton2.setSelected(true);
498         jToggleButton2.setText("書き込み欄");
499         jToggleButton2.setMaximumSize(new java.awt.Dimension(73, 26));
500         jToggleButton2.setMinimumSize(new java.awt.Dimension(73, 26));
501         jToggleButton2.addActionListener(new java.awt.event.ActionListener() {
502             public void actionPerformed(java.awt.event.ActionEvent evt) {
503                 jToggleButton2ActionPerformed(evt);
504             }
505         });
506
507         jMenu1.setMnemonic('F');
508         /*
509         org.openide.awt.Mnemonics.setLocalizedText(jMenu1, "ファイル(F)");
510         */
511         jMenu1.setText("ファイル(F)");
512
513         jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, java.awt.event.InputEvent.CTRL_MASK));
514         jMenuItem1.setMnemonic('X');
515         jMenuItem1.setText("終了(X)");
516         jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
517             public void actionPerformed(java.awt.event.ActionEvent evt) {
518                 jMenuItem1ActionPerformed(evt);
519             }
520         });
521         jMenu1.add(jMenuItem1);
522
523         jMenuBar1.add(jMenu1);
524
525         jMenu6.setMnemonic('O');
526         jMenu6.setText("操作(O)");
527
528         jMenuItem7.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F5, java.awt.event.InputEvent.CTRL_MASK));
529         jMenuItem7.setMnemonic('U');
530         jMenuItem7.setText("今すぐ更新(U)");
531         jMenuItem7.addActionListener(new java.awt.event.ActionListener() {
532             public void actionPerformed(java.awt.event.ActionEvent evt) {
533                 jMenuItem7ActionPerformed(evt);
534             }
535         });
536         jMenu6.add(jMenuItem7);
537
538         jMenuItem8.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F5, java.awt.event.InputEvent.ALT_MASK));
539         jMenuItem8.setMnemonic('T');
540         jMenuItem8.setText("時間情報を更新(T)");
541         jMenuItem8.addActionListener(new java.awt.event.ActionListener() {
542             public void actionPerformed(java.awt.event.ActionEvent evt) {
543                 jMenuItem8ActionPerformed(evt);
544             }
545         });
546         jMenu6.add(jMenuItem8);
547
548         jMenuBar1.add(jMenu6);
549
550         jMenu4.setMnemonic('V');
551         jMenu4.setText("表示(V)");
552
553         jMenuItem5.setMnemonic('D');
554         jMenuItem5.setText("選択しているタブを削除(D)");
555         jMenuItem5.addActionListener(new java.awt.event.ActionListener() {
556             public void actionPerformed(java.awt.event.ActionEvent evt) {
557                 jMenuItem5ActionPerformed(evt);
558             }
559         });
560         jMenu4.add(jMenuItem5);
561
562         jMenuItem9.setText("Debug");
563         jMenuItem9.addActionListener(new java.awt.event.ActionListener() {
564             public void actionPerformed(java.awt.event.ActionEvent evt) {
565                 jMenuItem9ActionPerformed(evt);
566             }
567         });
568         jMenu4.add(jMenuItem9);
569
570         jMenuBar1.add(jMenu4);
571
572         jMenu5.setMnemonic('S');
573         jMenu5.setText("検索(S)");
574
575         jMenuItem6.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.CTRL_MASK));
576         jMenuItem6.setMnemonic('A');
577         jMenuItem6.setText("キーワードでTwitter全体を検索(A)");
578         jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
579             public void actionPerformed(java.awt.event.ActionEvent evt) {
580                 jMenuItem6ActionPerformed(evt);
581             }
582         });
583         jMenu5.add(jMenuItem6);
584
585         jMenuBar1.add(jMenu5);
586
587         jMenu2.setMnemonic('O');
588         jMenu2.setText("設定(O)");
589
590         jMenuItem2.setText("基本設定");
591         jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
592             public void actionPerformed(java.awt.event.ActionEvent evt) {
593                 jMenuItem2ActionPerformed(evt);
594             }
595         });
596         jMenu2.add(jMenuItem2);
597
598         jMenuItem4.setText("アカウント設定");
599         jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
600             public void actionPerformed(java.awt.event.ActionEvent evt) {
601                 jMenuItem4ActionPerformed(evt);
602             }
603         });
604         jMenu2.add(jMenuItem4);
605
606         jMenuBar1.add(jMenu2);
607
608         jMenu3.setMnemonic('H');
609         jMenu3.setText("ヘルプ(H)");
610
611         jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F1, 0));
612         jMenuItem3.setText("このプログラムについて");
613         jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
614             public void actionPerformed(java.awt.event.ActionEvent evt) {
615                 jMenuItem3ActionPerformed(evt);
616             }
617         });
618         jMenu3.add(jMenuItem3);
619
620         jMenuBar1.add(jMenu3);
621
622         setJMenuBar(jMenuBar1);
623
624         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
625         getContentPane().setLayout(layout);
626         layout.setHorizontalGroup(
627             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
628             .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 729, Short.MAX_VALUE)
629             .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
630             .addGroup(layout.createSequentialGroup()
631                 .addContainerGap()
632                 .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)
633                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
634                 .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)
635                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
636                 .addComponent(jToggleButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
637                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
638                 .addComponent(jToggleButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
639                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 30, Short.MAX_VALUE)
640                 .addComponent(jLabel15)
641                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
642                 .addComponent(tweetLengthLabel)
643                 .addGap(18, 18, 18)
644                 .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)
645                 .addContainerGap())
646             .addComponent(statusBar, javax.swing.GroupLayout.DEFAULT_SIZE, 729, Short.MAX_VALUE)
647             .addComponent(jScrollPane9, javax.swing.GroupLayout.DEFAULT_SIZE, 729, Short.MAX_VALUE)
648         );
649         layout.setVerticalGroup(
650             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
651             .addGroup(layout.createSequentialGroup()
652                 .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 281, Short.MAX_VALUE)
653                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
654                 .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
655                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
656                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
657                     .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
658                         .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 34, Short.MAX_VALUE)
659                         .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, 34, Short.MAX_VALUE))
660                     .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
661                         .addComponent(jLabel15)
662                         .addComponent(tweetLengthLabel)
663                         .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, 34, Short.MAX_VALUE)
664                         .addComponent(jToggleButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 34, Short.MAX_VALUE)
665                         .addComponent(jToggleButton2, javax.swing.GroupLayout.DEFAULT_SIZE, 34, Short.MAX_VALUE)))
666                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
667                 .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
668                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
669                 .addComponent(statusBar, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
670         );
671
672         pack();
673     }// </editor-fold>//GEN-END:initComponents
674
675     private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
676         // メッセージをつぶやく
677         mainAction.actionTweet();
678         updateLen();
679     }//GEN-LAST:event_jButton4ActionPerformed
680
681     private void jTableFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTableFocusGained
682         // まだ見ていないtweet数を0にする
683         mainAction.actionResetUncheckedTimelineTweetCount();
684     }//GEN-LAST:event_jTableFocusGained
685
686     private void jTableMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTableMousePressed
687         //右クリックメニュー表示
688         showPopup(evt);
689         mainAction.actionResetUncheckedTimelineTweetCount();
690     }//GEN-LAST:event_jTableMousePressed
691
692     private void jTableMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTableMouseReleased
693         //右クリックメニュー表示
694         showPopup(evt);
695     }//GEN-LAST:event_jTableMouseReleased
696
697     private void jTable1FocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTable1FocusGained
698         mainAction.actionResetUncheckedMentionTweetCount();
699     }//GEN-LAST:event_jTable1FocusGained
700
701     private void jTable1MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable1MousePressed
702         //右クリックメニュー表示
703         showPopup(evt);
704         mainAction.actionResetUncheckedMentionTweetCount();
705     }//GEN-LAST:event_jTable1MousePressed
706
707     private void jTable1MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable1MouseReleased
708         //右クリックメニュー表示
709         showPopup(evt);
710     }//GEN-LAST:event_jTable1MouseReleased
711
712     private void jTable2FocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTable2FocusGained
713         mainAction.actionResetUncheckedDirectMessageCount();
714     }//GEN-LAST:event_jTable2FocusGained
715
716     private void jTable2MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable2MousePressed
717         //右クリックメニュー表示
718         showPopup(evt);
719         mainAction.actionResetUncheckedDirectMessageCount();
720     }//GEN-LAST:event_jTable2MousePressed
721
722     private void jTable2MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable2MouseReleased
723         //右クリックメニュー表示
724         showPopup(evt);
725     }//GEN-LAST:event_jTable2MouseReleased
726
727     private void tweetMessageBoxComponentResized(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_tweetMessageBoxComponentResized
728     }//GEN-LAST:event_tweetMessageBoxComponentResized
729
730     private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
731         mainAction.actionUpdateButton(evt);
732         // いますぐ更新ボタンを押したので,更新タイムを一度リセットする
733         mainAction.resetTweetAutoUpdate();
734     }//GEN-LAST:event_jButton1ActionPerformed
735
736     private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
737         // tweet取得時間情報を更新
738         mainAction.actionRefreshTime();
739     }//GEN-LAST:event_jButton2ActionPerformed
740
741     private void jToggleButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton1ActionPerformed
742         // 詳細情報ボタンを押した時の動作
743         mainAction.actionDetailInfoButton(evt);
744     }//GEN-LAST:event_jToggleButton1ActionPerformed
745
746     private void jTextPaneKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextPaneKeyReleased
747         // 残りつぶやける文字数情報を更新
748         mainAction.actionUpdateTweetMessageCount();
749     }//GEN-LAST:event_jTextPaneKeyReleased
750
751     private void jTextPaneFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextPaneFocusGained
752         updateLen();
753     }//GEN-LAST:event_jTextPaneFocusGained
754
755     private void jTextPaneFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextPaneFocusLost
756         updateLen();
757     }//GEN-LAST:event_jTextPaneFocusLost
758
759     private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
760         // 終了動作
761         mainAction.actionExitButton(evt);
762     }//GEN-LAST:event_jMenuItem1ActionPerformed
763
764     private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
765         // 基本設定ダイアログを開く
766         mainAction.actionBasicSettingDialog();
767     }//GEN-LAST:event_jMenuItem2ActionPerformed
768
769     private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
770         mainAction.actionShowAboutDialog();
771     }//GEN-LAST:event_jMenuItem3ActionPerformed
772
773     private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
774         mainAction.actionShowAccountDialog();
775     }//GEN-LAST:event_jMenuItem4ActionPerformed
776
777     private void jToggleButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton2ActionPerformed
778         mainAction.actionShowTweetboxButton(evt);
779         this.invalidate();
780         this.validate();
781     }//GEN-LAST:event_jToggleButton2ActionPerformed
782
783     private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem5ActionPerformed
784         //選択しているタブを削除
785         mainAction.actionRemoveFocusedTabbedTable();
786     }//GEN-LAST:event_jMenuItem5ActionPerformed
787
788     private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
789         this.mainAction.actionShowKeywordSearchDialog();
790     }//GEN-LAST:event_jMenuItem6ActionPerformed
791
792     private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem7ActionPerformed
793         mainAction.actionUpdateButton(evt);
794         // いますぐ更新ボタンを押したので,更新タイムを一度リセットする
795         mainAction.resetTweetAutoUpdate();
796     }//GEN-LAST:event_jMenuItem7ActionPerformed
797
798     private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem8ActionPerformed
799         // tweet取得時間情報を更新
800         mainAction.actionRefreshTime();
801     }//GEN-LAST:event_jMenuItem8ActionPerformed
802
803     private void jMenuItem9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem9ActionPerformed
804         mainAction.actionAddMentionTab(60);
805         mainAction.actionAddTimelineTab(60);
806         mainAction.actionAddDirectMessageTab(60);
807         mainAction.actionAddSendDirectMessageTab(60);
808     }//GEN-LAST:event_jMenuItem9ActionPerformed
809
810     /**
811      *
812      */
813     private void updateLen() {
814         // 残りつぶやける文字数情報を更新
815         mainAction.actionUpdateTweetMessageCount();
816     }
817
818     /**
819      * ポップアップメニューを作成
820      * @param e
821      */
822     private void showPopup(MouseEvent e) {
823         if (e.isPopupTrigger()) {
824             // 右クリックのメニューを表示
825             getRightClickPopup().show(e.getComponent(), e.getX(),
826                     e.getY());
827         }
828     }
829
830     /**
831      * @param args the command line arguments
832      */
833     public static void main(String args[]) {
834         java.awt.EventQueue.invokeLater(new Runnable() {
835
836             @Override
837             public void run() {
838                 try {
839                     // UIをシステム標準のものとする
840                     UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
841
842                 } catch (Exception e) {
843                     e.printStackTrace();
844                 }
845                 new NishioTweetManager().setVisible(true);
846             }
847         });
848     }
849
850     /**
851      * Twitter初期化
852      */
853     private void init() {
854         // twitterログイン
855         boolean login = false;
856         try {
857             tweetManager.loginTwitter();
858             login = true;
859         } catch (Exception e) {
860             e.printStackTrace();
861         }
862
863         // メインアクション初期化
864         mainAction = new TweetMainAction(this, tweetManager, statusBar,
865                 tweetTableModel, mentionTableModel, messageTableModel,
866                 sendMessageTableModel, jTable, jTable1, jTable2, jTable3,
867                 jTextPane, jScrollPane9, tweetLengthLabel, jPanel1, jTabbedPane1, tweetMessageBox, userImageLabel,
868                 userNameLabel, updateTimeLabel, followerLabel, followingLabel, locationLabel,
869                 clientNameLabel, updateLabel, userIntroBox, userWebBox);
870         // 自動更新開始
871         mainAction.startTweetAutoUpdate();
872         //もしログインに失敗したら,アカウント設定画面を出す
873         if (login == false) {
874             mainAction.actionShowAccountDialog();
875         }
876         //テーブル生成
877         createTweetTable(jTable);
878         createTweetTable(jTable1);
879         createTweetTable(jTable2);
880         createTweetTable(jTable3);
881     }
882
883     /**
884      * Tweetを表示するテーブルを作成
885      *
886      * @param model
887      * @return
888      */
889     private void createTweetTable(final JTable table) {
890
891         table.setAutoResizeMode(JTable.AUTO_RESIZE_NEXT_COLUMN);
892         table.setShowVerticalLines(false);
893         table.setShowHorizontalLines(true);
894
895         // Comment部分のColumnを複数行コメントが表示できるようにする
896         TableColumnModel mdl = table.getColumnModel();
897         TableColumn col = mdl.getColumn(1);
898         TweetCommentRenderer commentRenderer = new TweetCommentRenderer();
899         col.setCellRenderer(commentRenderer);
900         // INfo部分のColumnを複数行表示できるように
901         TweetCommentRenderer infoRenderer = new TweetCommentRenderer();
902         col = mdl.getColumn(2);
903         col.setCellRenderer(infoRenderer);
904         col.setMaxWidth(200);
905         col.setMinWidth(150);
906         // TODO:とりあえず幅指定した部分
907         // あとでファイルに幅情報などを保存しておき,それを読み込んで設定するような仕様に変更する
908         // ユーザImageを表示する部分
909         col = mdl.getColumn(0);
910         col.setCellRenderer(new UserImageRenderer());
911         col.setMinWidth(50);
912         col.setMaxWidth(50);
913         // 選択したセルの情報をDetailInfoへと表示
914         table.getSelectionModel().addListSelectionListener(
915                 new ListSelectionListener() {
916
917                     @Override
918                     public void valueChanged(ListSelectionEvent e) {
919
920                         if (e.getValueIsAdjusting()) {
921                             return;
922                         }
923
924                         //テーブルで選択した要素を詳細情報として表示
925                         mainAction.setDetailInformationFromTable(table);
926                     }
927                 });
928         // JTableを右クリックでも選択できるようにする
929         // また,同じ行を2回クリックできるようにする
930         table.addMouseListener(new MouseAdapter() {
931
932             @Override
933             public void mousePressed(MouseEvent e) {
934                 // いったんSelectしていた情報を削除
935                 table.clearSelection();
936                 // if (e.getButton() == MouseEvent.BUTTON3) {
937                 Point p = e.getPoint();
938                 int col = table.columnAtPoint(p);
939                 int row = table.rowAtPoint(p);
940                 table.changeSelection(row, col, false, false);
941                 // }
942             }
943         });
944         // MouseEventを追加
945         table.addMouseListener(commentRenderer);
946         table.addMouseMotionListener(commentRenderer);
947         table.addMouseListener(infoRenderer);
948         table.addMouseMotionListener(infoRenderer);
949     }
950
951     /**
952      * 右クリックを押した時のポップアップメニューを取得
953      *
954      * @return
955      */
956     private JPopupMenu getRightClickPopup() {
957         if (rightClickPopup == null) {
958             rightClickPopup = new JPopupMenu();
959             JMenuItem directMessageMenuItem = new JMenuItem("ダイレクトメッセージを送信");
960             directMessageMenuItem.addActionListener(new java.awt.event.ActionListener() {
961
962                 public void actionPerformed(java.awt.event.ActionEvent e) {
963                     // ダイレクトメッセージ送信ダイアログを表示
964                     mainAction.actionShowDirectMessageDialog();
965                 }
966             });
967             rightClickPopup.add(directMessageMenuItem);
968             JMenuItem retweetMenuItem = new JMenuItem("発言を公式リツイート");
969             retweetMenuItem.addActionListener(new java.awt.event.ActionListener() {
970
971                 public void actionPerformed(java.awt.event.ActionEvent e) {
972                     // 選択したセルのステータスをRetweet
973                     mainAction.actionRetweet();
974                 }
975             });
976             rightClickPopup.add(retweetMenuItem);
977             JMenuItem quoteMenuItem = new JMenuItem("発言をコメント付きリツイート");
978             quoteMenuItem.addActionListener(new java.awt.event.ActionListener() {
979
980                 public void actionPerformed(java.awt.event.ActionEvent e) {
981                     // 選択したセルのステータスをコメント付Retweet
982                     mainAction.actionCopySelectedStatusToTweetBoxPane();
983                 }
984             });
985             rightClickPopup.add(quoteMenuItem);
986
987             JMenuItem statusBrowserMenuItem = new JMenuItem("発言をブラウザで開く");
988             statusBrowserMenuItem.addActionListener(new java.awt.event.ActionListener() {
989
990                 public void actionPerformed(java.awt.event.ActionEvent e) {
991                     // 選択したセルのステータスをブラウザで開く
992                     mainAction.actionOpenStatusURL();
993                 }
994             });
995             rightClickPopup.add(statusBrowserMenuItem);
996
997             JMenuItem openBrowserUserInformationMenuItem = new JMenuItem(
998                     "この人のTimelineをブラウザで開く");
999             openBrowserUserInformationMenuItem.addActionListener(new java.awt.event.ActionListener() {
1000
1001                 public void actionPerformed(java.awt.event.ActionEvent e) {
1002                     // 選択したセルのユーザ情報をブラウザで開く
1003                     mainAction.actionOpenUserURL();
1004                 }
1005             });
1006             rightClickPopup.add(openBrowserUserInformationMenuItem);
1007         }
1008         return rightClickPopup;
1009     }
1010     //nishio tweet manager
1011     private JPopupMenu rightClickPopup = null;
1012     private TweetMainAction mainAction = null;
1013     // TweetManager
1014     private TweetManager tweetManager = new TweetManager();
1015     //TableModel
1016     private TweetTableModel tweetTableModel = new TweetTableModel();
1017     private TweetTableModel mentionTableModel = new TweetTableModel();
1018     private TweetTableModel messageTableModel = new TweetTableModel();
1019     private TweetTableModel sendMessageTableModel = new TweetTableModel();
1020     // Variables declaration - do not modify//GEN-BEGIN:variables
1021     private javax.swing.JEditorPane clientNameLabel;
1022     private javax.swing.JLabel followerLabel;
1023     private javax.swing.JLabel followingLabel;
1024     private javax.swing.JButton jButton1;
1025     private javax.swing.JButton jButton2;
1026     private javax.swing.JButton jButton4;
1027     private javax.swing.JLabel jLabel12;
1028     private javax.swing.JLabel jLabel13;
1029     private javax.swing.JLabel jLabel15;
1030     private javax.swing.JLabel jLabel3;
1031     private javax.swing.JLabel jLabel4;
1032     private javax.swing.JLabel jLabel5;
1033     private javax.swing.JLabel jLabel9;
1034     private javax.swing.JMenu jMenu1;
1035     private javax.swing.JMenu jMenu2;
1036     private javax.swing.JMenu jMenu3;
1037     private javax.swing.JMenu jMenu4;
1038     private javax.swing.JMenu jMenu5;
1039     private javax.swing.JMenu jMenu6;
1040     private javax.swing.JMenuBar jMenuBar1;
1041     private javax.swing.JMenuItem jMenuItem1;
1042     private javax.swing.JMenuItem jMenuItem2;
1043     private javax.swing.JMenuItem jMenuItem3;
1044     private javax.swing.JMenuItem jMenuItem4;
1045     private javax.swing.JMenuItem jMenuItem5;
1046     private javax.swing.JMenuItem jMenuItem6;
1047     private javax.swing.JMenuItem jMenuItem7;
1048     private javax.swing.JMenuItem jMenuItem8;
1049     private javax.swing.JMenuItem jMenuItem9;
1050     private javax.swing.JPanel jPanel1;
1051     private javax.swing.JScrollPane jScrollPane1;
1052     private javax.swing.JScrollPane jScrollPane2;
1053     private javax.swing.JScrollPane jScrollPane3;
1054     private javax.swing.JScrollPane jScrollPane4;
1055     private javax.swing.JScrollPane jScrollPane5;
1056     private javax.swing.JScrollPane jScrollPane6;
1057     private javax.swing.JScrollPane jScrollPane7;
1058     private javax.swing.JScrollPane jScrollPane8;
1059     private javax.swing.JScrollPane jScrollPane9;
1060     private javax.swing.JTabbedPane jTabbedPane1;
1061     private javax.swing.JTable jTable;
1062     private javax.swing.JTable jTable1;
1063     private javax.swing.JTable jTable2;
1064     private javax.swing.JTable jTable3;
1065     private javax.swing.JTextPane jTextPane;
1066     private javax.swing.JToggleButton jToggleButton1;
1067     private javax.swing.JToggleButton jToggleButton2;
1068     private javax.swing.JLabel locationLabel;
1069     private javax.swing.JLabel statusBar;
1070     private javax.swing.JLabel tweetLengthLabel;
1071     private javax.swing.JEditorPane tweetMessageBox;
1072     private javax.swing.JLabel updateLabel;
1073     private javax.swing.JLabel updateTimeLabel;
1074     private javax.swing.JLabel userImageLabel;
1075     private javax.swing.JEditorPane userIntroBox;
1076     private javax.swing.JLabel userNameLabel;
1077     private javax.swing.JEditorPane userWebBox;
1078     // End of variables declaration//GEN-END:variables
1079 }