[sip-comm-cvs] CVS update: /sip-communicator/src/net/java/sip/communicator/service/gui/event/, /sip-communicator/src/net/java/sip/communicator/service/gui/

yanas at dev.java.net yanas at dev.java.net
Wed Apr 11 16:10:34 CEST 2007


User: yanas   
Date: 2007-04-11 14:10:34+0000
Removed:
   sip-communicator/src/net/java/sip/communicator/service/gui/ApplicationWindow.java

Added:
   sip-communicator/src/net/java/sip/communicator/service/gui/event/ChatFocusListener.java
   sip-communicator/src/net/java/sip/communicator/service/gui/event/ChatFocusEvent.java
   sip-communicator/src/net/java/sip/communicator/service/gui/Chat.java
   sip-communicator/src/net/java/sip/communicator/service/gui/ExportedWindow.java

Modified:
   sip-communicator/src/net/java/sip/communicator/service/gui/ConfigurationWindow.java
   sip-communicator/src/net/java/sip/communicator/service/gui/UIService.java
   sip-communicator/src/net/java/sip/communicator/service/gui/PopupDialog.java

Log:
 UIService enhancements (Chat interface added, some class names changed)

File Changes:

Directory: /sip-communicator/src/net/java/sip/communicator/service/gui/event/
=============================================================================

File [added]: ChatFocusListener.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/src/net/java/sip/communicator/service/gui/event/ChatFocusListener.java?rev=1.1&content-type=text/vnd.viewcvs-markup
Added lines: 31
---------------
/*
 * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package net.java.sip.communicator.service.gui.event;

import java.util.*;

/**
 * The listener interface for receiving focus events on a <tt>Chat</tt>.
 * 
 * @author Yana Stamcheva
 */
public interface ChatFocusListener extends EventListener {

    /**
     * Indicates that a <tt>Chat</tt> has gained the focus.
     * 
     * @param event the ChatFocusEvent containing the corresponding chat.
     */
    public void chatFocusGained(ChatFocusEvent event);
    
    /**
     * Indicates that a <tt>Chat</tt> has lost the focus.
     * 
     * @param event the ChatFocusEvent containing the corresponding chat.
     */
    public void chatFocusLost(ChatFocusEvent event);
}

File [added]: ChatFocusEvent.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/src/net/java/sip/communicator/service/gui/event/ChatFocusEvent.java?rev=1.1&content-type=text/vnd.viewcvs-markup
Added lines: 67
---------------
/*
 * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package net.java.sip.communicator.service.gui.event;

import java.util.*;

import net.java.sip.communicator.service.gui.*;

/**
 * The <tt>ChatFocusEvent</tt> indicates that a <tt>Chat</tt> has gained or lost
 * the current focus.
 * 
 * @author Yana Stamcheva
 */
public class ChatFocusEvent
    extends EventObject
{
    private int eventID = -1;

    /**
     * Indicates that the ChatFocusEvent instance was triggered by
     * <tt>Chat</tt> gaining the focus.
     */
    public static final int FOCUS_GAINED = 1;

    /**
     * Indicates that the ChatFocusEvent instance was triggered by
     * <tt>Chat</tt> losing the focus.
     */
    public static final int FOCUS_LOST = 2;

    /**
     * Creates a new <tt>ChatFocusEvent</tt> according to the
     * specified parameters.
     * @param source The <tt>Chat</tt> that triggers the event.
     * @param eventID one of the FOCUS_XXX static fields indicating the
     * nature of the event.
     */
    public ChatFocusEvent(Object source, int eventID)
    {
        super(source);
        this.eventID = eventID;
    }
    
    /**
     * Returns an event id specifying what is the type of this event 
     * (FOCUS_GAINED or FOCUS_LOST)
     * @return one of the REGISTRATION_XXX int fields of this class.
     */
    public int getEventID(){
        return eventID;
    }
    
    /**
     * Returns the <tt>Chat</tt> object that corresponds to this event.
     * 
     * @return the <tt>Chat</tt> object that corresponds to this event
     */
    public Chat getChat()
    {
        return (Chat) source;
    }
}

