Update Roaster Icons and Spacing - Fix appearance null error - Add Right click to Username in Login Panel

This commit is contained in:
Amos Chepchieng
2020-12-19 22:25:25 +03:00
parent 666549918b
commit 8b95d439f6
23 changed files with 93 additions and 65 deletions

View File

@ -136,6 +136,11 @@
<Dimension value="[200, 30]"/>
</Property>
</Properties>
<Events>
<EventHandler event="mouseEntered" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tfUsernameMouseEntered"/>
<EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tfUsernameMouseExited"/>
<EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tfUsernameMousePressed"/>
</Events>
</Component>
<Component class="javax.swing.JTextField" name="tfDomain">
<Properties>

View File

@ -70,6 +70,7 @@ import javax.swing.JPasswordField;
import javax.swing.JPopupMenu;
import javax.swing.JSplitPane;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.text.JTextComponent;
import org.dom4j.Document;
@ -302,7 +303,6 @@ public class LoginUIPanel extends javax.swing.JPanel implements KeyListener, Act
//reset ui
//btnAdvanced.setUI(new BasicButtonUI());
//btnCreateAccount.setUI(new BasicButtonUI());
tfDomain.putClientProperty("JTextField.placeholderText", "Enter Domain(e.g igniterealtime.org)");
tfPassword.putClientProperty("JTextField.placeholderText", "Enter Password");
tfUsername.putClientProperty("JTextField.placeholderText", "Enter Username");
@ -376,6 +376,17 @@ public class LoginUIPanel extends javax.swing.JPanel implements KeyListener, Act
pnlCenter.add(filler2);
tfUsername.setPreferredSize(new java.awt.Dimension(200, 30));
tfUsername.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
tfUsernameMouseEntered(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
tfUsernameMouseExited(evt);
}
public void mousePressed(java.awt.event.MouseEvent evt) {
tfUsernameMousePressed(evt);
}
});
pnlCenter.add(tfUsername);
tfDomain.setPreferredSize(new java.awt.Dimension(200, 30));
@ -450,6 +461,20 @@ public class LoginUIPanel extends javax.swing.JPanel implements KeyListener, Act
// TODO add your handling code here:
}//GEN-LAST:event_btnLoginActionPerformed
private void tfUsernameMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tfUsernameMousePressed
if (SwingUtilities.isRightMouseButton(evt)) {
getPopup().show(tfUsername, evt.getX(), evt.getY());
}
}//GEN-LAST:event_tfUsernameMousePressed
private void tfUsernameMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tfUsernameMouseEntered
// getPopup().show(tfUsername, evt.getX(), evt.getY());
}//GEN-LAST:event_tfUsernameMouseEntered
private void tfUsernameMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tfUsernameMouseExited
// getPopup().setVisible(false);
}//GEN-LAST:event_tfUsernameMouseExited
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnAdvanced;
@ -509,7 +534,6 @@ public class LoginUIPanel extends javax.swing.JPanel implements KeyListener, Act
EventQueue.invokeLater(() -> {
loginDialog.setIconImage(SparkManager.getApplicationImage().getImage());
loginDialog.setContentPane(this);
loginDialog.setLocationRelativeTo(parentFrame);
@ -1174,15 +1198,15 @@ public class LoginUIPanel extends javax.swing.JPanel implements KeyListener, Act
loginDialog.setVisible(true);
}
if (loginDialog.isVisible()) {
if (xee.getMessage() != null && xee.getMessage().contains("Self Signed certificate")) {
// Handle specific case: if server certificate is self-signed, but self-signed certs are not allowed, show a popup allowing the user to override.
// Prompt user if they'd like to add the failed chain to the trust store.
final Object[] options = {
Res.getString("yes"),
Res.getString("no")
};
if (xee.getMessage() != null && xee.getMessage().contains("Self Signed certificate")) {
// Handle specific case: if server certificate is self-signed, but self-signed certs are not allowed, show a popup allowing the user to override.
// Prompt user if they'd like to add the failed chain to the trust store.
final Object[] options = {
Res.getString("yes"),
Res.getString("no")
};
final int userChoice = JOptionPane.showOptionDialog(this,
final int userChoice = JOptionPane.showOptionDialog(this,
Res.getString("dialog.certificate.ask.allow.self-signed"),
Res.getString("title.certificate"),
JOptionPane.YES_NO_OPTION,
@ -1191,27 +1215,27 @@ public class LoginUIPanel extends javax.swing.JPanel implements KeyListener, Act
options,
options[1]);
if (userChoice == JOptionPane.YES_OPTION) {
// Toggle the preference.
localPref.setAcceptSelfSigned(true);
SettingsManager.saveSettings();
if (userChoice == JOptionPane.YES_OPTION) {
// Toggle the preference.
localPref.setAcceptSelfSigned(true);
SettingsManager.saveSettings();
// Attempt to login again.
validateLogin();
}
} else {
final X509Certificate[] lastFailedChain = SparkTrustManager.getLastFailedChain();
final SparkTrustManager sparkTrustManager = (SparkTrustManager) SparkTrustManager.getTrustManagerList()[0];
// Handle specific case: if path validation failed because of an unrecognized CA, show popup allowing the user to add the certificate.
if (lastFailedChain != null && ((xee.getMessage() != null && xee.getMessage().contains("Certificate not in the TrustStore")) || !sparkTrustManager.containsTrustAnchorFor(lastFailedChain))) {
// Prompt user if they'd like to add the failed chain to the trust store.
final CertificateModel certModel = new CertificateModel(lastFailedChain[0]);
final Object[] options = {
Res.getString("yes"),
Res.getString("no")
};
// Attempt to login again.
validateLogin();
}
} else {
final X509Certificate[] lastFailedChain = SparkTrustManager.getLastFailedChain();
final SparkTrustManager sparkTrustManager = (SparkTrustManager) SparkTrustManager.getTrustManagerList()[0];
// Handle specific case: if path validation failed because of an unrecognized CA, show popup allowing the user to add the certificate.
if (lastFailedChain != null && ((xee.getMessage() != null && xee.getMessage().contains("Certificate not in the TrustStore")) || !sparkTrustManager.containsTrustAnchorFor(lastFailedChain))) {
// Prompt user if they'd like to add the failed chain to the trust store.
final CertificateModel certModel = new CertificateModel(lastFailedChain[0]);
final Object[] options = {
Res.getString("yes"),
Res.getString("no")
};
final int userChoice = JOptionPane.showOptionDialog(this,
final int userChoice = JOptionPane.showOptionDialog(this,
new UnrecognizedServerCertificatePanel(certModel),
Res.getString("title.certificate"),
JOptionPane.YES_NO_OPTION,
@ -1220,19 +1244,19 @@ public class LoginUIPanel extends javax.swing.JPanel implements KeyListener, Act
options,
options[1]);
if (userChoice == JOptionPane.YES_OPTION) {
// Add the certificate chain to the truststore.
sparkTrustManager.addChain(lastFailedChain);
if (userChoice == JOptionPane.YES_OPTION) {
// Add the certificate chain to the truststore.
sparkTrustManager.addChain(lastFailedChain);
// Attempt to login again.
validateLogin();
}
} else {
// For anything else, show a generic error dialog.
MessageDialog.showErrorDialog(loginDialog, errorMessage, xee);
// Attempt to login again.
validateLogin();
}
} else {
// For anything else, show a generic error dialog.
MessageDialog.showErrorDialog(loginDialog, errorMessage, xee);
}
}
}
});
setEnabled(true);
@ -1405,8 +1429,6 @@ public class LoginUIPanel extends javax.swing.JPanel implements KeyListener, Act
}
}
/**
* Checks for historic Spark settings and upgrades the user.
*

View File

@ -1042,6 +1042,7 @@ public abstract class ChatRoom extends BackgroundPanel implements ActionListener
*/
public void addChatRoomButton(ChatRoomButton button) {
buttonPanel.add(button);
buttonPanel.setBorder(BorderFactory.createEmptyBorder(5,0,5,0));
// Make all JButtons the same size
Component[] comps = buttonPanel.getComponents();

View File

@ -1606,7 +1606,7 @@ public class ContactList extends JPanel implements ActionListener,
};
lastActivityAction.putValue(Action.NAME, Res.getString("menuitem.view.last.activity"));
lastActivityAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_USER1_STOPWATCH));
lastActivityAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.HISTORY_16x16));
if (contactGroup == offlineGroup || item.getPresence().isAway() || (item.getPresence().getType() == Presence.Type.unavailable) || (item.getPresence().getType() == null)) {
popup.add(lastActivityAction);

View File

@ -115,14 +115,14 @@ public class ThemePanel extends JPanel {
}
private void setNewLaF() {
final String selectedName = (String) _lookandfeel.getSelectedItem();
try {
final String className = LookAndFeelManager.getClassName(selectedName);
// UIManager.setLookAndFeel(className);
// TODO setJTattooBar( _lookandfeelname.get( _lookandfeel.getSelectedIndex() ) );
} catch (Exception e) {
Log.error("An unexpected exception occurred while trying to update Look and Feel to '" + selectedName + "'.", e);
}
// final String selectedName = (String) _lookandfeel.getSelectedItem();
// try {
// final String className = LookAndFeelManager.getClassName(selectedName);
// // UIManager.setLookAndFeel(className);
// // TODO setJTattooBar( _lookandfeelname.get( _lookandfeel.getSelectedIndex() ) );
// } catch (Exception e) {
// Log.error("An unexpected exception occurred while trying to update Look and Feel to '" + selectedName + "'.", e);
// }
}
private void updateAllComponentsLaF(final Window window) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 734 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 506 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 474 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 858 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -56,7 +56,7 @@ FIND_IMAGE = images/find.png
SMALL_ADD_IMAGE = images/icons/add.png
DOCUMENT_EXCHANGE_IMAGE = images/document_exchange.png
SMALL_DOCUMENT_ADD = images/document_add.png
SMALL_CIRCLE_DELETE = images/small_delete.png
SMALL_CIRCLE_DELETE = images/icons/close.png
SMALL_DOCUMENT_VIEW = images/document_view.png
SMALL_USER1_MESSAGE = images/icons/chat_settings.png
USER1_MESSAGE_24x24 = images/icons/chat_settings.png
@ -64,7 +64,7 @@ SMALL_USER1_TIME = images/user1_time.png
SMALL_USER1_NEW = images/icons/create.png
SMALL_USER1_STOPWATCH = images/stopwatch_pause.png
SMALL_USER1_MOBILEPHONE = images/user1_mobilephone.png
SMALL_USER1_INFORMATION = images/user1_information.png
SMALL_USER1_INFORMATION = images/icons/subscribe.png
SMALL_ENTRY = images/small_entry.gif
SMALL_AGENT_IMAGE = images/small_agent.png
CHATTING_AGENT_IMAGE = images/user1.png
@ -93,12 +93,12 @@ FONT_16x16 = images/font.png
DOCUMENT_FIND_16x16 = images/document_find.png
DOCUMENT_INFO_32x32 = images/document_info.png
DOCUMENT_16x16 = images/icons/note.png
SMALL_CLOSE_BUTTON = images/deleteitem.gif
COPY_16x16 = images/copy.png
SMALL_CLOSE_BUTTON = images/icons/close.png
COPY_16x16 = images/icons/copy.png
BLANK_24x24 = images/blank_24x24.png
PUSH_URL_16x16 = images/earth_connection-16x16.png
LINK_16x16 = images/link-16x16.png
LINK_DELETE_16x16 = images/link_delete.png
LINK_16x16 = images/icons/link.png
LINK_DELETE_16x16 = images/icons/link_delete.png
EARTH_LOCK_16x16 = images/earth_lock-16x16.png
LOCK_16x16 = images/icons/lock.png
BLOCK_CONTACT_16x16 = images/icons/block.png
@ -150,9 +150,9 @@ CLOSE_DARK_X_IMAGE = images/icons/close.png
PALETTE_24x24_IMAGE = images/icons/appearance.png
NOTIFICATIONS = images/icons/notifications.png
COLOR_ICON = images/icons/colors.png
DEFAULT_AVATAR_16x16_IMAGE = images/default_avatar_16x16.png
DEFAULT_AVATAR_32x32_IMAGE = images/default_avatar_32x32.png
DEFAULT_AVATAR_64x64_IMAGE = images/default_avatar_64x64.png
DEFAULT_AVATAR_16x16_IMAGE = images/icons/user24.png
DEFAULT_AVATAR_32x32_IMAGE = images/icons/user32.png
DEFAULT_AVATAR_64x64_IMAGE = images/icons/user64.png
# Global Values
ERROR_INVALID_WORKGROUP = The workgroup is not valid. Please use a valid workgroup.
@ -204,11 +204,11 @@ FORUM_TAB_TITLE = Forums
#Images
CANCEL_IMAGE = images/cancel.gif
CONFERENCE_IMAGE_24x24 = images/icons/conference.png
CONFERENCE_IMAGE_24x24 = images/icons/invite24.png
CONFERENCE_IMAGE_16x16 = images/icons/conference.png
PROFILE_IMAGE_24x24 = images/icons/profile.png
PROFILE_IMAGE_24x24 = images/icons/profile24.png
SEARCH_USER_16x16 = images/icons/search.png
SEND_FILE_24x24 = images/icons/send_file.png
SEND_FILE_24x24 = images/icons/send_file24.png
ADD_IMAGE_24x24 = images/icons/add_image.png
TELEPHONE_24x24 = images/icons/phone.png
IM_DND = images/im_dnd.png
@ -231,7 +231,7 @@ DELETE_BOOKMARK_ICON = images/icons/remove.png
CLEAR_BALL_ICON = images/im_unavailable.png
CALL_ICON = images/call.png
PROFILE_ICON = images/profile.png
SEND_FILE_ICON = images/document_into.png
SEND_FILE_ICON = images/icons/send_file.png
ADD_CONTACT_IMAGE = images/icons/add_user.png
JOIN_GROUPCHAT_IMAGE = images/icons/join.png
PEOPLE_IMAGE = images/icons/add_user.png
@ -267,17 +267,17 @@ BACKGROUND_IMAGE = images/background.png
FREE_TO_CHAT_IMAGE = images/im_free_chat.png
SOUND_PREFERENCES_IMAGE = images/icons/sound.png
SPARK_LOGOUT_IMAGE = images/spark_100.jpg
PHOTO_IMAGE = images/icons/photo.png
PHOTO_IMAGE = images/icons/screenshot24.png
PLUGIN_IMAGE = images/icons/plugins.png
SMALL_PROFILE_IMAGE = images/small_profile.png
CHANGELOG_IMAGE = images/doc-changelog-16x16.gif
README_IMAGE = images/doc-readme-16x16.gif
DOWN_OPTION_IMAGE = images/option.png
STICKY_NOTE_IMAGE = images/sticky.png
HISTORY_24x24 = images/icons/history.png
HISTORY_24x24 = images/icons/history24.png
PANE_UP_ARROW_IMAGE = images/blueArrowRight.png
PANE_DOWN_ARROW_IMAGE = images/blueArrowDown.png
PROFILE_IMAGE_16x16 = images/profile_16x16.png
PROFILE_IMAGE_16x16 = images/icons/profile.png
LIGHTBULB_ON_16x16_IMAGE = images/lightbulb_on.png
DUMMY_CONTACT_IMAGE = images/dummyContact.png
CALENDAR_IMAGE = images/icon_calendarpicker.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB