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

emcho at dev.java.net emcho at dev.java.net
Wed May 26 11:08:21 CEST 2004


User: emcho   
Date: 04/05/26 02:08:20

Modified:
 /sip-communicator/src/net/java/sip/communicator/gui/
  AuthenticationSplash.java, GuiManager.java, MenuBar.java, PhoneFrame.java

Log:
 Ongoing work on simple

File Changes:

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

File [changed]: AuthenticationSplash.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/src/net/java/sip/communicator/gui/AuthenticationSplash.java?r1=1.6&r2=1.7
Delta lines:  +4 -3
-------------------
--- AuthenticationSplash.java	26 Mar 2004 14:34:51 -0000	1.6
+++ AuthenticationSplash.java	26 May 2004 09:08:17 -0000	1.7
@@ -378,6 +378,7 @@
         contents.add(centerPane, BorderLayout.CENTER);
         getRootPane().setDefaultButton(loginButton);
         equalizeButtonSizes();
+
         setFocusTraversalPolicy(new FocusTraversalPol());
 
     } // initComponents()
@@ -500,13 +501,13 @@
         dialog.setVisible(true);
     } // main()
 
-    private class FocusTraversalPol extends DefaultFocusTraversalPolicy
+    private class FocusTraversalPol extends LayoutFocusTraversalPolicy
     {
-        public Component getFirstComponent(Container cont)
+        public Component getDefaultComponent(Container cont)
         {
             if(  userNameTextField.getText() == null
                ||userNameTextField.getText().trim().length() == 0)
-                return userNameTextField;
+                return super.getFirstComponent(cont);
             else
                 return passwordTextField;
         }

File [changed]: GuiManager.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/src/net/java/sip/communicator/gui/GuiManager.java?r1=1.16&r2=1.17
Delta lines:  +54 -10
---------------------
--- GuiManager.java	13 Apr 2004 00:52:58 -0000	1.16
+++ GuiManager.java	26 May 2004 09:08:18 -0000	1.17
@@ -109,7 +109,7 @@
 
 /** @todo remove after testing */
 //    private Properties      properties;
-    private JLabel          logoLabel    = null;
+    private JPanel          logoPanel    = null;
     private InterlocutorsTableModel interlocutors = null;
     //Set default colors
     static Color defaultBackground = new Color(255, 255, 255);
@@ -136,14 +136,28 @@
         configFrame   = new ConfigFrame(phoneFrame);
         listeners     = new ArrayList();
         alertManager  = new AlertManager();
-        logoLabel     = new JLabel();
+        logoPanel     = new JPanel(new FlowLayout(FlowLayout.CENTER));
         interlocutors = new InterlocutorsTableModel();
 
         initActionListeners();
         phoneFrame.contactBox.setModel(new ContactsComboBoxModel());
-        ( (MenuBar) phoneFrame.jMenuBar1).addConfigCallAction(new ConfigAction());
-        ( (MenuBar) phoneFrame.jMenuBar1).addConfigMediaAction(new ConfigMediaAction());
+
+        ConfigAction configAction = new ConfigAction();
+        ( (MenuBar) phoneFrame.jMenuBar1).addConfigCallAction(configAction);
+        contactList.menuBar.addConfigAction(configAction);
+
+        ConfigMediaAction configMediaAction = new ConfigMediaAction();
+        ( (MenuBar) phoneFrame.jMenuBar1).addConfigMediaAction(configMediaAction);
+        contactList.menuBar.addConfigMediaAction(configMediaAction);
+
+        SetupWizardAction setupWizardAction = new SetupWizardAction();
         ( (MenuBar) phoneFrame.jMenuBar1).addSetupWizardAction(new SetupWizardAction());
+        contactList.menuBar.addSetupWizardAction(setupWizardAction);
+
+        AboutAction aboutAction = new AboutAction();
+        ( (MenuBar) phoneFrame.jMenuBar1).addAbout(aboutAction);
+        contactList.menuBar.addAboutAction(aboutAction);
+
         ( (MenuBar) phoneFrame.jMenuBar1).addCallAction(voiceMailAction, KeyEvent.VK_F6);
 
         if(isThisSipphoneAnywhere)
@@ -152,14 +166,22 @@
             ( (MenuBar) phoneFrame.jMenuBar1).addCallAction(mySipphoneAction, KeyEvent.VK_F7);
         }
 
