Some chat toolbar enhancements.

cusax-fix
Yana Stamcheva 18 years ago
parent 13c88b07c8
commit 72f65a50fc

Binary file not shown.

Before

Width:  |  Height:  |  Size: 440 B

After

Width:  |  Height:  |  Size: 593 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 423 B

After

Width:  |  Height:  |  Size: 551 B

@ -280,6 +280,7 @@ showCallPanel=Show call panel
showChannelsList=Show channels list
showOffline=Hide
showOfflineUsers=Hide/Show offline users
smiley=Smiley
specifyReason=In the field below you could specify the reason of this operation.
sound=Sound
soundOnOff=Turn sound on/off

@ -778,8 +778,10 @@ public void run() {
* The <tt>RunApplication</tt> implements the Runnable interface and is used to
* shows the main application window in a separate thread.
*/
private class RunApplicationGui implements Runnable {
public void run() {
private class RunApplicationGui implements Runnable
{
public void run()
{
mainFrame.setVisible(true);
}
}

@ -6,7 +6,6 @@
*/
package net.java.sip.communicator.impl.gui.customcontrols;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
@ -33,9 +32,8 @@ public class SIPCommMenu
* Creates an instance of <tt>SIPCommMenu</tt>.
*/
public SIPCommMenu()
{
{
this.setUI(new SIPCommSelectorMenuUI());
this.setPreferredSize(new Dimension(28, 24));
}
/**

@ -24,9 +24,10 @@ public class SIPCommChatSelectorMenuUI
{
private Image menuBgImage
= ImageLoader.getImage(ImageLoader.CHAT_TOOLBAR_BUTTON_BG);
private Image menuRolloverImage
= ImageLoader.getImage(ImageLoader.CHAT_TOOLBAR_ROLLOVER_BUTTON_BG);
/**
* Creates a new SIPCommChatSelectorMenuUI instance.
*/
@ -52,12 +53,19 @@ public void paint(Graphics g, JComponent c)
protected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor)
{
AntialiasingManager.activateAntialiasing(g);
super.paintBackground(g, menuItem, bgColor);
int menuWidth = menuItem.getWidth();
int menuHeight = menuItem.getHeight();
g.drawImage(menuBgImage, 0, 0, menuWidth, menuHeight, null);
boolean isToolBarExtended
= new Boolean(ApplicationProperties
.getProperty("isToolBarExteneded")).booleanValue();
if (!isToolBarExtended)
{
int menuWidth = menuItem.getWidth();
int menuHeight = menuItem.getHeight();
g.drawImage(menuBgImage, 0, 0, menuWidth, menuHeight, null);
}
}
}

@ -51,7 +51,9 @@ public class AccountSelectorBox
public AccountSelectorBox(CallManager callManager)
{
this.callManager = callManager;
this.menu.setPreferredSize(new Dimension(28, 24));
this.add(menu);
}

@ -47,13 +47,15 @@ public ProtocolContactSelectorBox(MetaContactChatPanel chatPanel,
MetaContact metaContact, Contact protocolContact)
{
this.chatPanel = chatPanel;
this.metaContact = metaContact;
this.currentProtoContact = protocolContact;
this.menu.setPreferredSize(new Dimension(28, 24));
this.add(menu);
Iterator protocolContacts = metaContact.getContacts();
while (protocolContacts.hasNext()) {
Contact contact = (Contact) protocolContacts.next();

@ -25,8 +25,8 @@
* @author Yana Stamcheva
*/
public class SmiliesSelectorBox extends JMenuBar
implements ActionListener {
implements ActionListener
{
private ChatWindow chatWindow;
private ArrayList imageList;
@ -34,32 +34,39 @@ public class SmiliesSelectorBox extends JMenuBar
private int gridRowCount = 0;
private int gridColCount = 0;
private SIPCommMenu selectorBox = new SIPCommMenu();
private static int BUTTON_HEIGHT
= SizeProperties.getSize("mainToolbarButtonHeight");
private static int BUTTON_WIDTH
= SizeProperties.getSize("mainToolbarButtonWidth");
/**
* Creates an instance of this <tt>SmiliesSelectorBox</tt> and initializes
* the panel with the smiley icons given by the incoming imageList.
*
* @param imageList The pack of smiley icons.
*/
public SmiliesSelectorBox(ArrayList imageList, ChatWindow chatWindow) {
public SmiliesSelectorBox(ArrayList imageList, ChatWindow chatWindow)
{
this.imageList = imageList;
this.chatWindow = chatWindow;
this.selectorBox.setUI(new SIPCommChatSelectorMenuUI());
this.selectorBox.setPreferredSize(new Dimension(24, 24));
//Should explicetly remove any border in order to align correctly the
this.setPreferredSize(
new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
//Should explicitly remove any border in order to align correctly the
//icon.
this.selectorBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.selectorBox.setIcon(new ImageIcon(ImageLoader
.getImage(ImageLoader.SMILIES_ICON)));
this.calculateGridDimensions(imageList.size());
this.selectorBox.getPopupMenu().setLayout(new GridLayout(
@ -141,4 +148,21 @@ public void actionPerformed(ActionEvent e)
}
}
}
/**
* Sets the given text to this smiley selector box. The given text will be
* position by default on the bottom of the icon.
*
* @param text the text to be added to this selector box.
*/
public void setText(String text)
{
this.selectorBox.setText(text);
this.selectorBox.setFont(getFont().deriveFont(Font.BOLD, 10f));
this.selectorBox.setVerticalTextPosition(SwingConstants.BOTTOM);
this.selectorBox.setHorizontalTextPosition(SwingConstants.CENTER);
this.selectorBox.setForeground(
new Color(ColorProperties.getColor("chatMenuBarForeground")));
}
}

@ -97,6 +97,8 @@ public ExtendedMainToolBar(ChatWindow messageWindow)
this.smiliesBox = new SmiliesSelectorBox(
ImageLoader.getDefaultSmiliesPack(), messageWindow);
this.smiliesBox.setText(Messages.getI18NString("smiley").getText());
this.setRollover(true);
this.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
this.setPreferredSize(new Dimension(300, BUTTON_HEIGHT));

@ -66,9 +66,15 @@ public class MainToolBar
private ChatToolbarButton fontButton = new ChatToolbarButton(ImageLoader
.getImage(ImageLoader.FONT_ICON));
SmiliesSelectorBox smiliesBox;
private static int BUTTON_HEIGHT
= SizeProperties.getSize("mainToolbarButtonHeight");
private static int BUTTON_WIDTH
= SizeProperties.getSize("mainToolbarButtonWidth");
private SmiliesSelectorBox smiliesBox;
private ChatWindow messageWindow;
/**
@ -94,10 +100,10 @@ public MainToolBar(ChatWindow messageWindow) {
this.setLayout(new FlowLayout(FlowLayout.LEFT, 3, 0));
this.setBorder(BorderFactory.createEmptyBorder(2, 2, 5, 2));
this.add(saveButton);
this.add(printButton);
this.addSeparator();
// this.add(saveButton);
// this.add(printButton);
//
// this.addSeparator();
this.add(cutButton);
this.add(copyButton);
@ -114,12 +120,12 @@ public MainToolBar(ChatWindow messageWindow) {
this.addSeparator();
this.add(sendFileButton);
// this.add(sendFileButton);
this.add(historyButton);
this.addSeparator();
this.add(fontButton);
// this.addSeparator();
//
// this.add(fontButton);
this.saveButton.setName("save");
this.saveButton.setToolTipText(
@ -169,19 +175,40 @@ public MainToolBar(ChatWindow messageWindow) {
this.printButton.addActionListener(this);
this.cutButton.addActionListener(this);
this.copyButton.addActionListener(this);
this.pasteButton.addActionListener(this);
this.pasteButton.addActionListener(this);
this.previousButton.addActionListener(this);
this.nextButton.addActionListener(this);
this.sendFileButton.addActionListener(this);
this.historyButton.addActionListener(this);
this.fontButton.addActionListener(this);
this.saveButton.setPreferredSize(
new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
this.printButton.setPreferredSize(
new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
this.cutButton.setPreferredSize(
new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
this.copyButton.setPreferredSize(
new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
this.pasteButton.setPreferredSize(
new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
this.previousButton.setPreferredSize(
new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
this.nextButton.setPreferredSize(
new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
this.sendFileButton.setPreferredSize(
new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
this.historyButton.setPreferredSize(
new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
this.fontButton.setPreferredSize(
new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
// Disable all buttons that do nothing.
this.saveButton.setEnabled(false);
this.printButton.setEnabled(false);
this.sendFileButton.setEnabled(false);
this.fontButton.setEnabled(false);
this.initPluginComponents();
}

@ -70,11 +70,12 @@ public class PresenceStatusSelectorBox
public PresenceStatusSelectorBox(MainFrame mainFrame,
ProtocolProviderService protocolProvider, int accountIndex)
{
this.mainFrame = mainFrame;
this.protocolProvider = protocolProvider;
this.accountIndex = accountIndex;
this.setPreferredSize(new Dimension(28, 24));
this.presence = mainFrame.getProtocolPresenceOpSet(protocolProvider);
this.statusIterator = this.presence.getSupportedStatusSet();

@ -73,6 +73,8 @@ public SimpleStatusSelectorBox(MainFrame mainFrame,
this.protocolProvider = protocolProvider;
this.accountIndex = accountIndex;
this.setPreferredSize(new Dimension(28, 24));
this.onlineIcon = new ImageIcon(
ImageLoader.getBytesInImage(protocolProvider.getProtocolIcon()
.getIcon(ProtocolIcon.ICON_SIZE_16x16)));

@ -6,6 +6,7 @@
*/
package net.java.sip.communicator.impl.gui.main.presence;
import java.awt.Dimension;
import java.awt.image.*;
import java.util.*;
@ -107,5 +108,6 @@ protected void saveStatusInformation(
statusName);
}
this.setPreferredSize(new Dimension(28, 24));
}
}

Loading…
Cancel
Save