Commits the second patch of Sebastien Vincent in the dev mailing list thread "Fix lot of warnings in the code" which fixes multiple compiler warnings.

cusax-fix
Lyubomir Marinov 17 years ago
parent 400fe1b68b
commit c7e4952a8f

@ -32,7 +32,7 @@ public class SIPCommSmartComboBox
*/
public SIPCommSmartComboBox()
{
setModel(new FilterableComboBoxModel(new ArrayList()));
setModel(new FilterableComboBoxModel());
setEditor(new CallComboEditor());
setEditable(true);
setFocusable(true);
@ -46,16 +46,16 @@ public static class FilterableComboBoxModel
extends AbstractListModel
implements MutableComboBoxModel
{
private List items;
private final List<Object> items;
private Filter filter;
private List filteredItems;
private final List<Object> filteredItems;
private Object selectedItem;
public FilterableComboBoxModel(List items)
public FilterableComboBoxModel()
{
this.items = new ArrayList(items);
filteredItems = new ArrayList(items.size());
this.items = new ArrayList<Object>();
this.filteredItems = new ArrayList<Object>(this.items.size());
updateFilteredItems();
}

@ -288,24 +288,21 @@ public Iterator<String> getRegisteredEvents()
* an event with the specified name has occurred, or null if no actions
* have been defined for <tt>eventType</tt>.
*/
public Map getEventNotifications(String eventType)
public Map<String, NotificationActionHandler> getEventNotifications(String eventType)
{
EventNotification notification = notificationsTable.get(eventType);
if(notification == null)
return null;
// TODO: cleanup mixed usage of different classes/objects in hashtable
// Cleanup together with NotificationService and NotificationConfigurationPanel
Hashtable actions = new Hashtable();
Hashtable<String, NotificationActionHandler> actions = new Hashtable<String, NotificationActionHandler>();
for (Object value : notification.getActions().values())
{
Action action = (Action) value;
NotificationActionHandler handler = action.getActionHandler();
actions.put(action.getActionType(), (handler == null) ? ""
: handler);
actions.put(action.getActionType(), handler);
}
return actions;
@ -1059,41 +1056,28 @@ else if (actionType.equals(NotificationService.ACTION_COMMAND))
*/
public void restoreDefaults()
{
Set<String> eventTypes =
((Hashtable<String, EventNotification>) notificationsTable.clone())
.keySet();
for (String eventType : eventTypes)
for (String eventType : new Vector<String>(notificationsTable.keySet()))
{
EventNotification notification = notificationsTable.get(eventType);
Vector<String> actionsToRemove = new Vector<String>(notification.getActions().keySet());
Iterator<String> actionIter = actionsToRemove.iterator();
while (actionIter.hasNext())
{
String actionType = actionIter.next();
for (String actionType
: new Vector<String>(notification.getActions().keySet()))
removeEventNotificationAction(eventType, actionType);
}
removeEventNotification(eventType);
}
for (Map.Entry<String, EventNotification> entry : defaultNotificationsTable.entrySet())
for (Map.Entry<String, EventNotification> entry
: defaultNotificationsTable.entrySet())
{
String eventType = entry.getKey();
EventNotification notification = entry.getValue();
Iterator<String> actionIter = notification.getActions().keySet().iterator();
while (actionIter.hasNext())
{
String actionType = actionIter.next();
for (String actionType : notification.getActions().keySet())
registerNotificationForEvent(
eventType,
actionType,
notification.getAction(actionType).getActionHandler());
}
}
}
}

@ -20,7 +20,6 @@
*
* @author Rupert Burchardi
*/
@SuppressWarnings("unchecked")
public class ChatRoomIcqImpl implements ChatRoom
{
private static final Logger logger = Logger
@ -30,45 +29,52 @@ public class ChatRoomIcqImpl implements ChatRoom
* Listeners that will be notified of changes in member status in the
* room such as member joined, left or being kicked or dropped.
*/
private Vector memberListeners = new Vector();
private final List<ChatRoomMemberPresenceListener> memberListeners
= new Vector<ChatRoomMemberPresenceListener>();
/**
* Listeners that will be notified of changes in member role in the
* room such as member being granted admin permissions, or revoked admin
* permissions.
*/
private Vector memberRoleListeners = new Vector();
private final List<ChatRoomMemberRoleListener> memberRoleListeners
= new Vector<ChatRoomMemberRoleListener>();
/**
* Listeners that will be notified of changes in local user role in the
* room such as member being granted admin permissions, or revoked admin
* permissions.
*/
private Vector localUserRoleListeners = new Vector();
private final List<ChatRoomLocalUserRoleListener> localUserRoleListeners
= new Vector<ChatRoomLocalUserRoleListener>();
/**
* Listeners that will be notified every time
* a new message is received on this chat room.
*/
private Vector messageListeners = new Vector();
private final List<ChatRoomMessageListener> messageListeners
= new Vector<ChatRoomMessageListener>();
/**
* Listeners that will be notified every time
* a chat room property has been changed.
*/
private Vector propertyChangeListeners = new Vector();
private Vector<ChatRoomPropertyChangeListener> propertyChangeListeners
= new Vector<ChatRoomPropertyChangeListener>();
/**
* Listeners that will be notified every time
* a chat room member property has been changed.
*/
private Vector memberPropChangeListeners = new Vector();
private final List<ChatRoomMemberPropertyChangeListener> memberPropChangeListeners
= new Vector<ChatRoomMemberPropertyChangeListener>();
/**
* Chat room invitation from the icq provider, needed for joining a
* chat room.
*/
private ChatInvitation chatInvitation = null;
/**
* Chat room session from the icq provider, we get this after joining a
* chat room.
@ -79,7 +85,7 @@ public class ChatRoomIcqImpl implements ChatRoom
/**
* The list of members of this chat room.
*/
private Hashtable members = new Hashtable();
private Hashtable<String, ChatRoomMember> members = new Hashtable<String, ChatRoomMember>();
/**
* The operation set that created us.
@ -90,12 +96,11 @@ public class ChatRoomIcqImpl implements ChatRoom
* The protocol provider that created us
*/
private ProtocolProviderServiceIcqImpl provider = null;
/**
* List with invitations.
*/
private Hashtable<String, String> inviteUserList = new Hashtable();
private Hashtable<String, String> inviteUserList = new Hashtable<String, String>();
/**
* Invitation message text.
@ -175,10 +180,10 @@ public ChatRoomIcqImpl(String roomName, ChatRoomSession chatRoomSession,
*/
public void addLocalUserRoleListener(ChatRoomLocalUserRoleListener listener)
{
synchronized (propertyChangeListeners)
synchronized (localUserRoleListeners)
{
if (!propertyChangeListeners.contains(listener))
propertyChangeListeners.add(listener);
if (!localUserRoleListeners.contains(listener))
localUserRoleListeners.add(listener);
}
}
@ -218,7 +223,7 @@ public void addMemberPropertyChangeListener(
/**
* Adds a listener that will be notified of changes of a member role in the
* room such as being granded operator.
* room such as being granted operator.
*
* @param listener a member role listener.
*/
@ -310,17 +315,18 @@ public Message createMessage(byte[] content, String contentType,
*/
public Message createMessage(String messageText)
{
Message msg = new MessageIcqImpl(messageText,
OperationSetBasicInstantMessaging.DEFAULT_MIME_TYPE,
OperationSetBasicInstantMessaging.DEFAULT_MIME_ENCODING, null);
return msg;
return
new MessageIcqImpl(
messageText,
OperationSetBasicInstantMessaging.DEFAULT_MIME_TYPE,
OperationSetBasicInstantMessaging.DEFAULT_MIME_ENCODING,
null);
}
/**
* Returns the list of banned users.
*/
public Iterator getBanList() throws OperationFailedException
public Iterator<ChatRoomMember> getBanList() throws OperationFailedException
{
throw new OperationFailedException(
"This operation cannot be performed in the ICQ network.",
@ -363,9 +369,9 @@ public String getIdentifier()
* @return a <tt>List</tt> of <tt>Contact</tt> corresponding to all room
* members.
*/
public List getMembers()
public List<ChatRoomMember> getMembers()
{
return new LinkedList(members.values());
return new LinkedList<ChatRoomMember>(members.values());
}
/**
@ -522,7 +528,7 @@ public void join(byte[] password) throws OperationFailedException
public void joinAs(String nickname, byte[] password)
throws OperationFailedException
{
// TODO Auto-generated method stub
}
/**
@ -592,18 +598,11 @@ public void leave()
chatRoomSession = null;
}
Iterator membersSet = members.entrySet().iterator();
while (membersSet.hasNext())
{
Map.Entry memberEntry = (Map.Entry) membersSet.next();
ChatRoomMember member = (ChatRoomMember) memberEntry.getValue();
fireMemberPresenceEvent(member,
ChatRoomMemberPresenceChangeEvent.MEMBER_LEFT,
"Local user has left the chat room.");
}
for (ChatRoomMember member : members.values())
fireMemberPresenceEvent(
member,
ChatRoomMemberPresenceChangeEvent.MEMBER_LEFT,
"Local user has left the chat room.");
// Delete the list of members
members.clear();
@ -777,17 +776,14 @@ public void setUserNickname(String nickname)
*/
public void fireMessageEvent(EventObject evt)
{
Iterator listeners = null;
Iterable<ChatRoomMessageListener> listeners;
synchronized (messageListeners)
{
listeners = new ArrayList(messageListeners).iterator();
listeners = new ArrayList<ChatRoomMessageListener>(messageListeners);
}
while (listeners.hasNext())
for (ChatRoomMessageListener listener : listeners)
{
ChatRoomMessageListener listener
= (ChatRoomMessageListener) listeners.next();
if (evt instanceof ChatRoomMessageDeliveredEvent)
{
listener.messageDelivered((ChatRoomMessageDeliveredEvent) evt);
@ -824,19 +820,15 @@ private void fireMemberPresenceEvent(ChatRoomMember member, String eventID,
logger.trace("Will dispatch the following ChatRoom event: " + evt);
Iterator listeners = null;
Iterable<ChatRoomMemberPresenceListener> listeners;
synchronized (memberListeners)
{
listeners = new ArrayList(memberListeners).iterator();
listeners
= new ArrayList<ChatRoomMemberPresenceListener>(memberListeners);
}
while (listeners.hasNext())
{
ChatRoomMemberPresenceListener listener
= (ChatRoomMemberPresenceListener) listeners.next();
for (ChatRoomMemberPresenceListener listener : listeners)
listener.memberPresenceChanged(evt);
}
}
/**
@ -844,14 +836,13 @@ private void fireMemberPresenceEvent(ChatRoomMember member, String eventID,
* users that leave or join the chat room.
*
*/
private class ChatRoomSessionListenerImpl implements
ChatRoomSessionListener
private class ChatRoomSessionListenerImpl
implements ChatRoomSessionListener
{
/**
* The chat room this listener is for.
*/
private ChatRoomIcqImpl chatRoom = null;
private final ChatRoomIcqImpl chatRoom;
/**
* Constructor for this listener, needed to set the chatRoom.
@ -987,11 +978,8 @@ public void handleUsersLeft(ChatRoomSession chatRoomSession,
private void updateMemberList( Set<ChatRoomUser> chatRoomUserSet,
boolean removeMember)
{
Iterator it = chatRoomUserSet.iterator();
while (it.hasNext())
for (ChatRoomUser user : chatRoomUserSet)
{
ChatRoomUser user = (ChatRoomUser) it.next();
String uid = user.getScreenname().getFormatted();
//we want to add a member and he/she is not in our member list

@ -151,7 +151,7 @@ protected List<GenericDetail> getContactDetails(String uin)
*/
private class UserInfoResponseRetriever extends SnacRequestAdapter
{
int requestID;
private final int requestID;
List<GenericDetail> result = null;
UserInfoResponseRetriever(int requestID)
@ -588,6 +588,6 @@ private void readInterestsUserInfo(MetaInterestsInfoCmd cmd)
*/
private void readAffilationsUserInfo(MetaAffiliationsInfoCmd cmd)
{
// Vector infoData = getInfoForRequest(cmd.getId());
// Vector<GenericDetail> infoData = getInfoForRequest(cmd.getId());
}
}

@ -126,4 +126,4 @@ private void assertConnected() throws IllegalStateException
"The icq provider must be signed on the ICQ service before "
+"being able to communicate.");
}
}
}

@ -17,9 +17,12 @@
class VolatileGroup
implements MutableGroup
{
private String groupName = new String("NotInContactList");
private final String groupName;
VolatileGroup(){}
VolatileGroup()
{
this("NotInContactList");
}
VolatileGroup(String groupName)
{
@ -38,12 +41,11 @@ public String getName()
public void addGroupListener(GroupListener listener){}
public List getBuddiesCopy(){return null;}
public List<Buddy> getBuddiesCopy(){return null;}
public void removeGroupListener(GroupListener listener){}
public void copyBuddies(List buddies){}
public void deleteBuddies(List ingroup){}
public void deleteBuddies(List<Buddy> ingroup){}
public void addBuddy(String screenname){}
public void copyBuddies(Collection buddies){}
public void copyBuddies(Collection<? extends Buddy> buddies){}
public void deleteBuddy(Buddy buddy){}
public void rename(String newName){}
}

@ -10,7 +10,6 @@
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.util.*;
/**
* Allows creating, configuring, joining and administering of individual
@ -24,9 +23,6 @@
public class OperationSetMultiUserChatIrcImpl
extends AbstractOperationSetMultiUserChat
{
private static final Logger logger
= Logger.getLogger(OperationSetMultiUserChatIrcImpl.class);
/**
* A call back to the IRC provider that created us.
*/
@ -90,18 +86,18 @@ public List<String> getExistingChatRooms() throws OperationFailedException
* @return a <tt>List</tt> of the rooms where the user has joined using a
* given connection.
*/
public List getCurrentlyJoinedChatRooms()
public List<ChatRoom> getCurrentlyJoinedChatRooms()
{
synchronized(chatRoomCache)
{
List joinedRooms
= new LinkedList(this.chatRoomCache.values());
List<ChatRoom> joinedRooms
= new LinkedList<ChatRoom>(this.chatRoomCache.values());
Iterator joinedRoomsIter = joinedRooms.iterator();
Iterator<ChatRoom> joinedRoomsIter = joinedRooms.iterator();
while (joinedRoomsIter.hasNext())
{
if ( !( (ChatRoom) joinedRoomsIter.next()).isJoined())
if (!joinedRoomsIter.next().isJoined())
joinedRoomsIter.remove();
}
@ -118,7 +114,7 @@ public List getCurrentlyJoinedChatRooms()
* @return a list of the chat rooms that <tt>chatRoomMember</tt> has joined
* and is currently active in.
*/
public List getCurrentlyJoinedChatRooms(ChatRoomMember chatRoomMember)
public List<String> getCurrentlyJoinedChatRooms(ChatRoomMember chatRoomMember)
{
//TODO: Implement "who is" for the IRC stack.
return null;

@ -8,6 +8,10 @@
import java.util.*;
import net.java.sip.communicator.service.protocol.*;
import org.jivesoftware.smack.*;
/**
* The Jabber implementation of the Volatile ContactGroup interface.
*
@ -19,7 +23,7 @@ public class VolatileContactGroupJabberImpl
/**
* This contact group name
*/
private String contactGroupName = null;
private final String contactGroupName;
/**
* Creates an Jabber group using the specified group name
@ -31,7 +35,8 @@ public class VolatileContactGroupJabberImpl
String groupName,
ServerStoredContactListJabberImpl ssclCallback)
{
super(null, new Vector().iterator(), ssclCallback, false);
super(null, new Vector<RosterEntry>().iterator(), ssclCallback, false);
this.contactGroupName = groupName;
}
@ -55,10 +60,10 @@ public String toString()
buff.append(getGroupName());
buff.append(", childContacts="+countContacts()+":[");
Iterator contacts = contacts();
Iterator<Contact> contacts = contacts();
while (contacts.hasNext())
{
ContactJabberImpl contact = (ContactJabberImpl) contacts.next();
Contact contact = contacts.next();
buff.append(contact.toString());
if(contacts.hasNext())
buff.append(", ");

@ -37,12 +37,14 @@ public class WhiteboardSessionJabberImpl
/**
* A list of listeners registered for message events.
*/
private Vector messageListeners = new Vector();
private Vector<WhiteboardObjectListener> messageListeners
= new Vector<WhiteboardObjectListener>();
/**
* A list containing all <tt>WhiteboardParticipant</tt>s of this session.
*/
private Hashtable wbParticipants = new Hashtable();
private Hashtable<String, WhiteboardParticipant> wbParticipants
= new Hashtable<String, WhiteboardParticipant>();
/**
* The state that this white-board is currently in.
@ -64,13 +66,14 @@ public class WhiteboardSessionJabberImpl
* A list of all listeners currently registered for
* <tt>WhiteboardChangeEvent</tt>s
*/
private Vector whiteboardListeners = new Vector();
private Vector<WhiteboardChangeListener> whiteboardListeners
= new Vector<WhiteboardChangeListener>();
/**
* Stores all white board objects contained in this session.
*/
private final Vector<WhiteboardObjectJabberImpl> whiteboardObjects
= new Vector<WhiteboardObjectJabberImpl>();
private final Vector<WhiteboardObject> whiteboardObjects
= new Vector<WhiteboardObject>();
/**
* The <tt>OperationSet</tt> charged with the whiteboarding.
@ -107,9 +110,11 @@ public WhiteboardSessionJabberImpl(
* @return an Iterator over all participants currently involved in the
* white-board.
*/
public Iterator getWhiteboardParticipants()
public Iterator<WhiteboardParticipant> getWhiteboardParticipants()
{
return new LinkedList(wbParticipants.values()).iterator();
return
new LinkedList<WhiteboardParticipant>(wbParticipants.values())
.iterator();
}
/**
@ -279,10 +284,9 @@ public WhiteboardSession getWhiteboardSession()
*/
public void participantStateChanged(WhiteboardParticipantChangeEvent evt)
{
if (((WhiteboardParticipantState) evt.getNewValue())
== WhiteboardParticipantState.DISCONNECTED
|| ((WhiteboardParticipantState) evt.getNewValue())
== WhiteboardParticipantState.FAILED)
Object newValue = evt.getNewValue();
if ((newValue== WhiteboardParticipantState.DISCONNECTED)
|| (newValue == WhiteboardParticipantState.FAILED))
{
removeWhiteboardParticipant((WhiteboardParticipantJabberImpl) evt
.getSourceWhiteboardParticipant());
@ -564,13 +568,13 @@ public void moveWhiteboardObject(WhiteboardObject obj)
public void deleteWhiteboardObject(WhiteboardObject obj)
throws OperationFailedException
{
Iterator participants = getWhiteboardParticipants();
Iterator<WhiteboardParticipant> participants
= getWhiteboardParticipants();
if (!participants.hasNext())
return;
WhiteboardParticipantJabberImpl participant
= (WhiteboardParticipantJabberImpl) participants.next();
Contact contact = participant.getContact();
try
@ -601,7 +605,7 @@ public void deleteWhiteboardObject(WhiteboardObject obj)
int i = 0;
while (i < whiteboardObjects.size())
{
WhiteboardObjectJabberImpl wbObj = whiteboardObjects.get(i);
WhiteboardObjectJabberImpl wbObj = (WhiteboardObjectJabberImpl)whiteboardObjects.get(i);
if (wbObj.getID().equals(obj.getID()))
whiteboardObjects.remove(i);
else
@ -629,14 +633,14 @@ public void deleteWhiteboardObject(WhiteboardObject obj)
public void sendWhiteboardObject(WhiteboardObject message)
throws OperationFailedException
{
Iterator participants = getWhiteboardParticipants();
Iterator<WhiteboardParticipant> participants
= getWhiteboardParticipants();
if (!participants.hasNext())
return;
WhiteboardParticipantJabberImpl participant
= (WhiteboardParticipantJabberImpl) participants.next();
Contact contact = participant.getContact();
try
@ -786,7 +790,6 @@ public ProtocolProviderService getProtocolProvider()
public void fireWhiteboardParticipantEvent(
WhiteboardParticipant sourceWhiteboardParticipant, int eventID)
{
WhiteboardParticipantEvent cpEvent =
new WhiteboardParticipantEvent(this, sourceWhiteboardParticipant,
eventID);
@ -795,17 +798,15 @@ public void fireWhiteboardParticipantEvent(
+ whiteboardListeners.size() + " listeners. event is: "
+ cpEvent.toString());
Iterator listeners = null;
Iterable<WhiteboardChangeListener> listeners;
synchronized (whiteboardListeners)
{
listeners = new ArrayList(whiteboardListeners).iterator();
listeners
= new ArrayList<WhiteboardChangeListener>(whiteboardListeners);
}
while (listeners.hasNext())
for (WhiteboardChangeListener listener : listeners)
{
WhiteboardChangeListener listener =
(WhiteboardChangeListener) listeners.next();
if (eventID
== WhiteboardParticipantEvent
.WHITEBOARD_PARTICIPANT_ADDED)
@ -818,7 +819,6 @@ else if (eventID
{
listener.whiteboardParticipantRemoved(cpEvent);
}
}
}
@ -844,17 +844,15 @@ public void fireWhiteboardChangeEvent(String type, Object oldValue,
+ whiteboardListeners.size() + " listeners. event is: "
+ ccEvent.toString());
Iterator listeners = null;
Iterable<WhiteboardChangeListener> listeners;
synchronized (whiteboardListeners)
{
listeners = new ArrayList(whiteboardListeners).iterator();
listeners
= new ArrayList<WhiteboardChangeListener>(whiteboardListeners);
}
while (listeners.hasNext())
for (WhiteboardChangeListener listener : listeners)
{
WhiteboardChangeListener listener =
(WhiteboardChangeListener) listeners.next();
if (type.equals(WhiteboardChangeEvent.WHITEBOARD_STATE_CHANGE))
listener.whiteboardStateChanged(ccEvent);
}
@ -865,7 +863,7 @@ public void fireWhiteboardChangeEvent(String type, Object oldValue,
* @return an <tt>Vector</tt> of WhiteboardObjects associated
* with this whiteboard.
*/
public Vector getWhiteboardObjects()
public Vector<WhiteboardObject> getWhiteboardObjects()
{
return whiteboardObjects;
}
@ -903,17 +901,15 @@ public void fireMessageEvent(EventObject evt)
+ messageListeners.size() + " listeners. event is: "
+ evt.toString());
Iterator listeners = null;
Iterable<WhiteboardObjectListener> listeners;
synchronized (messageListeners)
{
listeners = new ArrayList(messageListeners).iterator();
listeners
= new ArrayList<WhiteboardObjectListener>(messageListeners);
}
while (listeners.hasNext())
for (WhiteboardObjectListener listener : listeners)
{
WhiteboardObjectListener listener =
(WhiteboardObjectListener) listeners.next();
if (evt instanceof WhiteboardObjectDeliveredEvent)
{
listener.whiteboardObjectDelivered(
@ -940,7 +936,7 @@ else if (evt instanceof WhiteboardObjectDeletedEvent)
int i = 0;
while (i < whiteboardObjects.size())
{
WhiteboardObjectJabberImpl wbObj = whiteboardObjects.get(i);
WhiteboardObjectJabberImpl wbObj = (WhiteboardObjectJabberImpl)whiteboardObjects.get(i);
if (wbObj.getID().equals(wbObjID))
whiteboardObjects.remove(i);
else
@ -975,7 +971,7 @@ private WhiteboardObject updateWhiteboardObjects(WhiteboardObject ws)
int i = 0;
while (i < whiteboardObjects.size())
{
WhiteboardObjectJabberImpl wbObjTmp = whiteboardObjects.get(i);
WhiteboardObjectJabberImpl wbObjTmp = (WhiteboardObjectJabberImpl)whiteboardObjects.get(i);
if (wbObjTmp.getID().equals(ws.getID()))
{
wbObj = wbObjTmp;
@ -1259,17 +1255,9 @@ public boolean isParticipantContained(String participantName)
private WhiteboardParticipant findWhiteboardParticipantFromContactAddress(
String contactAddress)
{
Enumeration participants = wbParticipants.elements();
while(participants.hasMoreElements())
{
WhiteboardParticipant participant
= (WhiteboardParticipant) participants.nextElement();
for (WhiteboardParticipant participant : wbParticipants.values())
if (participant.getContactAddress().equals(contactAddress))
return participant;
}
return null;
}
}
}

@ -4,20 +4,21 @@
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.impl.protocol.jabber.extensions.whiteboard;
import net.java.sip.communicator.service.protocol.WhiteboardPoint;
import net.java.sip.communicator.util.*;
import java.awt.Color;
import java.awt.*;
import java.io.*;
import java.util.LinkedList;
import java.util.*;
import java.util.List;
import java.util.regex.*;
import javax.xml.parsers.*;
import org.w3c.dom.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.whiteboardobjects.*;
import net.java.sip.communicator.util.*;
import org.w3c.dom.*;
/**
* WhiteboardObjectPathJabberImpl
@ -38,7 +39,8 @@ public class WhiteboardObjectPathJabberImpl
/**
* List of WhiteboardPoint
*/
private LinkedList listPoints = new LinkedList ();
private List<WhiteboardPoint> listPoints
= new LinkedList<WhiteboardPoint>();
/**
* Default WhiteboardObjectPathJabberImpl constructor.
@ -101,9 +103,9 @@ public WhiteboardObjectPathJabberImpl (String xml)
* @param points the list of <tt>WhiteboardPoint</tt> instances that this
* <tt>WhiteboardObject</tt> is composed of.
*/
public void setPoints (List points)
public void setPoints (List<WhiteboardPoint> points)
{
this.listPoints = new LinkedList (points);
this.listPoints = new LinkedList<WhiteboardPoint>(points);
}
/**
@ -112,7 +114,7 @@ public void setPoints (List points)
*
* @return the list of <tt>WhiteboardPoint</tt>s composing this object.
*/
public List getPoints ()
public List<WhiteboardPoint> getPoints ()
{
return this.listPoints;
}
@ -125,9 +127,9 @@ public List getPoints ()
* of WhiteboardPoint.
* @return a LinkedList (WhiteboardPoint) of the String points parameter
*/
private List getPathPoints (String points)
private List<WhiteboardPoint> getPathPoints (String points)
{
List list = new LinkedList ();
List<WhiteboardPoint> list = new LinkedList<WhiteboardPoint>();
if (points == null)
{
return list;
@ -149,7 +151,7 @@ private List getPathPoints (String points)
}
/**
* Returns the XML reppresentation of the PacketExtension.
* Returns the XML representation of the PacketExtension.
*
* @return the packet extension as XML.
* @todo Implement this org.jivesoftware.smack.packet.PacketExtension
@ -169,7 +171,7 @@ public String toXML ()
int size = listPoints.size ();
for (int i = 0; i < size; i++)
{
WhiteboardPoint point = (WhiteboardPoint) listPoints.get (i);
WhiteboardPoint point = listPoints.get (i);
sb.append ((i == 0) ? "M" : "L");
sb.append (point.getX ());
sb.append (" ");
@ -179,4 +181,4 @@ public String toXML ()
s = s.replaceAll ("#p", sb.toString ());
return s;
}
}
}

@ -4,17 +4,20 @@
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.impl.protocol.jabber.extensions.whiteboard;
import net.java.sip.communicator.util.*;
import java.awt.Color;
import java.awt.*;
import java.io.*;
import java.util.*;
import java.util.List;
import javax.xml.parsers.*;
import net.java.sip.communicator.service.protocol.WhiteboardPoint;
import org.w3c.dom.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.whiteboardobjects.*;
import net.java.sip.communicator.util.*;
import org.w3c.dom.*;
/**
* WhiteboardObjectPolyLineJabberImpl
@ -35,7 +38,8 @@ public class WhiteboardObjectPolyLineJabberImpl
/**
* list of WhiteboardPoint
*/
private LinkedList listPoints = new LinkedList ();
private List<WhiteboardPoint> listPoints
= new LinkedList<WhiteboardPoint>();
/**
* Default WhiteboardObjectPolyLineJabberImpl constructor.
@ -99,9 +103,9 @@ public WhiteboardObjectPolyLineJabberImpl (String xml)
* @param points the list of <tt>WhiteboardPoint</tt> instances that this
* <tt>WhiteboardObject</tt> is composed of.
*/
public void setPoints (List points)
public void setPoints (List<WhiteboardPoint> points)
{
this.listPoints = new LinkedList (points);
this.listPoints = new LinkedList<WhiteboardPoint>(points);
}
/**
@ -110,7 +114,7 @@ public void setPoints (List points)
*
* @return the list of <tt>WhiteboardPoint</tt>s composing this object.
*/
public List getPoints ()
public List<WhiteboardPoint> getPoints ()
{
return this.listPoints;
}
@ -124,9 +128,9 @@ public List getPoints ()
*
* @return a List of the String points parameter
*/
private List getPolyPoints (String points)
private List<WhiteboardPoint> getPolyPoints (String points)
{
List list = new LinkedList ();
List<WhiteboardPoint> list = new LinkedList<WhiteboardPoint>();
if (points == null)
{
return list;
@ -167,7 +171,7 @@ public String toXML ()
for (int i = 0; i < listPoints.size (); i++)
{
WhiteboardPoint point = (WhiteboardPoint) listPoints.get (i);
WhiteboardPoint point = listPoints.get (i);
sb.append (point.getX ());
sb.append (",");
sb.append (point.getY ());
@ -176,4 +180,4 @@ public String toXML ()
s = s.replaceAll ("#p", sb.toString ());
return s;
}
}
}

@ -4,17 +4,20 @@
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.impl.protocol.jabber.extensions.whiteboard;
import net.java.sip.communicator.util.*;
import java.awt.Color;
import java.awt.*;
import java.io.*;
import java.util.*;
import java.util.List;
import javax.xml.parsers.*;
import net.java.sip.communicator.service.protocol.WhiteboardPoint;
import org.w3c.dom.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.whiteboardobjects.*;
import net.java.sip.communicator.util.*;
import org.w3c.dom.*;
/**
* WhiteboardObjectPolygonJabberImpl
@ -35,7 +38,8 @@ public class WhiteboardObjectPolygonJabberImpl
/**
* list of WhiteboardPoint
*/
private LinkedList listPoints = new LinkedList ();
private List<WhiteboardPoint> listPoints
= new LinkedList<WhiteboardPoint>();
/**
* True is filled, false is unfilled.
@ -110,9 +114,9 @@ public WhiteboardObjectPolygonJabberImpl (String xml)
* @param points the list of <tt>WhiteboardPoint</tt> instances that this
* <tt>WhiteboardObject</tt> is composed of.
*/
public void setPoints (List points)
public void setPoints (List<WhiteboardPoint> points)
{
this.listPoints = new LinkedList (points);
this.listPoints = new LinkedList<WhiteboardPoint>(points);
}
/**
@ -121,7 +125,7 @@ public void setPoints (List points)
*
* @return the list of <tt>WhiteboardPoint</tt>s composing this object.
*/
public List getPoints ()
public List<WhiteboardPoint> getPoints ()
{
return this.listPoints;
}
@ -134,9 +138,9 @@ public List getPoints ()
* List of <tt>WhiteboardPoint</tt>.
* @return a List of the String points parameter
*/
private List getPolyPoints (String points)
private List<WhiteboardPoint> getPolyPoints (String points)
{
List list = new LinkedList ();
List<WhiteboardPoint> list = new LinkedList<WhiteboardPoint>();
if (points == null)
{
return list;
@ -204,7 +208,7 @@ public int getBackgroundColor ()
}
/**
* Returns the XML reppresentation of the PacketExtension.
* Returns the XML representation of the PacketExtension.
*
* @return the packet extension as XML.
* @todo Implement this org.jivesoftware.smack.packet.PacketExtension
@ -223,7 +227,7 @@ public String toXML ()
for (int i = 0; i < listPoints.size (); i++)
{
WhiteboardPoint point = (WhiteboardPoint) listPoints.get (i);
WhiteboardPoint point = listPoints.get (i);
sb.append (point.getX ());
sb.append (",");
sb.append (point.getY ());
@ -232,4 +236,4 @@ public String toXML ()
s = s.replaceAll ("#p", sb.toString ());
return s;
}
}
}

@ -413,34 +413,21 @@ public String toString()
return buff.append("]").toString();
}
public Vector getRssURLList(Vector rssURLList){
//private Vector rssURLList;
//StringBuffer buff = new StringBuffer(getGroupName());
//buff.append(".subGroups=" + countSubgroups() + ":\n");
public void getRssURLList(List<ContactRssImpl> rssURLList)
{
Iterator<ContactGroup> subGroups = subgroups();
while (subGroups.hasNext())
{
ContactGroupRssImpl group = (ContactGroupRssImpl)subGroups.next();
//buff.append(
group.getRssURLList(rssURLList);
// if (subGroups.hasNext())
// buff.append("\n");
group.getRssURLList(rssURLList);
}
//buff.append("\nChildContacts="+countContacts()+":[");
Iterator<Contact> contacts = contacts();
while (contacts.hasNext())
{
ContactRssImpl contact = (ContactRssImpl) contacts.next();
//buff.append(contact.getDisplayName());
rssURLList.addElement(contact);
//if(contacts.hasNext())
// buff.append(", ");
rssURLList.add(contact);
}
//return buff.append("]").toString();
return rssURLList;
}
/**

@ -203,13 +203,11 @@ else if(userRequestedUpdate)
*/
public void refreshAllRssFeeds()
{
Vector rssContactList = new Vector();
rssContactList = opSetPersPresence.getContactListRoot().
getRssURLList(rssContactList);
Iterator rssContact = rssContactList.iterator();
while(rssContact.hasNext())
Vector<ContactRssImpl> rssContactList = new Vector<ContactRssImpl>();
opSetPersPresence.getContactListRoot().getRssURLList(rssContactList);
for (ContactRssImpl contact : rssContactList)
{
ContactRssImpl contact = (ContactRssImpl)rssContact.next();
try
{
submitRssQuery(contact, false);

@ -17,9 +17,9 @@
*/
public class CallListModel extends AbstractListModel
{
private LinkedList callList = new LinkedList();
private final LinkedList<Object> callList = new LinkedList<Object>();
private Hashtable closedDates = new Hashtable();
private final Map<Object, Object> closedDates = new Hashtable<Object, Object>();
/**
* Closes the given date by hiding all containing calls.
@ -31,7 +31,7 @@ public void closeDate(Object date)
int startIndex = this.indexOf(date);
int endIndex = startIndex;
int currentSize = getSize();
Collection c = new ArrayList();
Collection<Object> c = new ArrayList<Object>();
for(int i = startIndex + 1; i < currentSize; i ++) {
Object o = this.getElementAt(i);
@ -57,19 +57,22 @@ public void openDate(Object date)
{
int startIndex = this.indexOf(date);
int endIndex = startIndex;
Hashtable closedDatesCopy = (Hashtable)closedDates.clone();
if(closedDatesCopy.containsValue(date)) {
Iterator dates = closedDatesCopy.entrySet().iterator();
if (closedDates.containsValue(date))
{
Iterator<Map.Entry<Object, Object>> dates
= closedDates.entrySet().iterator();
while(dates.hasNext()) {
Map.Entry entry = (Map.Entry)dates.next();
while (dates.hasNext())
{
Map.Entry<Object, Object> entry = dates.next();
Object callRecord = entry.getKey();
Object callDate = entry.getValue();
if(callDate.equals(date)) {
if (callDate.equals(date))
{
endIndex++;
closedDates.remove(callRecord);
dates.remove();
this.addElement(endIndex, callRecord);
}
}
@ -84,10 +87,7 @@ public void openDate(Object date)
* @return True if the date is closed, false - otherwise.
*/
public boolean isDateClosed(Object date) {
if (this.closedDates.containsValue(date))
return true;
else
return false;
return this.closedDates.containsValue(date);
}
public int getSize()
@ -128,7 +128,7 @@ public void removeElement(Object item)
}
}
public void removeAll(Collection c)
public void removeAll(Collection<Object> c)
{
synchronized (callList) {
callList.removeAll(c);

@ -613,7 +613,7 @@ else if(e.getSource() == apply)
{
notificationService.registerNotificationForEvent(
tmpNTE.getEvent(),
notificationService.ACTION_SOUND,
NotificationService.ACTION_SOUND,
tmpNTE.getSoundFile(),
"");
logger.debug("Adding Sound");
@ -622,7 +622,7 @@ else if(e.getSource() == apply)
{
notificationService.removeEventNotificationAction(
tmpNTE.getEvent(),
notificationService.ACTION_SOUND);
NotificationService.ACTION_SOUND);
logger.debug("Deleting Sound");
}
@ -630,7 +630,7 @@ else if(e.getSource() == apply)
{
notificationService.registerNotificationForEvent(
tmpNTE.getEvent(),
notificationService.ACTION_COMMAND,
NotificationService.ACTION_COMMAND,
tmpNTE.getProgramFile(),
"");
logger.debug("Program");
@ -639,7 +639,7 @@ else if(e.getSource() == apply)
{
notificationService.removeEventNotificationAction(
tmpNTE.getEvent(),
notificationService.ACTION_COMMAND);
NotificationService.ACTION_COMMAND);
logger.debug("Deleting Program");
}
@ -647,7 +647,7 @@ else if(e.getSource() == apply)
{
notificationService.registerNotificationForEvent(
tmpNTE.getEvent(),
notificationService.ACTION_POPUP_MESSAGE,
NotificationService.ACTION_POPUP_MESSAGE,
"",
"");
logger.debug("Popup");
@ -656,7 +656,7 @@ else if(e.getSource() == apply)
{
notificationService.removeEventNotificationAction(
tmpNTE.getEvent(),
notificationService.ACTION_POPUP_MESSAGE);
NotificationService.ACTION_POPUP_MESSAGE);
logger.debug("Deleting Popup");
}
tmpNTE.setModify(false);
@ -804,7 +804,7 @@ public void actionAdded(NotificationActionTypeEvent event)
tmpNTE.setPopup(isActionEnabled);
}
else if(event.getSourceActionType()
.equals(notificationService.ACTION_COMMAND))
.equals(NotificationService.ACTION_COMMAND))
{
tmpNTE.setProgram(isActionEnabled);
@ -843,7 +843,7 @@ else if(event.getSourceActionType()
}
else if(event.getSourceActionType()
.equals(notificationService.ACTION_COMMAND))
.equals(NotificationService.ACTION_COMMAND))
{
tmpNTE.setProgram(isActionEnabled);
tmpNTE.setProgramFile(((CommandNotificationHandler)event
@ -877,7 +877,7 @@ else if(event.getSourceActionType()
tmpNTE.setPopup(isActionEnabled);
}
else if(event.getSourceActionType()
.equals(notificationService.ACTION_COMMAND))
.equals(NotificationService.ACTION_COMMAND))
{
tmpNTE.setProgram(isActionEnabled);
tmpNTE.setProgramFile(((CommandNotificationHandler)event
@ -954,7 +954,7 @@ public void actionChanged(NotificationActionTypeEvent event)
if(tmpNTE.getEvent().equals(eventName))
{
if(event.getSourceActionType()
.equals(notificationService.ACTION_COMMAND))
.equals(NotificationService.ACTION_COMMAND))
{
tmpNTE.setProgramFile(((CommandNotificationHandler)event
.getActionHandler()).getDescriptor());
@ -1060,8 +1060,6 @@ public void buildingVector()
Iterator<String> it = notificationService.getRegisteredEvents();
NotificationsTableEntry tmpNTE = null;
String event = null;
Map actionsMap = null;
dataVector.removeAllElements();
while(it.hasNext())
@ -1078,34 +1076,24 @@ public void buildingVector()
event,
false);
actionsMap = notificationService.getEventNotifications(event);
Map<String, NotificationActionHandler> actionsMap
= notificationService.getEventNotifications(event);
if(actionsMap != null)
{
Set entry = actionsMap.entrySet();
Iterator itEntry = entry.iterator();
while(itEntry.hasNext())
for (Map.Entry<String, NotificationActionHandler> mEntry
: actionsMap.entrySet())
{
Map.Entry mEntry = (Map.Entry) itEntry.next();
String actionType = (String) mEntry.getKey();
NotificationActionHandler handler = null;
boolean isActionEnabled = false;
if(mEntry.getValue() instanceof NotificationActionHandler)
{
handler = (NotificationActionHandler)mEntry.getValue();
isActionEnabled = handler.isEnabled();
}
String actionType = mEntry.getKey();
NotificationActionHandler handler = mEntry.getValue();
boolean isActionEnabled = (handler == null) ? false : handler.isEnabled();
if(actionType
.equals(notificationService.ACTION_POPUP_MESSAGE))
.equals(NotificationService.ACTION_POPUP_MESSAGE))
{
tmpNTE.setPopup(isActionEnabled);
}
else if(actionType
.equals(notificationService.ACTION_SOUND) &&
.equals(NotificationService.ACTION_SOUND) &&
handler != null)
{
tmpNTE.setSound(isActionEnabled);
@ -1113,7 +1101,7 @@ else if(actionType
((SoundNotificationHandler) handler).getDescriptor());
}
else if(actionType
.equals(notificationService.ACTION_COMMAND) &&
.equals(NotificationService.ACTION_COMMAND) &&
handler != null)
{
tmpNTE.setProgram(isActionEnabled);

@ -82,9 +82,10 @@ public static UIService getUiService()
* @return all <tt>OperationSetWhiteboarding</tt>s obtained from the bundle
* context
*/
public static List getWhiteboardOperationSets()
public static List<OperationSetWhiteboarding> getWhiteboardOperationSets()
{
List<OperationSet> whiteboardOpSets = new ArrayList<OperationSet>();
List<OperationSetWhiteboarding> whiteboardOpSets
= new ArrayList<OperationSetWhiteboarding>();
ServiceReference[] serRefs = null;
try
@ -102,15 +103,15 @@ public static List getWhiteboardOperationSets()
if (serRefs == null)
return null;
for (int i = 0; i < serRefs.length; i++)
for (ServiceReference serRef : serRefs)
{
ProtocolProviderService protocolProvider
= (ProtocolProviderService) bundleContext
.getService(serRefs[i]);
= (ProtocolProviderService) bundleContext.getService(serRef);
OperationSet opSet
= protocolProvider.getOperationSet(
OperationSetWhiteboarding.class);
OperationSetWhiteboarding opSet
= (OperationSetWhiteboarding)
protocolProvider
.getOperationSet(OperationSetWhiteboarding.class);
if(opSet != null)
whiteboardOpSets.add(opSet);

@ -8,6 +8,7 @@
import java.awt.*;
import java.util.*;
import java.util.List;
import net.java.sip.communicator.plugin.whiteboard.gui.*;
import net.java.sip.communicator.plugin.whiteboard.gui.whiteboardshapes.*;
@ -38,18 +39,14 @@ public class WhiteboardSessionManager
public WhiteboardSessionManager()
{
if (WhiteboardActivator
.getWhiteboardOperationSets() == null)
return;
List<OperationSetWhiteboarding> whiteboardOpSets
= WhiteboardActivator.getWhiteboardOperationSets();
Iterator opSets = WhiteboardActivator
.getWhiteboardOperationSets().iterator();
if (whiteboardOpSets == null)
return;
while (opSets.hasNext())
for (OperationSetWhiteboarding whiteboardOpSet : whiteboardOpSets)
{
OperationSetWhiteboarding whiteboardOpSet
= (OperationSetWhiteboarding) opSets.next();
whiteboardOpSet.addInvitationListener(new InvitationListener());
whiteboardOpSet.addPresenceListener(new PresenceListener());
}
@ -130,7 +127,7 @@ public WhiteboardObject sendWhiteboardObject ( WhiteboardSession wbSession,
WhiteboardShape ws)
throws OperationFailedException
{
Vector supportedWBO = new Vector (
Vector<String> supportedWBO = new Vector<String>(
Arrays.asList (wbSession.getSupportedWhiteboardObjects ()));
if(ws instanceof WhiteboardObjectPath)

@ -156,11 +156,6 @@ public class WhiteboardFrame
*/
private WhiteboardShape selectedShape = null;
/**
* The current selected point (null if nothing is seleted)
*/
private Point2D selectedPoint = null;
/**
* The current preselected shape (null if nothing is preseleted) A shape is
* preselected when the mouse move on.
@ -220,12 +215,12 @@ public class WhiteboardFrame
/**
* List of WhiteboardShape
*/
private List displayList = new CopyOnWriteArrayList();
private List<WhiteboardShape> displayList = new CopyOnWriteArrayList<WhiteboardShape>();
/**
* Aarray of WhiteboardPoint
*/
private List pathList = new ArrayList();
private List<WhiteboardPoint> pathList = new ArrayList<WhiteboardPoint>();
/**
* WhiteboardPanel where the shapes are drawn
@ -462,8 +457,7 @@ public void mousePressed(MouseEvent e)
deselect();
for (int i = displayList.size() - 1; i >= 0; i--)
{
WhiteboardShape shape =
(WhiteboardShape) displayList.get(i);
WhiteboardShape shape = displayList.get(i);
if (shape.contains(s2w.transform(e.getPoint(), null)))
{
@ -482,8 +476,7 @@ else if (currentTool == MODIF)
deselect();
for (int i = displayList.size() - 1; i >= 0; i--)
{
WhiteboardShape shape =
(WhiteboardShape) displayList.get(i);
WhiteboardShape shape = displayList.get(i);
WhiteboardPoint point = shape.getSelectionPoint(
s2w.transform(e.getPoint(), null));
@ -661,7 +654,7 @@ public void mouseMoved(MouseEvent e)
WhiteboardShape shape;
for (int i = 0; i < displayList.size(); i++)
{
shape = (WhiteboardShape) displayList.get(i);
shape = displayList.get(i);
if (shape.contains(s2w.transform(e.getPoint(), null)))
{
@ -811,7 +804,6 @@ private void initComponents()
newMenuItem = new JMenuItem();
openMenuItem = new JMenuItem();
saveMenuItem = new JMenuItem();
sendMenuItem = new JMenuItem();
printMenuItem = new JMenuItem();
exitMenuItem = new JMenuItem();
editMenu = new JMenu();
@ -831,7 +823,7 @@ private void initComponents()
if (session != null)
{
Iterator participants = session.getWhiteboardParticipants();
Iterator<?> participants = session.getWhiteboardParticipants();
while (participants.hasNext())
{
@ -1531,8 +1523,6 @@ private void colorChooserButtonActionPerformed(
private javax.swing.JToggleButton selectionButton;
private javax.swing.JMenuItem sendMenuItem;
private javax.swing.JToggleButton textButton;
private JPanel toolBar;
@ -2215,7 +2205,7 @@ private void deselect()
WhiteboardShape shape;
for (int i = 0; i < displayList.size(); i++)
{
shape = (WhiteboardShape) displayList.get(i);
shape = displayList.get(i);
shape.setSelected(false);
shape.setModifyPoint(null);
}
@ -2287,7 +2277,7 @@ public void receiveWhiteboardObject(WhiteboardObject wbo)
WhiteboardShape ws = createWhiteboardShape(wbo);
for (int i = 0; i < displayList.size(); i++)
{
WhiteboardShape wbs = (WhiteboardShape) displayList.get(i);
WhiteboardShape wbs = displayList.get(i);
if (wbs.getID().equals(wbo.getID()))
{
displayList.set(i, ws);
@ -2310,7 +2300,7 @@ public void receiveDeleteWhiteboardObject(String id)
int i = 0;
while (i < displayList.size())
{
WhiteboardShape wbs = (WhiteboardShape) displayList.get(i);
WhiteboardShape wbs = displayList.get(i);
if (id.equals(wbs.getID()))
displayList.remove(i);
else
@ -2339,7 +2329,7 @@ private WhiteboardShape createWhiteboardShape(WhiteboardObject wbo)
WhiteboardObjectPath path = (WhiteboardObjectPath) wbo;
logger.debug("[log] : WB_PATH");
Color c = Color.getColor("", color);
List points = path.getPoints();
List<WhiteboardPoint> points = path.getPoints();
wShape = new WhiteboardShapePath(id, t, c, points);
}
else if (wbo instanceof WhiteboardObjectPolyLine)
@ -2347,7 +2337,7 @@ else if (wbo instanceof WhiteboardObjectPolyLine)
WhiteboardObjectPolyLine pLine = (WhiteboardObjectPolyLine) wbo;
logger.debug("[log] : WB_POLYLINE");
Color c = Color.getColor("", color);
List points = pLine.getPoints();
List<WhiteboardPoint> points = pLine.getPoints();
wShape = new WhiteboardShapePolyLine(id, t, c, points, false);
}
@ -2356,7 +2346,7 @@ else if (wbo instanceof WhiteboardObjectPolygon)
WhiteboardObjectPolygon polygon = (WhiteboardObjectPolygon) wbo;
logger.debug("[log] : WB_POLYGON");
Color c = Color.getColor("", color);
List points = polygon.getPoints();
List<WhiteboardPoint> points = polygon.getPoints();
boolean fill = polygon.isFill();
wShape = new WhiteboardShapePolygon(id, t, c, points, fill);
@ -2401,11 +2391,8 @@ else if (wbo instanceof WhiteboardObjectText)
logger.debug("[log] : WB_TEXT");
Color c = Color.getColor("", color);
WhiteboardPoint p = text.getWhiteboardPoint();
int size;
String txt, fontFamily;
size = text.getFontSize();
txt = text.getText();
fontFamily = text.getFontName();
int size = text.getFontSize();
String txt = text.getText();
wShape = new WhiteboardShapeText(id, c, p, size, txt);
}
@ -2413,7 +2400,6 @@ else if (wbo instanceof WhiteboardObjectImage)
{
WhiteboardObjectImage img = (WhiteboardObjectImage) wbo;
logger.debug("[log] : WB_IMAGE");
Color c = Color.getColor("", color);
double height, width;
WhiteboardPoint p = img.getWhiteboardPoint();
width = img.getWidth();
@ -2433,7 +2419,7 @@ public void deleteSelected()
int i = 0;
while (i < displayList.size())
{
s = (WhiteboardShape) displayList.get(i);
s = displayList.get(i);
if (s.isSelected())
{
this.sendDeleteShape(s);

@ -4,17 +4,14 @@
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.plugin.whiteboard.gui.whiteboardshapes;
import java.awt.*;
import java.awt.geom.AffineTransform;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Point2D;
import java.awt.geom.*;
import java.util.*;
import java.util.List;
import net.java.sip.communicator.service.protocol.WhiteboardPoint;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.whiteboardobjects.*;
/**
@ -49,7 +46,7 @@ public class WhiteboardShapeCircle
/**
* Stores all selection points for this shape.
*/
private ArrayList selectionPoints = new ArrayList();
private ArrayList<WhiteboardPoint> selectionPoints = new ArrayList<WhiteboardPoint>();
/**
* WhiteboardShapeCircle constructor
@ -207,14 +204,9 @@ public WhiteboardPoint getSelectionPoint (Point2D p)
{
WhiteboardPoint givenPoint = new WhiteboardPoint(p.getX(), p.getY());
for (int i = 0; i < selectionPoints.size(); i ++)
{
WhiteboardPoint point = (WhiteboardPoint) selectionPoints.get(i);
for (WhiteboardPoint point : selectionPoints)
if (point.distance(givenPoint) < 10)
return point;
}
return null;
}
/**
@ -222,7 +214,7 @@ public WhiteboardPoint getSelectionPoint (Point2D p)
*
* @return list of selected points
*/
public List getSelectionPoints ()
public List<WhiteboardPoint> getSelectionPoints ()
{
return selectionPoints;
}
@ -398,4 +390,4 @@ private void recalculateSelectionPoints()
new WhiteboardPoint ( whiteboardPoint.getX(),
whiteboardPoint.getY() + radius));
}
}
}

@ -55,7 +55,7 @@ public class WhiteboardShapeImage
/**
* Stores all selection points for this shape.
*/
private ArrayList selectionPoints = new ArrayList();
private ArrayList<WhiteboardPoint> selectionPoints = new ArrayList<WhiteboardPoint>();
/**
* WhiteboardShapImage constructor
@ -117,7 +117,7 @@ public void paintShape (Graphics2D g, AffineTransform t)
*
* @return list of selected points
*/
public List getSelectionPoints ()
public List<WhiteboardPoint> getSelectionPoints ()
{
return selectionPoints;
}
@ -262,14 +262,9 @@ public WhiteboardPoint getSelectionPoint (Point2D p)
{
WhiteboardPoint givenPoint = new WhiteboardPoint(p.getX(), p.getY());
for (int i = 0; i < selectionPoints.size(); i ++)
{
WhiteboardPoint point = (WhiteboardPoint) selectionPoints.get(i);
for (WhiteboardPoint point : selectionPoints)
if (point.distance(givenPoint) < 18)
return point;
}
return null;
}
@ -343,4 +338,4 @@ private void recalculateSelectionPoints()
new WhiteboardPoint ( whiteboardPoint.getX() + width,
whiteboardPoint.getY() + height));
}
}
}

@ -131,9 +131,9 @@ public boolean contains (Point2D p)
*
* @return list of selected points
*/
public List getSelectionPoints ()
public List<WhiteboardPoint> getSelectionPoints ()
{
ArrayList selectionPoints = new ArrayList();
ArrayList<WhiteboardPoint> selectionPoints = new ArrayList<WhiteboardPoint>();
selectionPoints.add (startPoint);
selectionPoints.add (endPoint);
@ -246,4 +246,4 @@ public void setWhiteboardPointEnd (WhiteboardPoint whiteboardPointEnd)
{
this.endPoint = whiteboardPointEnd;
}
}
}

@ -4,15 +4,14 @@
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.plugin.whiteboard.gui.whiteboardshapes;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.*;
import java.awt.geom.*;
import java.util.*;
import net.java.sip.communicator.service.protocol.WhiteboardPoint;
import java.util.List;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.whiteboardobjects.*;
/**
@ -28,7 +27,7 @@ public class WhiteboardShapePath
/**
* List of WhiteboardPoint
*/
private ArrayList points;
private ArrayList<WhiteboardPoint> points;
/**
* WhiteboardShapePath constructor.
@ -39,12 +38,12 @@ public class WhiteboardShapePath
* @param c WhiteboardShapePath's color (or rather it's border)
* @param points list of WhiteboardPoint.
*/
public WhiteboardShapePath (String id, int t, Color c, List points)
public WhiteboardShapePath (String id, int t, Color c, List<WhiteboardPoint> points)
{
super (id);
this.setThickness (t);
setColor (c.getRGB ());
this.points = new ArrayList (points);
this.points = new ArrayList<WhiteboardPoint>(points);
}
/**
@ -57,17 +56,15 @@ public WhiteboardShapePath (String id, int t, Color c, List points)
* @param v2w 2D affine transform
*/
public WhiteboardShapePath (String id, int t, Color c,
List points, AffineTransform v2w)
List<WhiteboardPoint> points, AffineTransform v2w)
{
super (id);
this.setThickness (t);
setColor (c.getRGB ());
this.points = new ArrayList ();
WhiteboardPoint p = null;
for (int i = 0; i < points.size ();i++)
this.points = new ArrayList<WhiteboardPoint>();
for (WhiteboardPoint p : points)
{
p = (WhiteboardPoint) points.get (i);
Point2D w = v2w.transform (
new Point2D.Double (p.getX (), p.getY ()), null);
this.points.add (new WhiteboardPoint (w.getX (), w.getY ()));
@ -80,7 +77,7 @@ public WhiteboardShapePath (String id, int t, Color c,
*
* @return the list of <tt>WhiteboardPoint</tt>s composing this object.
*/
public List getPoints ()
public List<WhiteboardPoint> getPoints ()
{
return points;
}
@ -90,15 +87,12 @@ public List getPoints ()
*
* @return list of selected points
*/
public List getSelectionPoints ()
public List<WhiteboardPoint> getSelectionPoints ()
{
List list = new ArrayList ();
WhiteboardPoint p ;
for(int i =0; i< points.size (); i++)
{
p = (WhiteboardPoint) points.get (i);
List<WhiteboardPoint> list = new ArrayList<WhiteboardPoint>();
for(WhiteboardPoint p : points)
list.add (new WhiteboardPoint (p.getX (), p.getY ()));
}
return list;
}
@ -116,7 +110,7 @@ public void paintShape (Graphics2D g, AffineTransform t)
int size = points.size ();
for (int i = 0; i < size; i++)
{
WhiteboardPoint point = (WhiteboardPoint) points.get (i);
WhiteboardPoint point = points.get (i);
Point2D p0 = t.transform (
new Point2D.Double (startX, startY), null);
Point2D p1 = t.transform (
@ -151,7 +145,7 @@ public boolean contains (Point2D p)
int size = points.size ();
for (int i = 0; i < size; i++)
{
WhiteboardPoint point = (WhiteboardPoint) points.get (i);
WhiteboardPoint point = points.get (i);
if (i > 0)
{
@ -177,9 +171,9 @@ public boolean contains (Point2D p)
* @param points the list of <tt>WhiteboardPoint</tt> instances that this
* <tt>WhiteboardObject</tt> is composed of.
*/
public void setPoints (List points)
public void setPoints (List<WhiteboardPoint> points)
{
this.points = new ArrayList (points);
this.points = new ArrayList<WhiteboardPoint>(points);
}
/**
@ -193,7 +187,7 @@ public void translate (double deltaX, double deltaY)
WhiteboardPoint point;
for (int i = 0; i< points.size ();i++)
{
point = (WhiteboardPoint) points.get (i);
point = points.get (i);
points.set (i, new WhiteboardPoint (
point.getX () + deltaX, point.getY () + deltaY));
@ -216,7 +210,7 @@ public void translateSelectedPoint (double deltaX, double deltaY)
for (int i = 0; i < points.size (); i++)
{
point = (WhiteboardPoint) points.get (i);
point = points.get (i);
if(getModifyPoint().equals(point))
{
@ -239,17 +233,10 @@ public void translateSelectedPoint (double deltaX, double deltaY)
*/
public WhiteboardPoint getSelectionPoint (Point2D p)
{
WhiteboardPoint point;
for (int i = 0; i < points.size (); i++)
{
point = (WhiteboardPoint) points.get (i);
if((new Point2D.Double (
point.getX (), point.getY ())).distance (p) < 18)
{
for (WhiteboardPoint point : points)
if((new Point2D.Double (point.getX (), point.getY ())).distance (p)
< 18)
return point;
}
}
return null;
}
}
}

@ -31,7 +31,7 @@ public class WhiteboardShapePolyLine
/**
* list of WhiteboardPoint
*/
private List points;
private List<WhiteboardPoint> points;
/**
* True is filled, false is unfilled.
*/
@ -50,7 +50,7 @@ public class WhiteboardShapePolyLine
public WhiteboardShapePolyLine (String id,
int thickness,
Color color,
List points,
List<WhiteboardPoint> points,
boolean fill)
{
super (id);
@ -72,18 +72,18 @@ public WhiteboardShapePolyLine (String id,
public WhiteboardShapePolyLine (String id,
int thickness,
Color color,
List m_points,
List<WhiteboardPoint> m_points,
boolean fill,
AffineTransform at)
{
super (id);
ArrayList pointsList = new ArrayList ();
ArrayList<WhiteboardPoint> pointsList = new ArrayList<WhiteboardPoint>();
WhiteboardPoint p;
for (int i = 0; i<m_points.size ();i++)
{
p = (WhiteboardPoint) m_points.get (i);
p = m_points.get (i);
Point2D w = at.transform (
new Point2D.Double (p.getX (), p.getY ()), null);
pointsList.add (new WhiteboardPoint (w.getX (), w.getY ()));
@ -103,14 +103,14 @@ public WhiteboardShapePolyLine (String id,
*/
private void initShape (int thickness,
Color color,
List points,
List<WhiteboardPoint> points,
boolean fill)
{
this.setThickness (thickness);
this.setColor (color);
// need to clone because passed by reference
this.points = new ArrayList (points);
this.points = new ArrayList<WhiteboardPoint>(points);
this.fill = fill;
}
@ -160,13 +160,13 @@ public void paintShape (Graphics2D g, AffineTransform t)
*
* @return list of selected WhiteboardPoints
*/
public List getSelectionPoints ()
public List<WhiteboardPoint> getSelectionPoints ()
{
List list = new ArrayList ();
WhiteboardPoint p ;
List<WhiteboardPoint> list = new ArrayList<WhiteboardPoint>();
WhiteboardPoint p;
for(int i =0; i< points.size (); i++)
{
p = (WhiteboardPoint) points.get (i);
p = points.get (i);
list.add (new WhiteboardPoint (p.getX (), p.getY ()));
}
return list;
@ -196,14 +196,14 @@ private GeneralPath createPoly (AffineTransform w2v)
GeneralPath.WIND_EVEN_ODD, points.size ());
if(points.size ()<=0)
return polyline;
WhiteboardPoint start = (WhiteboardPoint) points.get (0);
WhiteboardPoint start = points.get (0);
Point2D w = new Point2D.Double (start.getX (), start.getY ());
Point2D v = w2v.transform (w, null);
polyline.moveTo ((int) v.getX (), (int) v.getY ());
WhiteboardPoint p;
for (int i =0; i<points.size ();i++)
{
p = (WhiteboardPoint) points.get (i);
p = points.get (i);
w = new Point2D.Double (p.getX (), p.getY ());
v = w2v.transform (w, null);
polyline.lineTo ((int) v.getX (), (int) v.getY ());
@ -224,13 +224,13 @@ private GeneralPath createPolyWorld ()
GeneralPath.WIND_EVEN_ODD, points.size ());
if(points.size ()<=0)
return polyline;
WhiteboardPoint start = (WhiteboardPoint) points.get (0);
WhiteboardPoint start = points.get (0);
polyline.moveTo ((float) start.getX (), (float) start.getY ());
WhiteboardPoint p;
for (int i =0; i<points.size ();i++)
{
p = (WhiteboardPoint) points.get (i);
p = points.get (i);
polyline.lineTo ((float) p.getX (), (float) p.getY ());
}
@ -243,7 +243,7 @@ private GeneralPath createPolyWorld ()
*
* @return the list of <tt>WhiteboardPoint</tt>s composing this object.
*/
public List getPoints ()
public List<WhiteboardPoint> getPoints ()
{
return points;
}
@ -255,9 +255,9 @@ public List getPoints ()
* @param points the list of <tt>WhiteboardPoint</tt> instances that this
* <tt>WhiteboardObject</tt> is composed of.
*/
public void setPoints (List points)
public void setPoints (List<WhiteboardPoint> points)
{
this.points = new ArrayList (points);
this.points = new ArrayList<WhiteboardPoint> (points);
}
/**
@ -271,7 +271,7 @@ public void translate (double deltaX, double deltaY)
WhiteboardPoint point ;
for (int i =0; i<points.size ();i++)
{
point = (WhiteboardPoint) points.get (i);
point = points.get (i);
points.set (i,
new WhiteboardPoint(point.getX () + deltaX,
point.getY () + deltaY));
@ -292,7 +292,7 @@ public void translateSelectedPoint (double deltaX, double deltaY)
WhiteboardPoint point;
for (int i = 0; i < points.size (); i++)
{
point = (WhiteboardPoint) points.get (i);
point = points.get (i);
if(getModifyPoint().equals(point))
{
@ -318,7 +318,7 @@ public WhiteboardPoint getSelectionPoint (Point2D p)
WhiteboardPoint point;
for (int i = 0; i < points.size (); i++)
{
point = (WhiteboardPoint) points.get (i);
point = points.get (i);
if(( new Point2D.Double (
point.getX (), point.getY ())).distance (p) < 18)
{
@ -328,4 +328,4 @@ public WhiteboardPoint getSelectionPoint (Point2D p)
return null;
}
}
}

@ -32,7 +32,7 @@ public class WhiteboardShapePolygon
/**
* list of WhiteboardPoint
*/
private List points;
private List<WhiteboardPoint> points;
/**
* True is filled, false is unfilled.
*/
@ -55,7 +55,7 @@ public class WhiteboardShapePolygon
public WhiteboardShapePolygon ( String id,
int thickness,
Color color,
List points,
List<WhiteboardPoint> points,
boolean fill)
{
super (id);
@ -77,17 +77,17 @@ public WhiteboardShapePolygon ( String id,
public WhiteboardShapePolygon ( String id,
int t,
Color c,
List m_points,
List<WhiteboardPoint> m_points,
boolean fill,
AffineTransform at)
{
super (id);
ArrayList pointsList = new ArrayList ();
ArrayList<WhiteboardPoint> pointsList = new ArrayList<WhiteboardPoint>();
WhiteboardPoint p;
for (int i = 0; i < m_points.size (); i++)
{
p = (WhiteboardPoint) m_points.get (i);
p = m_points.get (i);
Point2D w = at.transform (
new Point2D.Double (p.getX (), p.getY ()), null);
pointsList.add (new WhiteboardPoint (w.getX (), w.getY ()));
@ -107,13 +107,13 @@ public WhiteboardShapePolygon ( String id,
*/
private void initShape (int thickness,
Color color,
List points,
List<WhiteboardPoint> points,
boolean fill)
{
this.setThickness (thickness);
setColor (color);
this.backgroundColor = color;
this.points = new ArrayList (points);
this.points = new ArrayList<WhiteboardPoint>(points);
this.fill = fill;
}
@ -163,7 +163,7 @@ public void paintShape (Graphics2D g, AffineTransform t)
*
* @return list of selected WhiteboardPoints
*/
public List getSelectionPoints ()
public List<WhiteboardPoint> getSelectionPoints ()
{
return points;
}
@ -193,7 +193,7 @@ private GeneralPath createPoly (AffineTransform w2v)
if(points.size ()<=0)
return polygon;
WhiteboardPoint start = (WhiteboardPoint) points.get (0);
WhiteboardPoint start = points.get (0);
Point2D w = new Point2D.Double (start.getX (), start.getY ());
Point2D v = w2v.transform (w, null);
polygon.moveTo ((int) v.getX (), (int) v.getY ());
@ -201,7 +201,7 @@ private GeneralPath createPoly (AffineTransform w2v)
WhiteboardPoint p;
for (int i =0; i<points.size ();i++)
{
p = (WhiteboardPoint) points.get (i);
p = points.get (i);
w = new Point2D.Double (p.getX (), p.getY ());
v = w2v.transform (w, null);
polygon.lineTo ((int) v.getX (), (int) v.getY ());
@ -224,13 +224,13 @@ private GeneralPath createPolyWorld ()
if(points.size ()<=0)
return polygon;
WhiteboardPoint start = (WhiteboardPoint) points.get (0);
WhiteboardPoint start = points.get (0);
polygon.moveTo ((float) start.getX (), (float) start.getY ());
WhiteboardPoint p;
for (int i =0; i<points.size ();i++)
{
p = (WhiteboardPoint) points.get (i);
p = points.get (i);
polygon.lineTo ((float) p.getX (), (float) p.getY ());
}
@ -244,7 +244,7 @@ private GeneralPath createPolyWorld ()
*
* @return the list of <tt>WhiteboardPoint</tt>s composing this object.
*/
public List getPoints ()
public List<WhiteboardPoint> getPoints ()
{
return points;
}
@ -256,9 +256,9 @@ public List getPoints ()
* @param points the list of <tt>WhiteboardPoint</tt> instances that this
* <tt>WhiteboardObject</tt> is composed of.
*/
public void setPoints (List points)
public void setPoints (List<WhiteboardPoint> points)
{
this.points = new ArrayList (points);
this.points = new ArrayList<WhiteboardPoint>(points);
}
/**
@ -272,7 +272,7 @@ public void translate (double deltaX, double deltaY)
WhiteboardPoint point ;
for (int i =0; i<points.size ();i++)
{
point = (WhiteboardPoint) points.get (i);
point = points.get (i);
points.set (i,
new WhiteboardPoint (point.getX () + deltaX,
point.getY () + deltaY));
@ -294,7 +294,7 @@ public void translateSelectedPoint (double deltaX, double deltaY)
WhiteboardPoint point;
for (int i = 0; i < points.size (); i++)
{
point = (WhiteboardPoint) points.get (i);
point = points.get (i);
if(getModifyPoint().equals(point))
{
WhiteboardPoint newPoint
@ -320,7 +320,7 @@ public WhiteboardPoint getSelectionPoint (Point2D p)
WhiteboardPoint point;
for (int i = 0; i< points.size ();i++)
{
point = (WhiteboardPoint) points.get (i);
point = points.get (i);
if(( new Point2D.Double (
point.getX (), point.getY ())).distance (p) < 18)
@ -355,4 +355,4 @@ public int getBackgroundColor ()
{
return this.backgroundColor.getRGB ();
}
}
}

@ -4,16 +4,14 @@
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.plugin.whiteboard.gui.whiteboardshapes;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.*;
import java.awt.geom.*;
import java.util.*;
import java.util.List;
import net.java.sip.communicator.service.protocol.WhiteboardPoint;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.whiteboardobjects.*;
/**
@ -53,7 +51,8 @@ public class WhiteboardShapeRect
/**
* Stores all selection points for this shape.
*/
private ArrayList selectionPoints = new ArrayList();
private List<WhiteboardPoint> selectionPoints
= new ArrayList<WhiteboardPoint>();
/**
* WhiteboardShapeRect constructor.
@ -234,7 +233,7 @@ public void paintShape (Graphics2D g, AffineTransform t)
*
* @return list of selected points
*/
public List getSelectionPoints ()
public List<WhiteboardPoint> getSelectionPoints ()
{
return selectionPoints;
}
@ -340,14 +339,9 @@ public WhiteboardPoint getSelectionPoint (Point2D p)
{
WhiteboardPoint givenPoint = new WhiteboardPoint(p.getX(), p.getY());
for (int i = 0; i < selectionPoints.size(); i ++)
{
WhiteboardPoint point = (WhiteboardPoint) selectionPoints.get(i);
for (WhiteboardPoint point : selectionPoints)
if (point.distance(givenPoint) < 18)
return point;
}
return null;
}
@ -440,4 +434,4 @@ private void recalculateSelectionPoints()
new WhiteboardPoint ( point.getX() + width,
point.getY() + height));
}
}
}

@ -153,9 +153,9 @@ public void paintShape (Graphics2D g, AffineTransform t)
*
* @return list of selected points
*/
public List getSelectionPoints ()
public List<WhiteboardPoint> getSelectionPoints ()
{
List list = new ArrayList ();
List<WhiteboardPoint> list = new ArrayList<WhiteboardPoint>();
list.add (point);
return list;
@ -319,4 +319,4 @@ public void setFontName (String fontName)
{
this.fontName = fontName;
}
}
}

@ -280,7 +280,8 @@ public void removeEventNotificationAction( String eventType,
* an event with the specified name has occurred, or null if no actions
* have been defined for <tt>eventType</tt>.
*/
public Map getEventNotifications(String eventType);
public Map<String, NotificationActionHandler> getEventNotifications(
String eventType);
/**
* Returns the <tt>NotificationActionHandler</tt> corresponding to the given

@ -9,8 +9,7 @@
import java.util.*;
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.service.protocol.whiteboardobjects.WhiteboardObject;
import net.java.sip.communicator.service.protocol.whiteboardobjects.*;
/**
* A represenation of a <tt>WhiteboardSession</tt>.
@ -34,7 +33,7 @@ public interface WhiteboardSession
* @return an Iterator over all participants currently involved in the
* whiteboard.
*/
public Iterator getWhiteboardParticipants ();
public Iterator<WhiteboardParticipant> getWhiteboardParticipants ();
/**
* Returns the number of participants currently associated
@ -224,7 +223,7 @@ public abstract void removeWhiteboardParticipant (
* @return an <tt>Vector</tt> of WhiteboardObjects associated
* with this whiteboard.
*/
public Vector getWhiteboardObjects ();
public Vector<WhiteboardObject> getWhiteboardObjects ();
/**
* Sets the state of this whiteboard

@ -4,11 +4,12 @@
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.service.protocol.whiteboardobjects;
import java.util.List;
import net.java.sip.communicator.service.protocol.*;
/**
* Used to access the content of instant whiteboard objects that are sent or
* received via the WhiteboardOperationSet.
@ -28,7 +29,7 @@ public interface WhiteboardObjectPath extends WhiteboardObject
*
* @return the list of <tt>WhiteboardPoint</tt>s composing this object.
*/
public List getPoints();
public List<WhiteboardPoint> getPoints();
/**
* Sets the list of <tt>WhiteboardPoint</tt> instances that this
@ -37,5 +38,5 @@ public interface WhiteboardObjectPath extends WhiteboardObject
* @param points the list of <tt>WhiteboardPoint</tt> instances that this
* <tt>WhiteboardObject</tt> is composed of.
*/
public void setPoints(List points);
}
public void setPoints(List<WhiteboardPoint> points);
}

@ -4,10 +4,11 @@
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.service.protocol.whiteboardobjects;
import java.util.List;
import java.util.*;
import net.java.sip.communicator.service.protocol.*;
/**
* Used to access the content of instant whiteboard objects that are sent or
@ -28,7 +29,7 @@ public interface WhiteboardObjectPolyLine extends WhiteboardObject
*
* @return the list of <tt>WhiteboardPoint</tt>s composing this object.
*/
public List getPoints ();
public List<WhiteboardPoint> getPoints ();
/**
* Sets the list of <tt>WhiteboardPoint</tt> instances that this
@ -37,5 +38,5 @@ public interface WhiteboardObjectPolyLine extends WhiteboardObject
* @param points the list of <tt>WhiteboardPoint</tt> instances that this
* <tt>WhiteboardObject</tt> is composed of.
*/
public void setPoints (List points);
}
public void setPoints (List<WhiteboardPoint> points);
}

@ -4,11 +4,12 @@
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.service.protocol.whiteboardobjects;
import java.util.List;
import net.java.sip.communicator.service.protocol.*;
/**
* Used to access the content of instant whiteboard objects that are sent or
* received via the WhiteboardOperationSet.
@ -43,7 +44,7 @@ public interface WhiteboardObjectPolygon extends WhiteboardObject
*
* @return the list of <tt>WhiteboardPoint</tt>s composing this object.
*/
public List getPoints ();
public List<WhiteboardPoint> getPoints ();
/**
* Sets the list of <tt>WhiteboardPoint</tt> instances that this
@ -52,7 +53,7 @@ public interface WhiteboardObjectPolygon extends WhiteboardObject
* @param points the list of <tt>WhiteboardPoint</tt> instances that this
* <tt>WhiteboardObject</tt> is composed of.
*/
public void setPoints (List points);
public void setPoints (List<WhiteboardPoint> points);
/**
* Specifies the background color for this object. The color parameter
@ -72,4 +73,4 @@ public interface WhiteboardObjectPolygon extends WhiteboardObject
* @return the RGB value of the background color of this object.
*/
public int getBackgroundColor ();
}
}

@ -165,7 +165,7 @@ private void generateCall(String participant)
iter = v.iterator();
while (iter.hasNext())
{
CallPeer item = (CallPeer) iter.next();
CallPeer item = iter.next();
mockBTelphonyOpSet.hangupCallPeer(item);
}
}
@ -212,14 +212,14 @@ public void readRecords()
assertEquals("Calls must be 2", rs.size(), 2);
CallRecord rec = (CallRecord)resultIter.next();
CallRecord rec = resultIter.next();
CallPeerRecord participant = rec.getPeerRecords().get(0);
assertTrue("Participant incorrect ",
participant.getPeerAddress().
equals(participantAddresses.get(2)));
rec = (CallRecord)resultIter.next();
rec = resultIter.next();
participant = rec.getPeerRecords().get(0);
assertTrue("Participant incorrect ",
@ -234,7 +234,7 @@ public void readRecords()
assertEquals("Calls must be 1", rs.size(), 1);
rec = (CallRecord)resultIter.next();
rec = resultIter.next();
participant = rec.getPeerRecords().get(0);
assertTrue("Participant incorrect ",
@ -249,21 +249,21 @@ public void readRecords()
assertEquals("Calls must be 3", rs.size(), 3);
rec = (CallRecord)resultIter.next();
rec = resultIter.next();
participant = rec.getPeerRecords().get(0);
assertTrue("Participant incorrect ",
participant.getPeerAddress().
equals(participantAddresses.get(3)));
rec = (CallRecord)resultIter.next();
rec = resultIter.next();
participant = rec.getPeerRecords().get(0);
assertTrue("Participant incorrect ",
participant.getPeerAddress().
equals(participantAddresses.get(2)));
rec = (CallRecord)resultIter.next();
rec = resultIter.next();
participant = rec.getPeerRecords().get(0);
assertTrue("Participant incorrect ",
@ -304,7 +304,7 @@ public void checkRecordCompleteness()
iter = v.iterator();
while (iter.hasNext())
{
CallPeer item = (CallPeer) iter.next();
CallPeer item = iter.next();
mockBTelphonyOpSet.hangupCallPeer(item);
}
}

@ -300,7 +300,7 @@ private void generateCall(String participant)
iter = v.iterator();
while (iter.hasNext())
{
CallPeer item = (CallPeer) iter.next();
CallPeer item = iter.next();
mockBTelphonyOpSet.hangupCallPeer(item);
}
}
@ -704,7 +704,7 @@ public void fileTests()
it = rs.iterator();
assertTrue("Filetransfers not found",
((FileRecord)it.next()).getFile().getName().
it.next().getFile().getName().
equals(files[2].getName()));
rs = getFileRecords(

@ -166,8 +166,7 @@ public void writeData(OutputStream out)
private Hashtable<String, Object> getInfoForRequest(int requestID)
{
Hashtable<String, Object> res
= (Hashtable<String, Object>)
retreivedInfo.get(new Integer(requestID));
= retreivedInfo.get(new Integer(requestID));
if (res == null)
{

@ -24,13 +24,10 @@
import net.kano.joscar.tlv.*;
import net.kano.joustsim.*;
import net.kano.joustsim.oscar.*;
import net.kano.joustsim.oscar.State;
import net.kano.joustsim.oscar.oscar.service.bos.*;
import net.kano.joustsim.oscar.oscar.service.buddy.*;
import net.kano.joustsim.oscar.oscar.service.icbm.*;
import net.kano.joustsim.oscar.oscar.service.info.*;
import net.kano.joustsim.oscar.oscar.service.ssi.*;
import net.kano.joustsim.trust.*;
/**
* An utility that we use to test AIM/ICQ implementations of the
@ -656,18 +653,16 @@ private static class BosEventNotifier implements MainBosServiceListener
public Object extraInfoLock = new Object();
public Object infoLock = new Object();
public List lastExtraInfos = null;
public FullUserInfo lastUserInfo = null;
/**
* Saves the extraInfos list and calls a notifyAll on the extraInfoLock
* @param extraInfos the list of extraInfos that the AIM server sent
*/
public void handleYourExtraInfo(List extraInfos)
public void handleYourExtraInfo(List<ExtraInfoBlock> extraInfos)
{
logger.debug("Bosiat.extrainfo=" + extraInfos);
synchronized(extraInfoLock){
lastExtraInfos = extraInfos;
extraInfoLock.notifyAll();
}
}
@ -697,7 +692,7 @@ private class LayoutEventCollector
{
public Vector<Group> addedGroups = new Vector<Group>();
public Vector<Buddy> addedBuddies = new Vector<Buddy>();
public Vector removedBuddies = new Vector();
public Vector<Buddy> removedBuddies = new Vector<Buddy>();
/**
* The method would wait until at least one new buddy is collected by
@ -807,22 +802,28 @@ public void buddyAdded(BuddyList list,
}
//we don't use this one so far.
public void groupsReordered(BuddyList list, List oldOrder, List newOrder)
public void groupsReordered(
BuddyList list,
List<? extends Group> oldOrder,
List<? extends Group> newOrder)
{
logger.debug("groupsReordered");
}
//we don't use this one so far.
public void groupRemoved(BuddyList list,
List oldItems, List newItems, Group group)
public void groupRemoved(
BuddyList list,
List<? extends Group> oldItems,
List<? extends Group> newItems,
Group group)
{
logger.debug("removedGroup="+group.getName());
}
// we don't use this one so far.
public void buddyRemoved(BuddyList list, Group group,
List oldItems,
List newItems,
List<? extends Buddy> oldItems,
List<? extends Buddy> newItems,
Buddy buddy)
{
logger.debug("removed buddy=" + buddy);
@ -830,8 +831,8 @@ public void buddyRemoved(BuddyList list, Group group,
//we don't use this one
public void buddiesReordered(BuddyList list, Group group,
List oldBuddies,
List newBuddies)
List<? extends Buddy> oldBuddies,
List<? extends Buddy> newBuddies)
{
logger.debug("buddiesReordered in group " + group.getName());
}
@ -844,7 +845,7 @@ public void gotBuddyStatus(BuddyService service, Screenname buddy,
{
System.out.println("BuddyListener.gotBuddyStatus " + buddy.toString()
+" and status is : " + info.getIcqStatus());
List eInfoBlocks = info.getExtraInfoBlocks();
List<ExtraInfoBlock> eInfoBlocks = info.getExtraInfoBlocks();
if (eInfoBlocks != null)
{
System.out.println("printing extra info blocks ("
@ -907,71 +908,36 @@ public void receivedStatusUpdate(BuddyInfoManager manager,
}
private class ServiceListener implements OpenedServiceListener
{
public void closedServices(AimConnection conn, Collection services)
{
}
public void openedServices(AimConnection conn, Collection services)
{
conn.getBuddyInfoManager().addGlobalBuddyInfoListener(new GlobalBuddyListener());
conn.getBuddyService().addBuddyListener(new BuddyListener());
}
}
private static class InfoRespListener implements InfoResponseListener{
public void handleAwayMessage(InfoService service, Screenname buddy,
String awayMessage)
{
System.out.println("InfoResponseListener.handleAwayMessage " + awayMessage);
}
public void handleCertificateInfo(InfoService service,
Screenname buddy,
BuddyCertificateInfo certInfo)
{
System.out.println("InfoResponseListener.handleCertificateInfo " + certInfo);
}
public void handleDirectoryInfo(InfoService service,
Screenname buddy, DirInfo dirInfo)
{
System.out.println("InfoResponseListener.handleDirectoryInfo " + dirInfo);
}
public void handleUserProfile(InfoService service, Screenname buddy,
String userInfo)
{
System.out.println("InfoResponseListener.handleUserProfile " + userInfo);
}
public void handleInvalidCertificates(InfoService service,
Screenname buddy,
CertificateInfo origCertInfo,
Throwable ex)
{
System.out.println("InfoResponseListener.handleInvalidCertificates " + origCertInfo);
}
}
// private class ServiceListener
// implements OpenedServiceListener
// {
// public void closedServices(AimConnection conn, Collection services)
// {
// }
//
// public void openedServices(AimConnection conn, Collection services)
// {
// conn.getBuddyInfoManager()
// .addGlobalBuddyInfoListener(new GlobalBuddyListener());
// conn.getBuddyService().addBuddyListener(new BuddyListener());
// }
// }
private class RetroListener
implements BuddyListLayoutListener, GroupListener
{
public void groupsReordered(BuddyList list, List oldOrder,
List newOrder)
public void groupsReordered(BuddyList list,
List<? extends Group> oldOrder,
List<? extends Group> newOrder)
{
System.out.println(" RetroListener.groupReordered");
}
public void groupAdded(BuddyList list, List oldItems,
List newItems,
Group group, List buddies)
public void groupAdded(BuddyList list,
List<? extends Group> oldItems,
List<? extends Group> newItems,
Group group,
List<? extends Buddy> buddies)
{
System.out.println("RetroListener.groupAdded");
System.out.println(" group.name is="+group.getName());
@ -989,36 +955,42 @@ public void groupAdded(BuddyList list, List oldItems,
group.addGroupListener(this);
}
public void groupRemoved(BuddyList list, List oldItems,
List newItems,
Group group)
public void groupRemoved(BuddyList list,
List<? extends Group> oldItems,
List<? extends Group> newItems,
Group group)
{
System.out.println(" RetroListener.groupRemoved");
}
public void buddyAdded(BuddyList list, Group group, List oldItems,
List newItems,
Buddy buddy)
public void buddyAdded(BuddyList list,
Group group,
List<? extends Buddy> oldItems,
List<? extends Buddy> newItems,
Buddy buddy)
{
System.out.println(" RetroListener.buddyAdded="+buddy);
}
public void buddyRemoved(BuddyList list, Group group,
List oldItems,
List newItems,
Buddy buddy)
public void buddyRemoved(BuddyList list,
Group group,
List<? extends Buddy> oldItems,
List<? extends Buddy> newItems,
Buddy buddy)
{
System.out.println(" RetroListener.buddyRemoved"+buddy);
}
public void buddiesReordered(BuddyList list, Group group,
List oldBuddies,
List newBuddies)
public void buddiesReordered(BuddyList list,
Group group,
List<? extends Buddy> oldBuddies,
List<? extends Buddy> newBuddies)
{
System.out.println(" RetroListener.buddiesReordered");
}
public void groupNameChanged(Group group, String oldName,
public void groupNameChanged(Group group,
String oldName,
String newName)
{
System.out.println(
@ -1028,23 +1000,22 @@ public void groupNameChanged(Group group, String oldName,
+ newName
+ " group is="+group.getName());
System.out.println("GroupContains="+group.getBuddiesCopy());
}
}
////////////////////////// ugly unused testing code //////////////////////////
private RetroListener rl = new RetroListener();
public static void main(String[] args) throws Throwable
{
java.util.logging.Logger.getLogger("net.kano").setLevel(java.util.logging.Level.FINEST);
java.util.logging.Logger.getLogger("net.kano")
.setLevel(java.util.logging.Level.FINEST);
IcqTesterAgent icqtests = new IcqTesterAgent("319305099");
if (!icqtests.register("6pC0mmtt"))
{
System.out.println("registration failed"); ;
return;
}
MainBosService bos = icqtests.conn.getBosService();
Thread.sleep(1000);
icqtests.conn.getSsiService()
.getBuddyList().addRetroactiveLayoutListener(icqtests.rl);
@ -1056,19 +1027,13 @@ public static void main(String[] args) throws Throwable
MutableBuddyList list = icqtests.conn.getSsiService().getBuddyList();
MutableGroup dupeGroup = null;
MutableGroup grpGroup = null;
Buddy buddyToMove = null;
List groups = list.getGroups();
Iterator groupsIter = groups.iterator();
while(groupsIter.hasNext())
for (Group group : list.getGroups())
{
MutableGroup group = (MutableGroup)groupsIter.next();
if (group.getName().equals("dupe"))
dupeGroup = group;
if (group.getName().equals("grp"))
grpGroup = group;
grpGroup = (MutableGroup) group;
List<? extends Buddy> buddies = group.getBuddiesCopy();
System.out.println("Printing buddies for group " + group.getName());
Thread.sleep(1000);
@ -1091,10 +1056,8 @@ public static void main(String[] args) throws Throwable
//find the buddy again.
Buddy movedBuddy = null;
groupsIter = list.getGroups().iterator();
while(groupsIter.hasNext())
for (Group group : list.getGroups())
{
MutableGroup group = (MutableGroup)groupsIter.next();
List<? extends Buddy> buddies = group.getBuddiesCopy();
for (Buddy buddy : buddies)
{
@ -1105,28 +1068,6 @@ public static void main(String[] args) throws Throwable
if (buddyToMove == movedBuddy)
System.out.println("hahaha");
}
private class TestSnacCmd extends SnacCommand
{
/** The SNAC family code for the location family. */
public static final int FAMILY_ICQ = 0x0015;
protected TestSnacCmd(int command) {
super(FAMILY_ICQ, command);
}
/**
* Writes this command's SNAC data block to the given stream. The SNAC data
* block is the data after the first ten bytes of a SNAC packet.
*
* @param out the stream to which to write the SNAC data
* @throws IOException if an I/O error occurs
*/
public void writeData(OutputStream out) throws IOException
{
}
}
public void deleteBuddy(String screenname)
@ -1331,7 +1272,7 @@ public class AuthCmdFactory
extends ServerSsiCmdFactory
implements SnacResponseListener
{
List SUPPORTED_TYPES = null;
List<CmdType> SUPPORTED_TYPES = null;
public String responseReasonStr = null;
public String requestReasonStr = null;
@ -1342,15 +1283,15 @@ public class AuthCmdFactory
public AuthCmdFactory()
{
List types = super.getSupportedTypes();
ArrayList tempTypes = new ArrayList(types);
List<CmdType> types = super.getSupportedTypes();
ArrayList<CmdType> tempTypes = new ArrayList<CmdType>(types);
tempTypes.add(new CmdType(SsiCommand.FAMILY_SSI, 0x001b)); // 1b auth request reply
tempTypes.add(new CmdType(SsiCommand.FAMILY_SSI, 0x0019)); // 19 auth request
this.SUPPORTED_TYPES = DefensiveTools.getUnmodifiable(tempTypes);
}
public List getSupportedTypes()
public List<CmdType> getSupportedTypes()
{return SUPPORTED_TYPES;}
public SnacCommand genSnacCommand(SnacPacket packet)
@ -1402,9 +1343,9 @@ public void handleResponse(SnacResponseEvent e)
(SsiDataModResponse) e.getSnacCommand();
int[] results = dataModResponse.getResults();
List items = ( (ItemsCmd) e.getRequest().getCommand()).
List<SsiItem> items = ( (ItemsCmd) e.getRequest().getCommand()).
getItems();
items = new LinkedList(items);
items = new LinkedList<SsiItem>(items);
for (int i = 0; i < results.length; i++)
{
@ -1415,11 +1356,11 @@ public void handleResponse(SnacResponseEvent e)
isErrorAddingReceived = true;
// authorisation required for user
SsiItem buddyItem = (SsiItem) items.get(i);
SsiItem buddyItem = items.get(i);
String uinToAskForAuth = buddyItem.getName();
Vector buddiesToBeAdded = new Vector();
Vector<SsiItem> buddiesToBeAdded = new Vector<SsiItem>();
BuddyAwaitingAuth newBuddy = new BuddyAwaitingAuth(
buddyItem);

@ -10,6 +10,7 @@
import junit.framework.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.ServerStoredDetails.*;
import net.java.sip.communicator.util.*;
/**
@ -192,14 +193,15 @@ public void testReadInfo()
= opSetPresence.findContactByID(fixture.testerAgent.getIcqUIN());
// Get the last name info
Iterator iter =
Iterator<GenericDetail> iter =
opSetServerStoredContactInfo.
getDetails(testerAgentContact,
ServerStoredDetails.LastNameDetail.class);
while (iter.hasNext())
{
ServerStoredDetails.LastNameDetail item = (ServerStoredDetails.LastNameDetail) iter.next();
ServerStoredDetails.LastNameDetail item
= (ServerStoredDetails.LastNameDetail) iter.next();
assertEquals("The LastName we set is not set or not read properly"
, item.getName()
@ -227,10 +229,11 @@ public void testReadInfo()
opSetServerStoredContactInfo.
getDetails(testerAgentContact,
ServerStoredDetails.SpokenLanguageDetail.class);
ArrayList spokenLanguagesServer = new ArrayList();
List<Locale> spokenLanguagesServer = new ArrayList<Locale>();
while (iter.hasNext())
{
ServerStoredDetails.SpokenLanguageDetail item = (ServerStoredDetails.SpokenLanguageDetail)iter.next();
ServerStoredDetails.SpokenLanguageDetail item
= (ServerStoredDetails.SpokenLanguageDetail)iter.next();
spokenLanguagesServer.add(item.getLocale());
}
@ -254,7 +257,8 @@ public void testReadInfo()
ServerStoredDetails.CountryDetail.class);
while (iter.hasNext())
{
ServerStoredDetails.CountryDetail item = (ServerStoredDetails.CountryDetail) iter.next();
ServerStoredDetails.CountryDetail item
= (ServerStoredDetails.CountryDetail) iter.next();
logger.info("read item value: " + item.getLocale().getDisplayCountry());
@ -282,7 +286,7 @@ public void testWriteInfo()
ServerStoredDetails.CountryDetail homeCountryDetail = null;
// Get Last name info detail
Iterator iter =
Iterator<GenericDetail> iter =
opSetServerStoredAccountInfo.
getDetails(ServerStoredDetails.LastNameDetail.class);
if (iter.hasNext())
@ -485,7 +489,7 @@ public void testWriteInfo()
logger.trace("Proceeding to Testing values!");
// make the tests here
Hashtable userInfo = fixture.testerAgent.getUserInfo(fixture.ourUserID);
Hashtable<String, Object> userInfo = fixture.testerAgent.getUserInfo(fixture.ourUserID);
assertEquals("The LastName we set is not set or not read properly"
, newLastName
@ -495,13 +499,17 @@ public void testWriteInfo()
, newPhoneNumber
, userInfo.get(FullUserInfoCmd.PHONE_NUMBER));
ArrayList languageCodes = (ArrayList)userInfo.get(FullUserInfoCmd.SPEAK_LANG);
ArrayList languages = new ArrayList();
List<?> languageCodes
= (ArrayList<?>) userInfo.get(FullUserInfoCmd.SPEAK_LANG);
ArrayList<Locale> languages = new ArrayList<Locale>();
// convert language codes to locales in the list
iter = languageCodes.iterator();
while (iter.hasNext())
Iterator<?> languageCodeIter = languageCodes.iterator();
while (languageCodeIter.hasNext())
{
languages.add(spokenLanguages[((Integer)iter.next()).intValue()]);
languages
.add(
spokenLanguages[
((Integer) languageCodeIter.next()).intValue()]);
}
// assertEquals("The number of spoken languages dowsn't match",
// newLanguages.length,
@ -525,15 +533,14 @@ public void testWriteInfo()
*/
public void errorHandling()
{
Iterator iter =
Iterator<GenericDetail> iter =
opSetServerStoredAccountInfo.
getDetails(ServerStoredDetails.SpokenLanguageDetail.class);
ArrayList initialLanguages = new ArrayList();
ArrayList<GenericDetail> initialLanguages
= new ArrayList<GenericDetail>();
while (iter.hasNext())
{
initialLanguages.add(iter.next());
}
assertEquals("There must be 3 language details!", 3, initialLanguages.size());
@ -607,23 +614,22 @@ public void removingItems()
try
{
Iterator iter =
Iterator<GenericDetail> iter =
opSetServerStoredAccountInfo.
getDetails(ServerStoredDetails.SpokenLanguageDetail.class);
ArrayList initialLanguages = new ArrayList();
List<GenericDetail> initialLanguages
= new ArrayList<GenericDetail>();
while (iter.hasNext())
{
initialLanguages.add(iter.next());
}
// now remove those languages
iter = initialLanguages.iterator();
while (iter.hasNext())
{
assertTrue("Error removing language!",
opSetServerStoredAccountInfo.removeDetail(
(ServerStoredDetails.SpokenLanguageDetail)iter.next()));
assertTrue(
"Error removing language!",
opSetServerStoredAccountInfo.removeDetail(iter.next()));
synchronized (lock)
{
try{
@ -648,14 +654,12 @@ public void removingItems()
opSetServerStoredAccountInfo.
getDetails(ServerStoredDetails.SpokenLanguageDetail.class);
ArrayList languages = new ArrayList();
List<GenericDetail> languages = new ArrayList<GenericDetail>();
while (iter.hasNext())
{
languages.add(iter.next());
}
logger.trace("languages " + languages.size());
// there must be no languages after the last retreive
// there must be no languages after the last retrieve
assertEquals("There must be no language details!", 0, languages.size());
}
catch (OperationFailedException ex)

Loading…
Cancel
Save