org.xnap.plugin.opennap.net
Class OpenNapChannel

java.lang.Object
  extended by org.xnap.chat.AbstractChannel
      extended by org.xnap.plugin.opennap.net.OpenNapAbstractChannel
          extended by org.xnap.plugin.opennap.net.OpenNapChannel
All Implemented Interfaces:
Channel, ChannelInfo, OpenNapConsole, ExceptionListener, MessageListener

public class OpenNapChannel
extends OpenNapAbstractChannel
implements MessageListener

Represents a single channel on a server.


Field Summary
 
Fields inherited from class org.xnap.plugin.opennap.net.OpenNapAbstractChannel
server
 
Fields inherited from class org.xnap.chat.AbstractChannel
cs
 
Fields inherited from interface org.xnap.chat.Channel
AWAY_MESSAGE_INTERVAL
 
Constructor Summary
OpenNapChannel(OpenNapServer server, java.lang.String name)
           
 
Method Summary
 void add(Peer peer)
           
 void changeTopic(java.lang.String newValue)
           
 void close()
          Invoked by the ChatManager when the channel is removed.
 boolean equals(java.lang.Object o)
           
 javax.swing.Action[] getActions()
          Returns an array of actions that can be performed on the channel.
 Command[] getCommands()
          Returns null.
 javax.swing.Icon getIcon()
          Returns null.
 javax.swing.Action[] getPeerActions(Peer peer)
          Returns an array of peer specific actions.
 int getPeerCount()
          Returns the number of peers that have joined this channel.
 ChatProvider getProvider()
          Returns a reference to the chat provider.
 boolean isJoined()
          Returns true, if the channel is joined.
 void join()
           
 void messageReceived(ServerMessage msg)
           
 void sendMessage(java.lang.String message)
          Sends a message to this channel.
 void setJoined(boolean joined, java.lang.String reason)
           
 void setUserCount(int userCount)
           
 
Methods inherited from class org.xnap.plugin.opennap.net.OpenNapAbstractChannel
exceptionThrown, getServer, isLocal, println
 
Methods inherited from class org.xnap.chat.AbstractChannel
actionMessageReceived, addChannelListener, errorReceived, getName, getPeers, getPrefix, getTopic, infoReceived, joined, messageReceived, parted, peerChanged, remove, removeChannelListener, setTopic, topicChanged
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenNapChannel

public OpenNapChannel(OpenNapServer server,
                      java.lang.String name)
Method Detail

add

public void add(Peer peer)
Overrides:
add in class AbstractChannel

changeTopic

public void changeTopic(java.lang.String newValue)
                 throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
Description copied from interface: Channel
Invoked by the ChatManager when the channel is removed.

Specified by:
close in interface Channel

getActions

public javax.swing.Action[] getActions()
Description copied from interface: Channel
Returns an array of actions that can be performed on the channel.

Specified by:
getActions in interface Channel

getCommands

public Command[] getCommands()
Description copied from class: AbstractChannel
Returns null.

Specified by:
getCommands in interface Channel
Overrides:
getCommands in class AbstractChannel

getIcon

public javax.swing.Icon getIcon()
Description copied from class: AbstractChannel
Returns null.

Specified by:
getIcon in interface Channel
Overrides:
getIcon in class AbstractChannel
See Also:
OpenNapPlugin.ICON_16.

getPeerActions

public javax.swing.Action[] getPeerActions(Peer peer)
Description copied from interface: Channel
Returns an array of peer specific actions.

This can be used to implement channel operations like "op".

Specified by:
getPeerActions in interface Channel

getPeerCount

public int getPeerCount()
Description copied from interface: ChannelInfo
Returns the number of peers that have joined this channel.

Specified by:
getPeerCount in interface ChannelInfo
Overrides:
getPeerCount in class AbstractChannel

getProvider

public ChatProvider getProvider()
Description copied from interface: Channel
Returns a reference to the chat provider.

Specified by:
getProvider in interface Channel
Overrides:
getProvider in class OpenNapAbstractChannel
Returns:
null, if the channel has no provider; the provider, otherwise

isJoined

public boolean isJoined()
Description copied from interface: Channel
Returns true, if the channel is joined.

Specified by:
isJoined in interface Channel

join

public void join()

messageReceived

public void messageReceived(ServerMessage msg)
Specified by:
messageReceived in interface MessageListener

sendMessage

public void sendMessage(java.lang.String message)
Description copied from interface: Channel
Sends a message to this channel.

Specified by:
sendMessage in interface Channel

setJoined

public void setJoined(boolean joined,
                      java.lang.String reason)

setUserCount

public void setUserCount(int userCount)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object


Copyright © 2001-2005 XNap Team. All Rights Reserved.