Directory: /sip-communicator/src/net/java/sip/communicator/service/gui/
=======================================================================

File [changed]: ConfigurationWindow.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/src/net/java/sip/communicator/service/gui/ConfigurationWindow.java?r1=1.1&r2=1.2
Delta lines:  +1 -1
-------------------
--- ConfigurationWindow.java	2007-02-09 08:15:01+0000	1.1
+++ ConfigurationWindow.java	2007-04-11 14:10:32+0000	1.2
@@ -22,7 +22,7 @@
  * 
  * @author Yana Stamcheva
  */
-public interface ConfigurationWindow extends ApplicationWindow {
+public interface ConfigurationWindow extends ExportedWindow {
 
     /**
      * Adds the given <tt>ConfigurationForm</tt> in this

File [added]: Chat.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/src/net/java/sip/communicator/service/gui/Chat.java?rev=1.1&content-type=text/vnd.viewcvs-markup
Added lines: 46
---------------
/*
 * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package net.java.sip.communicator.service.gui;

import net.java.sip.communicator.service.gui.event.*;

/**
 * The <tt>Chat</tt> interface is meant to be implemented by the GUI component
 * class representing a chat. Through the <i>isChatFocused</i> method the other
 * bundles could check the visibility of the chat component. The
 * <tt>ChatFocusListener</tt> is used to inform other bundles when a chat has
 * changed its focus state.
 * 
 * @author Yana Stamcheva
 */
public interface Chat
{
    /**
     * Checks if this <tt>Chat</tt> is currently focused.
     * 
     * @return TRUE if the chat is focused, FALSE - otherwise
     */
    public boolean isChatFocused();
    
    /**
     * Adds the given <tt>ChatFocusListener</tt> to this <tt>Chat</tt>.
     * The <tt>ChatFocusListener</tt> is used to inform other bundles when a
     * chat has changed its focus state.
     * 
     * @param l the <tt>ChatFocusListener</tt> to add
     */
    public void addChatFocusListener(ChatFocusListener l);
    
    /**
     * Removes the given <tt>ChatFocusListener</tt> from this <tt>Chat</tt>.
     * The <tt>ChatFocusListener</tt> is used to inform other bundles when a
     * chat has changed its focus state.
     * 
     * @param l the <tt>ChatFocusListener</tt> to remove
     */
    public void removeChatFocusListener(ChatFocusListener l);
}

File [removed]: ApplicationWindow.java

File [added]: ExportedWindow.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/src/net/java/sip/communicator/service/gui/ExportedWindow.java?rev=1.1&content-type=text/vnd.viewcvs-markup
Added lines: 95
---------------
/*
 * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package net.java.sip.communicator.service.gui;

/**
 * A window that could be shown, hidden, resized, moved, etc. Meant to be used
 * from other services to show an application window, like for example a 
 * "Configuration" or "Add contact" window.
 * 
 * @author Yana Stamcheva
 */
public interface ExportedWindow
{
    /*
     * WindowID-s
     */    
    public static final WindowID ADD_CONTACT_WINDOW
        = new WindowID("AddContactWindow");
    
    public static final WindowID ABOUT_WINDOW
        = new WindowID("AboutWindow");
    
    public static final WindowID CHAT_WINDOW
        = new WindowID("ChatWindow");
    
    public static final WindowID CONFIGURATION_WINDOW
        = new WindowID("ConfigurationWindow");
    
    public static final WindowID AUTHENTICATION_WINDOW
        = new WindowID("AuthenticationWindow");

    /**
     * Returns the WindowID corresponding to this window. The window id should
     * be one of the defined in this class XXX_WINDOW constants.
     *   
     * @return the WindowID corresponding to this window
     */
    public WindowID getIdentifier();
    
    /**
     * Returns TRUE if the component is visible and FALSE otherwise.
     * 
     * @return <code>true</code> if the component is visible and
     * <code>false</code> otherwise.
     */
    public boolean isVisible();
    
    /**
     * Returns TRUE if this component is currently the focused component,
     * FALSE - otherwise.
     * @return TRUE if this component is currently the focused component,
     * FALSE - otherwise.
     */
    public boolean isFocused();
    
    /**
     * Shows or hides this component.
     */
    public void setVisible(boolean isVisible);
    
    /**
     * Brings the focus to this window.
     */
    public void bringToFront();
    
    /**
     * Resizes the window with the given width and height.
     * 
     * @param width The new width.
     * @param height The new height.
     */
    public void setSize(int width, int height);
    
    /**
     * Moves the window to the given coordinates.
     * 
     * @param x The x coordinate.
     * @param y The y coordinate.
     */
    public void setLocation(int x, int y);
    
    /**
     * Minimizes the window.
     */
    public void minimize();
    
    /**
     * Maximizes the window.
     */
    public void maximize();
}

File [changed]: UIService.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/src/net/java/sip/communicator/service/gui/UIService.java?r1=1.16&r2=1.17
Delta lines:  +55 -42
---------------------
--- UIService.java	2007-03-20 11:51:57+0000	1.16
+++ UIService.java	2007-04-11 14:10:32+0000	1.17
@@ -30,18 +30,13 @@
  * getPopupDialog method and then one of the showXXX methods, which corresponds
  * best to the required dialog. 
  * <p>
- * Certain application windows within the GUI, like "AddContact" for example,
+ * Certain components within the GUI, like "AddContact" window for example,
  * could be also shown from outside the ui. To make one of
- * these windows showable, the <tt>UIService</tt> implementation should attach
- * to it a <tt>WindowID</tt>. A window then could be shown, by
- * invoking <code>getApplicationWindow(WindowID)</code> and then 
- * <code>show</code>. The <tt>WindowID</tt> above should be one of the exported
- * <tt>WindowID</tt>s obtained from <code>getApplicationWindows</code>.
- * <p>
- * Each <code>UIService</code> implementation should implement the method
- * <code>getChatWindow(Contact contact)</code>, which is meant to provide an
- * access to the chat component for the given contact in the form of 
- * <code>ApplicationWindow</code>.
+ * these component exportable, the <tt>UIService</tt> implementation should attach
+ * to it an <tt>WindowID</tt>. A window then could be shown, by invoking
+ * <code>getExportedWindow(WindowID)</code> and then 
+ * <code>show</code>. The <tt>WindowID</tt> above should be obtained from
+ * <code>getSupportedExportedWindows</code>.
  * 
  * @author Yana Stamcheva
  */
@@ -230,20 +225,19 @@
     public boolean getExitOnMainWindowClose();
     
     /**
-     * Returns a common application window given by WindowID. This 
-     * could be for example an "Add contact" window or any other window within
-     * the application, which could be simply shown without need of additional
-     * arguments. The <tt>windowID</tt> SHOULD be one of the WINDOW_XXX obtained
-     * by the getApplicationWindows method.
+     * Returns an exported window given by the <tt>WindowID</tt>.
+     * This could be for example the "Add contact" window or any other window
+     * within the application. The <tt>windowID</tt> should be one of the
+     * WINDOW_XXX obtained by the <tt>getSupportedExportedWindows</tt> method.
      *  
      * @param windowID One of the WINDOW_XXX WindowID-s.
      * @throws IllegalArgumentException if the specified <tt>windowID</tt>
      * is not recognized by the implementation (note that implementations
      * MUST properly handle all WINDOW_XXX ID-s.
      * @return the window to be shown
-     * @see #getApplicationWindows()
+     * @see #getSupportedExportedWindows()
      */
-    public ApplicationWindow getApplicationWindow(WindowID windowID)
+    public ExportedWindow getExportedWindow(WindowID windowID)
         throws IllegalArgumentException;
     
     /**
@@ -257,15 +251,32 @@
     public PopupDialog getPopupDialog();
          
     /**
-     * Returns the <tt>ApplicationWindow</tt> corresponding to the component
-     * representing the chat for the given contact. Meant to be used from other
-     * bundles to allow them to check the visibility of a chat, hide it or show
-     * it.
-     * @param contact
-     * @return The <tt>ApplicationWindow</tt> corresponding to the component
-     * representing the chat for the given contact.
+     * Returns the <tt>Chat</tt> corresponding to the given <tt>Contact</tt>.
+     * 
+     * @param contact the <tt>Contact</tt> for which the searched chat is about.
+     * @return the <tt>Chat</tt> corresponding to the given <tt>Contact</tt>.
      */
-    public ApplicationWindow getChatWindow(Contact contact);
+    public Chat getChat(Contact contact);
+    
+    /**
+     * Returns an <tt>ExportableComponent</tt> that corresponds to an
+     * authentication window for the given protocol provider and user
+     * inromation. Initially this method is meant to be used by the
+     * <tt>SystrayService</tt> in order to show a login window when user tries
+     * to connect using the systray menu.
+     *     
+     * @param protocolProvider the <tt>ProtocolProviderService</tt> for which
+     * the authentication window is about.
+     * @param realm the realm
+     * @param userCredentials the <tt>UserCredentials</tt>, where the username
+     * and password details are stored
+     * @return an <tt>ExportableComponent</tt> that corresponds to an
+     * authentication window for the given protocol provider and user information.
+     */
+    public ExportedWindow getAuthenticationWindow(
+        ProtocolProviderService protocolProvider,
+        String realm,
+        UserCredentials userCredentials);
     
     /**
      * Returns the <tt>ConfigurationWindow</tt> implementation for this
@@ -280,29 +291,31 @@
     public ConfigurationWindow getConfigurationWindow();
     
     /**
-     * Returns an iterator over a set of windowID-s. Each WindowID points to
-     * a common window in the current UI implementation. Each WindowID in the
-     * set is one of the WINDOW_XXX constants. The method is meant to be used
-     * by bundles that would like to show common windows like "Add contact" per
-     * example. Before showing any window they should use this method to obtain
-     * all possible windows, which could be shown for the current ui
-     * implementation.  
+     * Returns an iterator over a set of windowID-s. Each <tt>WindowID</tt>
+     * points to a window in the current UI implementation. Each
+     * <tt>WindowID</tt> in the set is one of the constants in the
+     * <tt>ExportedWindow</tt> interface. The method is meant to be used by
+     * bundles that would like to have access to some windows in the gui
+     * - for example the "Add contact" window, the "Settings" window, the
+     * "Chat window", etc.
      *       
-     * @return Iterator An iterator to a set containing windowID-s 
-     * representing all windows supported by the current UI implementation.
+     * @return Iterator An iterator to a set containing WindowID-s 
+     * representing all exported windows supported by the current UI
+     * implementation.
      */
-    public Iterator getSupportedApplicationWindows();
+    public Iterator getSupportedExportedWindows();
     
     /**
-     * Chechks if the application window with the given <tt>WindowID</tt> is
-     * contained in the current UI implementation.
+     * Chechks if a window with the given <tt>WindowID</tt> is contained in the
+     * current UI implementation.
      * 
-     * @param windowID One of the WINDOW_XXX WindowID-s. 
-     * @return <code>true</code> if the application window with the given 
-     * <tt>WindowID</tt> is exported from the current UI implementation,
+     * @param windowID one of the <tt>WindowID</tt>-s, defined in the
+     * <tt>ExportedWindow</tt> interface. 
+     * @return <code>true</code> if the component with the given
+     * <tt>WindowID</tt> is contained in the current UI implementation,
      * <code>false</code> otherwise.
      */
-    public boolean containsApplicationWindow(WindowID windowID);
+    public boolean isExportedWindowSupported(WindowID windowID);
     
     /**
      * Returns the <tt>AccountRegistrationWizardContainer</tt> for the current

File [changed]: PopupDialog.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/src/net/java/sip/communicator/service/gui/PopupDialog.java?r1=1.4&r2=1.5
Delta lines:  +1 -1
-------------------
--- PopupDialog.java	2007-03-20 11:52:38+0000	1.4
+++ PopupDialog.java	2007-04-11 14:10:32+0000	1.5
@@ -19,7 +19,7 @@
  * 
  * @author Yana Stamcheva
  */
-public interface PopupDialog extends ApplicationWindow
+public interface PopupDialog extends ExportedWindow
 {
     public static final WindowID WINDOW_GENERAL_POPUP
         = new WindowID("GeneralPopupWindow");




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





More information about the commits mailing list