-        ( (MenuBar) phoneFrame.jMenuBar1).addExitCallAction(new ExitAction());
+        ExitAction exitAction = new ExitAction();
+        ( (MenuBar) phoneFrame.jMenuBar1).addExitCallAction(exitAction);
+        contactList.menuBar.addExitAction(exitAction);
         configFrame.setLocationRelativeTo(phoneFrame);
 
         phoneFrame.participantsTable.setModel(interlocutors);
         phoneFrame.setIconImage(new ImageIcon(Utils.getResource("sip-communicator-16x16.jpg")).getImage());
-        logoLabel.setIcon(new ImageIcon(Utils.getResource("sip-communicator.jpg")));
+        JLabel logoLabel = new JLabel();
+
+//        logoLabel.setIcon(new ImageIcon(Utils.getResource("sip-communicator.jpg")));
+        logoLabel.setIcon(new ImageIcon(Utils.getResource("sip-communicator.logo.thin.jpg")));
+        logoPanel.add(logoLabel);
+        logoPanel.setBackground(Color.white);
+
         phoneFrame.videoPane.setBackground(Color.white);
-        phoneFrame.videoPane.add(logoLabel);
+        phoneFrame.videoPane.add(logoPanel);
         setGlobalStatus(NOT_REGISTERED, "");
         JOptionPane.setRootFrame(phoneFrame);
     }
@@ -214,7 +236,7 @@
             return;
         }
         else {
-            phoneFrame.videoPane.remove(logoLabel);
+            phoneFrame.videoPane.remove(logoPanel);
             phoneFrame.videoPane.add(vComp);
         }
         phoneFrame.videoPane.updateUI();
@@ -226,7 +248,7 @@
             return;
         }
         else {
-            phoneFrame.videoPane.remove(logoLabel);
+            phoneFrame.videoPane.remove(logoPanel);
             phoneFrame.videoPane.add(cComp);
         }
         phoneFrame.videoPane.updateUI();
@@ -237,7 +259,7 @@
         phoneFrame.videoPane.removeAll();
 //        phoneFrame.controlPanes.removeAll();
 //        phoneFrame.videoPane.add(phoneFrame.controlPanes, BorderLayout.SOUTH);
-        phoneFrame.videoPane.add(logoLabel);
+        phoneFrame.videoPane.add(logoPanel);
         phoneFrame.videoPane.updateUI();
     }
 
@@ -676,5 +698,27 @@
     {
         return SubscriptionAuthorizationDialog.obtainAuthorisationResponse(phoneFrame, request);
     }
+
+    /**
+     * The class is used to display an About Dialog describing the SIP Communicator
+     * project
+     */
+    private class AboutAction
+        extends AbstractAction
+    {
+        public AboutAction()
+        {
+            super("About ...");
+        }
+
+        public void actionPerformed(ActionEvent evt)
+        {
+             JOptionPane.showMessageDialog(null,
+                                           new JLabel(new ImageIcon(Utils.getResource("sip-communicator.about.jpg"))),
+                                           "SIPphone Anywhere (powered by SIP Communicator)",
+                                           JOptionPane.PLAIN_MESSAGE);
+        }
+    }
+
 
 }

File [changed]: MenuBar.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/src/net/java/sip/communicator/gui/MenuBar.java?r1=1.11&r2=1.12
Delta lines:  +20 -30
---------------------
--- MenuBar.java	26 Mar 2004 14:35:42 -0000	1.11
+++ MenuBar.java	26 May 2004 09:08:18 -0000	1.12
@@ -87,7 +87,6 @@
         callMenu.setMnemonic('C');
         settingsMenu.setMnemonic('S');
         helpMenu.setMnemonic('H');
