OSDN Git Service

詳細表示ボタンを押したときに、発言したユーザのイメージと発言も消えてしまう問題を解決
[nt-manager/nt-manager.git] / src / twitter / gui / form / NishioTweetManager.java
index e994732..1e0dc4d 100644 (file)
@@ -44,12 +44,13 @@ import twitter.manage.ClientVersionManager;
 import twitter.manage.TweetManager;
 import twitter.manage.VersionInfo;
 import twitter.task.TimerID;
+import twitter4j.ConnectionLifeCycleListener;
 
 /**
  *
  * @author nishio
  */
-public class NishioTweetManager extends javax.swing.JFrame {
+public class NishioTweetManager extends javax.swing.JFrame implements ConnectionLifeCycleListener{
 
        private SystemTray systemTray;
        private TrayIcon trayIcon;
@@ -133,7 +134,11 @@ public class NishioTweetManager extends javax.swing.JFrame {
 
                //tweet発言するボックスの右クリック対応
                this.jTextPane.setComponentPopupMenu(
-                               new TweetTextFieldPopupMenu( this.jTextPane ) );
+                               new TweetTextFieldPopupMenu( this.jTextPane, false ) );
+               this.tweetMessageBox.setComponentPopupMenu(
+                               new TweetTextFieldPopupMenu( this.tweetMessageBox, true) );
+               this.userIntroBox.setComponentPopupMenu(
+                               new TweetTextFieldPopupMenu(this.userIntroBox, true));
        }
 
        /**
@@ -148,9 +153,6 @@ public class NishioTweetManager extends javax.swing.JFrame {
 
         jTabbedPane1 = new twitter.gui.component.DnDTabbedPane();
         jPanel1 = new javax.swing.JPanel();
-        userImageLabel = new javax.swing.JLabel();
-        jScrollPane5 = new javax.swing.JScrollPane();
-        tweetMessageBox = new javax.swing.JEditorPane();
         jLabel3 = new javax.swing.JLabel();
         jLabel4 = new javax.swing.JLabel();
         jLabel5 = new javax.swing.JLabel();
@@ -171,6 +173,7 @@ public class NishioTweetManager extends javax.swing.JFrame {
         clientNameLabel = new javax.swing.JEditorPane();
         jPanel2 = new javax.swing.JPanel();
         statusBar = new javax.swing.JLabel();
+        streamingLabel = new javax.swing.JLabel();
         jToolBar1 = new javax.swing.JToolBar();
         jButton1 = new javax.swing.JButton();
         jSeparator1 = new javax.swing.JToolBar.Separator();
@@ -189,6 +192,10 @@ public class NishioTweetManager extends javax.swing.JFrame {
         jButton4 = new javax.swing.JButton();
         tweetLengthLabel = new javax.swing.JLabel();
         jLabel15 = new javax.swing.JLabel();
+        jPanel4 = new javax.swing.JPanel();
+        userImageLabel = new javax.swing.JLabel();
+        jScrollPane5 = new javax.swing.JScrollPane();
+        tweetMessageBox = new javax.swing.JEditorPane();
         jMenuBar1 = new javax.swing.JMenuBar();
         jMenu1 = new javax.swing.JMenu();
         jMenuItem1 = new javax.swing.JMenuItem();
@@ -244,6 +251,7 @@ public class NishioTweetManager extends javax.swing.JFrame {
         logSaveCheckItem = new javax.swing.JCheckBoxMenuItem();
         jMenuItem32 = new javax.swing.JMenuItem();
         jMenu9 = new javax.swing.JMenu();
+        isUsingStreamingMenuItem = new javax.swing.JCheckBoxMenuItem();
         jMenu3 = new javax.swing.JMenu();
         jMenuItem3 = new javax.swing.JMenuItem();
 
@@ -258,21 +266,6 @@ public class NishioTweetManager extends javax.swing.JFrame {
 
         jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
 
-        userImageLabel.setBackground(java.awt.Color.black);
-        userImageLabel.setOpaque(true);
-
-        jScrollPane5.setHorizontalScrollBar(null);
-
-        tweetMessageBox.setContentType("text/html");
-        tweetMessageBox.setEditable(false);
-        tweetMessageBox.addComponentListener(new java.awt.event.ComponentAdapter() {
-            public void componentResized(java.awt.event.ComponentEvent evt) {
-                tweetMessageBoxComponentResized(evt);
-            }
-        });
-        tweetMessageBox.addHyperlinkListener(hashTagHyperlinkListener);
-        jScrollPane5.setViewportView(tweetMessageBox);
-
         jLabel3.setText("ユーザ名");
 
         jLabel4.setText("更新日");
@@ -359,17 +352,17 @@ public class NishioTweetManager extends javax.swing.JFrame {
         jPanel1Layout.setHorizontalGroup(
             jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             .addGroup(jPanel1Layout.createSequentialGroup()
-                .addComponent(userImageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
-                .addGap(3, 3, 3)
-                .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 666, Short.MAX_VALUE))
-            .addGroup(jPanel1Layout.createSequentialGroup()
-                .addContainerGap()
                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                     .addGroup(jPanel1Layout.createSequentialGroup()
+                        .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)
+                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                        .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE))
+                    .addGroup(jPanel1Layout.createSequentialGroup()
+                        .addContainerGap()
                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                             .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                             .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-                            .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+                            .addComponent(jLabel3))
                         .addGap(18, 18, 18)
                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                             .addComponent(locationLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE)
@@ -384,23 +377,17 @@ public class NishioTweetManager extends javax.swing.JFrame {
                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                             .addComponent(updateLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                             .addComponent(followerLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 68, Short.MAX_VALUE)
-                            .addComponent(followingLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
-                    .addGroup(jPanel1Layout.createSequentialGroup()
-                        .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)
-                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                        .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE)))
+                            .addComponent(followingLabel))))
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 282, Short.MAX_VALUE))
+                .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 293, Short.MAX_VALUE))
         );
         jPanel1Layout.setVerticalGroup(
             jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             .addGroup(jPanel1Layout.createSequentialGroup()
-                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-                    .addComponent(userImageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
-                    .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE))
-                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-                    .addGroup(jPanel1Layout.createSequentialGroup()
+                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
+                    .addComponent(jScrollPane6)
+                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
+                        .addContainerGap()
                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                             .addGroup(jPanel1Layout.createSequentialGroup()
                                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
@@ -426,12 +413,11 @@ public class NishioTweetManager extends javax.swing.JFrame {
                                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                     .addComponent(jLabel13)
                                     .addComponent(updateLabel))))
-                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                        .addGap(9, 9, 9)
                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                             .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
-                            .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)))
-                    .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE))
-                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+                            .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))))
+                .addContainerGap(2, Short.MAX_VALUE))
         );
 
         jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
@@ -443,15 +429,25 @@ public class NishioTweetManager extends javax.swing.JFrame {
             }
         });
 
+        streamingLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
+        streamingLabel.setText("StreamingAPI停止中");
+        streamingLabel.setBorder(javax.swing.BorderFactory.createEtchedBorder());
+        streamingLabel.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
+
         javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
         jPanel2.setLayout(jPanel2Layout);
         jPanel2Layout.setHorizontalGroup(
             jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addComponent(statusBar, javax.swing.GroupLayout.PREFERRED_SIZE, 707, javax.swing.GroupLayout.PREFERRED_SIZE)
+            .addGroup(jPanel2Layout.createSequentialGroup()
+                .addComponent(statusBar, javax.swing.GroupLayout.DEFAULT_SIZE, 553, Short.MAX_VALUE)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(streamingLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE))
         );
         jPanel2Layout.setVerticalGroup(
             jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addComponent(statusBar, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 20, Short.MAX_VALUE)
+            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                .addComponent(statusBar, javax.swing.GroupLayout.DEFAULT_SIZE, 20, Short.MAX_VALUE)
+                .addComponent(streamingLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 20, Short.MAX_VALUE))
         );
 
         jToolBar1.setRollover(true);
@@ -592,7 +588,7 @@ public class NishioTweetManager extends javax.swing.JFrame {
         jPanel3Layout.setHorizontalGroup(
             jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
-                .addComponent(jScrollPane9, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)
+                .addComponent(jScrollPane9, javax.swing.GroupLayout.DEFAULT_SIZE, 528, Short.MAX_VALUE)
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                     .addComponent(jLabel15)
@@ -610,12 +606,42 @@ public class NishioTweetManager extends javax.swing.JFrame {
                         .addComponent(jLabel15)
                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                         .addComponent(tweetLengthLabel)))
-                .addGap(48, 48, 48))
+                .addGap(38, 38, 38))
             .addGroup(jPanel3Layout.createSequentialGroup()
-                .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
         );
 
+        userImageLabel.setBackground(java.awt.Color.black);
+        userImageLabel.setOpaque(true);
+
+        jScrollPane5.setHorizontalScrollBar(null);
+
+        tweetMessageBox.setContentType("text/html");
+        tweetMessageBox.setEditable(false);
+        tweetMessageBox.addComponentListener(new java.awt.event.ComponentAdapter() {
+            public void componentResized(java.awt.event.ComponentEvent evt) {
+                tweetMessageBoxComponentResized(evt);
+            }
+        });
+        tweetMessageBox.addHyperlinkListener(hashTagHyperlinkListener);
+        jScrollPane5.setViewportView(tweetMessageBox);
+
+        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
+        jPanel4.setLayout(jPanel4Layout);
+        jPanel4Layout.setHorizontalGroup(
+            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(jPanel4Layout.createSequentialGroup()
+                .addComponent(userImageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 667, Short.MAX_VALUE))
+        );
+        jPanel4Layout.setVerticalGroup(
+            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 58, Short.MAX_VALUE)
+            .addComponent(userImageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
+        );
+
         jMenu1.setMnemonic('F');
         /*
         org.openide.awt.Mnemonics.setLocalizedText(jMenu1, "ファイル(F)");
@@ -1047,6 +1073,16 @@ public class NishioTweetManager extends javax.swing.JFrame {
         jMenuBar1.add(jMenu8);
 
         jMenu9.setText("ストリーミング");
+
+        isUsingStreamingMenuItem.setSelected(true);
+        isUsingStreamingMenuItem.setText("ストリーミングAPIを利用する");
+        isUsingStreamingMenuItem.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                isUsingStreamingMenuItemActionPerformed(evt);
+            }
+        });
+        jMenu9.add(isUsingStreamingMenuItem);
+
         jMenuBar1.add(jMenu9);
 
         jMenu3.setMnemonic('H');
@@ -1069,23 +1105,26 @@ public class NishioTweetManager extends javax.swing.JFrame {
         getContentPane().setLayout(layout);
         layout.setHorizontalGroup(
             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, 721, Short.MAX_VALUE)
-            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-            .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 721, Short.MAX_VALUE)
             .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-            .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 721, Short.MAX_VALUE)
+            .addComponent(jPanel4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+            .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 720, Short.MAX_VALUE)
+            .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 720, Short.MAX_VALUE)
+            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
         );
         layout.setVerticalGroup(
             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
-                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 321, Short.MAX_VALUE)
-                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 434, Short.MAX_VALUE)
+                .addGap(1, 1, 1)
+                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addGap(2, 2, 2)
+                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
-                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
-                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addGap(1, 1, 1)
+                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addGap(1, 1, 1)
                 .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
         );
 
@@ -1116,37 +1155,45 @@ public class NishioTweetManager extends javax.swing.JFrame {
             mainAction.actionOpenFollower();
         }//GEN-LAST:event_jMenuItem36ActionPerformed
 
-private void logSaveCheckItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_logSaveCheckItemActionPerformed
-    mainAction.setSaveLog(this.logSaveCheckItem.getState());
+    private void logSaveCheckItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_logSaveCheckItemActionPerformed
+       mainAction.setSaveLog(this.logSaveCheckItem.getState());
         try {
             mainAction.saveProperties();
         } catch (IOException ex) {
             Logger.getLogger(NishioTweetManager.class.getName()).log(Level.SEVERE, null, ex);
         }
-}//GEN-LAST:event_logSaveCheckItemActionPerformed
+    }//GEN-LAST:event_logSaveCheckItemActionPerformed
+
+    private void isUsingStreamingMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_isUsingStreamingMenuItemActionPerformed
+       if( mainAction.isUsingStreaming() ) {
+           mainAction.stopStreaming();
+       }else {
+           mainAction.startStreaming();
+       }
+    }//GEN-LAST:event_isUsingStreamingMenuItemActionPerformed
 
-       private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jButton4ActionPerformed
-               // メッセージをつぶやく
-               mainAction.actionTweet();
-               updateLen();
-       }// GEN-LAST:event_jButton4ActionPerformed
+    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jButton4ActionPerformed
+       // メッセージをつぶやく
+       mainAction.actionTweet();
+       updateLen();
+    }// GEN-LAST:event_jButton4ActionPerformed
 
-       private void tweetMessageBoxComponentResized(
-                       java.awt.event.ComponentEvent evt) {// GEN-FIRST:event_tweetMessageBoxComponentResized
-       }// GEN-LAST:event_tweetMessageBoxComponentResized
+    private void tweetMessageBoxComponentResized(
+                                                java.awt.event.ComponentEvent evt) {// GEN-FIRST:event_tweetMessageBoxComponentResized
+    }// GEN-LAST:event_tweetMessageBoxComponentResized
 
-       private void jTextPaneKeyReleased(java.awt.event.KeyEvent evt) {// GEN-FIRST:event_jTextPaneKeyReleased
-               // 残りつぶやける文字数情報を更新
-               mainAction.actionUpdateTweetMessageCount();
-       }// GEN-LAST:event_jTextPaneKeyReleased
+    private void jTextPaneKeyReleased(java.awt.event.KeyEvent evt) {// GEN-FIRST:event_jTextPaneKeyReleased
+       // 残りつぶやける文字数情報を更新
+       mainAction.actionUpdateTweetMessageCount();
+    }// GEN-LAST:event_jTextPaneKeyReleased
 
-       private void jTextPaneFocusGained(java.awt.event.FocusEvent evt) {// GEN-FIRST:event_jTextPaneFocusGained
-               updateLen();
-       }// GEN-LAST:event_jTextPaneFocusGained
+    private void jTextPaneFocusGained(java.awt.event.FocusEvent evt) {// GEN-FIRST:event_jTextPaneFocusGained
+       updateLen();
+    }// GEN-LAST:event_jTextPaneFocusGained
 
-       private void jTextPaneFocusLost(java.awt.event.FocusEvent evt) {// GEN-FIRST:event_jTextPaneFocusLost
-               updateLen();
-       }// GEN-LAST:event_jTextPaneFocusLost
+    private void jTextPaneFocusLost(java.awt.event.FocusEvent evt) {// GEN-FIRST:event_jTextPaneFocusLost
+       updateLen();
+    }// GEN-LAST:event_jTextPaneFocusLost
 
        private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jMenuItem1ActionPerformed
                // 終了動作
@@ -1515,6 +1562,13 @@ private void logSaveCheckItemActionPerformed(java.awt.event.ActionEvent evt) {//
                 }catch(Exception e) {
                     e.printStackTrace();
                 }
+
+               //Streaming APIを利用しているかどうかを表示
+               this.tweetManager.getStreamManager().addCollectionLifeCycleListener(this);
+               //streaming利用時はstreamingを開始する
+               if( this.mainAction.isUsingStreaming() ) {
+                   this.mainAction.startStreaming();
+               }
        }
 
        /**
@@ -1532,6 +1586,29 @@ private void logSaveCheckItemActionPerformed(java.awt.event.ActionEvent evt) {//
                 logSaveCheckItem.setSelected(mainAction.isSaveLog());
                // TL表示
                mainAction.updateCheckboxInformation();
+               //streaming apiを利用するかどうか
+               isUsingStreamingMenuItem.setSelected(mainAction.isUsingStreaming());
+       }
+
+       /**
+        * streaming api接続時
+        */
+       public void onConnect() {
+           streamingLabel.setText("StreamingAPI開始");
+       }
+
+       /**
+        * streaming api接続解除時
+        */
+       public void onDisconnect() {
+           streamingLabel.setText("StreamingAPI停止中");
+       }
+
+       /**
+        * streaming apiクリーンアップ時
+        */
+       public void onCleanUp() {
+           //nothing
        }
 
        // nishio tweet manager
@@ -1543,6 +1620,7 @@ private void logSaveCheckItemActionPerformed(java.awt.event.ActionEvent evt) {//
     private javax.swing.JEditorPane clientNameLabel;
     private javax.swing.JLabel followerLabel;
     private javax.swing.JLabel followingLabel;
+    private javax.swing.JCheckBoxMenuItem isUsingStreamingMenuItem;
     private javax.swing.JButton jButton1;
     private javax.swing.JButton jButton2;
     private javax.swing.JButton jButton4;
@@ -1608,6 +1686,7 @@ private void logSaveCheckItemActionPerformed(java.awt.event.ActionEvent evt) {//
     private javax.swing.JPanel jPanel1;
     private javax.swing.JPanel jPanel2;
     private javax.swing.JPanel jPanel3;
+    private javax.swing.JPanel jPanel4;
     private javax.swing.JScrollPane jScrollPane5;
     private javax.swing.JScrollPane jScrollPane6;
     private javax.swing.JScrollPane jScrollPane7;
@@ -1632,6 +1711,7 @@ private void logSaveCheckItemActionPerformed(java.awt.event.ActionEvent evt) {//
     private javax.swing.JLabel locationLabel;
     private javax.swing.JCheckBoxMenuItem logSaveCheckItem;
     private javax.swing.JLabel statusBar;
+    private javax.swing.JLabel streamingLabel;
     private javax.swing.JLabel tweetLengthLabel;
     private javax.swing.JEditorPane tweetMessageBox;
     private javax.swing.JLabel updateLabel;
@@ -1641,4 +1721,5 @@ private void logSaveCheckItemActionPerformed(java.awt.event.ActionEvent evt) {//
     private javax.swing.JLabel userNameLabel;
     private javax.swing.JEditorPane userWebBox;
     // End of variables declaration//GEN-END:variables
+
 }