2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
7 * NishioTweetManager.java
9 * Created on 2010/09/06, 3:32:04
11 package twitter.gui.form;
13 import java.awt.AWTException;
14 import java.awt.Image;
15 import java.awt.MenuItem;
16 import java.awt.PopupMenu;
17 import java.awt.SystemTray;
18 import java.awt.TrayIcon;
19 import java.awt.event.ActionEvent;
20 import java.awt.event.ActionListener;
21 import java.awt.event.MouseAdapter;
22 import java.awt.event.MouseEvent;
23 import java.awt.image.BufferedImage;
25 import java.util.logging.Level;
26 import java.util.logging.Logger;
27 import javax.swing.ImageIcon;
28 import javax.swing.JButton;
29 import javax.swing.JFrame;
30 import javax.swing.JPopupMenu;
31 import javax.swing.UIManager;
32 import javax.swing.WindowConstants;
33 import javax.swing.text.Style;
34 import javax.swing.text.StyleConstants;
35 import javax.swing.text.html.HTMLDocument;
36 import javax.swing.text.html.StyleSheet;
37 import twitter.gui.action.TweetMainAction;
38 import twitter.gui.component.TweetHashtagHyperlinkHandler;
39 import twitter.gui.component.TweetHyperlinkHandler;
40 import twitter.manage.TweetManager;
41 import twitter.task.TimerID;
47 public class NishioTweetManager extends javax.swing.JFrame {
49 private SystemTray systemTray;
50 private TrayIcon trayIcon;
51 private TweetHashtagHyperlinkHandler hashTagHyperlinkListener = new TweetHashtagHyperlinkHandler();
53 /** Creates new form NishioTweetManager */
54 public NishioTweetManager() {
61 updateSelectedInformation();
67 private void initComponents2() {
71 /*URL resource = getClass().getResource("icon.png");
72 image = new ImageIcon(resource).getImage();*/
73 image = new ImageIcon("resources/icon.png").getImage();
75 this.setIconImage(image);
76 } catch (Exception e) {
78 image = new BufferedImage(32, 32, BufferedImage.TYPE_INT_RGB);
81 systemTray = SystemTray.getSystemTray();
82 final JFrame frame = this;
83 final PopupMenu popup = new PopupMenu();
84 trayIcon = new TrayIcon(image, "Nishio Tweet Manager", popup);
86 //左クリックした時に「画面を開く」アクションをする
87 trayIcon.addMouseListener(new MouseAdapter() {
90 public void mousePressed(MouseEvent me) {
92 if (me.getButton() == MouseEvent.BUTTON1) {
93 frame.setVisible(true);
99 MenuItem item1 = new MenuItem("画面を開く");
100 item1.addActionListener(new ActionListener() {
103 public void actionPerformed(ActionEvent e) {
104 frame.setVisible(true);
107 MenuItem item2 = new MenuItem("終了");
108 item2.addActionListener(new ActionListener() {
111 public void actionPerformed(ActionEvent e) {
112 systemTray.remove(trayIcon);
113 frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
122 systemTray.add(trayIcon);
123 } catch (AWTException e) {
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.
134 @SuppressWarnings("unchecked")
135 // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
136 private void initComponents() {
138 jTabbedPane1 = new twitter.gui.component.DnDTabbedPane();
139 jPanel1 = new javax.swing.JPanel();
140 userImageLabel = new javax.swing.JLabel();
141 jScrollPane5 = new javax.swing.JScrollPane();
142 tweetMessageBox = new javax.swing.JEditorPane();
143 jLabel3 = new javax.swing.JLabel();
144 jLabel4 = new javax.swing.JLabel();
145 jLabel5 = new javax.swing.JLabel();
146 userNameLabel = new javax.swing.JLabel();
147 updateTimeLabel = new javax.swing.JLabel();
148 locationLabel = new javax.swing.JLabel();
149 jLabel9 = new javax.swing.JLabel();
150 followingLabel = new javax.swing.JLabel();
151 followerLabel = new javax.swing.JLabel();
152 jLabel12 = new javax.swing.JLabel();
153 jLabel13 = new javax.swing.JLabel();
154 updateLabel = new javax.swing.JLabel();
155 jScrollPane6 = new javax.swing.JScrollPane();
156 userIntroBox = new javax.swing.JEditorPane();
157 jScrollPane7 = new javax.swing.JScrollPane();
158 userWebBox = new javax.swing.JEditorPane();
159 jScrollPane8 = new javax.swing.JScrollPane();
160 clientNameLabel = new javax.swing.JEditorPane();
161 jPanel2 = new javax.swing.JPanel();
162 statusBar = new javax.swing.JLabel();
163 jToolBar1 = new javax.swing.JToolBar();
164 jButton1 = new javax.swing.JButton();
165 jSeparator1 = new javax.swing.JToolBar.Separator();
166 jButton2 = new javax.swing.JButton();
167 jSeparator2 = new javax.swing.JToolBar.Separator();
168 jToggleButton1 = new javax.swing.JToggleButton();
169 jToggleButton2 = new javax.swing.JToggleButton();
170 jSeparator3 = new javax.swing.JToolBar.Separator();
171 jToggleButton3 = new javax.swing.JToggleButton();
172 jToggleButton4 = new javax.swing.JToggleButton();
173 jToggleButton5 = new javax.swing.JToggleButton();
174 jToggleButton6 = new javax.swing.JToggleButton();
175 jPanel3 = new javax.swing.JPanel();
176 jScrollPane9 = new javax.swing.JScrollPane();
177 jTextPane = new javax.swing.JTextPane();
178 jButton4 = new javax.swing.JButton();
179 tweetLengthLabel = new javax.swing.JLabel();
180 jLabel15 = new javax.swing.JLabel();
181 jMenuBar1 = new javax.swing.JMenuBar();
182 jMenu1 = new javax.swing.JMenu();
183 jMenuItem1 = new javax.swing.JMenuItem();
184 jMenu6 = new javax.swing.JMenu();
185 jMenuItem10 = new javax.swing.JMenuItem();
186 jMenuItem7 = new javax.swing.JMenuItem();
187 jMenuItem8 = new javax.swing.JMenuItem();
188 jSeparator4 = new javax.swing.JPopupMenu.Separator();
189 jMenuItem11 = new javax.swing.JMenuItem();
190 jMenuItem12 = new javax.swing.JMenuItem();
191 jMenuItem13 = new javax.swing.JMenuItem();
192 jMenuItem15 = new javax.swing.JMenuItem();
193 jMenuItem14 = new javax.swing.JMenuItem();
194 jMenuItem16 = new javax.swing.JMenuItem();
195 jSeparator5 = new javax.swing.JPopupMenu.Separator();
196 jMenuItem17 = new javax.swing.JMenuItem();
197 jMenuItem18 = new javax.swing.JMenuItem();
198 jMenuItem21 = new javax.swing.JMenuItem();
199 jSeparator6 = new javax.swing.JPopupMenu.Separator();
200 jMenuItem19 = new javax.swing.JMenuItem();
201 jMenuItem20 = new javax.swing.JMenuItem();
202 jMenuItem22 = new javax.swing.JMenuItem();
203 jMenu4 = new javax.swing.JMenu();
204 jMenuItem5 = new javax.swing.JMenuItem();
205 jCheckBoxMenuItem1 = new javax.swing.JCheckBoxMenuItem();
206 jCheckBoxMenuItem2 = new javax.swing.JCheckBoxMenuItem();
207 jCheckBoxMenuItem3 = new javax.swing.JCheckBoxMenuItem();
208 jCheckBoxMenuItem4 = new javax.swing.JCheckBoxMenuItem();
209 jCheckBoxMenuItem5 = new javax.swing.JCheckBoxMenuItem();
210 jCheckBoxMenuItem6 = new javax.swing.JCheckBoxMenuItem();
211 jMenuItem9 = new javax.swing.JMenuItem();
212 jMenu5 = new javax.swing.JMenu();
213 jMenuItem6 = new javax.swing.JMenuItem();
214 jMenuItem23 = new javax.swing.JMenuItem();
215 jMenu2 = new javax.swing.JMenu();
216 jMenuItem2 = new javax.swing.JMenuItem();
217 jMenuItem4 = new javax.swing.JMenuItem();
218 jMenu3 = new javax.swing.JMenu();
219 jMenuItem3 = new javax.swing.JMenuItem();
221 setTitle("Nishio Tweet Manager");
223 jTabbedPane1.addContainerListener(new java.awt.event.ContainerAdapter() {
224 public void componentRemoved(java.awt.event.ContainerEvent evt) {
225 jTabbedPane1ComponentRemoved(evt);
229 jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
231 userImageLabel.setBackground(java.awt.Color.black);
232 userImageLabel.setOpaque(true);
234 jScrollPane5.setHorizontalScrollBar(null);
236 tweetMessageBox.setContentType("text/html");
237 tweetMessageBox.setEditable(false);
238 tweetMessageBox.addComponentListener(new java.awt.event.ComponentAdapter() {
239 public void componentResized(java.awt.event.ComponentEvent evt) {
240 tweetMessageBoxComponentResized(evt);
243 tweetMessageBox.addHyperlinkListener(hashTagHyperlinkListener);
244 jScrollPane5.setViewportView(tweetMessageBox);
246 jLabel3.setText("ユーザ名");
248 jLabel4.setText("更新日");
250 jLabel5.setText("現在地");
252 userNameLabel.setText("UserName");
254 updateTimeLabel.setText("Date");
256 locationLabel.setText("Information");
258 jLabel9.setText("Following");
260 followingLabel.setText("0");
262 followerLabel.setText("0");
264 jLabel12.setText("Follower");
266 jLabel13.setText("更新回数");
268 updateLabel.setText("0");
270 jScrollPane6.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
272 userIntroBox.setContentType("text/html");
273 userIntroBox.setEditable(false);
274 userIntroBox.setMinimumSize(new java.awt.Dimension(120, 20));
275 jScrollPane6.setViewportView(userIntroBox);
277 jScrollPane7.setBorder(null);
278 jScrollPane7.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
279 jScrollPane7.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
281 userWebBox.setBorder(null);
282 userWebBox.setContentType("text/html");
283 userWebBox.setEditable(false);
284 userWebBox.setEditable(false);
285 userWebBox.addHyperlinkListener(new TweetHyperlinkHandler());
288 HTMLDocument doc = (HTMLDocument) userWebBox.getDocument();
289 StyleSheet[] style = doc.getStyleSheet().getStyleSheets();
290 for (int i = style.length - 1; i >= 0; i--) {
291 Style body = style[i].getStyle("body");
293 // TODO: change default font size
294 StyleConstants.setFontSize(body, 13);
297 } catch (Exception e) {
300 jScrollPane7.setViewportView(userWebBox);
302 jScrollPane8.setBorder(null);
303 jScrollPane8.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
304 jScrollPane8.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
306 clientNameLabel.setBorder(null);
307 clientNameLabel.setContentType("text/html");
308 clientNameLabel.setEditable(false);
309 clientNameLabel.setEditable(false);
310 clientNameLabel.addHyperlinkListener(new TweetHyperlinkHandler());
313 HTMLDocument doc = (HTMLDocument) clientNameLabel.getDocument();
314 StyleSheet[] style = doc.getStyleSheet().getStyleSheets();
315 for (int i = style.length - 1; i >= 0; i--) {
316 Style body = style[i].getStyle("body");
318 // TODO: default font size
319 StyleConstants.setFontSize(body, 13);
322 } catch (Exception e) {
325 jScrollPane8.setViewportView(clientNameLabel);
327 javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
328 jPanel1.setLayout(jPanel1Layout);
329 jPanel1Layout.setHorizontalGroup(
330 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
331 .addGroup(jPanel1Layout.createSequentialGroup()
332 .addComponent(userImageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
334 .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 656, Short.MAX_VALUE))
335 .addGroup(jPanel1Layout.createSequentialGroup()
337 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
338 .addGroup(jPanel1Layout.createSequentialGroup()
339 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
340 .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
341 .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
342 .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
344 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
345 .addComponent(locationLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE)
346 .addComponent(userNameLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE)
347 .addComponent(updateTimeLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE))
348 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
349 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
350 .addComponent(jLabel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
351 .addComponent(jLabel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
352 .addComponent(jLabel9))
354 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
355 .addComponent(updateLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
356 .addComponent(followerLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 68, Short.MAX_VALUE)
357 .addComponent(followingLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
358 .addGroup(jPanel1Layout.createSequentialGroup()
359 .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)
360 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
361 .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE)))
362 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
363 .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 274, Short.MAX_VALUE))
365 jPanel1Layout.setVerticalGroup(
366 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
367 .addGroup(jPanel1Layout.createSequentialGroup()
368 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
369 .addComponent(userImageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
370 .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE))
371 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
372 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
373 .addGroup(jPanel1Layout.createSequentialGroup()
374 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
375 .addGroup(jPanel1Layout.createSequentialGroup()
376 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
377 .addComponent(jLabel3)
378 .addComponent(userNameLabel))
379 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
380 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
381 .addComponent(jLabel4)
382 .addComponent(updateTimeLabel))
383 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
384 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
385 .addComponent(jLabel5)
386 .addComponent(locationLabel)))
387 .addGroup(jPanel1Layout.createSequentialGroup()
388 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
389 .addComponent(jLabel9)
390 .addComponent(followingLabel))
391 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
392 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
393 .addComponent(jLabel12)
394 .addComponent(followerLabel))
395 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
396 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
397 .addComponent(jLabel13)
398 .addComponent(updateLabel))))
399 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
400 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
401 .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
402 .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)))
403 .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE))
404 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
407 jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
409 statusBar.setText("Status");
410 statusBar.setBorder(null);
411 statusBar.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
412 public void propertyChange(java.beans.PropertyChangeEvent evt) {
413 statusBarPropertyChange(evt);
417 javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
418 jPanel2.setLayout(jPanel2Layout);
419 jPanel2Layout.setHorizontalGroup(
420 jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
421 .addComponent(statusBar, javax.swing.GroupLayout.PREFERRED_SIZE, 707, javax.swing.GroupLayout.PREFERRED_SIZE)
423 jPanel2Layout.setVerticalGroup(
424 jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
425 .addComponent(statusBar, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 20, Short.MAX_VALUE)
428 jToolBar1.setRollover(true);
430 jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/toolbarButtonGraphics/general/Refresh24.gif"))); // NOI18N
431 jButton1.setToolTipText("今すぐ更新");
432 jButton1.setFocusable(false);
433 jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
434 jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
435 jButton1.addActionListener(new java.awt.event.ActionListener() {
436 public void actionPerformed(java.awt.event.ActionEvent evt) {
437 jButton1ActionPerformed(evt);
440 jToolBar1.add(jButton1);
441 jToolBar1.add(jSeparator1);
443 jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/toolbarButtonGraphics/general/Find24.gif"))); // NOI18N
444 jButton2.setFocusable(false);
445 jButton2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
446 jButton2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
447 jButton2.addActionListener(new java.awt.event.ActionListener() {
448 public void actionPerformed(java.awt.event.ActionEvent evt) {
449 jButton2ActionPerformed(evt);
452 jToolBar1.add(jButton2);
453 jToolBar1.add(jSeparator2);
455 jToggleButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resource/syousai.PNG"))); // NOI18N
456 jToggleButton1.setSelected(true);
457 jToggleButton1.setFocusable(false);
458 jToggleButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
459 jToggleButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
460 jToggleButton1.addActionListener(new java.awt.event.ActionListener() {
461 public void actionPerformed(java.awt.event.ActionEvent evt) {
462 jToggleButton1ActionPerformed(evt);
465 jToolBar1.add(jToggleButton1);
467 jToggleButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resource/write.PNG"))); // NOI18N
468 jToggleButton2.setSelected(true);
469 jToggleButton2.setFocusable(false);
470 jToggleButton2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
471 jToggleButton2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
472 jToggleButton2.addActionListener(new java.awt.event.ActionListener() {
473 public void actionPerformed(java.awt.event.ActionEvent evt) {
474 jToggleButton2ActionPerformed(evt);
477 jToolBar1.add(jToggleButton2);
478 jToolBar1.add(jSeparator3);
480 jToggleButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resource/timeline.PNG"))); // NOI18N
481 jToggleButton3.setFocusable(false);
482 jToggleButton3.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
483 jToggleButton3.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
484 jToggleButton3.addActionListener(new java.awt.event.ActionListener() {
485 public void actionPerformed(java.awt.event.ActionEvent evt) {
486 jToggleButton3ActionPerformed(evt);
489 jToolBar1.add(jToggleButton3);
491 jToggleButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resource/mention.PNG"))); // NOI18N
492 jToggleButton4.setFocusable(false);
493 jToggleButton4.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
494 jToggleButton4.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
495 jToggleButton4.addActionListener(new java.awt.event.ActionListener() {
496 public void actionPerformed(java.awt.event.ActionEvent evt) {
497 jToggleButton4ActionPerformed(evt);
500 jToolBar1.add(jToggleButton4);
502 jToggleButton5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resource/directmessage.PNG"))); // NOI18N
503 jToggleButton5.setFocusable(false);
504 jToggleButton5.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
505 jToggleButton5.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
506 jToggleButton5.addActionListener(new java.awt.event.ActionListener() {
507 public void actionPerformed(java.awt.event.ActionEvent evt) {
508 jToggleButton5ActionPerformed(evt);
511 jToolBar1.add(jToggleButton5);
513 jToggleButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resource/sendMessage.PNG"))); // NOI18N
514 jToggleButton6.setFocusable(false);
515 jToggleButton6.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
516 jToggleButton6.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
517 jToggleButton6.addActionListener(new java.awt.event.ActionListener() {
518 public void actionPerformed(java.awt.event.ActionEvent evt) {
519 jToggleButton6ActionPerformed(evt);
522 jToolBar1.add(jToggleButton6);
524 jScrollPane9.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
525 jScrollPane9.setMaximumSize(new java.awt.Dimension(32767, 80));
526 jScrollPane9.setMinimumSize(new java.awt.Dimension(26, 80));
528 jTextPane.setMaximumSize(new java.awt.Dimension(2147483647, 20));
529 jTextPane.addCaretListener(new javax.swing.event.CaretListener() {
530 public void caretUpdate(javax.swing.event.CaretEvent evt) {
531 jTextPaneCaretUpdate(evt);
534 jTextPane.addFocusListener(new java.awt.event.FocusAdapter() {
535 public void focusGained(java.awt.event.FocusEvent evt) {
536 jTextPaneFocusGained(evt);
538 public void focusLost(java.awt.event.FocusEvent evt) {
539 jTextPaneFocusLost(evt);
542 jTextPane.addKeyListener(new java.awt.event.KeyAdapter() {
543 public void keyReleased(java.awt.event.KeyEvent evt) {
544 jTextPaneKeyReleased(evt);
547 jScrollPane9.setViewportView(jTextPane);
549 jButton4.setText("つぶやく");
550 jButton4.addActionListener(new java.awt.event.ActionListener() {
551 public void actionPerformed(java.awt.event.ActionEvent evt) {
552 jButton4ActionPerformed(evt);
556 tweetLengthLabel.setText("140");
558 jLabel15.setText("残り文字数");
560 javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
561 jPanel3.setLayout(jPanel3Layout);
562 jPanel3Layout.setHorizontalGroup(
563 jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
564 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
565 .addComponent(jScrollPane9, javax.swing.GroupLayout.DEFAULT_SIZE, 498, Short.MAX_VALUE)
566 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
567 .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
568 .addComponent(jLabel15)
569 .addComponent(tweetLengthLabel))
570 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
571 .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)
574 jPanel3Layout.setVerticalGroup(
575 jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
576 .addGroup(jPanel3Layout.createSequentialGroup()
577 .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
578 .addComponent(jButton4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 34, Short.MAX_VALUE)
579 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup()
580 .addComponent(jLabel15)
581 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
582 .addComponent(tweetLengthLabel)))
584 .addGroup(jPanel3Layout.createSequentialGroup()
585 .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)
586 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
589 jMenu1.setMnemonic('F');
591 org.openide.awt.Mnemonics.setLocalizedText(jMenu1, "ファイル(F)");
593 jMenu1.setText("ファイル(F)");
595 jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, java.awt.event.InputEvent.CTRL_MASK));
596 jMenuItem1.setMnemonic('X');
597 jMenuItem1.setText("終了(X)");
598 jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
599 public void actionPerformed(java.awt.event.ActionEvent evt) {
600 jMenuItem1ActionPerformed(evt);
603 jMenu1.add(jMenuItem1);
605 jMenuBar1.add(jMenu1);
607 jMenu6.setMnemonic('O');
608 jMenu6.setText("操作(O)");
610 jMenuItem10.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F5, 0));
611 jMenuItem10.setMnemonic('U');
612 jMenuItem10.setText("今すぐ更新(U)");
613 jMenuItem10.addActionListener(new java.awt.event.ActionListener() {
614 public void actionPerformed(java.awt.event.ActionEvent evt) {
615 jMenuItem10ActionPerformed(evt);
618 jMenu6.add(jMenuItem10);
620 jMenuItem7.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F5, java.awt.event.InputEvent.CTRL_MASK));
621 jMenuItem7.setMnemonic('A');
622 jMenuItem7.setText("すべての情報を今すぐ更新(A)");
623 jMenuItem7.addActionListener(new java.awt.event.ActionListener() {
624 public void actionPerformed(java.awt.event.ActionEvent evt) {
625 jMenuItem7ActionPerformed(evt);
628 jMenu6.add(jMenuItem7);
630 jMenuItem8.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F5, java.awt.event.InputEvent.ALT_MASK));
631 jMenuItem8.setMnemonic('I');
632 jMenuItem8.setText("時間情報を更新(I)");
633 jMenuItem8.addActionListener(new java.awt.event.ActionListener() {
634 public void actionPerformed(java.awt.event.ActionEvent evt) {
635 jMenuItem8ActionPerformed(evt);
638 jMenu6.add(jMenuItem8);
639 jMenu6.add(jSeparator4);
641 jMenuItem11.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, java.awt.event.InputEvent.CTRL_MASK));
642 jMenuItem11.setMnemonic('R');
643 jMenuItem11.setText("発言に返信(Reply)");
644 jMenuItem11.addActionListener(new java.awt.event.ActionListener() {
645 public void actionPerformed(java.awt.event.ActionEvent evt) {
646 jMenuItem11ActionPerformed(evt);
649 jMenu6.add(jMenuItem11);
651 jMenuItem12.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
652 jMenuItem12.setMnemonic('A');
653 jMenuItem12.setText("発言に返信(Reply All)");
654 jMenuItem12.addActionListener(new java.awt.event.ActionListener() {
655 public void actionPerformed(java.awt.event.ActionEvent evt) {
656 jMenuItem12ActionPerformed(evt);
659 jMenu6.add(jMenuItem12);
661 jMenuItem13.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, java.awt.event.InputEvent.CTRL_MASK));
662 jMenuItem13.setMnemonic('T');
663 jMenuItem13.setText("発言を公式リツイート(RT)");
664 jMenuItem13.addActionListener(new java.awt.event.ActionListener() {
665 public void actionPerformed(java.awt.event.ActionEvent evt) {
666 jMenuItem13ActionPerformed(evt);
669 jMenu6.add(jMenuItem13);
671 jMenuItem15.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
672 jMenuItem15.setText("発言をコメント付リツイート(非公式RT)");
673 jMenuItem15.addActionListener(new java.awt.event.ActionListener() {
674 public void actionPerformed(java.awt.event.ActionEvent evt) {
675 jMenuItem15ActionPerformed(evt);
678 jMenu6.add(jMenuItem15);
680 jMenuItem14.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, java.awt.event.InputEvent.CTRL_MASK));
681 jMenuItem14.setMnemonic('Q');
682 jMenuItem14.setText("発言を引用ツイート(QT)");
683 jMenuItem14.addActionListener(new java.awt.event.ActionListener() {
684 public void actionPerformed(java.awt.event.ActionEvent evt) {
685 jMenuItem14ActionPerformed(evt);
688 jMenu6.add(jMenuItem14);
690 jMenuItem16.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_D, java.awt.event.InputEvent.CTRL_MASK));
691 jMenuItem16.setMnemonic('D');
692 jMenuItem16.setText("ダイレクトメッセージを送信(D)");
693 jMenuItem16.addActionListener(new java.awt.event.ActionListener() {
694 public void actionPerformed(java.awt.event.ActionEvent evt) {
695 jMenuItem16ActionPerformed(evt);
698 jMenu6.add(jMenuItem16);
699 jMenu6.add(jSeparator5);
701 jMenuItem17.setText("選択した発言をブラウザで開く");
702 jMenuItem17.addActionListener(new java.awt.event.ActionListener() {
703 public void actionPerformed(java.awt.event.ActionEvent evt) {
704 jMenuItem17ActionPerformed(evt);
707 jMenu6.add(jMenuItem17);
709 jMenuItem18.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
710 jMenuItem18.setMnemonic('S');
711 jMenuItem18.setText("選択した人の発言を別タブで開く(S)");
712 jMenuItem18.addActionListener(new java.awt.event.ActionListener() {
713 public void actionPerformed(java.awt.event.ActionEvent evt) {
714 jMenuItem18ActionPerformed(evt);
717 jMenu6.add(jMenuItem18);
719 jMenuItem21.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_B, java.awt.event.InputEvent.CTRL_MASK));
720 jMenuItem21.setMnemonic('B');
721 jMenuItem21.setText("選択した人の発言をブラウザで開く(B)");
722 jMenuItem21.addActionListener(new java.awt.event.ActionListener() {
723 public void actionPerformed(java.awt.event.ActionEvent evt) {
724 jMenuItem21ActionPerformed(evt);
727 jMenu6.add(jMenuItem21);
728 jMenu6.add(jSeparator6);
730 jMenuItem19.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_MASK));
731 jMenuItem19.setMnemonic('F');
732 jMenuItem19.setText("選択した発言をお気に入りに追加(F)");
733 jMenuItem19.addActionListener(new java.awt.event.ActionListener() {
734 public void actionPerformed(java.awt.event.ActionEvent evt) {
735 jMenuItem19ActionPerformed(evt);
738 jMenu6.add(jMenuItem19);
740 jMenuItem20.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
741 jMenuItem20.setText("選択した発言をお気に入りから削除");
742 jMenuItem20.addActionListener(new java.awt.event.ActionListener() {
743 public void actionPerformed(java.awt.event.ActionEvent evt) {
744 jMenuItem20ActionPerformed(evt);
747 jMenu6.add(jMenuItem20);
749 jMenuItem22.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.ALT_MASK));
750 jMenuItem22.setText("選択したユーザのお気に入りを開く");
751 jMenuItem22.addActionListener(new java.awt.event.ActionListener() {
752 public void actionPerformed(java.awt.event.ActionEvent evt) {
753 jMenuItem22ActionPerformed(evt);
756 jMenu6.add(jMenuItem22);
758 jMenuBar1.add(jMenu6);
760 jMenu4.setMnemonic('V');
761 jMenu4.setText("表示(V)");
763 jMenuItem5.setMnemonic('D');
764 jMenuItem5.setText("選択しているタブを削除(D)");
765 jMenuItem5.addActionListener(new java.awt.event.ActionListener() {
766 public void actionPerformed(java.awt.event.ActionEvent evt) {
767 jMenuItem5ActionPerformed(evt);
770 jMenu4.add(jMenuItem5);
772 jCheckBoxMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_I, java.awt.event.InputEvent.CTRL_MASK));
773 jCheckBoxMenuItem1.setMnemonic('I');
774 jCheckBoxMenuItem1.setSelected(true);
775 jCheckBoxMenuItem1.setText("詳細情報ボタンの表示(I)");
776 jCheckBoxMenuItem1.addActionListener(new java.awt.event.ActionListener() {
777 public void actionPerformed(java.awt.event.ActionEvent evt) {
778 jCheckBoxMenuItem1ActionPerformed(evt);
781 jMenu4.add(jCheckBoxMenuItem1);
783 jCheckBoxMenuItem2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W, java.awt.event.InputEvent.CTRL_MASK));
784 jCheckBoxMenuItem2.setMnemonic('W');
785 jCheckBoxMenuItem2.setSelected(true);
786 jCheckBoxMenuItem2.setText("書き込みボタンの表示(W)");
787 jCheckBoxMenuItem2.addActionListener(new java.awt.event.ActionListener() {
788 public void actionPerformed(java.awt.event.ActionEvent evt) {
789 jCheckBoxMenuItem2ActionPerformed(evt);
792 jMenu4.add(jCheckBoxMenuItem2);
794 jCheckBoxMenuItem3.setSelected(true);
795 jCheckBoxMenuItem3.setText("Timelineタブを表示");
796 jCheckBoxMenuItem3.addActionListener(new java.awt.event.ActionListener() {
797 public void actionPerformed(java.awt.event.ActionEvent evt) {
798 jCheckBoxMenuItem3ActionPerformed(evt);
801 jMenu4.add(jCheckBoxMenuItem3);
803 jCheckBoxMenuItem4.setSelected(true);
804 jCheckBoxMenuItem4.setText("Mentionタブを表示");
805 jCheckBoxMenuItem4.addActionListener(new java.awt.event.ActionListener() {
806 public void actionPerformed(java.awt.event.ActionEvent evt) {
807 jCheckBoxMenuItem4ActionPerformed(evt);
810 jMenu4.add(jCheckBoxMenuItem4);
812 jCheckBoxMenuItem5.setSelected(true);
813 jCheckBoxMenuItem5.setText("ダイレクトメッセージタブを表示");
814 jCheckBoxMenuItem5.addActionListener(new java.awt.event.ActionListener() {
815 public void actionPerformed(java.awt.event.ActionEvent evt) {
816 jCheckBoxMenuItem5ActionPerformed(evt);
819 jMenu4.add(jCheckBoxMenuItem5);
821 jCheckBoxMenuItem6.setSelected(true);
822 jCheckBoxMenuItem6.setText("送信済みメッセージタブの表示");
823 jCheckBoxMenuItem6.addActionListener(new java.awt.event.ActionListener() {
824 public void actionPerformed(java.awt.event.ActionEvent evt) {
825 jCheckBoxMenuItem6ActionPerformed(evt);
828 jMenu4.add(jCheckBoxMenuItem6);
830 jMenuItem9.setText("Debug");
831 jMenuItem9.addActionListener(new java.awt.event.ActionListener() {
832 public void actionPerformed(java.awt.event.ActionEvent evt) {
833 jMenuItem9ActionPerformed(evt);
836 jMenu4.add(jMenuItem9);
838 jMenuBar1.add(jMenu4);
840 jMenu5.setMnemonic('S');
841 jMenu5.setText("検索(S)");
843 jMenuItem6.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.CTRL_MASK));
844 jMenuItem6.setMnemonic('A');
845 jMenuItem6.setText("キーワードでTwitter全体を検索(A)");
846 jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
847 public void actionPerformed(java.awt.event.ActionEvent evt) {
848 jMenuItem6ActionPerformed(evt);
851 jMenu5.add(jMenuItem6);
853 jMenuItem23.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_H, java.awt.event.InputEvent.CTRL_MASK));
854 jMenuItem23.setMnemonic('K');
855 jMenuItem23.setText("キーワードに関連するハッシュタグを検索(K)");
856 jMenuItem23.addActionListener(new java.awt.event.ActionListener() {
857 public void actionPerformed(java.awt.event.ActionEvent evt) {
858 jMenuItem23ActionPerformed(evt);
861 jMenu5.add(jMenuItem23);
863 jMenuBar1.add(jMenu5);
865 jMenu2.setMnemonic('O');
866 jMenu2.setText("設定(O)");
868 jMenuItem2.setText("基本設定");
869 jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
870 public void actionPerformed(java.awt.event.ActionEvent evt) {
871 jMenuItem2ActionPerformed(evt);
874 jMenu2.add(jMenuItem2);
876 jMenuItem4.setText("アカウント設定");
877 jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
878 public void actionPerformed(java.awt.event.ActionEvent evt) {
879 jMenuItem4ActionPerformed(evt);
882 jMenu2.add(jMenuItem4);
884 jMenuBar1.add(jMenu2);
886 jMenu3.setMnemonic('H');
887 jMenu3.setText("ヘルプ(H)");
889 jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F1, 0));
890 jMenuItem3.setText("このプログラムについて");
891 jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
892 public void actionPerformed(java.awt.event.ActionEvent evt) {
893 jMenuItem3ActionPerformed(evt);
896 jMenu3.add(jMenuItem3);
898 jMenuBar1.add(jMenu3);
900 setJMenuBar(jMenuBar1);
902 javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
903 getContentPane().setLayout(layout);
904 layout.setHorizontalGroup(
905 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
906 .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
907 .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
908 .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 711, Short.MAX_VALUE)
909 .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
910 .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 711, Short.MAX_VALUE)
912 layout.setVerticalGroup(
913 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
914 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
915 .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 321, Short.MAX_VALUE)
916 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
917 .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
918 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
919 .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
920 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
921 .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
922 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
923 .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
927 }// </editor-fold>//GEN-END:initComponents
929 private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
931 mainAction.actionTweet();
933 }//GEN-LAST:event_jButton4ActionPerformed
935 private void tweetMessageBoxComponentResized(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_tweetMessageBoxComponentResized
936 }//GEN-LAST:event_tweetMessageBoxComponentResized
938 private void jTextPaneKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextPaneKeyReleased
940 mainAction.actionUpdateTweetMessageCount();
941 }//GEN-LAST:event_jTextPaneKeyReleased
943 private void jTextPaneFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextPaneFocusGained
945 }//GEN-LAST:event_jTextPaneFocusGained
947 private void jTextPaneFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextPaneFocusLost
949 }//GEN-LAST:event_jTextPaneFocusLost
951 private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
953 mainAction.actionExitButton(evt);
954 }//GEN-LAST:event_jMenuItem1ActionPerformed
956 private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
958 mainAction.actionBasicSettingDialog();
959 }//GEN-LAST:event_jMenuItem2ActionPerformed
961 private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
962 mainAction.actionShowAboutDialog();
963 }//GEN-LAST:event_jMenuItem3ActionPerformed
965 private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
966 mainAction.actionShowAccountDialog();
967 }//GEN-LAST:event_jMenuItem4ActionPerformed
969 private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem5ActionPerformed
971 mainAction.actionRemoveFocusedTabbedTable();
972 }//GEN-LAST:event_jMenuItem5ActionPerformed
974 private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
975 this.mainAction.actionShowKeywordSearchDialog();
976 }//GEN-LAST:event_jMenuItem6ActionPerformed
978 private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem7ActionPerformed
979 mainAction.actionUpdateButton(evt);
980 // いますぐ更新ボタンを押したので,更新タイムを一度リセットする
981 // mainAction.resetTweetAutoUpdate();
982 }//GEN-LAST:event_jMenuItem7ActionPerformed
984 private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem8ActionPerformed
986 mainAction.actionRefreshTime();
987 }//GEN-LAST:event_jMenuItem8ActionPerformed
989 private void jMenuItem9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem9ActionPerformed
990 mainAction.information("とても長い文章のテストとても長い文章のテストとても長い文章のテストとても長い文章のテストとても長い文章のテストとても長い文章のテスト");
991 }//GEN-LAST:event_jMenuItem9ActionPerformed
993 private void jTextPaneCaretUpdate(javax.swing.event.CaretEvent evt) {//GEN-FIRST:event_jTextPaneCaretUpdate
994 // TODO add your handling code here:
995 }//GEN-LAST:event_jTextPaneCaretUpdate
997 private void statusBarPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_statusBarPropertyChange
999 }//GEN-LAST:event_statusBarPropertyChange
1001 private void jMenuItem10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem10ActionPerformed
1003 mainAction.actionFocusedTableUpdate();
1004 }//GEN-LAST:event_jMenuItem10ActionPerformed
1006 private void jCheckBoxMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxMenuItem1ActionPerformed
1008 mainAction.actionDetailInfoButton(evt);
1009 jCheckBoxMenuItem1.setSelected( mainAction.isDetailInfoPanelVisible() );
1010 jToggleButton1.setSelected( mainAction.isDetailInfoPanelVisible() );
1011 }//GEN-LAST:event_jCheckBoxMenuItem1ActionPerformed
1013 private void jCheckBoxMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxMenuItem2ActionPerformed
1015 mainAction.actionShowTweetboxButton(evt);
1019 jCheckBoxMenuItem2.setSelected( mainAction.isShowTweetBoxVisible() );
1020 jToggleButton2.setSelected( mainAction.isShowTweetBoxVisible() );
1021 }//GEN-LAST:event_jCheckBoxMenuItem2ActionPerformed
1023 private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
1024 jMenuItem10ActionPerformed(evt);
1025 }//GEN-LAST:event_jButton1ActionPerformed
1027 private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
1028 jMenuItem6ActionPerformed(evt);
1029 }//GEN-LAST:event_jButton2ActionPerformed
1031 private void jToggleButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton1ActionPerformed
1032 jCheckBoxMenuItem1ActionPerformed(evt);
1033 }//GEN-LAST:event_jToggleButton1ActionPerformed
1035 private void jToggleButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton2ActionPerformed
1036 jCheckBoxMenuItem2ActionPerformed(evt);
1037 }//GEN-LAST:event_jToggleButton2ActionPerformed
1039 private void jCheckBoxMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxMenuItem3ActionPerformed
1040 if( mainAction.isExistTimelineTab() ) {
1042 mainAction.actionRemoveTabbedTable( TimerID.createTimelineID() );
1043 jCheckBoxMenuItem3.setSelected(false);
1044 jToggleButton3.setSelected(false);
1047 mainAction.actionAddTimelineTab( mainAction.getGetTimelinePeriod() );
1048 jCheckBoxMenuItem3.setSelected(true);
1049 jToggleButton3.setSelected(true);
1051 }//GEN-LAST:event_jCheckBoxMenuItem3ActionPerformed
1053 private void jToggleButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton3ActionPerformed
1054 jCheckBoxMenuItem3ActionPerformed(evt);
1055 }//GEN-LAST:event_jToggleButton3ActionPerformed
1057 private void jTabbedPane1ComponentRemoved(java.awt.event.ContainerEvent evt) {//GEN-FIRST:event_jTabbedPane1ComponentRemoved
1059 }//GEN-LAST:event_jTabbedPane1ComponentRemoved
1061 private void jCheckBoxMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxMenuItem4ActionPerformed
1062 if( mainAction.isExistMentionTab() ) {
1064 mainAction.actionRemoveTabbedTable( TimerID.createMentionID() );
1065 jCheckBoxMenuItem4.setSelected(false);
1066 jToggleButton4.setSelected(false);
1069 mainAction.actionAddMentionTab( mainAction.getGetMentionPeriod() );
1070 jCheckBoxMenuItem4.setSelected(true);
1071 jToggleButton4.setSelected(true);
1073 }//GEN-LAST:event_jCheckBoxMenuItem4ActionPerformed
1075 private void jCheckBoxMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxMenuItem5ActionPerformed
1076 if( mainAction.isExistDirectMessageTab() ) {
1078 mainAction.actionRemoveTabbedTable( TimerID.createDirectMessageID() );
1079 jCheckBoxMenuItem5.setSelected(false);
1080 jToggleButton5.setSelected(false);
1083 mainAction.actionAddDirectMessageTab( mainAction.getGetDirectMessagePeriod() );
1084 jCheckBoxMenuItem5.setSelected(true);
1085 jToggleButton5.setSelected(true);
1087 }//GEN-LAST:event_jCheckBoxMenuItem5ActionPerformed
1089 private void jCheckBoxMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxMenuItem6ActionPerformed
1090 if( mainAction.isExistSendDirectMessageTab() ) {
1092 mainAction.actionRemoveTabbedTable( TimerID.createSendDirectMessageID() );
1093 jCheckBoxMenuItem6.setSelected(false);
1094 jToggleButton6.setSelected(false);
1097 mainAction.actionAddSendDirectMessageTab( mainAction.getGetSendDirectMessagePeriod() );
1098 jCheckBoxMenuItem6.setSelected(true);
1099 jToggleButton6.setSelected(true);
1101 }//GEN-LAST:event_jCheckBoxMenuItem6ActionPerformed
1103 private void jToggleButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton4ActionPerformed
1104 jCheckBoxMenuItem4ActionPerformed(evt);
1105 }//GEN-LAST:event_jToggleButton4ActionPerformed
1107 private void jToggleButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton5ActionPerformed
1108 jCheckBoxMenuItem5ActionPerformed(evt);
1109 }//GEN-LAST:event_jToggleButton5ActionPerformed
1111 private void jToggleButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton6ActionPerformed
1112 jCheckBoxMenuItem6ActionPerformed(evt);
1113 }//GEN-LAST:event_jToggleButton6ActionPerformed
1115 private void jMenuItem11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem11ActionPerformed
1117 this.mainAction.actionSetReplyStatusToTweetBoxPane();
1118 }//GEN-LAST:event_jMenuItem11ActionPerformed
1120 private void jMenuItem12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem12ActionPerformed
1122 this.mainAction.actionSetReplyAllStatusToTweetBoxPane();
1123 }//GEN-LAST:event_jMenuItem12ActionPerformed
1125 private void jMenuItem13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem13ActionPerformed
1127 this.mainAction.actionRetweet();
1128 }//GEN-LAST:event_jMenuItem13ActionPerformed
1130 private void jMenuItem15ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem15ActionPerformed
1131 this.mainAction.actionCopySelectedStatusToTweetBoxPane();
1132 }//GEN-LAST:event_jMenuItem15ActionPerformed
1134 private void jMenuItem14ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem14ActionPerformed
1135 this.mainAction.actionSetQuoteStatusToTweetBoxPane();
1136 }//GEN-LAST:event_jMenuItem14ActionPerformed
1138 private void jMenuItem16ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem16ActionPerformed
1139 this.mainAction.actionShowDirectMessageDialog();
1140 }//GEN-LAST:event_jMenuItem16ActionPerformed
1142 private void jMenuItem17ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem17ActionPerformed
1143 this.mainAction.actionOpenStatusURL();
1144 }//GEN-LAST:event_jMenuItem17ActionPerformed
1146 private void jMenuItem18ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem18ActionPerformed
1147 this.mainAction.actionSelectedUserTimeline();
1148 }//GEN-LAST:event_jMenuItem18ActionPerformed
1150 private void jMenuItem21ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem21ActionPerformed
1151 this.mainAction.actionOpenUserURL();
1152 }//GEN-LAST:event_jMenuItem21ActionPerformed
1154 private void jMenuItem22ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem22ActionPerformed
1155 this.mainAction.actionOpenUserFav();
1156 }//GEN-LAST:event_jMenuItem22ActionPerformed
1158 private void jMenuItem19ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem19ActionPerformed
1159 this.mainAction.actionCreateFavorite();
1160 }//GEN-LAST:event_jMenuItem19ActionPerformed
1162 private void jMenuItem20ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem20ActionPerformed
1163 this.mainAction.actionDestroyFavorite();
1164 }//GEN-LAST:event_jMenuItem20ActionPerformed
1166 private void jMenuItem23ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem23ActionPerformed
1167 this.mainAction.actionShowHashtagSearchDialog();
1168 }//GEN-LAST:event_jMenuItem23ActionPerformed
1173 private void updateLen() {
1175 mainAction.actionUpdateTweetMessageCount();
1179 * @param args the command line arguments
1181 public static void main(String args[]) {
1182 java.awt.EventQueue.invokeLater(new Runnable() {
1188 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
1190 } catch (Exception e) {
1191 e.printStackTrace();
1193 new NishioTweetManager().setVisible(true);
1201 private void init() {
1203 boolean login = false;
1205 tweetManager.loginTwitter();
1207 } catch (Exception e) {
1208 e.printStackTrace();
1212 mainAction = new TweetMainAction(this, tweetManager, statusBar,
1213 jTextPane, jPanel3, tweetLengthLabel, jPanel1, jTabbedPane1, tweetMessageBox, userImageLabel,
1214 userNameLabel, updateTimeLabel, followerLabel, followingLabel, locationLabel,
1215 clientNameLabel, updateLabel, userIntroBox, userWebBox,
1216 jToggleButton3, jToggleButton4, jToggleButton5, jToggleButton6,
1217 jCheckBoxMenuItem3,jCheckBoxMenuItem4, jCheckBoxMenuItem5, jCheckBoxMenuItem6);
1218 //ハッシュタグ用のハイパーリンクリスナーにアクション登録
1219 this.hashTagHyperlinkListener.setMainAction(mainAction);
1220 //もしログインに失敗したら,アカウント設定画面を出す
1221 if (login == false) {
1222 mainAction.actionShowAccountDialog();
1226 //TODO:TL, Mention, DMのタブを表示するかしないかの設定を読み込んで反映するように
1227 this.mainAction.actionAddTimelineTab( this.mainAction.getGetTimelinePeriod() );
1228 this.mainAction.actionAddMentionTab( this.mainAction.getGetMentionPeriod() );
1229 this.mainAction.actionAddDirectMessageTab( this.mainAction.getGetDirectMessagePeriod() );
1230 //this.mainAction.actionAddSendDirectMessageTab( this.mainAction.getGetSendDirectMessagePeriod() );
1235 * チェックボックスすべてのチェック状態を更新
1237 public void updateSelectedInformation() {
1240 jCheckBoxMenuItem1.setSelected( mainAction.isDetailInfoPanelVisible() );
1241 jToggleButton1.setSelected( mainAction.isDetailInfoPanelVisible() );
1243 jCheckBoxMenuItem2.setSelected(mainAction.isShowTweetBoxVisible());
1244 jToggleButton2.setSelected( mainAction.isShowTweetBoxVisible() );
1246 mainAction.updateCheckboxInformation();
1249 //nishio tweet manager
1250 private JPopupMenu rightClickPopup = null;
1251 private TweetMainAction mainAction = null;
1253 private TweetManager tweetManager = new TweetManager();
1254 // Variables declaration - do not modify//GEN-BEGIN:variables
1255 private javax.swing.JEditorPane clientNameLabel;
1256 private javax.swing.JLabel followerLabel;
1257 private javax.swing.JLabel followingLabel;
1258 private javax.swing.JButton jButton1;
1259 private javax.swing.JButton jButton2;
1260 private javax.swing.JButton jButton4;
1261 private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItem1;
1262 private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItem2;
1263 private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItem3;
1264 private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItem4;
1265 private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItem5;
1266 private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItem6;
1267 private javax.swing.JLabel jLabel12;
1268 private javax.swing.JLabel jLabel13;
1269 private javax.swing.JLabel jLabel15;
1270 private javax.swing.JLabel jLabel3;
1271 private javax.swing.JLabel jLabel4;
1272 private javax.swing.JLabel jLabel5;
1273 private javax.swing.JLabel jLabel9;
1274 private javax.swing.JMenu jMenu1;
1275 private javax.swing.JMenu jMenu2;
1276 private javax.swing.JMenu jMenu3;
1277 private javax.swing.JMenu jMenu4;
1278 private javax.swing.JMenu jMenu5;
1279 private javax.swing.JMenu jMenu6;
1280 private javax.swing.JMenuBar jMenuBar1;
1281 private javax.swing.JMenuItem jMenuItem1;
1282 private javax.swing.JMenuItem jMenuItem10;
1283 private javax.swing.JMenuItem jMenuItem11;
1284 private javax.swing.JMenuItem jMenuItem12;
1285 private javax.swing.JMenuItem jMenuItem13;
1286 private javax.swing.JMenuItem jMenuItem14;
1287 private javax.swing.JMenuItem jMenuItem15;
1288 private javax.swing.JMenuItem jMenuItem16;
1289 private javax.swing.JMenuItem jMenuItem17;
1290 private javax.swing.JMenuItem jMenuItem18;
1291 private javax.swing.JMenuItem jMenuItem19;
1292 private javax.swing.JMenuItem jMenuItem2;
1293 private javax.swing.JMenuItem jMenuItem20;
1294 private javax.swing.JMenuItem jMenuItem21;
1295 private javax.swing.JMenuItem jMenuItem22;
1296 private javax.swing.JMenuItem jMenuItem23;
1297 private javax.swing.JMenuItem jMenuItem3;
1298 private javax.swing.JMenuItem jMenuItem4;
1299 private javax.swing.JMenuItem jMenuItem5;
1300 private javax.swing.JMenuItem jMenuItem6;
1301 private javax.swing.JMenuItem jMenuItem7;
1302 private javax.swing.JMenuItem jMenuItem8;
1303 private javax.swing.JMenuItem jMenuItem9;
1304 private javax.swing.JPanel jPanel1;
1305 private javax.swing.JPanel jPanel2;
1306 private javax.swing.JPanel jPanel3;
1307 private javax.swing.JScrollPane jScrollPane5;
1308 private javax.swing.JScrollPane jScrollPane6;
1309 private javax.swing.JScrollPane jScrollPane7;
1310 private javax.swing.JScrollPane jScrollPane8;
1311 private javax.swing.JScrollPane jScrollPane9;
1312 private javax.swing.JToolBar.Separator jSeparator1;
1313 private javax.swing.JToolBar.Separator jSeparator2;
1314 private javax.swing.JToolBar.Separator jSeparator3;
1315 private javax.swing.JPopupMenu.Separator jSeparator4;
1316 private javax.swing.JPopupMenu.Separator jSeparator5;
1317 private javax.swing.JPopupMenu.Separator jSeparator6;
1318 private javax.swing.JTabbedPane jTabbedPane1;
1319 private javax.swing.JTextPane jTextPane;
1320 private javax.swing.JToggleButton jToggleButton1;
1321 private javax.swing.JToggleButton jToggleButton2;
1322 private javax.swing.JToggleButton jToggleButton3;
1323 private javax.swing.JToggleButton jToggleButton4;
1324 private javax.swing.JToggleButton jToggleButton5;
1325 private javax.swing.JToggleButton jToggleButton6;
1326 private javax.swing.JToolBar jToolBar1;
1327 private javax.swing.JLabel locationLabel;
1328 private javax.swing.JLabel statusBar;
1329 private javax.swing.JLabel tweetLengthLabel;
1330 private javax.swing.JEditorPane tweetMessageBox;
1331 private javax.swing.JLabel updateLabel;
1332 private javax.swing.JLabel updateTimeLabel;
1333 private javax.swing.JLabel userImageLabel;
1334 private javax.swing.JEditorPane userIntroBox;
1335 private javax.swing.JLabel userNameLabel;
1336 private javax.swing.JEditorPane userWebBox;
1337 // End of variables declaration//GEN-END:variables