-        helpMenu.add(new JMenuItem( new AboutAction()));
         add(callMenu);
         add(settingsMenu);
         add(helpMenu);
@@ -99,34 +98,6 @@
         this.configFrame = configFrame;
     }
 
-    private class AboutAction
-        extends AbstractAction
-    {
-        public AboutAction()
-        {
-            super("About ...");
-        }
-
-        public void actionPerformed(ActionEvent evt)
-        {/*
-            JOptionPane.showMessageDialog(
-                null,
-                "Network Research Team ( http://www-r2.u-strasbg.fr )\n" +
-                "LSIIT Laboratory ( http://lsiit.u-strasbg.fr )\n" +
-                "Louis Pasteur University ( http://www-ulp.u-strasbg.fr )\n" +
-                "Division Chief: Thomas Noel ( Thomas.Noel at dpt-info.u-strasbg.fr )\n\n" +
-                "Author: Emil Ivov\n" +
-                "http://www.emcho.com\n" +
-                "e-mail: emil_ivov at yahoo.com"
-                );
-          */
-             JOptionPane.showMessageDialog(null,
-                                           new JLabel(new ImageIcon(Utils.getResource("sip-communicator.about.jpg"))),
-                                           "SIPphone Anywhere (powered by SIP Communicator)",
-                                           JOptionPane.PLAIN_MESSAGE);
-        }
-    }
-
     void addConfigCallAction(Action action)
     {
         JMenuItem config = new JMenuItem(action);
@@ -151,7 +122,11 @@
     void addExitCallAction(Action action)
     {
         callMenu.addSeparator();
-        callMenu.add(action);
+
+        JMenuItem menuItem = new JMenuItem(action);
+        menuItem.setMnemonic('X');
+
+        callMenu.add(menuItem);
     }
 
     void addConfigMediaAction(Action action)
@@ -169,6 +144,21 @@
         settingsMenu.addSeparator();
         settingsMenu.add(mItem);
     }
