|
|
|
|
@ -60,12 +60,12 @@ public class AccountStatusPanel
|
|
|
|
|
/**
|
|
|
|
|
* The desired height of the avatar.
|
|
|
|
|
*/
|
|
|
|
|
private static final int AVATAR_ICON_HEIGHT = 40;
|
|
|
|
|
private static final int AVATAR_ICON_HEIGHT = 50;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The desired width of the avatar.
|
|
|
|
|
*/
|
|
|
|
|
private static final int AVATAR_ICON_WIDTH = 40;
|
|
|
|
|
private static final int AVATAR_ICON_WIDTH = 50;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The image object storing the avatar.
|
|
|
|
|
@ -122,6 +122,18 @@ public class AccountStatusPanel
|
|
|
|
|
*/
|
|
|
|
|
private final PluginContainer mainToolbarPluginContainer;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* When setting global status message, the message will be displayed in this
|
|
|
|
|
* label.
|
|
|
|
|
*/
|
|
|
|
|
private final JLabel statusMessageLabel = new JLabel();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This is the panel that contains display name, status message, status
|
|
|
|
|
* selector box and plugins.
|
|
|
|
|
*/
|
|
|
|
|
private final TransparentPanel rightPanel = new TransparentPanel();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Creates an instance of <tt>AccountStatusPanel</tt> by specifying the
|
|
|
|
|
* main window, where this panel is added.
|
|
|
|
|
@ -144,7 +156,7 @@ public AccountStatusPanel()
|
|
|
|
|
accountNameLabel.getFont().deriveFont(12f));
|
|
|
|
|
accountNameLabel.setOpaque(false);
|
|
|
|
|
|
|
|
|
|
statusComboBox = new GlobalStatusSelectorBox();
|
|
|
|
|
statusComboBox = new GlobalStatusSelectorBox(this);
|
|
|
|
|
// Align status combo box with account name field.
|
|
|
|
|
statusComboBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
|
|
|
|
|
|
|
|
|
|
@ -163,9 +175,14 @@ public AccountStatusPanel()
|
|
|
|
|
|
|
|
|
|
statusToolsPanel.add(toolbarPluginPanel, BorderLayout.EAST);
|
|
|
|
|
|
|
|
|
|
TransparentPanel rightPanel = new TransparentPanel();
|
|
|
|
|
statusMessageLabel.setFont(
|
|
|
|
|
statusMessageLabel.getFont().deriveFont(9f));
|
|
|
|
|
statusMessageLabel.setForeground(Color.GRAY);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rightPanel.setLayout(new BorderLayout(0, 0));
|
|
|
|
|
rightPanel.add(accountNameLabel, BorderLayout.NORTH);
|
|
|
|
|
rightPanel.add(statusMessageLabel, BorderLayout.CENTER);
|
|
|
|
|
rightPanel.add(statusToolsPanel, BorderLayout.SOUTH);
|
|
|
|
|
|
|
|
|
|
this.add(accountImageLabel, BorderLayout.WEST);
|
|
|
|
|
@ -196,6 +213,24 @@ public AccountStatusPanel()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Updates status message.
|
|
|
|
|
* @param text
|
|
|
|
|
*/
|
|
|
|
|
void setStatusMessage(String text)
|
|
|
|
|
{
|
|
|
|
|
if(text == null)
|
|
|
|
|
{
|
|
|
|
|
statusMessageLabel.setText("");
|
|
|
|
|
rightPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
rightPanel.setBorder(null);
|
|
|
|
|
statusMessageLabel.setText(text);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Adds the account given by <tt>protocolProvider</tt> in the contained
|
|
|
|
|
* status combo box.
|
|
|
|
|
|