Revision 3952,
1.3 KB
checked in by alexandrecorreia, 13 years ago
(diff) |
Ticket #1710 - Adicao do codigo fonte java do componente jmessenger(jabberit_messenger)
|
-
Property svn:executable set to
*
|
Rev | Line | |
---|
[3952] | 1 | //Created on 14-sep-2003 |
---|
| 2 | package nu.fw.jeti.util; |
---|
| 3 | |
---|
| 4 | import java.awt.event.ActionEvent; |
---|
| 5 | import java.awt.event.ActionListener; |
---|
| 6 | |
---|
| 7 | import javax.swing.JFrame; |
---|
| 8 | import javax.swing.Timer; |
---|
| 9 | |
---|
| 10 | /** |
---|
| 11 | * Title: im |
---|
| 12 | * Description: |
---|
| 13 | * Copyright: Copyright (c) 2001 |
---|
| 14 | * Company: |
---|
| 15 | * @author E.S. de Boer |
---|
| 16 | * @version 1.0 |
---|
| 17 | */ |
---|
| 18 | |
---|
| 19 | public class TitleTimer implements ActionListener |
---|
| 20 | { |
---|
| 21 | private Timer timer; |
---|
| 22 | private String first; |
---|
| 23 | private String second; |
---|
| 24 | private int teller; |
---|
| 25 | private int max = 9; |
---|
| 26 | private JFrame frame; |
---|
| 27 | private String title; |
---|
| 28 | |
---|
| 29 | |
---|
| 30 | public TitleTimer(JFrame frame, String title) |
---|
| 31 | { |
---|
| 32 | this.frame = frame; |
---|
| 33 | this.title =title; |
---|
| 34 | timer = new Timer(1200,this); |
---|
| 35 | } |
---|
| 36 | |
---|
| 37 | public void setTitle(String title) |
---|
| 38 | { |
---|
| 39 | this.title = title; |
---|
| 40 | } |
---|
| 41 | |
---|
| 42 | public void init(String first, String second) |
---|
| 43 | { |
---|
| 44 | frame.setTitle(first); |
---|
| 45 | timer.stop(); |
---|
| 46 | this.first = first; |
---|
| 47 | this.second = second; |
---|
| 48 | teller =0; |
---|
| 49 | timer.restart(); |
---|
| 50 | } |
---|
| 51 | |
---|
| 52 | public void stop() |
---|
| 53 | { |
---|
| 54 | timer.stop(); |
---|
| 55 | } |
---|
| 56 | |
---|
| 57 | public void actionPerformed(ActionEvent e) |
---|
| 58 | { |
---|
| 59 | if(teller > max) |
---|
| 60 | { |
---|
| 61 | teller =0; |
---|
| 62 | timer.stop(); |
---|
| 63 | frame.setTitle(title); |
---|
| 64 | } |
---|
| 65 | else |
---|
| 66 | { |
---|
| 67 | if(teller%2==0) |
---|
| 68 | { |
---|
| 69 | frame.setTitle(first); |
---|
| 70 | } |
---|
| 71 | else |
---|
| 72 | { |
---|
| 73 | frame.setTitle(second); |
---|
| 74 | } |
---|
| 75 | teller++; |
---|
| 76 | } |
---|
| 77 | //System.out.println("timer"); |
---|
| 78 | } |
---|
| 79 | |
---|
| 80 | } |
---|
| 81 | /* |
---|
| 82 | * Overrides for emacs |
---|
| 83 | * Local variables: |
---|
| 84 | * tab-width: 4 |
---|
| 85 | * End: |
---|
| 86 | */ |
---|
Note: See
TracBrowser
for help on using the repository browser.