ContactList tree replaced by JList

cusax-fix
Yana Stamcheva 20 years ago
parent e256fef3ba
commit a2ff15ce5e

@ -119,19 +119,7 @@ public void setThemePack(String themePack) {
UIManager.setLookAndFeel
("com.l2fprod.gui.plaf.skin.SkinLookAndFeel");
}
// Decorates the frames and dialogs if we are running with jdk1.4 +
/*
* if (OS.isOneDotFourOrMore()) { java.lang.reflect.Method method =
* JFrame.class.getMethod( "setDefaultLookAndFeelDecorated", new
* Class[] { boolean.class }); method.invoke(null, new Object[] {
* Boolean.TRUE });
*
* method = JDialog.class.getMethod(
* "setDefaultLookAndFeelDecorated", new Class[] { boolean.class });
* method.invoke(null, neif (args.length > 0) { }
*/
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();

@ -16,14 +16,19 @@
import java.util.Iterator;
import java.util.Map;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JPanel;
import net.java.sip.communicator.impl.gui.main.configforms.ConfigurationFrame;
import net.java.sip.communicator.impl.gui.main.contactlist.ContactListModel;
import net.java.sip.communicator.impl.gui.main.contactlist.ContactNode;
import net.java.sip.communicator.impl.gui.main.contactlist.MetaContactNode;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.main.utils.Constants;
import net.java.sip.communicator.impl.gui.main.utils.ImageLoader;
import net.java.sip.communicator.service.contactlist.MetaContact;
import net.java.sip.communicator.service.contactlist.MetaContactGroup;
import net.java.sip.communicator.service.contactlist.MetaContactListService;
import net.java.sip.communicator.service.protocol.OperationFailedException;
import net.java.sip.communicator.service.protocol.OperationSetPersistentPresence;
@ -85,8 +90,6 @@ public MainFrame() {
this.setIconImage(ImageLoader.getImage(ImageLoader.SIP_LOGO));
this.setSize(Constants.MAINFRAME_WIDTH, Constants.MAINFRAME_HEIGHT);
this.init();
}
@ -108,7 +111,9 @@ private void setInitialBounds() {
this.setLocation(Toolkit.getDefaultToolkit().getScreenSize().width
- MainFrame.WIDTH, 50);
this.tabbedPane.setMinimumSize(minimumFrameSize);
this.setSize(155, 400);
this.contactListPanel.setPreferredSize(new Dimension(140, 350));
this.contactListPanel.setMinimumSize(new Dimension(80, 200));
}
public CallPanel getCallPanel() {
@ -217,14 +222,27 @@ private class ProviderPresenceStatusAdapter
private class ContactPresenceStatusAdapter
implements ContactPresenceStatusListener {
public void contactPresenceStatusChanged(ContactPresenceStatusChangeEvent evt) {
ContactNode node = tabbedPane.getContactListPanel().getContactListTree().contains(evt.getSourceContact());
public void contactPresenceStatusChanged
(ContactPresenceStatusChangeEvent evt) {
MetaContact metaContact
= contactList.findMetaContactByContact(evt.getSourceContact());
if (metaContact != null){
ContactListModel model
= (ContactListModel)tabbedPane.getContactListPanel()
.getContactList().getModel();
MetaContactNode node
= model.getContactNodeByContact(metaContact);
if(node != null){
node.setStatusIcon
(new ImageIcon(Constants.getStatusIcon
(evt.getNewStatus())));
}
}
if(node != null){
node.setIcon(Constants.getStatusIcon(evt.getNewStatus()));
tabbedPane.getContactListPanel().getContactListTree().repaint();
}
}
}

@ -30,14 +30,10 @@ public class Constants {
* ------------------------ SIZE CONSTANTS -------------------------------
* =======================================================================
*/
public static final int MAINFRAME_MIN_HEIGHT = 200;
public static final int MAINFRAME_HEIGHT = 180;
public static final int MAINFRAME_WIDTH = 120;
public static final int MAINFRAME_MIN_HEIGHT = 300;
public static final int MAINFRAME_MIN_WIDTH = 200;
public static final int MAINFRAME_MIN_WIDTH = 80;
public static final int CONTACTPANEL_HEIGHT = 20;

Loading…
Cancel
Save