Fix window always on top after buzz.

git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@6648 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Derek DeMoro
2007-01-10 08:07:10 +00:00
committed by derek
parent b4582c8a17
commit 3910718a22
3 changed files with 20 additions and 27 deletions

View File

@ -43,7 +43,6 @@ public class ShakeWindow extends Object {
JFrame f = (JFrame)window;
f.setState(Frame.NORMAL);
f.setVisible(true);
f.setAlwaysOnTop(true);
}
SparkManager.getAlertManager().flashWindow(window);

View File

@ -11,6 +11,7 @@
package org.jivesoftware.spark.ui;
import org.jivesoftware.resource.Res;
import org.jivesoftware.resource.SparkRes;
import org.jivesoftware.smack.PacketCollector;
import org.jivesoftware.smack.filter.PacketIDFilter;
import org.jivesoftware.smack.packet.IQ;
@ -80,27 +81,30 @@ public class VCardPanel extends JPanel {
return;
}
ImageIcon icon = null;
byte[] bytes = vcard.getAvatar();
if (bytes != null) {
try {
ImageIcon icon = new ImageIcon(bytes);
icon = new ImageIcon(bytes);
Image aImage = icon.getImage();
if (icon.getIconHeight() > 32 || icon.getIconWidth() > 32) {
aImage = aImage.getScaledInstance(-1, 32, Image.SCALE_SMOOTH);
}
icon = new ImageIcon(aImage);
if (icon.getIconWidth() > 0) {
avatarImage.setIcon(icon);
avatarImage.setBorder(BorderFactory.createBevelBorder(0, Color.white, Color.lightGray));
}
}
catch (Exception e) {
Log.error(e);
}
}
else {
icon = SparkRes.getImageIcon(SparkRes.DEFAULT_AVATAR_32x32_IMAGE);
}
if (icon != null && icon.getIconWidth() > 0) {
avatarImage.setIcon(icon);
avatarImage.setBorder(BorderFactory.createBevelBorder(0, Color.white, Color.lightGray));
}
vcard.setJabberId(jid);
buildUI(vcard);
@ -156,32 +160,22 @@ public class VCardPanel extends JPanel {
}
add(usernameLabel, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 2, 5), 0, 0));
add(usernameLabel, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 2, 0, 0), 0, 0));
/*
final JLabel locationLabel = new JLabel();
if (ModelUtil.hasLength(city) && ModelUtil.hasLength(state) && ModelUtil.hasLength(country)) {
locationLabel.setText(" - " + city + ", " + state + " " + country);
}
add(locationLabel, new GridBagConstraints(2, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 5, 2, 5), 0, 0));
*/
final JLabel titleLabel = new JLabel(title);
final JLabel titleLabel = new JLabel("("+title+")");
titleLabel.setFont(new Font("Dialog", Font.PLAIN, 11));
if (ModelUtil.hasLength(title)) {
add(titleLabel, new GridBagConstraints(1, 1, 2, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 0, 5), 0, 0));
add(titleLabel, new GridBagConstraints(2, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 2, 0, 0), 0, 0));
}
/*
String phone = vcard.getPhoneWork("VOICE");
if (ModelUtil.hasLength(phone)) {
final JLabel phoneNumber = new JLabel("Work: " + phone);
add(phoneNumber, new GridBagConstraints(1, 2, 2, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 5, 2, 5), 0, 0));
}
*/
final JLabel localTime = new JLabel();
add(localTime, new GridBagConstraints(1, 3, 2, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 0, 5), 0, 0));
add(localTime, new GridBagConstraints(1, 3, 2, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 2, 0, 0), 0, 0));
localTime.setFont(new Font("Dialog", Font.PLAIN, 11));
final Time time = new Time();
time.setType(IQ.Type.GET);

View File

@ -195,7 +195,7 @@ public class ChatRoomImpl extends ChatRoom {
// Add VCard Panel
final VCardPanel vcardPanel = new VCardPanel(participantJID);
getToolBar().add(vcardPanel, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
getToolBar().add(vcardPanel, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
}