irc
Class IRCApplication

java.lang.Object
  |
  +--irc.IRCObject
        |
        +--irc.IRCApplication
All Implemented Interfaces:
java.awt.event.ActionListener, AWTSourceListener, DCCListener, java.util.EventListener, IdentListener, PixxMDIInterfaceListener, ServerListener, ServerManager, java.awt.event.WindowListener

public class IRCApplication
extends IRCObject
implements ServerListener, ServerManager, DCCListener, IdentListener, PixxMDIInterfaceListener, java.awt.event.WindowListener, AWTSourceListener, java.awt.event.ActionListener

The IRC Application. This is the main class of PJIRC.


Field Summary
 
Fields inherited from class irc.IRCObject
_ircConfiguration
 
Fields inherited from interface irc.ident.IdentListener
IDENT_DEFAULT, IDENT_ERROR, IDENT_NOT_FOUND, IDENT_OK
 
Constructor Summary
IRCApplication(IRCConfiguration config, StartupConfiguration startupConfig, java.awt.Container source)
          Create a new IRCApplication.
 
Method Summary
 void aboutTriggered(PixxMDIInterface mdi)
          The about button has been triggered.
 void actionPerformed(java.awt.event.ActionEvent evt)
           
 void activated(AWTSource source)
          The source has been activated.
 void activeChanged(AWTSource source, PixxMDIInterface mdi)
          The active source has changed.
 java.lang.String[] cannotUseRequestedNicknames(Server s)
          The nickname(s) provided to this server for registration cannot be used for any reason.
 void connectTriggered(PixxMDIInterface mdi)
          The connect button has been triggered.
 boolean DCCChatRequest(java.lang.String nick)
          A new DCCChat is requested.
 void DCCFileCreated(DCCFile file, Server s, java.lang.Boolean bring)
           
 void DCCFileRemoved(DCCFile file, Server s)
           
 java.io.File DCCFileRequest(java.lang.String nick, java.lang.String fileName, java.lang.Integer size)
          A new DCC reception is requested.
 void eventOccured(AWTSource source)
          An event has occured.
 java.lang.String getFieldText()
          Get the current textfield text.
static void go(java.lang.String[] args)
           
 void helpTriggered(PixxMDIInterface mdi)
          The help button has been triggered.
 void identLeaving(java.lang.String message)
          The ident server is leaving.
 void identRequested(java.lang.String source, java.lang.Integer result, java.lang.String reply)
          The ident server has received a request.
 void identRunning(java.lang.Integer port)
          The ident server is running.
 void init()
          Init the application.
static void main(java.lang.String[] args)
           
 void newServer(Server server, boolean connect)
          A new server has been created, but not yet connected.
 void requestSourceFocus()
          Request the active source to gain focus.
 void sendString(java.lang.String str)
          Send the given string to the current source interpretor.
 void serverConnected(Server server)
          The server connected.
 void serverDisconnected(Server s)
          The server disconnected.
 void serverLeft(Server s)
          The server has left.
 void setFieldText(java.lang.String txt)
          Set the current textfield text.
 void sourceCreated(Source source, Server server, java.lang.Boolean bring)
          A new source has been created.
 void sourceRemoved(Source source, Server server)
          An existing source has been removed.
 void titleChanged(AWTSource source)
          This source title has changed.
 void uninit()
          Uninit the application.
 void validateText()
          Validate the current textfield text, as if user pressed return key.
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
           
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 
Methods inherited from class irc.IRCObject
getColor, getIRCConfiguration, getText, getText, getText, getText, getTimeStamp, release
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IRCApplication

public IRCApplication(IRCConfiguration config,
                      StartupConfiguration startupConfig,
                      java.awt.Container source)
Create a new IRCApplication.

Parameters:
config - the IRC configuration.
startupConfig - the startup configuration.
source - a container in wich the application will display. Maybe null. If null, a new Frame will be opened.
Method Detail

init

public void init()
Init the application.


newServer

public void newServer(Server server,
                      boolean connect)
Description copied from interface: ServerManager
A new server has been created, but not yet connected.

Specified by:
newServer in interface ServerManager
Parameters:
server - the newly created server.
connect - true if the channel should be connected has soon as possible.

uninit

public void uninit()
Uninit the application.


DCCFileCreated

public void DCCFileCreated(DCCFile file,
                           Server s,
                           java.lang.Boolean bring)

DCCFileRemoved

public void DCCFileRemoved(DCCFile file,
                           Server s)

sourceCreated

public void sourceCreated(Source source,
                          Server server,
                          java.lang.Boolean bring)
Description copied from interface: ServerListener
A new source has been created.

Specified by:
sourceCreated in interface ServerListener
Parameters:
source - the created source.
server - the server.
bring - true if the newly created source must have immediate focus.

sourceRemoved

public void sourceRemoved(Source source,
                          Server server)
