[sc1.0-cvs] CVS update: /sip-communicator-1-0-draft/src/net/java/sip/communicator/impl/gui/main/

yanas at dev.java.net yanas at dev.java.net
Fri Feb 17 15:11:27 CET 2006


User: yanas   
Date: 2006/02/17 06:11:27

Log:
 presence added, but not finished yet

File Changes:

Directory: /sip-communicator-1-0-draft/src/net/java/sip/communicator/impl/gui/main/
===================================================================================

File [changed]: MainFrame.java
Url: https://sip-communicator-1-0-draft.dev.java.net/source/browse/sip-communicator-1-0-draft/src/net/java/sip/communicator/impl/gui/main/MainFrame.java?r1=1.5&r2=1.6
Delta lines:  +79 -0
--------------------
--- MainFrame.java	7 Feb 2006 10:01:20 -0000	1.5
+++ MainFrame.java	17 Feb 2006 14:11:23 -0000	1.6
@@ -13,7 +13,12 @@
 import java.awt.Toolkit;

 import java.awt.event.ComponentAdapter;

 import java.awt.event.ComponentEvent;

+import java.beans.PropertyChangeEvent;

+import java.util.Enumeration;

+import java.util.Iterator;

+import java.util.Map;

 

+import javax.swing.ImageIcon;

 import javax.swing.JFrame;

 import javax.swing.JPanel;

 

@@ -21,7 +26,14 @@
 import net.java.sip.communicator.impl.gui.main.i18n.Messages;

 import net.java.sip.communicator.impl.gui.main.utils.Constants;

 import net.java.sip.communicator.impl.gui.main.utils.ImageLoader;

+import net.java.sip.communicator.impl.gui.main.utils.SelectorBoxItem;

 import net.java.sip.communicator.service.contactlist.MetaContactListService;

+import net.java.sip.communicator.service.protocol.OperationFailedException;

+import net.java.sip.communicator.service.protocol.OperationSetPersistentPresence;

+import net.java.sip.communicator.service.protocol.OperationSetPresence;

+import net.java.sip.communicator.service.protocol.event.ProviderPresenceStatusChangeEvent;

+import net.java.sip.communicator.service.protocol.event.ProviderPresenceStatusListener;

+import net.java.sip.communicator.service.protocol.icqconstants.IcqStatusEnum;

 

 /**

  * @author Yana Stamcheva

@@ -50,6 +62,8 @@
 

 	private User user;

 

+    private Map supportedOperationSets;

+    

 	private Dimension minimumFrameSize = new Dimension(

 			Constants.MAINFRAME_MIN_WIDTH, Constants.MAINFRAME_MIN_HEIGHT);

 

@@ -131,4 +145,69 @@
 	

 		this.configFrame = configFrame;

 	}

+

+    public Map getSupportedOperationSets() {

+        return supportedOperationSets;

+    }

+

+    public void setSupportedOperationSets(

+            Map supportedOperationSets) {

+        

+        this.supportedOperationSets = supportedOperationSets;

+        

+        Iterator entrySetIter = supportedOperationSets.entrySet().iterator();

+        

+        for (int i = 0; i < supportedOperationSets.size(); i++)

+        {

+            Map.Entry entry = (Map.Entry) entrySetIter.next();

+

+            Object key = entry.getKey();

+            Object value = entry.getValue();        

+            

+            if(key.equals(OperationSetPersistentPresence.class.getName())){

+

+                OperationSetPersistentPresence persistentPresence 

+                    = (OperationSetPersistentPresence)value;

+                

+                this.statusPanel.setPresence(persistentPresence);

+            

+                persistentPresence

+                    .addProviderPresenceStatusListener

+                        (new ProviderPresenceStatusAdapter());

+                                

+                try {            

+                    persistentPresence

+                        .publishPresenceStatus(IcqStatusEnum.ONLINE, "");                    

+                                       

+                    this.statusPanel.setSelectedStatus

+                        (Constants.ICQ, Constants.ONLINE_STATUS);

+                        

+                } catch (IllegalArgumentException e) {

+                    // TODO Auto-generated catch block

+                    e.printStackTrace();

+                } catch (IllegalStateException e) {

+                    // TODO Auto-generated catch block

+                    e.printStackTrace();

+                } catch (OperationFailedException e) {

+                    // TODO Auto-generated catch block

+                    e.printStackTrace();

+                }

+            }

+        }

+    }

+    

+    private class ProviderPresenceStatusAdapter

+        implements ProviderPresenceStatusListener {

+

+        public void providerStatusChanged

+            (ProviderPresenceStatusChangeEvent evt) {

+            

+        }

+    

+        public void providerStatusMessageChanged

+            (PropertyChangeEvent evt) {           

+            

+        }

+    

+    }

 }





---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe at sip-communicator-1-0-draft.dev.java.net
For additional commands, e-mail: cvs-help at sip-communicator-1-0-draft.dev.java.net





More information about the commits mailing list