irc.ButtonThreadJvn2 Class Reference

Collaboration diagram for irc.ButtonThreadJvn2:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void run ()

Package Functions

 ButtonThreadJvn2 (IrcJvn2 i, ButtonType b)

Private Attributes

IrcJvn2 irc
ButtonType button


Detailed Description

This class defines a thread which is activated when any button is pressed. We do this using threads in order not to block the interface when the lock is being processed and let the user press any button at any time.

Definition at line 142 of file IrcJvn2.java.


Constructor & Destructor Documentation

irc.ButtonThreadJvn2.ButtonThreadJvn2 ( IrcJvn2  i,
ButtonType  b 
) [package]

Constructor: initialized the ButtonThread.

Parameters:
i IRC class to use.
b Which button has been pressed.

Definition at line 152 of file IrcJvn2.java.

References irc.ButtonThreadJvn2.button, and irc.ButtonThreadJvn2.irc.

00152                                                     {
00153                 irc = i;
00154                 button = b;
00155         }


Member Function Documentation

void irc.ButtonThreadJvn2.run (  ) 

Starts the thread.

See also:
Thread.run()

Definition at line 162 of file IrcJvn2.java.

References irc.ButtonThreadJvn2.button, irc.IrcJvn2.data, jvn.JvnException.getMessage(), irc.ButtonThreadJvn2.irc, irc.IrcJvn2.sentence, and irc.IrcJvn2.text.

00162                           {
00163                 try {
00164                         if( button == ButtonType.Read ) {
00165                                 // invoke the method
00166                                 String s = irc.sentence.read();
00167 
00168                                 // display the read value
00169                                 irc.data.setText(s);
00170                                 irc.text.append(s+"\n");
00171 
00172                         } else if( button == ButtonType.Write ) {
00173                                 // get the value to be written from the buffer
00174                                 String s = irc.data.getText();
00175 
00176                                 // invoke the method
00177                                 irc.sentence.write(s);
00178                         }
00179                 } catch (JvnException je) {
00180                         System.out.println("Javanaise error while processing IRC button action: " + je.getMessage());
00181                 } catch( Exception e ) {
00182                         System.out.println( "Error while processing IRC button action: "+e);
00183                 }
00184         }

Here is the call graph for this function:


Member Data Documentation

IrcJvn2 irc.ButtonThreadJvn2.irc [private]

Definition at line 143 of file IrcJvn2.java.

Referenced by irc.ButtonThreadJvn2.ButtonThreadJvn2(), and irc.ButtonThreadJvn2.run().

ButtonType irc.ButtonThreadJvn2.button [private]

Definition at line 144 of file IrcJvn2.java.

Referenced by irc.ButtonThreadJvn2.ButtonThreadJvn2(), and irc.ButtonThreadJvn2.run().


The documentation for this class was generated from the following file:
Generated on Wed Jan 2 10:15:57 2008 for Javanaise by  doxygen 1.5.4