From 4046890e518ad318af3fc4f303fe4cbb65b3cf8b Mon Sep 17 00:00:00 2001 From: Sebastien Mazy Date: Mon, 16 Feb 2009 18:52:31 +0000 Subject: [PATCH] cosmetics, add a few "final" --- .../gui/main/contactlist/ContactList.java | 2 +- .../MoveSubcontactMessageDialog.java | 52 +++++++++---------- .../impl/gui/utils/ContactListDraggable.java | 18 +++---- .../impl/protocol/sip/SipStackProperties.java | 12 ++--- 4 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactList.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactList.java index 0f30c5534..f33298981 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactList.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactList.java @@ -75,7 +75,7 @@ public class ContactList * these contacts with a special icon. */ private Vector activeContacts = new Vector(); - + /** * Creates an instance of the ContactList. * diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/MoveSubcontactMessageDialog.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/MoveSubcontactMessageDialog.java index 846bc903a..c9e26fe34 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/MoveSubcontactMessageDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/MoveSubcontactMessageDialog.java @@ -31,32 +31,32 @@ public class MoveSubcontactMessageDialog private SIPCommMsgTextArea infoArea = new SIPCommMsgTextArea( GuiActivator.getResources() .getI18NString("service.gui.MOVE_SUBCONTACT_MSG")); - + private JLabel infoTitleLabel = new JLabel( GuiActivator.getResources() .getI18NString("service.gui.MOVE_SUBCONTACT")); - + private JLabel iconLabel = new JLabel( new ImageIcon(ImageLoader.getImage(ImageLoader.INFO_ICON))); - + private JButton cancelButton = new JButton( GuiActivator.getResources().getI18NString("service.gui.CANCEL")); - + private TransparentPanel labelsPanel = new TransparentPanel(new GridLayout(0, 1)); - + private TransparentPanel mainPanel = new TransparentPanel(new BorderLayout(10, 10)); - + private TransparentPanel buttonsPanel = new TransparentPanel(new FlowLayout(FlowLayout.RIGHT)); - + private int dialogWidth = 350; private int dialogHeight = 150; - + private MainFrame mainFrame; private ContactListListener clistListener; - + /** * Creates an instance of MoveSubcontactMessageDialog and constructs * all panels contained in this dialog. @@ -67,26 +67,26 @@ public MoveSubcontactMessageDialog(MainFrame parentWindow, ContactListListener listener) { super(parentWindow); - + this.mainFrame = parentWindow; this.clistListener = listener; - + this.setTitle(GuiActivator.getResources() .getI18NString("service.gui.MOVE_SUBCONTACT")); - + this.mainPanel.setPreferredSize( new Dimension(dialogWidth, dialogHeight)); - + this.cancelButton.setMnemonic( GuiActivator.getResources().getI18nMnemonic("service.gui.CANCEL")); - + this.cancelButton.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { dispose(); - + ContactList clist = mainFrame.getContactListPanel().getContactList(); - + clist.removeExcContactListListener(clistListener); // FIXME: unset the special cursor after a subcontact has been @@ -95,22 +95,22 @@ public void actionPerformed(ActionEvent e) { // Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); } }); - + this.infoTitleLabel.setHorizontalAlignment(JLabel.CENTER); this.infoTitleLabel.setFont(Constants.FONT.deriveFont(Font.BOLD, 18)); - + this.labelsPanel.add(infoTitleLabel); this.labelsPanel.add(infoArea); - + this.mainPanel.setBorder( BorderFactory.createEmptyBorder(10, 10, 10, 10)); - + this.buttonsPanel.add(cancelButton); - + this.mainPanel.add(labelsPanel, BorderLayout.CENTER); this.mainPanel.add(iconLabel, BorderLayout.WEST); this.mainPanel.add(buttonsPanel, BorderLayout.SOUTH); - + this.getContentPane().add(mainPanel); this.pack(); } @@ -124,9 +124,9 @@ private void setDialogLocation(JFrame parentWindow) { int dialogY = (int) Toolkit.getDefaultToolkit() .getScreenSize().getHeight()/2 - dialogHeight/2; - + int parentX = parentWindow.getLocation().x; - + if ((parentX - dialogWidth) > 0) { this.setLocation(parentX - dialogWidth, dialogY); @@ -141,11 +141,11 @@ protected void close(boolean isEscaped) { this.cancelButton.doClick(); } - + public void setVisible(boolean isVisible) { super.setVisible(isVisible); - + this.setDialogLocation(mainFrame); } } diff --git a/src/net/java/sip/communicator/impl/gui/utils/ContactListDraggable.java b/src/net/java/sip/communicator/impl/gui/utils/ContactListDraggable.java index 679f26ffc..38f71e40e 100644 --- a/src/net/java/sip/communicator/impl/gui/utils/ContactListDraggable.java +++ b/src/net/java/sip/communicator/impl/gui/utils/ContactListDraggable.java @@ -68,7 +68,7 @@ public class ContactListDraggable extends JComponent */ private static Hashtable cursors = new Hashtable(2); static { - try + try { cursors.put("valid", Cursor.getSystemCustomCursor("MoveDrop.32x32")); } @@ -78,7 +78,7 @@ public class ContactListDraggable extends JComponent "will use Cursor.MOVE_CURSOR instead", ex); cursors.put("valid", Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); } - try + try { cursors.put("invalid", Cursor.getSystemCustomCursor("Invalid.32x32")); } @@ -89,7 +89,7 @@ public class ContactListDraggable extends JComponent cursors.put("invalid", Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); } } - + /** * Creates a new instance of ContactListDraggable which is a represantation * of an object currently dragged over the contactlist. @@ -105,9 +105,9 @@ public ContactListDraggable(ContactList contactList, MetaContact metaContact, Contact contact, Image image) { setOpaque(false); - + this.contactList = contactList; - + setMetaContact(metaContact); setContact(contact); setImage(image); @@ -145,7 +145,7 @@ public Contact getContact() { return contact; } - /** + /** * Set the Contact associated with this ContactListDraggable. * Could be null if we are dragging a whole MetaContact. * If not null, this Contact is a subcontact of the @@ -220,19 +220,19 @@ public void paintComponent(Graphics g) Graphics2D g2 = (Graphics2D) g; g2.setComposite(AlphaComposite. getInstance(AlphaComposite.SRC_OVER, 0.8f)); - + g2.drawImage( image, (int) (location.getX() - image.getWidth(null) / 2), (int) (location.getY() - image.getHeight(null) / 2), null); - + g2.setColor(Color.GRAY); g2.drawRect((int) (location.getX() - image.getWidth(null) / 2), (int) (location.getY() - image.getHeight(null) / 2), image.getWidth(null), image.getHeight(null)); - + // check if we are located over the contact list Point p = SwingUtilities.convertPoint(this, location, contactList); if (contactList.contains(p)) diff --git a/src/net/java/sip/communicator/impl/protocol/sip/SipStackProperties.java b/src/net/java/sip/communicator/impl/protocol/sip/SipStackProperties.java index 5c75aafb4..ef98a9cca 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/SipStackProperties.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/SipStackProperties.java @@ -33,8 +33,8 @@ public class SipStackProperties * The name of the property under which the jain-sip-ri would expect to find * the name of the server log file. */ - private static final String NSPNAME_SERVER_LOG = - "gov.nist.javax.sip.SERVER_LOG"; + private static final String NSPNAME_SERVER_LOG + = "gov.nist.javax.sip.SERVER_LOG"; /** * The default name of a server log file for the jain-sip RI. @@ -46,28 +46,28 @@ public class SipStackProperties * The name of the property under which the jain-sip-ri would expect to find * if the debug log file has to be overwritten when starting. */ - private static String NSPNAME_DEBUG_LOG_OVERWRITE + private static final String NSPNAME_DEBUG_LOG_OVERWRITE = "gov.nist.javax.sip.DEBUG_LOG_OVERWRITE"; /** * A string indicating to jain-sip-ri if the debug log file has to be * overwritten when starting. */ - private static String NSPVALUE_DEBUG_LOG_OVERWRITE + private static final String NSPVALUE_DEBUG_LOG_OVERWRITE = "true"; /** * The name of the property under which the jain-sip-ri would expect to find * if the server log file has to be overwritten when starting. */ - private static String NSPNAME_SERVER_LOG_OVERWRITE + private static final String NSPNAME_SERVER_LOG_OVERWRITE = "gov.nist.javax.sip.SERVER_LOG_OVERWRITE"; /** * A string indicating to jain-sip-ri if the server log file has to be * overwritten when starting. */ - private static String NSPVALUE_SERVER_LOG_OVERWRITE + private static final String NSPVALUE_SERVER_LOG_OVERWRITE = "true"; /**