Description copied from interface: ServerListener
An existing source has been removed.

Specified by:
sourceRemoved in interface ServerListener
Parameters:
source - the removed source.
server - the server.

serverLeft

public void serverLeft(Server s)
Description copied from interface: ServerListener
The server has left.

Specified by:
serverLeft in interface ServerListener
Parameters:
s - the server.

DCCFileRequest

public java.io.File DCCFileRequest(java.lang.String nick,
                                   java.lang.String fileName,
                                   java.lang.Integer size)
Description copied from interface: DCCListener
A new DCC reception is requested.

Specified by:
DCCFileRequest in interface DCCListener
Parameters:
nick - the source nick.
fileName - the file to transfert.
size - the file size.
Returns:
the local destination file.

DCCChatRequest

public boolean DCCChatRequest(java.lang.String nick)
Description copied from interface: DCCListener
A new DCCChat is requested.

Specified by:
DCCChatRequest in interface DCCListener
Parameters:
nick - the requesting nick.
Returns:
true if the request is accepted, false otherwise.

serverConnected

public void serverConnected(Server server)
Description copied from interface: ServerListener
The server connected.

Specified by:
serverConnected in interface ServerListener
Parameters:
server - the server.

serverDisconnected

public void serverDisconnected(Server s)
Description copied from interface: ServerListener
The server disconnected.

Specified by:
serverDisconnected in interface ServerListener
Parameters:
s - the server.

identRequested

public void identRequested(java.lang.String source,
                           java.lang.Integer result,
                           java.lang.String reply)
Description copied from interface: IdentListener
The ident server has received a request.

Specified by:
identRequested in interface IdentListener
Parameters:
source - the request source.
result - the request result.
reply - the replied result.

identRunning

public void identRunning(java.lang.Integer port)
Description copied from interface: IdentListener
The ident server is running.

Specified by:
identRunning in interface IdentListener
Parameters:
port - port on wich the server is running.

identLeaving

public void identLeaving(java.lang.String message)
Description copied from interface: IdentListener
The ident server is leaving.

Specified by:
identLeaving in interface IdentListener
Parameters:
message - leaving message.

activeChanged

public void activeChanged(AWTSource source,
                          PixxMDIInterface mdi)
Description copied from interface: PixxMDIInterfaceListener
The active source has changed.

Specified by:
activeChanged in interface PixxMDIInterfaceListener
Parameters:
source - the new active source.
mdi - the mdi.

titleChanged

public void titleChanged(AWTSource source)
Description copied from interface: AWTSourceListener
This source title has changed.

Specified by:
titleChanged in interface AWTSourceListener
Parameters:
source - the source whose title has changed.

eventOccured

public void eventOccured(AWTSource source)
Description copied from interface: AWTSourceListener
An event has occured.

Specified by:
eventOccured in interface AWTSourceListener
Parameters:
source - the source on whose event has occured.

activated

public void activated(AWTSource source)
Description copied from interface: AWTSourceListener
The source has been activated.

Specified by:
activated in interface AWTSourceListener
Parameters:
source - the activated source.

connectTriggered

public void connectTriggered(PixxMDIInterface mdi)
Description copied from interface: PixxMDIInterfaceListener
The connect button has been triggered.

Specified by:
connectTriggered in interface PixxMDIInterfaceListener
Parameters:
mdi - the mdi.

aboutTriggered

public void aboutTriggered(PixxMDIInterface mdi)
Description copied from interface: PixxMDIInterfaceListener
The about button has been triggered.

Specified by:
aboutTriggered in interface PixxMDIInterfaceListener
Parameters:
mdi - the mdi.

helpTriggered

public void helpTriggered(PixxMDIInterface mdi)
Description copied from interface: PixxMDIInterfaceListener
The help button has been triggered.

Specified by:
helpTriggered in interface PixxMDIInterfaceListener
Parameters:
mdi - the mdi.

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Specified by:
windowClosing in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener

requestSourceFocus

public void requestSourceFocus()
Request the active source to gain focus.


sendString

public void sendString(java.lang.String str)
Send the given string to the current source interpretor.

Parameters:
str - string to send to the interpretor.

setFieldText

public void setFieldText(java.lang.String txt)
Set the current textfield text.


getFieldText

public java.lang.String getFieldText()
Get the current textfield text.

Returns:
the current textfield text.

validateText

public void validateText()
Validate the current textfield text, as if user pressed return key.


cannotUseRequestedNicknames

public java.lang.String[] cannotUseRequestedNicknames(Server s)
Description copied from interface: ServerListener
The nickname(s) provided to this server for registration cannot be used for any reason.

Specified by:
cannotUseRequestedNicknames in interface ServerListener
Parameters:
s - the server.
Returns:
an array of alternative nicknames.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

go

public static void go(java.lang.String[] args)

main

public static void main(java.lang.String[] args)