svn commit: r3287 - trunk/src/net/java/sip/communicator/plugin/whiteboard/gui/WhiteboardFrame.java

yanas at dev.java.net yanas at dev.java.net
Tue Dec 4 16:24:44 CET 2007


Author: yanas
Date: 2007-12-04 15:24:42+0000
New Revision: 3287

Modified:
   trunk/src/net/java/sip/communicator/plugin/whiteboard/gui/WhiteboardFrame.java

Log:
whiteboard gui enhancements

Modified: trunk/src/net/java/sip/communicator/plugin/whiteboard/gui/WhiteboardFrame.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/plugin/whiteboard/gui/WhiteboardFrame.java?view=diff&rev=3287&p1=trunk/src/net/java/sip/communicator/plugin/whiteboard/gui/WhiteboardFrame.java&p2=trunk/src/net/java/sip/communicator/plugin/whiteboard/gui/WhiteboardFrame.java&r1=3286&r2=3287
==============================================================================
--- trunk/src/net/java/sip/communicator/plugin/whiteboard/gui/WhiteboardFrame.java	(original)
+++ trunk/src/net/java/sip/communicator/plugin/whiteboard/gui/WhiteboardFrame.java	2007-12-04 15:24:42+0000
@@ -7,6 +7,7 @@
 package net.java.sip.communicator.plugin.whiteboard.gui;
 
 import java.awt.event.*;
+
 import javax.imageio.ImageIO;
 import java.awt.*;
 import java.awt.geom.*;
@@ -19,7 +20,9 @@
 
 import net.java.sip.communicator.plugin.whiteboard.*;
 import net.java.sip.communicator.plugin.whiteboard.gui.whiteboardshapes.*;
+import net.java.sip.communicator.service.gui.*;
 import net.java.sip.communicator.service.protocol.*;
+import net.java.sip.communicator.service.protocol.event.*;
 import net.java.sip.communicator.service.protocol.whiteboardobjects.*;
 import net.java.sip.communicator.util.Logger;
 
@@ -294,6 +297,9 @@
         this.sessionManager = wps;
         this.session = session;
 
+        this.session.addWhiteboardChangeListener(
+            new WhiteboardChangeListenerImpl());
+
         initComponents();
         initIcons();
         initMouse();
@@ -1058,23 +1064,47 @@
         getContentPane().add(leftPanel, BorderLayout.WEST);
 
         fileMenu.setText(Resources.getString("file"));
-        fileMenu.setEnabled(false);
+
         newMenuItem.setText(Resources.getString("new"));
+        newMenuItem.addActionListener(new ActionListener()
+        {
+            public void actionPerformed(ActionEvent e)
+            {
+                try
+                {
+                    if (session != null)
+                        session.join();
+                    else
+                        sessionManager.initWhiteboard(contact);
+                }
+                catch (OperationFailedException e1)
+                {
+                    logger.error("Creating new session failed.", e1);
+                }
+            }
+        });
         fileMenu.add(newMenuItem);
 
         openMenuItem.setText(Resources.getString("open"));
+        openMenuItem.setEnabled(false);
         fileMenu.add(openMenuItem);
 
         saveMenuItem.setText(Resources.getString("save"));
+        saveMenuItem.setEnabled(false);
         fileMenu.add(saveMenuItem);
 
-        sendMenuItem.setText(Resources.getString("send"));
-        fileMenu.add(sendMenuItem);
-
         printMenuItem.setText(Resources.getString("print"));
+        printMenuItem.setEnabled(false);
         fileMenu.add(printMenuItem);
 
         exitMenuItem.setText(Resources.getString("exit"));
+        exitMenuItem.addActionListener(new ActionListener()
+        {
+            public void actionPerformed(ActionEvent e)
+            {
+                session.leave();
+            }
+        });
         fileMenu.add(exitMenuItem);
 
         menuBar.add(fileMenu);
@@ -2477,4 +2507,25 @@
     {
         return this.session;
     }
+
+    private class WhiteboardChangeListenerImpl
+        implements WhiteboardChangeListener
+    {
+        public void whiteboardParticipantAdded(WhiteboardParticipantEvent evt)
+        {
+        }
+
+        public void whiteboardParticipantRemoved(WhiteboardParticipantEvent evt)
+        {
+            logger.trace("Whiteboard participant has left.");
+
+            WhiteboardActivator.getUiService().getPopupDialog()
+                .showMessagePopupDialog(contact.getAddress()
+                        + " has left the whiteboard.");
+        }
+
+        public void whiteboardStateChanged(WhiteboardChangeEvent evt)
+        {
+        }
+    }
 }
\ No newline at end of file

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe at sip-communicator.dev.java.net
For additional commands, e-mail: commits-help at sip-communicator.dev.java.net





More information about the commits mailing list