|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--swpchat.client.ClientControls
This class implements all functions of the client.
Field Summary | |
private AudioActivator |
audioActivator
|
private boolean |
audioFlag
|
private AudioMapper |
audioMapper
|
private static java.lang.String |
CLS
|
private ContactsMapper |
contactsMapper
|
ControlConnection |
controlConnection
|
private DisplayControler |
displayControler
|
private OpenServer |
fileServer
|
private java.util.Vector |
fileVector
|
private int |
MAX_FILE_COUNTER
|
private MemberMap |
memberMap
|
private PictureFrame |
pictureFrame
|
private ReceiveFileQuestionDialog |
questDialog
|
ReceiverServerConnection |
receiverConnection
|
SenderServerConnection |
senderConnection
|
private java.lang.String |
sessionKey
|
private static java.lang.String |
STR_AUDIO_KEY
|
private static java.lang.String |
STR_CONTACTS_KEY
|
private SWPOptions |
swpOptions
|
private boolean |
transferIP
|
Fields inherited from interface swpchat.protocol.ChatTokens |
CHAR_ARG_SEP, CHAR_MSG_END, CHAR_MSG_EOL, CHAR_QUOTE, CHAR_STRING_DELIMITER, STR_ARG_SEP, STR_AUTHORIZE, STR_MSG_END, STR_MSG_EOL, STR_NEG_ARG, STR_NEGATIVE, STR_POS_ARG, STR_POSITIVE, STR_QUOTE, STR_REPLY, STR_STRING_DELIMITER, STR_WAIT |
Constructor Summary | |
ClientControls(DisplayControler displayControler)
Constructor. |
Method Summary | |
void |
addAudioFile(java.lang.String audioKey,
java.lang.String sound)
Adds an audio file to the properties. |
void |
addChannelToAvailableList(java.lang.String channelName)
Adds channel to list of available channels in main frame. |
void |
addContact(java.lang.String nick)
Add a contact to the list. |
void |
addContactAndLocations(java.lang.String nick,
java.util.Enumeration channels)
Add a contact and the channels where is joined to the list. |
void |
addFileTransfer(FileProtocolHandler file)
method encapsulates a (assozierte Warteschlange) add fileProtocolHandler to the que. |
void |
addLocation(java.lang.String nick,
java.lang.String channel)
Add a location to a contact. |
void |
addNewContact(java.lang.String strNick)
|
void |
changeAudioFlag()
Switches the audio flag to the opposite value. |
boolean |
changeNick(java.lang.String newNickname)
Changes the actual nickname. |
void |
changeTopic(java.lang.String channel)
prompt for the topic of a specified channel and tell the server about it |
boolean |
connect(java.lang.String servername,
java.lang.String nickname)
Connects to a given server with a given nickname. |
boolean |
createNewChannel(java.lang.String name,
java.lang.String sendPasswd,
java.lang.String recvPasswd)
Creates a new channel. |
void |
deleteContact(java.lang.String strNick)
|
boolean |
disconnect()
Disconnects from the server. |
void |
displayEmotion(java.lang.String channel,
java.lang.String from,
java.lang.String target,
java.lang.String emo)
Shows received emotion message in the receiver textarea |
void |
displayMessage(java.lang.String sender,
java.lang.String channel,
java.lang.String message)
Shows received message in the receiver textarea |
void |
displayPlayMessage(java.lang.String sender,
java.lang.String channel,
java.lang.String message)
Shows received message in the receiver textarea |
void |
displayShipMessage(java.lang.String channel,
java.lang.String sender,
java.lang.String victim,
java.lang.String status)
Shows received ship-message in the receiver textarea If Client is victim something funny happens.! |
void |
displayUserInfo(java.util.Vector tokenlist)
method analyses tokenlist |
void |
displayWhisperMsg(java.lang.String channel,
java.lang.String sender,
java.lang.String message)
Shows received whispermessage in the receiver textarea |
boolean |
emotion(java.lang.String channel,
java.lang.String target,
java.lang.String emo)
The Emotionmessage is passed on to the SenderServerConnection |
java.util.Enumeration |
getAudioEnumeration()
Gets an enumeration of audio files from the AudioMapper and returns it. |
java.util.Enumeration |
getAvailableChannelEnumeration()
Gets an enumeration of available channels and returns it. |
java.util.Enumeration |
getContactEnumeration()
Gets an enumeration of all stored Contacts and returns it. |
java.util.Iterator |
getLocations(java.lang.String nick)
Get an Iterator over the channels where a contact is joined. |
java.lang.String |
getMixerPath()
Gets the stored default path and returns it. |
java.lang.String |
getNickname()
Gets the stored default nickname from swpOpions and returns it. |
java.lang.String |
getPassword(java.lang.String message)
Opens an InputDialog and returns the entered Text |
java.util.Enumeration |
getSelectedChannelEnumeration()
Gets an enumeration of selected channels and returns it. |
java.lang.String |
getServername()
Gets the stored default servername from swpOpions and returns it. |
java.lang.String |
getSFMikePath()
Gets the stored default path and returns it. |
java.lang.String |
getSFSpeakerPath()
Gets the stored default path and returns it. |
void |
handlingMemberMap(java.lang.String channelName,
java.lang.String name,
java.lang.Boolean sender,
java.lang.Boolean receiver,
java.lang.Boolean schiffer)
|
boolean |
isConnected()
Checks if the client is actually connected completely. |
boolean |
join(java.lang.String channel)
Joins a channel. |
boolean |
leave(java.lang.String channel)
Leaves a channel. |
void |
notificationRequest(java.lang.String nick)
|
void |
openServer()
starts a new Server for receiving files |
boolean |
play(java.lang.String channel,
java.lang.String audiokey)
Sends a play request to the specified channel. |
boolean |
playReceivedAudioRequest(java.lang.String channel,
java.lang.String sender,
java.lang.String audio)
Plays an audio file. |
void |
quit()
Quits the client program with disconnecting from server. |
void |
removeAudioFile(java.lang.String audioKey)
Removes an audio file from the properties. |
boolean |
removeChannel(java.lang.String name)
Removes an existing channel. |
void |
removeChannelFromAvailableList(java.lang.String channelName)
Removes channel from list of available channels in main frame. |
void |
removeContact(java.lang.String nick)
Remove a contact from the list. |
void |
removeFileTransfer(FileProtocolHandler file)
method encapsulates a (assozierte Warteschlange) remove fileProtocolHandler from the que. |
void |
removeLocation(java.lang.String nick,
java.lang.String channel)
Remove a location from a contact. |
boolean |
renameChannel(java.lang.String oldname,
java.lang.String newname)
Renames an existing channel. |
void |
requestUserInfo(java.lang.String nickname)
method is invoked if the infos of another user are requested (delegates task to requestUserInfo in SenderConnection) |
void |
saveMixerPath(java.lang.String newPath)
Stores path in properties. |
void |
saveNickname(java.lang.String nickname)
Stores nickname in properties. |
void |
saveReceivedFile(byte[] fileBytes,
java.lang.String strFileName,
int iFileSize)
|
void |
saveServername(java.lang.String servername)
Stores servername in properties. |
void |
saveSFMikePath(java.lang.String newPath)
Stores path in properties. |
void |
saveSFSpeakerPath(java.lang.String newPath)
Stores path in properties. |
boolean |
send(java.lang.String channel,
java.lang.String message)
Sends a given message to a given channel to the server. |
boolean |
sendFile(java.io.File pictureFile,
java.util.Vector vecReceiver)
Sends a picture to the server. |
boolean |
sendTelephoneRequest(java.lang.String partner,
java.lang.String reason)
Sends a telephonerequest to the server. |
void |
sendUserInfo(java.util.HashMap hashUserInfo)
send user info of the actual client as a long String first hashmap is serialized into a sendable string then sendUserInfo from ControlServerConnection is invoked |
void |
setContactState(java.lang.String nick,
java.lang.String state,
java.lang.String channel)
Set the state of a Contact, that is: online or offline. |
void |
setTransferIPAddress(boolean allowed)
|
boolean |
ship(java.lang.String nick,
java.lang.String status,
ShipWindow shipWindow)
Give or fetch someone his ship. |
boolean |
showAskDialog(java.lang.String name,
java.lang.String size)
shows the receive file dialog. |
void |
showDialogMessage(java.lang.String msg)
Creates and shows a dialog with the specified message. |
void |
showReceivedFile(byte[] fileBytes,
java.lang.String strFileName,
int iFileSize)
shows image file in Frame. |
boolean |
showReceivedPicture(java.io.File pictureFile)
Shows a received picture. |
void |
startupUserInfoSend()
this method checks if the user infos should be send automatically to server when you connect. |
void |
stopNotification(java.lang.String nick)
|
void |
topicChanged(java.lang.String channel,
java.lang.String nick,
java.lang.String topic)
Change the current topic |
boolean |
transferIPAddress()
|
boolean |
whisper(java.lang.String channel,
java.lang.String receiver,
java.lang.String message)
The Whispermessage is passed on to the SenderServerConnection |
Methods inherited from class java.lang.Object |
|
Field Detail |
private static final java.lang.String CLS
private static final java.lang.String STR_AUDIO_KEY
private static final java.lang.String STR_CONTACTS_KEY
public ControlConnection controlConnection
public SenderServerConnection senderConnection
public ReceiverServerConnection receiverConnection
private OpenServer fileServer
private final int MAX_FILE_COUNTER
private java.util.Vector fileVector
private SWPOptions swpOptions
private AudioActivator audioActivator
private AudioMapper audioMapper
private ContactsMapper contactsMapper
private DisplayControler displayControler
private PictureFrame pictureFrame
private MemberMap memberMap
private ReceiveFileQuestionDialog questDialog
private java.lang.String sessionKey
private boolean audioFlag
private boolean transferIP
Constructor Detail |
public ClientControls(DisplayControler displayControler)
displayControler
- The display controler all frames are registered to.Method Detail |
public boolean connect(java.lang.String servername, java.lang.String nickname)
connect
in interface ClientFunctions
servername
- The server name.nickname
- The user's nickname.public boolean disconnect()
disconnect
in interface ClientFunctions
public boolean sendTelephoneRequest(java.lang.String partner, java.lang.String reason)
partner
- the partner, who is desired to be heart and spoken toreason
- the reason, which the partner gets to see
returns true if telephonerequest is sent successfully, false elsepublic boolean send(java.lang.String channel, java.lang.String message)
send
in interface ClientFunctions
channel
- The channel the message should be sent to.message
- The message :-)public boolean isConnected()
isConnected
in interface ClientFunctions
public void quit()
quit
in interface ClientFunctions
public void showDialogMessage(java.lang.String msg)
msg
- The message to be shown.public boolean changeNick(java.lang.String newNickname)
changeNick
in interface ClientFunctions
newNickname
- The new nickname, what else?public java.lang.String getNickname()
getNickname
in interface ClientFunctions
public void saveNickname(java.lang.String nickname)
saveNickname
in interface ClientFunctions
public java.lang.String getServername()
getServername
in interface ClientFunctions
public void saveServername(java.lang.String servername)
saveServername
in interface ClientFunctions
public java.lang.String getSFMikePath()
public void saveSFMikePath(java.lang.String newPath)
public java.lang.String getSFSpeakerPath()
public void saveSFSpeakerPath(java.lang.String newPath)
public java.lang.String getMixerPath()
public void saveMixerPath(java.lang.String newPath)
public boolean transferIPAddress()
public void setTransferIPAddress(boolean allowed)
allowed
- contains the authorisation to send the IPAddresspublic boolean play(java.lang.String channel, java.lang.String audiokey)
play
in interface ClientFunctions
channel
- The actual channel.audiokey
- The audio key of the file to be played.public boolean playReceivedAudioRequest(java.lang.String channel, java.lang.String sender, java.lang.String audio)
playReceivedAudioRequest
in interface ClientFunctions
channel
- The actual channel.sender
- The sender of the play request.audio
- The audio key of the audio file to be played.public void addAudioFile(java.lang.String audioKey, java.lang.String sound)
addAudioFile
in interface ClientFunctions
audioKey
- The audio key of the audio file to be added.sound
- The URL to the audio file.public void removeAudioFile(java.lang.String audioKey)
removeAudioFile
in interface ClientFunctions
audioKey
- The audio key to be removed.public java.util.Enumeration getAudioEnumeration()
getAudioEnumeration
in interface ClientFunctions
public boolean sendFile(java.io.File pictureFile, java.util.Vector vecReceiver)
sendFile
in interface ClientFunctions
actualChannel
- The Channel the picture is sent to.pictureFile
- The File containing th picture.public void showReceivedFile(byte[] fileBytes, java.lang.String strFileName, int iFileSize)
public void saveReceivedFile(byte[] fileBytes, java.lang.String strFileName, int iFileSize)
public void openServer()
public void addFileTransfer(FileProtocolHandler file)
file,
- the ProtocolHandler that is (eingereiht) in the que.public void removeFileTransfer(FileProtocolHandler file)
file,
- the ProtocolHandler that is (eingereiht) in the que.public boolean whisper(java.lang.String channel, java.lang.String receiver, java.lang.String message)
channel
- The Channel on which the receiver is expectedreceiver
- The Nick of the Client the message is to be send
tomessage
- The actual message to be sendpublic boolean emotion(java.lang.String channel, java.lang.String target, java.lang.String emo)
channel
- The Channel on which the receiver is expectedtarget
- The Nick of the Client who is the targetemotion
- The emotion to be sendpublic boolean showAskDialog(java.lang.String name, java.lang.String size)
public boolean showReceivedPicture(java.io.File pictureFile)
showReceivedPicture
in interface ClientFunctions
pictureFile
- The received picture file.public boolean join(java.lang.String channel)
join
in interface ClientFunctions
channel
- The channel to be joined.public boolean leave(java.lang.String channel)
leave
in interface ClientFunctions
channel
- The channel to be left.public boolean createNewChannel(java.lang.String name, java.lang.String sendPasswd, java.lang.String recvPasswd)
createNewChannel
in interface ClientFunctions
name
- The name of the new channel.public boolean renameChannel(java.lang.String oldname, java.lang.String newname)
renameChannel
in interface ClientFunctions
oldname
- The old channel name.newname
- The new channel name.public boolean removeChannel(java.lang.String name)
removeChannel
in interface ClientFunctions
name
- The name of the channel to be removed.public java.util.Enumeration getAvailableChannelEnumeration()
getAvailableChannelEnumeration
in interface ClientFunctions
public java.util.Enumeration getSelectedChannelEnumeration()
getSelectedChannelEnumeration
in interface ClientFunctions
public void addChannelToAvailableList(java.lang.String channelName)
channelName
- The channel name.public void removeChannelFromAvailableList(java.lang.String channelName)
channelName
- The channel name.public void displayMessage(java.lang.String sender, java.lang.String channel, java.lang.String message)
sender
- The sender of the message.channel
- The channel for the message.message
- The message itself.public void displayWhisperMsg(java.lang.String channel, java.lang.String sender, java.lang.String message)
sender
- The sender of the message.channel
- The channel for the message.message
- The message itself.public void displayShipMessage(java.lang.String channel, java.lang.String sender, java.lang.String victim, java.lang.String status)
channel
- The channel for the ship-attac.sender
- The sender of the ship-attac.victim
- The victim of the ship-attac.status
- The status of the ship-attac (ON/OFF).public void displayEmotion(java.lang.String channel, java.lang.String from, java.lang.String target, java.lang.String emo)
channel
- The channel for the emo.sender
- The sender of the emo.target
- The target for the emo.emo
- The emo itself.public void displayPlayMessage(java.lang.String sender, java.lang.String channel, java.lang.String message)
sender
- The sender of the message.channel
- The channel for the message.message
- The play message itself.public void changeAudioFlag()
public void sendUserInfo(java.util.HashMap hashUserInfo)
hashUserInfo
- List of attributes and their valuespublic void requestUserInfo(java.lang.String nickname)
nickname
- the nick name of the user we want the infos ofpublic void handlingMemberMap(java.lang.String channelName, java.lang.String name, java.lang.Boolean sender, java.lang.Boolean receiver, java.lang.Boolean schiffer)
public void displayUserInfo(java.util.Vector tokenlist)
tokenlist
- the tokenlist from MessageReceiverpublic void startupUserInfoSend()
public void notificationRequest(java.lang.String nick)
public void stopNotification(java.lang.String nick)
public void addNewContact(java.lang.String strNick)
public void deleteContact(java.lang.String strNick)
public java.util.Enumeration getContactEnumeration()
public void setContactState(java.lang.String nick, java.lang.String state, java.lang.String channel)
strNick
- String
specifying the contact affected.state
- String
specifying the state, i.e. the states
specified in NotificationTokens
.channels
- if state is STR_STATE_JOINED or STR_STATE_LEFT the channel joined or left.
not used yet. If state is STR_STATE_ONLINE channels contains a list
of all channels joined by nick divided by ';'s.public boolean ship(java.lang.String nick, java.lang.String status, ShipWindow shipWindow)
nick
- the person, who you want to give or fetch shipstatus
- on/offpublic void addContact(java.lang.String nick)
nick
- String
specifying the contact.public void addContactAndLocations(java.lang.String nick, java.util.Enumeration channels)
nick
- String
specifying the contact.channels
- Enumeration
containing the channels,
where this contact is joined.public void removeContact(java.lang.String nick)
nick
- String
specifying the contact.public java.util.Iterator getLocations(java.lang.String nick)
nick
- String
specifying the contact.public void addLocation(java.lang.String nick, java.lang.String channel)
nick
- String
specifying the contact.channel
- String
specifying the channel joined.public void removeLocation(java.lang.String nick, java.lang.String channel)
nick
- String
specifying the contact.channel
- String
specifying the channel left.public java.lang.String getPassword(java.lang.String message)
message
- The message shown in the Dialog's titlepublic void changeTopic(java.lang.String channel)
channel
- guess...public void topicChanged(java.lang.String channel, java.lang.String nick, java.lang.String topic)
channel
- which channel should get a new topic?nick
- who changed the topictopic
- the new topic
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |