import twitter.gui.form.HashtagSearchDialog;
import twitter.gui.form.KeywordSearchDialog;
import twitter.gui.form.OutputCSVLogDialog;
+import twitter.gui.form.UpdateNotifyDialog;
import twitter.gui.form.UserListDialog;
import twitter.gui.form.UserSearchDialog;
import twitter.log.TwitterLogManager;
private boolean isTempOpenedSendDMTab = true;
//ログを保存するかどうか
private boolean saveLog = false;
+ //update通知をするかどうか
+ private boolean isUpdateNotify = true;
// Tweetの詳細情報を表示する部分
private JLabel userImageLabel = null;
// 新しく取得したtweetでまだ参照していない数
private int uncheckedTimelineTweetCount = 0;
private AboutDialog aboutDialog = null;
+ //update dialog
+ private UpdateNotifyDialog updateDialog = null;
// アカウント情報表示ダイアログ
private AccountDialog accountDialog;
// ツイートを表示するテーブル管理
// dialog.setLocation(loc);
dialog.setVisible(true);
}
+
+ /**
+ * 最新クライアント情報通知ダイアログを表示
+ */
+ public void actionShowUpdateDialog() {
+ UpdateNotifyDialog dialog = getUpdateNotifyDialog();
+ dialog.setLocationRelativeTo(null);
+ dialog.setVisible(true);
+ }
/**
* アカウントダイアログを表示
}
return aboutDialog;
}
+
+ /**
+ * update dialog
+ * @return
+ */
+ public UpdateNotifyDialog getUpdateNotifyDialog() {
+ if( updateDialog == null ) {
+ updateDialog = new UpdateNotifyDialog(mainFrame, true, this);
+ }
+ return updateDialog;
+ }
/**
* テーブルで選択した場所のTweet情報を取得
//表示可能ツイート数
String nost = this.property.getProperty("numOfShowTweet");
+
+ //最新クライアント情報を通知するか
+ String unt = this.property.getProperty("updateNotify");
+ if( unt == null ) {
+ unt = this.isUpdateNotify + "";
+ }
try {
this.newTableColor = new Color(Integer.parseInt(ntrgb));
//表示可能ツイート数
this.tableElementMaxSize = Integer.parseInt(nost);
+
+ //update notify
+ this.isUpdateNotify = Boolean.parseBoolean(unt);
} catch (NumberFormatException e) {
e.printStackTrace();
}
//テーブルに表示可能なツイートの数
this.property.setProperty("numOfShowTweet", this.getTableElementMaxSize() + "");
+
+ //update notify
+ this.property.setProperty("updateNotify", this.isUpdateNotify + "");
// プロパティのリストを保存
property.store(new FileOutputStream("./" + PROPERTIES_DIRECTORY + "/"
public void setNotifyDirectMessage(boolean notify) {
this.isNotifyDirectMessage = notify;
}
+
+ /**
+ * 最新クライアント情報を通知するかどうか
+ */
+ public boolean isUpdateNotify() {
+ return this.isUpdateNotify;
+ }
+
+ /**
+ * 最新クライアント情報を通知するかどうか設定
+ */
+ public void setUpdateNotify(boolean notify) {
+ this.isUpdateNotify = notify;
+ }
/**
*
*/
package twitter.gui.form;
+import java.awt.Desktop;
+import java.io.IOException;
+import java.net.URL;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import twitter.gui.action.TweetMainAction;
+import twitter.manage.ClientVersionManager;
+import twitter.manage.VersionInfo;
+
/**
*
* @author nishio
public class UpdateNotifyDialog extends javax.swing.JDialog {
/** Creates new form UpdateNotifyDialog */
- public UpdateNotifyDialog(java.awt.Frame parent, boolean modal) {
+ public UpdateNotifyDialog(java.awt.Frame parent, boolean modal, TweetMainAction mainAction) {
super(parent, modal);
initComponents();
+ this.mainAction = mainAction;
+ init();
+ }
+
+ /**
+ * 初期化
+ */
+ public void init() {
+ ClientVersionManager version = ClientVersionManager.getInstance();
+ //現在のバージョン
+ this.jLabel4.setText(version.getCurrentversion());
+ latest = version.getLatestVersionInfo();
+ if( latest != null ) {
+ String newVersion = latest.getVersion();
+ this.jLabel5.setText(newVersion);
+ String log = latest.getLog();
+ jTextArea1.setText(log);
+ }
}
/** This method is called from within the constructor to
jScrollPane1.setViewportView(jTextArea1);
jButton1.setText("サイトへ移動");
+ jButton1.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jButton1ActionPerformed(evt);
+ }
+ });
jButton2.setText("了解");
+ jButton2.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jButton2ActionPerformed(evt);
+ }
+ });
jCheckBox1.setText("次回からアップデート通知を行わない");
+ jCheckBox1.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jCheckBox1ActionPerformed(evt);
+ }
+ });
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
pack();
}// </editor-fold>//GEN-END:initComponents
- /**
- * @param args the command line arguments
- */
- public static void main(String args[]) {
- /* Set the Nimbus look and feel */
- //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
- /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
- * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
- */
+private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
+ boolean update = jCheckBox1.isSelected();
+ this.mainAction.setUpdateNotify(!update);
try {
- for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
- if ("Nimbus".equals(info.getName())) {
- javax.swing.UIManager.setLookAndFeel(info.getClassName());
- break;
- }
- }
- } catch (ClassNotFoundException ex) {
- java.util.logging.Logger.getLogger(UpdateNotifyDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (InstantiationException ex) {
- java.util.logging.Logger.getLogger(UpdateNotifyDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (IllegalAccessException ex) {
- java.util.logging.Logger.getLogger(UpdateNotifyDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (javax.swing.UnsupportedLookAndFeelException ex) {
- java.util.logging.Logger.getLogger(UpdateNotifyDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ this.mainAction.saveProperties();
+ } catch (IOException ex) {
+ Logger.getLogger(UpdateNotifyDialog.class.getName()).log(Level.SEVERE, null, ex);
}
- //</editor-fold>
-
- /* Create and display the dialog */
- java.awt.EventQueue.invokeLater(new Runnable() {
-
- public void run() {
- UpdateNotifyDialog dialog = new UpdateNotifyDialog(new javax.swing.JFrame(), true);
- dialog.addWindowListener(new java.awt.event.WindowAdapter() {
-
- @Override
- public void windowClosing(java.awt.event.WindowEvent e) {
- System.exit(0);
- }
- });
- dialog.setVisible(true);
- }
- });
+ this.setVisible(false);
+}//GEN-LAST:event_jButton2ActionPerformed
+
+private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox1ActionPerformed
+// TODO add your handling code here:
+}//GEN-LAST:event_jCheckBox1ActionPerformed
+
+private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
+ try {
+ // クリック時
+ ClientVersionManager version = ClientVersionManager.getInstance();
+ URL url = new URL( version.getNishiotweetmanagerurl() );
+ // デフォルトのブラウザを使ってリンク先を表示
+ Desktop dp = Desktop.getDesktop();
+ dp.browse(url.toURI());
+ } catch (Exception ex) {
+ ex.printStackTrace();
}
+}//GEN-LAST:event_jButton1ActionPerformed
+
+ private TweetMainAction mainAction = null;
+ //latestVersion
+ private VersionInfo latest = null;
+
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;