+
+
+    /**
+     * Creates a JMenuItem using the specified <code>action</code> sets A as
+     * its mnemonic character and adds it to the settings menu.
+     * @param action the about action
+     */
+    public void addAbout(Action action)
+    {
+        JMenuItem mItem = new JMenuItem(action);
+        mItem.setMnemonic('A');
+        helpMenu.addSeparator();
+        helpMenu.add(mItem);
+    }
+
 
 /*
     void addShowTracesAction(Action action)

File [changed]: PhoneFrame.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/src/net/java/sip/communicator/gui/PhoneFrame.java?r1=1.7&r2=1.8
Delta lines:  +29 -31
---------------------
--- PhoneFrame.java	23 Feb 2004 16:12:14 -0000	1.7
+++ PhoneFrame.java	26 May 2004 09:08:18 -0000	1.8
@@ -89,14 +89,10 @@
     JScrollPane participantsScroll = new JScrollPane();
     JPanel videoPane = new JPanel();
     BorderLayout borderLayout2 = new BorderLayout();
-    JPanel dialPanel = new JPanel();
     JPanel callControlButtons = new JPanel();
     JButton answerButton = new JButton();
     JButton hangupButton = new JButton();
     GridLayout gridLayout1 = new GridLayout();
-    JButton dialButton = new JButton();
-    JComboBox contactBox = new JComboBox();
-    BorderLayout borderLayout4 = new BorderLayout();
     Border border6;
     Border border7;
     Border border8;
@@ -116,6 +112,10 @@
     Border border15;
 
 	private GuiManager guiManCallback = null;
+    BorderLayout borderLayout4 = new BorderLayout();
+    JPanel dialPanel = new JPanel();
+    JButton dialButton = new JButton();
+    JComboBox contactBox = new JComboBox();
 
     public PhoneFrame(GuiManager guiManCallback) //throws HeadlessException
     {
@@ -156,15 +156,15 @@
         border8 = BorderFactory.createEmptyBorder(5, 5, 5, 5);
         border14 = BorderFactory.createEmptyBorder(4, 0, 0, 0);
         this.getContentPane().setLayout(borderLayout1);
-        splitPane.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
+        splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
         splitPane.setBorder(null);
-        splitPane.setMinimumSize(new Dimension(560, 225));
-        splitPane.setPreferredSize(new Dimension(560, 225));
-    splitPane.setLastDividerLocation(600);
+        splitPane.setMinimumSize(new Dimension(260, 300));
+        splitPane.setPreferredSize(new Dimension(260, 300));
+//    splitPane.setLastDividerLocation(600);
 //        splitPane.setLastDividerLocation(400);
         splitPane.setOneTouchExpandable(true);
         this.setJMenuBar(jMenuBar1);
-        this.setResizable(false);
+        this.setResizable(true);
         this.setState(Frame.NORMAL);
         if(GuiManager.isThisSipphoneAnywhere)
             this.setTitle("SIPphone Anywhere");
@@ -183,33 +183,28 @@
         callControlButtons.setLayout(gridLayout1);
         gridLayout1.setHgap(10);
         gridLayout1.setVgap(10);
-        dialButton.setEnabled(false);
-        dialButton.setMnemonic('D');
-        dialButton.setText("Dial");
-        contactBox.setBorder(null);
-        contactBox.setDebugGraphicsOptions(0);
-        contactBox.setActionMap(null);
-        contactBox.setEditable(true);
-        dialPanel.setLayout(borderLayout4);
         callControlButtons.setBorder(border6);
-        dialPanel.setBorder(border7);
         borderLayout2.setHgap(10);
         borderLayout2.setVgap(0);
-        borderLayout4.setHgap(10);
         videoPane.setBorder(border8);
-        videoPane.setMaximumSize(new Dimension(2147483647, 2147483647));
 //        videoPane.setPreferredSize(new Dimension(200, 10));
         registrationLabel.setText("Not Registered");
         statusPanel.setLayout(borderLayout5);
-        statusPanel.setMaximumSize(new Dimension(32767, 32767));
 //        participantsTable.setMinimumSize(new Dimension(45, 300));
+        borderLayout4.setHgap(10);
+        dialPanel.setLayout(borderLayout4);
+        dialPanel.setBorder(border7);
+        dialButton.setEnabled(false);
+        dialButton.setMnemonic('D');
+        dialButton.setText("Dial");
+        contactBox.setBorder(null);
+        contactBox.setDebugGraphicsOptions(0);
+        contactBox.setActionMap(null);
+        contactBox.setEditable(true);
         this.getContentPane().add(splitPane, BorderLayout.CENTER);
         splitPane.add(controlPanel, JSplitPane.BOTTOM);
         splitPane.add(videoPane, JSplitPane.TOP);
         this.getContentPane().add(statusPanel, BorderLayout.SOUTH);
-        controlPanel.add(dialPanel, BorderLayout.NORTH);
-        dialPanel.add(dialButton, BorderLayout.EAST);
-        dialPanel.add(contactBox, BorderLayout.CENTER);
 
 		if(GuiManager.isThisSipphoneAnywhere)
         {
@@ -230,7 +225,10 @@
         participantsScroll.setViewportView(participantsTable);
         statusPanel.add(registrationLabel, BorderLayout.WEST);
         statusPanel.add(registrationAddressLabel, BorderLayout.CENTER);
-        splitPane.setDividerLocation(200);
+        this.getContentPane().add(dialPanel, BorderLayout.NORTH);
+        dialPanel.add(dialButton, BorderLayout.EAST);
+        dialPanel.add(contactBox, BorderLayout.CENTER);
+//        splitPane.setDividerLocation(200);
     }
 
 	//exit is handled by SipCommunicator.shutDown()




---------------------------------------------------------------------
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