diff options
author | Yana Stamcheva <yana@jitsi.org> | 2008-09-10 20:44:05 +0000 |
---|---|---|
committer | Yana Stamcheva <yana@jitsi.org> | 2008-09-10 20:44:05 +0000 |
commit | 0c40c5109ac460c2286e10acc1a7d28d11e6fd8b (patch) | |
tree | 611107128f3ddcabb3aeb09b06f6a27d128df783 /src/net/java | |
parent | 04d5a4c7e3fdc94f039808702c01910ffae42db7 (diff) | |
download | jitsi-0c40c5109ac460c2286e10acc1a7d28d11e6fd8b.zip jitsi-0c40c5109ac460c2286e10acc1a7d28d11e6fd8b.tar.gz jitsi-0c40c5109ac460c2286e10acc1a7d28d11e6fd8b.tar.bz2 |
- Added some new color constants.
- Added set/getSize and set/getLocation methods to the UIService.
Diffstat (limited to 'src/net/java')
14 files changed, 1037 insertions, 298 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/UIServiceImpl.java b/src/net/java/sip/communicator/impl/gui/UIServiceImpl.java index 93d160f..c362f6d 100644 --- a/src/net/java/sip/communicator/impl/gui/UIServiceImpl.java +++ b/src/net/java/sip/communicator/impl/gui/UIServiceImpl.java @@ -220,6 +220,49 @@ public class UIServiceImpl } /** + * Locates the main application window to the new x and y coordinates. + * + * @param x The new x coordinate. + * @param y The new y coordinate. + */ + public void setLocation(int x, int y) + { + mainFrame.setLocation(x, y); + } + + /** + * Returns the current location of the main application window. The returned + * point is the top left corner of the window. + * + * @return The top left corner coordinates of the main application window. + */ + public Point getLocation() + { + return mainFrame.getLocation(); + } + + /** + * Returns the size of the main application window. + * + * @return the size of the main application window. + */ + public Dimension getSize() + { + return mainFrame.getSize(); + } + + /** + * Sets the size of the main application window. + * + * @param width The width of the window. + * @param height The height of the window. + */ + public void setSize(int width, int height) + { + mainFrame.setSize(width, height); + } + + /** * Implements <code>minimize</code> in the UIService interface. Minimizes * the main application window. * diff --git a/src/net/java/sip/communicator/impl/gui/main/MainFrame.java b/src/net/java/sip/communicator/impl/gui/main/MainFrame.java index 6483a7b..b0f53ad 100755 --- a/src/net/java/sip/communicator/impl/gui/main/MainFrame.java +++ b/src/net/java/sip/communicator/impl/gui/main/MainFrame.java @@ -58,9 +58,9 @@ public class MainFrame { private Logger logger = Logger.getLogger(MainFrame.class.getName()); - private JPanel centerPanel = new JPanel(new BorderLayout()); + private JPanel mainPanel = new JPanel(new BorderLayout()); - private JPanel mainPanel = new JPanel(new BorderLayout(0, 5)); + private JPanel statusBarPanel = new JPanel(new BorderLayout()); private MainMenu menu; @@ -89,6 +89,7 @@ public class MainFrame private Hashtable nativePluginsTable = new Hashtable(); + private JPanel pluginPanelNorth = new JPanel(); private JPanel pluginPanelSouth = new JPanel(); private JPanel pluginPanelWest = new JPanel(); private JPanel pluginPanelEast = new JPanel(); @@ -100,6 +101,11 @@ public class MainFrame */ public MainFrame() { + if (!ConfigurationManager.isWindowDecorated()) + { + this.setUndecorated(true); + } + this.chatWindowManager = new ChatWindowManager(this); this.mainCallPanel = new MainCallPanel(this); @@ -136,6 +142,12 @@ public class MainFrame this.setTitle(applicationName); + this.setContentPane(new MainContentPane()); + + this.mainPanel.setBackground(new Color( + GuiActivator.getResources() + .getColor("mainWindowBackground"))); + this.init(); this.initPluginComponents(); @@ -149,31 +161,38 @@ public class MainFrame this.setKeybindingInput(KeybindingSet.Category.MAIN); this.addKeybindingAction("main-rename", new RenameAction()); - this.mainPanel.setOpaque(false); + JPanel northPanel = new JPanel(new BorderLayout()); + JPanel centerPanel = new JPanel(new BorderLayout()); + + northPanel.setOpaque(false); + centerPanel.setOpaque(false); + this.statusBarPanel.setOpaque(false); this.contactListPanel.setOpaque(false); - this.centerPanel.setOpaque(false); this.mainCallPanel.setOpaque(false); - this.centerPanel.add(contactListPanel, BorderLayout.CENTER); - this.centerPanel.add(mainCallPanel, BorderLayout.SOUTH); - - this.mainPanel.add(accountStatusPanel, BorderLayout.NORTH); - this.mainPanel.add(centerPanel, BorderLayout.CENTER); + JPanel menusPanel = new JPanel(new BorderLayout()); - JPanel menusPanel = new JPanel(new BorderLayout(0, 5)); - - this.setJMenuBar(menu); + String osName = System.getProperty("os.name"); + if (osName.startsWith("Mac")) + // this.setJMenuBar(menu); + // menusPanel.add(menu, BorderLayout.CENTER); menusPanel.add(quickMenu, BorderLayout.SOUTH); - JPanel northPanel = new JPanel(new BorderLayout()); - menusPanel.setUI(new SIPCommOpaquePanelUI()); + northPanel.add(new LogoBar(), BorderLayout.NORTH); northPanel.add(menusPanel, BorderLayout.CENTER); - this.getContentPane().add(northPanel, BorderLayout.NORTH); + centerPanel.add(accountStatusPanel, BorderLayout.NORTH); + centerPanel.add(contactListPanel, BorderLayout.CENTER); + centerPanel.add(mainCallPanel, BorderLayout.SOUTH); + + this.mainPanel.add(northPanel, BorderLayout.NORTH); + this.mainPanel.add(centerPanel, BorderLayout.CENTER); + this.getContentPane().add(mainPanel, BorderLayout.CENTER); + this.getContentPane().add(statusBarPanel, BorderLayout.SOUTH); } /** @@ -181,8 +200,10 @@ public class MainFrame */ private void initBounds() { - int width = GuiActivator.getResources().getSettingsInt("mainWindowWidth"); - int height = GuiActivator.getResources().getSettingsInt("mainWindowHeight"); + int width + = GuiActivator.getResources().getSettingsInt("mainWindowWidth"); + int height + = GuiActivator.getResources().getSettingsInt("mainWindowHeight"); this.setSize(width, height); @@ -1097,24 +1118,29 @@ public class MainFrame */ private void initPluginComponents() { - pluginPanelEast.setLayout( - new BoxLayout(pluginPanelEast, BoxLayout.Y_AXIS)); pluginPanelSouth.setLayout( new BoxLayout(pluginPanelSouth, BoxLayout.Y_AXIS)); + pluginPanelNorth.setLayout( + new BoxLayout(pluginPanelNorth, BoxLayout.Y_AXIS)); + pluginPanelEast.setLayout( + new BoxLayout(pluginPanelEast, BoxLayout.Y_AXIS)); pluginPanelWest.setLayout( new BoxLayout(pluginPanelWest, BoxLayout.Y_AXIS)); + this.getContentPane().add(pluginPanelNorth, BorderLayout.NORTH); this.getContentPane().add(pluginPanelEast, BorderLayout.EAST); - this.getContentPane().add(pluginPanelSouth, BorderLayout.SOUTH); this.getContentPane().add(pluginPanelWest, BorderLayout.WEST); + this.mainPanel.add(pluginPanelSouth, BorderLayout.SOUTH); // Search for plugin components registered through the OSGI bundle // context. ServiceReference[] serRefs = null; - String osgiFilter = "(" + String osgiFilter = "(|(" + Container.CONTAINER_ID - + "="+Container.CONTAINER_MAIN_WINDOW.getID()+")"; + + "="+Container.CONTAINER_MAIN_WINDOW.getID()+")" + + "(" + Container.CONTAINER_ID + + "="+Container.CONTAINER_STATUS_BAR.getID()+"))"; try { @@ -1147,8 +1173,9 @@ public class MainFrame else constraints = BorderLayout.SOUTH; - this.addPluginComponent( (Component) c.getComponent(), - constraints); + this.addPluginComponent((Component) c.getComponent(), + c.getContainer(), + constraints); } } } @@ -1165,7 +1192,9 @@ public class MainFrame PluginComponent pluginComponent = event.getPluginComponent(); if (pluginComponent.getContainer() - .equals(Container.CONTAINER_MAIN_WINDOW)) + .equals(Container.CONTAINER_MAIN_WINDOW) + || pluginComponent.getContainer() + .equals(Container.CONTAINER_STATUS_BAR)) { Object constraints = null; @@ -1197,6 +1226,7 @@ public class MainFrame { this.addPluginComponent( (Component) pluginComponent.getComponent(), + pluginComponent.getContainer(), constraints); } } @@ -1236,7 +1266,10 @@ public class MainFrame { public void run() { - removePluginComponent(c, finalConstraints); + removePluginComponent( + c, + pluginComponent.getContainer(), + finalConstraints); getContentPane().repaint(); pack(); @@ -1248,6 +1281,7 @@ public class MainFrame { this.removePluginComponent( (Component) pluginComponent.getComponent(), + pluginComponent.getContainer(), constraints); } @@ -1337,7 +1371,9 @@ public class MainFrame if (constraints == null) constraints = BorderLayout.SOUTH; - this.removePluginComponent(c, constraints); + this.removePluginComponent( c, + pluginComponent.getContainer(), + constraints); this.getContentPane().repaint(); } @@ -1364,7 +1400,7 @@ public class MainFrame Component c = (Component) plugin.getComponent(); - this.addPluginComponent(c, constraints); + this.addPluginComponent(c, plugin.getContainer(), constraints); this.nativePluginsTable.put(plugin, c); } @@ -1453,34 +1489,36 @@ public class MainFrame * @param c the component to add * @param constraints the constraints determining the container */ - private void addPluginComponent(Component c, Object constraints) + private void addPluginComponent(Component c, + Container container, + Object constraints) { - if (constraints.equals(BorderLayout.SOUTH)) - { - if (pluginPanelSouth.getComponentCount() == 0) - pluginPanelSouth.setBorder( - BorderFactory.createEmptyBorder(5, 5, 5, 5)); - - pluginPanelSouth.add(c); - pluginPanelSouth.repaint(); - } - else if (constraints.equals(BorderLayout.WEST)) + if (container.equals(Container.CONTAINER_MAIN_WINDOW)) { - if (pluginPanelWest.getComponentCount() == 0) - pluginPanelWest.setBorder( - BorderFactory.createEmptyBorder(5, 5, 5, 5)); - - pluginPanelWest.add(c); - pluginPanelSouth.repaint(); + if (constraints.equals(BorderLayout.NORTH)) + { + pluginPanelNorth.add(c); + pluginPanelNorth.repaint(); + } + else if (constraints.equals(BorderLayout.SOUTH)) + { + pluginPanelSouth.add(c); + pluginPanelSouth.repaint(); + } + else if (constraints.equals(BorderLayout.WEST)) + { + pluginPanelWest.add(c); + pluginPanelSouth.repaint(); + } + else if (constraints.equals(BorderLayout.EAST)) + { + pluginPanelEast.add(c); + pluginPanelSouth.repaint(); + } } - else if (constraints.equals(BorderLayout.EAST)) + else if (container.equals(Container.CONTAINER_STATUS_BAR)) { - if (pluginPanelEast.getComponentCount() == 0) - pluginPanelEast.setBorder( - BorderFactory.createEmptyBorder(5, 5, 5, 5)); - - pluginPanelEast.add(c); - pluginPanelSouth.repaint(); + statusBarPanel.add(c); } this.getContentPane().repaint(); @@ -1493,14 +1531,25 @@ public class MainFrame * @param c the component to remove * @param constraints the constraints determining the container */ - private void removePluginComponent(Component c, Object constraints) + private void removePluginComponent( Component c, + Container container, + Object constraints) { - if (constraints.equals(BorderLayout.SOUTH)) - pluginPanelSouth.remove(c); - else if (constraints.equals(BorderLayout.WEST)) - pluginPanelWest.remove(c); - else if (constraints.equals(BorderLayout.EAST)) - pluginPanelEast.remove(c); + if (container.equals(Container.CONTAINER_MAIN_WINDOW)) + { + if (constraints.equals(BorderLayout.NORTH)) + pluginPanelNorth.remove(c); + else if (constraints.equals(BorderLayout.SOUTH)) + pluginPanelSouth.remove(c); + else if (constraints.equals(BorderLayout.WEST)) + pluginPanelWest.remove(c); + else if (constraints.equals(BorderLayout.EAST)) + pluginPanelEast.remove(c); + } + else if (container.equals(Container.CONTAINER_STATUS_BAR)) + { + this.statusBarPanel.remove(c); + } } /** @@ -1511,4 +1560,16 @@ public class MainFrame { return accountStatusPanel; } + + private class MainContentPane extends JPanel + { + public MainContentPane() + { + super(new BorderLayout()); + + this.setBackground(new Color( + GuiActivator.getResources() + .getColor("desktopBackgroundColor"))); + } + } }
\ No newline at end of file diff --git a/src/net/java/sip/communicator/impl/gui/main/call/MainCallPanel.java b/src/net/java/sip/communicator/impl/gui/main/call/MainCallPanel.java index b9d7957..3b4d335 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/MainCallPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/MainCallPanel.java @@ -96,13 +96,18 @@ public class MainCallPanel callButton.setEnabled(false); - this.add(comboPanel, BorderLayout.CENTER); + this.add(comboPanel, BorderLayout.NORTH); callViaPanel.add(callViaLabel); callViaPanel.add(accountSelectorBox); buttonsPanel.add(callButton); + this.setOpaque(false); + comboPanel.setOpaque(false); + buttonsPanel.setOpaque(false); + phoneNumberCombo.setOpaque(false); + comboPanel.add(dialButton, BorderLayout.WEST); comboPanel.add(phoneNumberCombo, BorderLayout.CENTER); comboPanel.add(buttonsPanel, BorderLayout.EAST); diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListCellRenderer.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListCellRenderer.java index 01a4e7f..bdcea9e 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListCellRenderer.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListCellRenderer.java @@ -242,7 +242,14 @@ public class ContactListCellRenderer if (!this.isLeaf) { - g2.setColor(Constants.CONTACT_LIST_GROUP_BG_COLOR); + GradientPaint p = new GradientPaint(this.getWidth()/2, 0, + Constants.CONTACT_LIST_GROUP_BG_COLOR, + this.getWidth()/2, + this.getHeight(), + Constants.CONTACT_LIST_GROUP_BG_GRADIENT_COLOR); + + g2.setPaint(p); + g2.fillRoundRect(1, 1, this.getWidth(), this.getHeight() - 1, 7, 7); } else if (index%2 > 0) @@ -316,4 +323,4 @@ public class ContactListCellRenderer return toolTipText; } -} +}
\ No newline at end of file diff --git a/src/net/java/sip/communicator/impl/gui/main/menus/AboutWindow.java b/src/net/java/sip/communicator/impl/gui/main/menus/AboutWindow.java new file mode 100644 index 0000000..380e224 --- /dev/null +++ b/src/net/java/sip/communicator/impl/gui/main/menus/AboutWindow.java @@ -0,0 +1,168 @@ +package net.java.sip.communicator.impl.gui.main.menus;
+
+import java.awt.*;
+import java.awt.event.*;
+
+import javax.swing.*;
+
+import net.java.sip.communicator.impl.gui.*;
+import net.java.sip.communicator.impl.gui.i18n.*;
+import net.java.sip.communicator.impl.gui.utils.*;
+import net.java.sip.communicator.service.gui.*;
+
+public class AboutWindow
+ extends JDialog
+ implements ActionListener,
+ ExportedWindow
+{
+ private WindowBackground mainPanel = new WindowBackground();
+
+ private JLabel versionLabel = new JLabel(" "
+ + System.getProperty("sip-communicator.version"));
+
+ public AboutWindow()
+ {
+ this.setModal(false);
+ this.setResizable(false);
+
+ this.setTitle(
+ Messages.getI18NString("aboutWindowTitle",
+ new String[]{ GuiActivator.getResources()
+ .getSettingsString("applicationName")}).getText());
+
+ this.mainPanel.setLayout(null);
+
+ this.versionLabel.setFont(Constants.FONT.deriveFont(12));
+ this.versionLabel.setForeground(new Color(
+ GuiActivator.getResources().getColor("splashScreenTitleColor")));
+ this.versionLabel.setAlignmentX(Component.RIGHT_ALIGNMENT);
+
+ this.mainPanel.add(versionLabel);
+
+ Insets insets = mainPanel.getInsets();
+ versionLabel.setBounds(370 + insets.left, 307 + insets.top, 200, 20);
+
+ this.getContentPane().add(mainPanel);
+
+ // Close the splash screen on simple click or Esc.
+ this.getGlassPane().addMouseListener(new MouseAdapter()
+ {
+ public void mouseClicked(MouseEvent e)
+ {
+ AboutWindow.this.close(false);
+ }
+ });
+
+ this.getGlassPane().setVisible(true);
+
+ ActionMap amap = this.getRootPane().getActionMap();
+
+ amap.put("close", new CloseAction());
+
+ InputMap imap = this.getRootPane().getInputMap(
+ JComponent.WHEN_IN_FOCUSED_WINDOW);
+
+ imap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "close");
+ }
+
+ protected void close(boolean isEscaped)
+ {
+ this.dispose();
+ }
+
+ /**
+ * The action invoked when user presses Escape key.
+ */
+ private class CloseAction extends AbstractAction
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ AboutWindow.this.close(true);
+ }
+ }
+
+ /**
+ * Constructs the window background in order to have a background image.
+ */
+ private class WindowBackground
+ extends JPanel
+ {
+ private Image bgImage;
+
+ public WindowBackground()
+ {
+ this.setOpaque(true);
+
+ bgImage = ImageLoader.getImage(
+ ImageLoader.ABOUT_WINDOW_BACKGROUND);
+
+ this.setPreferredSize(new Dimension(bgImage.getWidth(this),
+ bgImage.getHeight(this)));
+ }
+
+ protected void paintComponent(Graphics g)
+ {
+ super.paintComponent(g);
+
+ Graphics2D g2 = (Graphics2D) g;
+
+ g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+ RenderingHints.VALUE_ANTIALIAS_ON);
+
+ g2.drawImage(bgImage, 0, 0, null);
+ }
+ }
+
+ public void actionPerformed(ActionEvent e)
+ {
+ this.dispose();
+ }
+
+ /**
+ * Implements the <tt>ExportedWindow.getIdentifier()</tt> method.
+ */
+ public WindowID getIdentifier()
+ {
+ return ExportedWindow.ABOUT_WINDOW;
+ }
+
+ /**
+ * This dialog could not be minimized.
+ */
+ public void minimize()
+ {
+ }
+
+ /**
+ * This dialog could not be maximized.
+ */
+ public void maximize()
+ {
+ }
+
+ /**
+ * Implements the <tt>ExportedWindow.bringToFront()</tt> method. Brings
+ * this window to front.
+ */
+ public void bringToFront()
+ {
+ this.toFront();
+ }
+
+ public static void activateAntialiasing(Graphics g)
+ {
+ Graphics2D g2d = (Graphics2D) g;
+
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+ RenderingHints.VALUE_ANTIALIAS_ON);
+ }
+
+ /**
+ * The source of the window
+ * @return the source of the window
+ */
+ public Object getSource()
+ {
+ return this;
+ }
+}
diff --git a/src/net/java/sip/communicator/impl/gui/main/menus/ExtendedQuickMenu.java b/src/net/java/sip/communicator/impl/gui/main/menus/ExtendedQuickMenu.java index 43d4321..48b0236 100644 --- a/src/net/java/sip/communicator/impl/gui/main/menus/ExtendedQuickMenu.java +++ b/src/net/java/sip/communicator/impl/gui/main/menus/ExtendedQuickMenu.java @@ -9,13 +9,12 @@ package net.java.sip.communicator.impl.gui.main.menus; import java.awt.*; import java.awt.event.*; +import java.awt.image.*; import java.util.*; import javax.swing.*; import javax.swing.event.*; -import org.osgi.framework.*; - import net.java.sip.communicator.impl.gui.*; import net.java.sip.communicator.impl.gui.customcontrols.*; import net.java.sip.communicator.impl.gui.event.*; @@ -23,6 +22,7 @@ import net.java.sip.communicator.impl.gui.i18n.*; import net.java.sip.communicator.impl.gui.main.*; import net.java.sip.communicator.impl.gui.main.contactlist.*; import net.java.sip.communicator.impl.gui.main.contactlist.addcontact.*; +import net.java.sip.communicator.impl.gui.main.contactlist.addgroup.*; import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.service.contactlist.*; import net.java.sip.communicator.service.gui.*; @@ -30,6 +30,8 @@ import net.java.sip.communicator.service.gui.Container; import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.util.*; +import org.osgi.framework.*; + /** * The <tt>QuickMenu</tt> is the toolbar on the top of the main * application window. It provides quick access to the "User info" window, the @@ -43,7 +45,7 @@ import net.java.sip.communicator.util.*; * @author Yana Stamcheva */ public class ExtendedQuickMenu - extends SIPCommToolBar + extends JPanel implements MouseListener, PluginComponentListener, ComponentListener, @@ -51,32 +53,44 @@ public class ExtendedQuickMenu { private Logger logger = Logger.getLogger(QuickMenu.class.getName()); + private SIPCommToolBar toolBar = new SIPCommToolBar(); + + BufferedImage backgroundImage + = ImageLoader.getImage(ImageLoader.TOOL_BAR_BACKGROUND); + + Rectangle rectangle + = new Rectangle(0, 0, + backgroundImage.getWidth(null), + backgroundImage.getHeight(null)); + + TexturePaint texture = new TexturePaint(backgroundImage, rectangle); + private ToolBarButton infoButton = new ToolBarButton( - Messages.getI18NString("info").getText(), ImageLoader.getImage(ImageLoader.QUICK_MENU_INFO_ICON)); private ToolBarButton configureButton = new ToolBarButton( - Messages.getI18NString("settings").getText(), ImageLoader.getImage(ImageLoader.QUICK_MENU_CONFIGURE_ICON)); private ToolBarButton hideShowButton = new ToolBarButton( - Messages.getI18NString("showOffline").getText(), ImageLoader.getImage(ImageLoader.QUICK_MENU_SHOW_OFFLINE_ICON)); private ToolBarButton addButton = new ToolBarButton( - Messages.getI18NString("add").getText(), ImageLoader.getImage(ImageLoader.QUICK_MENU_ADD_ICON)); private ToolBarButton soundButton = new ToolBarButton( - Messages.getI18NString("sound").getText(), ImageLoader.getImage(ImageLoader.QUICK_MENU_SOUND_ON_ICON)); + private ToolBarButton createGroupButton = new ToolBarButton( + ImageLoader.getImage(ImageLoader.QUICK_MENU_CREATE_GROUP_ICON)); + private static int DEFAULT_BUTTON_HEIGHT = GuiActivator.getResources().getSettingsInt("mainToolbarButtonHeight"); private static int DEFAULT_BUTTON_WIDTH = GuiActivator.getResources().getSettingsInt("mainToolbarButtonWidth"); + private MoreButton moreButton = new MoreButton(); + private ExportedWindow configDialog; private MainFrame mainFrame; @@ -85,47 +99,59 @@ public class ExtendedQuickMenu private Hashtable pluginsTable = new Hashtable(); + private LinkedList components = new LinkedList(); + /** * Create an instance of the <tt>QuickMenu</tt>. * @param mainFrame The parent <tt>MainFrame</tt> window. */ public ExtendedQuickMenu(MainFrame mainFrame) { + super(new BorderLayout()); + this.mainFrame = mainFrame; - this.setRollover(true); - this.setLayout(new FlowLayout(FlowLayout.LEFT, 2, 0)); + this.toolBar.setOpaque(false); + this.toolBar.setRollover(true); + this.toolBar.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 0)); - this.setFloatable(true); + this.toolBar.setFloatable(true); - int buttonWidth = calculateButtonWidth(); + this.setMinimumSize(new Dimension(650, 40)); + this.setPreferredSize(new Dimension(650, 40)); this.infoButton.setPreferredSize( - new Dimension(buttonWidth, DEFAULT_BUTTON_HEIGHT)); + new Dimension(DEFAULT_BUTTON_WIDTH, DEFAULT_BUTTON_HEIGHT)); this.configureButton.setPreferredSize( - new Dimension(buttonWidth, DEFAULT_BUTTON_HEIGHT)); + new Dimension(DEFAULT_BUTTON_WIDTH, DEFAULT_BUTTON_HEIGHT)); this.hideShowButton.setPreferredSize( - new Dimension(buttonWidth, DEFAULT_BUTTON_HEIGHT)); + new Dimension(DEFAULT_BUTTON_WIDTH, DEFAULT_BUTTON_HEIGHT)); this.addButton.setPreferredSize( - new Dimension(buttonWidth, DEFAULT_BUTTON_HEIGHT)); + new Dimension(DEFAULT_BUTTON_WIDTH, DEFAULT_BUTTON_HEIGHT)); this.soundButton.setPreferredSize( - new Dimension(buttonWidth, DEFAULT_BUTTON_HEIGHT)); + new Dimension(DEFAULT_BUTTON_WIDTH, DEFAULT_BUTTON_HEIGHT)); + this.createGroupButton.setPreferredSize( + new Dimension(DEFAULT_BUTTON_WIDTH, DEFAULT_BUTTON_HEIGHT)); this.infoButton.setToolTipText( Messages.getI18NString("contactInfo").getText()); this.configureButton.setToolTipText( - Messages.getI18NString("configure").getText()); + Messages.getI18NString("settings").getText()); this.hideShowButton.setToolTipText( Messages.getI18NString("hideOfflineContacts").getText()); this.addButton.setToolTipText( Messages.getI18NString("addContact").getText()); this.soundButton.setToolTipText( Messages.getI18NString("soundOnOff").getText()); + this.createGroupButton.setToolTipText( + Messages.getI18NString("createGroup").getText()); this.updateMuteButton( GuiActivator.getAudioNotifier().isMute()); this.init(); + + this.initPluginComponents(); } /** @@ -133,31 +159,38 @@ public class ExtendedQuickMenu */ private void init() { - this.add(addButton); - this.add(configureButton); - this.add(infoButton); - this.add(hideShowButton); - this.add(soundButton); + this.add(toolBar, BorderLayout.CENTER); + + this.toolBar.add(addButton); + this.toolBar.add(createGroupButton); + this.toolBar.add(configureButton); + this.toolBar.add(hideShowButton); + this.toolBar.add(soundButton); + + this.components.add(addButton); + this.components.add(createGroupButton); + this.components.add(configureButton); + this.components.add(hideShowButton); + this.components.add(soundButton); this.addButton.setName("add"); this.configureButton.setName("config"); this.hideShowButton.setName("search"); - this.infoButton.setName("info"); this.soundButton.setName("sound"); + this.createGroupButton.setName("createGroup"); this.addButton.addMouseListener(this); this.configureButton.addMouseListener(this); this.hideShowButton.addMouseListener(this); - this.infoButton.addMouseListener(this); this.soundButton.addMouseListener(this); + this.createGroupButton.addMouseListener(this); this.addButton.addComponentListener(this); this.configureButton.addComponentListener(this); this.hideShowButton.addComponentListener(this); this.infoButton.addComponentListener(this); this.soundButton.addComponentListener(this); - - this.initPluginComponents(); + this.createGroupButton.addComponentListener(this); } private void initPluginComponents() @@ -191,6 +224,9 @@ public class ExtendedQuickMenu Object selectedValue = mainFrame.getContactListPanel() .getContactList().getSelectedValue(); + if(component.getComponent() == null) + continue; + if(selectedValue instanceof MetaContact) { component.setCurrentContact((MetaContact)selectedValue); @@ -201,154 +237,60 @@ public class ExtendedQuickMenu .setCurrentContactGroup((MetaContactGroup)selectedValue); } - Component c = (Component)component.getComponent(); - - this.pluginsTable.put(component, c); - this.add(c); + Component c = (Component) component.getComponent(); - this.repaint(); + if (c != null) + { + if (component.getPositionIndex() > -1) + { + int index = component.getPositionIndex(); + this.toolBar.add(c, index); + this.components.add(index, c); + } + else + { + this.toolBar.add(c); + this.components.add(c); + } + + this.pluginsTable.put(component, c); + + this.repaint(); + } } } GuiActivator.getUIService().addPluginComponentListener(this); } - /** - * Handles the <tt>ActionEvent</tt> triggered when user clicks on one of - * the buttons in this toolbar. - */ - public void mousePressed(MouseEvent e) + + private class AddContactAction extends AbstractAction { - JLabel button = (JLabel) e.getSource(); - String buttonName = button.getName(); - - if (buttonName.equals("add")) + public void actionPerformed(ActionEvent arg0) { AddContactWizard wizard = new AddContactWizard(mainFrame); wizard.setVisible(true); } - else if (buttonName.equals("config")) + } + + private class ConfigAction extends AbstractAction + { + public void actionPerformed(ActionEvent arg0) { configDialog = GuiActivator.getUIService() .getExportedWindow(ExportedWindow.CONFIGURATION_WINDOW); configDialog.setVisible(true); } - else if (buttonName.equals("search")) - { - ContactList contactList = mainFrame.getContactListPanel() - .getContactList(); - - ContactListModel listModel - = (ContactListModel) contactList.getModel(); - - Object selectedObject = null; - int currentlySelectedIndex = contactList.getSelectedIndex(); - if(currentlySelectedIndex != -1) - { - selectedObject - = listModel.getElementAt(currentlySelectedIndex); - } - - if(ConfigurationManager.isShowOffline()) - { - button.setText( - "<html><center>" - + Messages.getI18NString("showOffline").getText() - + "</center></html>"); - - button.setIcon(new ImageIcon(ImageLoader.getImage( - ImageLoader.QUICK_MENU_SHOW_OFFLINE_ICON))); - - button.setToolTipText(Messages - .getI18NString("showOfflineContacts").getText()); - } - else - { - button.setText( - "<html><center>" - + Messages.getI18NString("hideOffline").getText() - + "</center></html>"); - - button.setIcon(new ImageIcon(ImageLoader.getImage( - ImageLoader.QUICK_MENU_HIDE_OFFLINE_ICON))); - - button.setToolTipText(Messages - .getI18NString("hideOfflineContacts").getText()); - } - - contactList.setShowOffline(!ConfigurationManager.isShowOffline()); - - if (selectedObject != null) - { - if (selectedObject instanceof MetaContact) - { - contactList.setSelectedIndex( - listModel.indexOf((MetaContact) selectedObject)); - } - else - { - contactList.setSelectedIndex( - listModel.indexOf( - (MetaContactGroup) selectedObject)); - } - } - } - else if (buttonName.equals("info")) - { - MetaContact selectedMetaContact = - (MetaContact) mainFrame.getContactListPanel() - .getContactList().getSelectedValue(); - - if(selectedMetaContact != null) - { - OperationSetWebContactInfo wContactInfo = null; - - Iterator protocolContacts = selectedMetaContact.getContacts(); - - while(protocolContacts.hasNext()) - { - Contact protoContact = (Contact) protocolContacts.next(); - - wContactInfo = mainFrame.getWebContactInfoOpSet( - protoContact.getProtocolProvider()); - - if(wContactInfo != null) - break; - } - - if(wContactInfo != null) - { - Contact defaultContact = selectedMetaContact - .getDefaultContact(); - - GuiActivator.getBrowserLauncher().openURL( - wContactInfo.getWebContactInfo(defaultContact) - .toString()); - } - else - { - new ErrorDialog(mainFrame, - Messages.getI18NString("warning").getText(), - Messages.getI18NString("selectContactSupportingInfo") - .getText(), - ErrorDialog.WARNING).showDialog(); - } - } - } - else if (buttonName.equals("sound")) - { - if(GuiActivator.getAudioNotifier().isMute()) - { - updateMuteButton(false); - GuiActivator.getAudioNotifier().setMute(false); - } - else - { - updateMuteButton(true); - GuiActivator.getAudioNotifier().setMute(true); - } - } + } + /** + * Handles the <tt>ActionEvent</tt> triggered when user clicks on one of + * the buttons in this toolbar. + */ + public void mousePressed(MouseEvent e) + { + ToolBarButton button = (ToolBarButton) e.getSource(); + button.setMousePressed(true); } /** @@ -365,20 +307,33 @@ public class ExtendedQuickMenu .equals(Container.CONTAINER_MAIN_TOOL_BAR)) return; - Object constraints = UIServiceImpl - .getBorderLayoutConstraintsFromContainer( - pluginComponent.getConstraints()); + int position = pluginComponent.getPositionIndex(); - Component c = (Component)pluginComponent.getComponent(); + Component c = (Component) pluginComponent.getComponent(); - if (constraints != null) - this.add(c, constraints); + if (c == null) + return; + + if (position > -1) + { + this.toolBar.add(c, position); + components.add(position, c); + } else - this.add(c); + { + this.toolBar.add(c); + components.add(c); + } + + pluginsTable.put(pluginComponent, c); + + c.setPreferredSize( + new Dimension(DEFAULT_BUTTON_WIDTH, DEFAULT_BUTTON_HEIGHT)); + c.addComponentListener(this); Object selectedValue = mainFrame.getContactListPanel() .getContactList().getSelectedValue(); - + if(selectedValue instanceof MetaContact) { pluginComponent @@ -409,7 +364,9 @@ public class ExtendedQuickMenu return; this.pluginsTable.remove(c); - this.remove((Component) c.getComponent()); + this.components.remove(c); + + this.toolBar.remove((Component) c.getComponent()); } public void componentHidden(ComponentEvent e) @@ -421,29 +378,39 @@ public class ExtendedQuickMenu */ public void componentMoved(ComponentEvent e) { - int compCount = this.getComponentCount(); + int compCount = this.components.size(); - int biggestY = 0; + int maxWidth = this.toolBar.getWidth(); + + int width = 0; for (int i = 0; i < compCount; i ++) { - Component c = this.getComponent(i); - - if(c instanceof JButton) + JComponent c = (JComponent) this.components.get(i); + + width += c.getWidth() + 10; + + if (width < maxWidth) + { + moreButton.removeMenuItem(c); + } + else { - if(c.getY() > biggestY) - biggestY = c.getY(); + moreButton.addMenuItem(c); } } - - this.setPreferredSize( - new Dimension(this.getWidth(), biggestY + DEFAULT_BUTTON_HEIGHT)); - - ((JPanel)this.getParent()).revalidate(); - ((JPanel)this.getParent()).repaint(); + + if (moreButton.getItemsCount() > 0) + this.add(moreButton, BorderLayout.EAST); + else + this.remove(moreButton); + + this.revalidate(); + this.repaint(); } public void componentResized(ComponentEvent e) - {} + { + } public void componentShown(ComponentEvent e) {} @@ -486,16 +453,6 @@ public class ExtendedQuickMenu ImageLoader.QUICK_MENU_SOUND_OFF_ICON))); } - public void paintComponent(Graphics g) - { - super.paintComponent(g); - - Image backgroundImage - = ImageLoader.getImage(ImageLoader.TOOL_BAR_BACKGROUND); - - g.drawImage(backgroundImage, 0, 0, getWidth(), getHeight(), null); - } - private class ToolBarButton extends JLabel { @@ -503,11 +460,11 @@ public class ExtendedQuickMenu private boolean isMouseOver = false; - public ToolBarButton(String text, Image iconImage) + private boolean isMousePressed = false; + + public ToolBarButton(Image iconImage) { - super( "<html><center>" + text + "</center></html>", - new ImageIcon(iconImage), - JLabel.CENTER); + super(new ImageIcon(iconImage)); this.setFont(getFont().deriveFont(Font.BOLD, 10f)); this.setForeground(new Color( @@ -523,26 +480,209 @@ public class ExtendedQuickMenu this.repaint(); } + public void setMousePressed(boolean isMousePressed) + { + this.isMousePressed = isMousePressed; + this.repaint(); + } + public void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D) g; AntialiasingManager.activateAntialiasing(g2); - super.paintComponent(g2); + Color color = null; - g2.setStroke(new BasicStroke(1.5f)); + if(isMouseOver) + { + color = new Color( + GuiActivator.getResources() + .getColor("toolbarRolloverBackground")); + + g2.setColor(color); - g2.setColor(new Color(0x646464)); + g2.drawRoundRect(0, 0, getWidth() - 1, getHeight() - 2, 8, 8); + } + + if (isMousePressed) + { + color = new Color( + GuiActivator.getResources().getColor("toolbarBackground")); - if (isMouseOver) - g.drawRoundRect(0, 0, this.getWidth() - 1, - this.getHeight() - 3, 5, 5); + g2.setColor(new Color( color.getRed(), + color.getGreen(), + color.getBlue(), + 100)); + + g2.fillRoundRect(0, 0, getWidth() - 1, getHeight() - 2, 8, 8); + } + + super.paintComponent(g2); + } + + public Action getAction() + { + return null; } } public void mouseClicked(MouseEvent e) { + JLabel button = (JLabel) e.getSource(); + String buttonName = button.getName(); + + if (buttonName.equals("add")) + { + Action a = new AddContactAction(); + a.putValue(Action.NAME, button.getToolTipText()); + a.actionPerformed(null); + } + else if (buttonName.equals("config")) + { + configDialog = GuiActivator.getUIService() + .getExportedWindow(ExportedWindow.CONFIGURATION_WINDOW); + + configDialog.setVisible(true); + } + else if (buttonName.equals("search")) + { + ContactList contactList = mainFrame.getContactListPanel() + .getContactList(); + + ContactListModel listModel + = (ContactListModel) contactList.getModel(); + + Object selectedObject = null; + int currentlySelectedIndex = contactList.getSelectedIndex(); + if(currentlySelectedIndex != -1) + { + selectedObject + = listModel.getElementAt(currentlySelectedIndex); + } + + if(ConfigurationManager.isShowOffline()) + { + button.setText( + "<html><center>" + + Messages.getI18NString("showOffline").getText() + + "</center></html>"); + + button.setIcon(new ImageIcon(ImageLoader.getImage( + ImageLoader.QUICK_MENU_SHOW_OFFLINE_ICON))); + + button.setToolTipText(Messages + .getI18NString("showOfflineContacts").getText()); + } + else + { + button.setText( + "<html><center>" + + Messages.getI18NString("hideOffline").getText() + + "</center></html>"); + + button.setIcon(new ImageIcon(ImageLoader.getImage( + ImageLoader.QUICK_MENU_HIDE_OFFLINE_ICON))); + + button.setToolTipText(Messages + .getI18NString("hideOfflineContacts").getText()); + } + + contactList.setShowOffline(!ConfigurationManager.isShowOffline()); + + if (selectedObject != null) + { + if (selectedObject instanceof MetaContact) + { + contactList.setSelectedIndex( + listModel.indexOf((MetaContact) selectedObject)); + } + else + { + contactList.setSelectedIndex( + listModel.indexOf( + (MetaContactGroup) selectedObject)); + } + } + } + else if (buttonName.equals("info")) + { + Object selectedValue = mainFrame.getContactListPanel() + .getContactList().getSelectedValue(); + + if (selectedValue == null + || !(selectedValue instanceof MetaContact)) + { + AboutWindow aboutWindow = new AboutWindow(); + + aboutWindow.pack(); + + aboutWindow.setLocation( + Toolkit.getDefaultToolkit().getScreenSize().width / 2 + - aboutWindow.getWidth() / 2, + Toolkit.getDefaultToolkit().getScreenSize().height / 2 + - aboutWindow.getHeight() / 2); + + aboutWindow.setVisible(true); + } + else + { + MetaContact selectedMetaContact = + (MetaContact) selectedValue; + + OperationSetWebContactInfo wContactInfo = null; + + Iterator protocolContacts = selectedMetaContact.getContacts(); + + while(protocolContacts.hasNext()) + { + Contact protoContact = (Contact) protocolContacts.next(); + + wContactInfo = mainFrame.getWebContactInfoOpSet( + protoContact.getProtocolProvider()); + + if(wContactInfo != null) + break; + } + + if(wContactInfo != null) + { + Contact defaultContact = selectedMetaContact + .getDefaultContact(); + + GuiActivator.getBrowserLauncher().openURL( + wContactInfo.getWebContactInfo(defaultContact) + .toString()); + } + else + { + new ErrorDialog(mainFrame, + Messages.getI18NString("warning").getText(), + Messages.getI18NString("selectContactSupportingInfo") + .getText(), + ErrorDialog.WARNING).showDialog(); + } + } + } + else if (buttonName.equals("sound")) + { + if(GuiActivator.getAudioNotifier().isMute()) + { + updateMuteButton(false); + GuiActivator.getAudioNotifier().setMute(false); + } + else + { + updateMuteButton(true); + GuiActivator.getAudioNotifier().setMute(true); + } + } + else if (buttonName.equals("createGroup")) + { + CreateGroupDialog dialog = new CreateGroupDialog(mainFrame); + + dialog.setVisible(true); + } } public void mouseEntered(MouseEvent e) @@ -559,46 +699,27 @@ public class ExtendedQuickMenu public void mouseReleased(MouseEvent e) { + ToolBarButton button = (ToolBarButton) e.getSource(); + button.setMousePressed(false); } - private int calculateButtonWidth() + public void paintComponent(Graphics g) { - int width = DEFAULT_BUTTON_WIDTH; - - FontMetrics fontMetrics - = infoButton.getFontMetrics(infoButton.getFont()); - - int textWidth = fontMetrics.stringWidth( - Messages.getI18NString("info").getText()); - - if (textWidth > width) - width = textWidth; - - textWidth = fontMetrics.stringWidth( - Messages.getI18NString("settings").getText()); - - if (textWidth > width) - width = textWidth; - - textWidth = fontMetrics.stringWidth( - Messages.getI18NString("showOffline").getText()); - - if (textWidth > width) - width = textWidth; + super.paintComponent(g); - textWidth = fontMetrics.stringWidth( - Messages.getI18NString("add").getText()); + if (backgroundImage != null) + { + Graphics2D g2 = (Graphics2D) g; - if (textWidth > width) - width = textWidth; + g2.setPaint(texture); - textWidth = fontMetrics.stringWidth( - Messages.getI18NString("sound").getText()); + g2.fillRect(0, 2, this.getWidth(), this.getHeight() - 2); - if (textWidth > width) - width = textWidth; + g2.setColor(new Color( + GuiActivator.getResources() + .getColor("desktopBackgroundColor"))); - // Return the width by - return width + 5; + g2.drawRect(0, this.getHeight() - 2, this.getWidth(), 2); + } } }
\ No newline at end of file diff --git a/src/net/java/sip/communicator/impl/gui/main/menus/MoreButton.java b/src/net/java/sip/communicator/impl/gui/main/menus/MoreButton.java new file mode 100644 index 0000000..5c809ca --- /dev/null +++ b/src/net/java/sip/communicator/impl/gui/main/menus/MoreButton.java @@ -0,0 +1,199 @@ +/* + * 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.impl.gui.main.menus; + +import java.awt.*; +import java.awt.event.*; +import java.util.*; + +import javax.swing.*; + +import net.java.sip.communicator.impl.gui.i18n.*; +import net.java.sip.communicator.impl.gui.utils.*; +import net.java.sip.communicator.service.contactlist.*; +import net.java.sip.communicator.service.gui.*; +import net.java.sip.communicator.service.gui.Container; + +public class MoreButton + extends JLabel + implements PluginComponent, + MouseListener, + FocusListener +{ + private Image iconImage; + + private boolean isMouseOver = false; + + private JPopupMenu menu = new JPopupMenu(); + + private Hashtable menuItemsTable = new Hashtable(); + + public MoreButton() + { + super(new ImageIcon(ImageLoader.getImage(ImageLoader.MORE_BUTTON)), + JLabel.CENTER); + + this.setVerticalTextPosition(SwingConstants.BOTTOM); + this.setHorizontalTextPosition(SwingConstants.CENTER); + + this.setToolTipText(Messages.getI18NString("more").getText()); + + this.addMouseListener(this); + + this.addFocusListener(this); + } + + public Object getComponent() + { + return this; + } + + public String getConstraints() + { + return null; + } + + public Container getContainer() + { + return Container.CONTAINER_MAIN_TOOL_BAR; + } + + public String getName() + { + return this.getText(); + } + + public void setMouseOver(boolean isMouseOver) + { + this.isMouseOver = isMouseOver; + this.repaint(); + } + + public void setCurrentContact(MetaContact metaContact) + { + } + + public void setCurrentContactGroup(MetaContactGroup metaGroup) + { + } + + public void mouseClicked(MouseEvent e) + { + } + + public void mouseEntered(MouseEvent e) + { + this.setMouseOver(true); + } + + public void mouseExited(MouseEvent e) + { + this.setMouseOver(false); + } + + public void mousePressed(MouseEvent e) + { + requestFocus(); + + if (!menu.isVisible()) + { + menu.setLocation( + getLocationOnScreen().x, + getLocationOnScreen().y + getHeight()); + + menu.setVisible(true); + } + else + menu.setVisible(false); + } + + public void mouseReleased(MouseEvent e) + { + } + + /** + * Specifies the position of this component in the container, where it + * will be added. + * @return 0 to indicate the first position in the container. + */ + public int getPositionIndex() + { + return -1; + } + + public void focusGained(FocusEvent arg0) + { + } + + public void focusLost(FocusEvent arg0) + { + menu.setVisible(false); + } + + public void addMenuItem(final JComponent c) + { + String name = c.getToolTipText(); + + if (!this.containsItem(name)) + { + JMenuItem item = new JMenuItem(name); + item.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + MouseEvent mouseEvent + = new MouseEvent(c, + MouseEvent.MOUSE_PRESSED, + System.currentTimeMillis(), + MouseEvent.BUTTON1, + c.getX(), + c.getY(), + 1, + false); + + MouseListener[] listeners = c.getMouseListeners(); + + for (int i = 0; i < listeners.length; i++) + { + MouseListener l = listeners[i]; + l.mousePressed(mouseEvent); + } + } + }); + + this.menu.add(item); + this.menuItemsTable.put(name, item); + } + } + + public void removeMenuItem(JComponent c) + { + String name = c.getToolTipText(); + Component item = (Component) this.menuItemsTable.get(name); + + if (item != null) + { + this.menu.remove(item); + menuItemsTable.remove(name); + } + } + + public int getItemsCount() + { + return menuItemsTable.size(); + } + + public boolean containsItem(String name) + { + return menuItemsTable.containsKey(name); + } + + public boolean isNativeComponent() + { + return false; + } +}
\ No newline at end of file diff --git a/src/net/java/sip/communicator/impl/gui/main/presence/AccountStatusPanel.java b/src/net/java/sip/communicator/impl/gui/main/presence/AccountStatusPanel.java index 5ab9c44..5956dd1 100644 --- a/src/net/java/sip/communicator/impl/gui/main/presence/AccountStatusPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/presence/AccountStatusPanel.java @@ -45,6 +45,7 @@ public class AccountStatusPanel this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + this.setOpaque(false); this.accountNameLabel.setOpaque(false); this.rightPanel.setOpaque(false); @@ -182,6 +183,8 @@ public class AccountStatusPanel protected void paintComponent(Graphics g) { + AntialiasingManager.activateAntialiasing(g); + super.paintComponent(g); Color bgColor = new Color( diff --git a/src/net/java/sip/communicator/impl/gui/main/presence/GlobalStatusSelectorBox.java b/src/net/java/sip/communicator/impl/gui/main/presence/GlobalStatusSelectorBox.java index a097037..0f78cf1 100644 --- a/src/net/java/sip/communicator/impl/gui/main/presence/GlobalStatusSelectorBox.java +++ b/src/net/java/sip/communicator/impl/gui/main/presence/GlobalStatusSelectorBox.java @@ -485,7 +485,7 @@ public class GlobalStatusSelectorBox Iterator pProviders = mainFrame.getProtocolProviders(); boolean isProtocolHidden; - +System.out.println("PROTOCOL PROVIDERRRSSSSSSSSSSSSSSSSSSS ============" + pProviders.hasNext()); while (pProviders.hasNext()) { ProtocolProviderService protocolProvider diff --git a/src/net/java/sip/communicator/impl/gui/utils/ConfigurationManager.java b/src/net/java/sip/communicator/impl/gui/utils/ConfigurationManager.java index cb5c6e1..b1bb003 100644 --- a/src/net/java/sip/communicator/impl/gui/utils/ConfigurationManager.java +++ b/src/net/java/sip/communicator/impl/gui/utils/ConfigurationManager.java @@ -50,6 +50,8 @@ public class ConfigurationManager private static boolean isTransparentWindowEnabled; + private static boolean isWindowDecorated; + private static ConfigurationService configService = GuiActivator.getConfigurationService(); @@ -265,6 +267,25 @@ public class ConfigurationManager = new Integer(windowTransparencyString).intValue(); } + // Load the "isWindowDecorated" property. + String isWindowDecoratedProperty + = "net.java.sip.communicator.impl.gui.isWindowDecorated"; + + String isWindowDecoratedString + = configService.getString(isWindowDecoratedProperty); + + if(isWindowDecoratedString == null) + isWindowDecoratedString = + GuiActivator.getResources(). + getSettingsString(isWindowDecoratedProperty); + + if(isWindowDecoratedString != null + && isWindowDecoratedString.length() > 0) + { + isWindowDecorated + = new Boolean(isWindowDecoratedString).booleanValue(); + } + // Load the "lastContactParent" property. lastContactParent = configService.getString( "net.java.sip.communicator.impl.gui.addcontact.lastContactParent"); @@ -393,6 +414,17 @@ public class ConfigurationManager } /** + * Returns <code>true</code> if the "isWindowDecorated" property is + * true, otherwise - returns <code>false</code>.. + * @return <code>true</code> if the "isWindowDecorated" property is + * true, otherwise - returns <code>false</code>. + */ + public static boolean isWindowDecorated() + { + return isWindowDecorated; + } + + /** * Return the "sendMessageCommand" property that was saved previously * through the <tt>ConfigurationService</tt>. Indicates to the user * interface whether the default send message command is Enter or CTRL-Enter. diff --git a/src/net/java/sip/communicator/impl/gui/utils/Constants.java b/src/net/java/sip/communicator/impl/gui/utils/Constants.java index fb92005..0fde341 100755 --- a/src/net/java/sip/communicator/impl/gui/utils/Constants.java +++ b/src/net/java/sip/communicator/impl/gui/utils/Constants.java @@ -196,6 +196,14 @@ public class Constants = new Color(GuiActivator.getResources() .getColor("contactListGroupRowColor")); + /** + * The end color used to paint a gradient mouse over background of some + * components. + */ + public static final Color CONTACT_LIST_GROUP_BG_GRADIENT_COLOR + = new Color(GuiActivator.getResources(). + getColor("contactListGroupGradientColor")); + /* * ====================================================================== * --------------------------- FONT CONSTANTS --------------------------- diff --git a/src/net/java/sip/communicator/impl/gui/utils/ImageLoader.java b/src/net/java/sip/communicator/impl/gui/utils/ImageLoader.java index 4e94794..a802cd0 100644 --- a/src/net/java/sip/communicator/impl/gui/utils/ImageLoader.java +++ b/src/net/java/sip/communicator/impl/gui/utils/ImageLoader.java @@ -56,6 +56,42 @@ public class ImageLoader { = new ImageID("BUTTON_ROLLOVER"); /** + * The background image of a button. + */ + public static final ImageID BUTTON_BG_LEFT + = new ImageID("BUTTON_BG_LEFT"); + + /** + * The background image of a button. + */ + public static final ImageID BUTTON_BG_RIGHT + = new ImageID("BUTTON_BG_RIGHT"); + + /** + * The background image of a button. + */ + public static final ImageID BUTTON_BG_MIDDLE + = new ImageID("BUTTON_BG_MIDDLE"); + + /** + * The background image of a button. + */ + public static final ImageID BUTTON_ROLLOVER_BG_LEFT + = new ImageID("BUTTON_ROLLOVER_BG_LEFT"); + + /** + * The background image of a button. + */ + public static final ImageID BUTTON_ROLLOVER_BG_RIGHT + = new ImageID("BUTTON_ROLLOVER_BG_RIGHT"); + + /** + * The background image of a button. + */ + public static final ImageID BUTTON_ROLLOVER_BG_MIDDLE + = new ImageID("BUTTON_ROLLOVER_BG_MIDDLE"); + + /** * The pressed toggle button background image. */ public static final ImageID TOGGLE_BUTTON_PRESSED @@ -215,6 +251,12 @@ public class ImageLoader { = new ImageID("MAIN_WINDOW_BACKGROUND"); /** + * The background of the main window and chat window. + */ + public static final ImageID MORE_BUTTON + = new ImageID("MORE_BUTTON"); + + /** * The icon on the "Add contact" button in the <tt>QuickMenu</tt>. */ public static final ImageID ACCOUNT_ICON @@ -627,6 +669,18 @@ public class ImageLoader { public static final ImageID WINDOW_TITLE_BAR_BG = new ImageID("WINDOW_TITLE_BAR_BG"); + /** + * Title bar background image. + */ + public static final ImageID QUICK_MENU_ABOUT_ICON + = new ImageID("QUICK_MENU_ABOUT_ICON"); + + /** + * Title bar background image. + */ + public static final ImageID QUICK_MENU_CREATE_GROUP_ICON + = new ImageID("QUICK_MENU_CREATE_GROUP_ICON"); + // ///////////////////// Edit Text Toolbar icons ////////////////////////// /** diff --git a/src/net/java/sip/communicator/service/gui/Container.java b/src/net/java/sip/communicator/service/gui/Container.java index 30e9514..06485b0 100644 --- a/src/net/java/sip/communicator/service/gui/Container.java +++ b/src/net/java/sip/communicator/service/gui/Container.java @@ -131,6 +131,12 @@ public class Container public static final Container CONTAINER_CALL_BUTTONS_PANEL = new Container("CONTAINER_CALL_BUTTONS_PANEL"); + /** + * Status bar container. + */ + public static final Container CONTAINER_STATUS_BAR + = new Container("CONTAINER_STATUS_BAR"); + /* * Constraints */ @@ -214,4 +220,4 @@ public class Container else return false; } -} +}
\ No newline at end of file diff --git a/src/net/java/sip/communicator/service/gui/UIService.java b/src/net/java/sip/communicator/service/gui/UIService.java index be7cffd..264124d 100644 --- a/src/net/java/sip/communicator/service/gui/UIService.java +++ b/src/net/java/sip/communicator/service/gui/UIService.java @@ -6,6 +6,7 @@ */ package net.java.sip.communicator.service.gui; +import java.awt.*; import java.util.*; import net.java.sip.communicator.service.protocol.*; @@ -68,6 +69,37 @@ public interface UIService public void setVisible(boolean visible); /** + * Returns the current location of the main application window. The returned + * point is the top left corner of the window. + * + * @return The top left corner coordinates of the main application window. + */ + public Point getLocation(); + + /** + * Locates the main application window to the new x and y coordinates. + * + * @param x The new x coordinate. + * @param y The new y coordinate. + */ + public void setLocation(int x, int y); + + /** + * Returns the size of the main application window. + * + * @return the size of the main application window. + */ + public Dimension getSize(); + + /** + * Sets the size of the main application window. + * + * @param width The width of the window. + * @param height The height of the window. + */ + public void setSize(int width, int height); + + /** * Minimizes the main application window. */ public void minimize(); @@ -274,4 +306,4 @@ public interface UIService * <code>false</code> otherwise. */ public boolean isContainerSupported(Container containderID); -} +}
\ No newline at end of file |