aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/net/java/sip/communicator/impl/gui/customcontrols/ChatToolbarButton.java1
-rw-r--r--src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommLookAndFeel.java3
-rw-r--r--src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommTextFieldUI.java1
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/call/CallDialog.java1
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/call/CallManager.java3
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/call/CallParticipantPanel.java1
-rwxr-xr-xsrc/net/java/sip/communicator/impl/gui/main/call/DialPanel.java2
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/call/HoldButton.java2
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/call/MuteButton.java2
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/call/ReceivedCallDialog.java1
-rwxr-xr-xsrc/net/java/sip/communicator/impl/gui/main/call/SecurityPanel.java1
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/call/TransferCallButton.java2
-rwxr-xr-xsrc/net/java/sip/communicator/impl/gui/main/chat/ChatConversationPanel.java2
-rwxr-xr-xsrc/net/java/sip/communicator/impl/gui/main/chat/ChatWritePanel.java2
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chat/toolBars/EditTextToolBar.java1
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/contactlist/ActionMenuPanel.java1
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/contactlist/ContactProtocolButton.java2
-rw-r--r--src/net/java/sip/communicator/impl/gui/utils/ConfigurationManager.java58
-rw-r--r--src/net/java/sip/communicator/impl/gui/utils/NotificationManager.java8
-rw-r--r--src/net/java/sip/communicator/impl/notification/NotificationServiceImpl.java11
-rw-r--r--src/net/java/sip/communicator/impl/swingnotification/PopupMessageHandlerSwingImpl.java74
-rw-r--r--src/net/java/sip/communicator/impl/swingnotification/swingnotification.manifest.mf1
-rw-r--r--src/net/java/sip/communicator/impl/systray/jdic/LightGrayFilter.java46
-rw-r--r--src/net/java/sip/communicator/impl/systray/jdic/StatusSimpleSelector.java1
-rw-r--r--src/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java63
-rw-r--r--src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigurationPanel.java17
-rw-r--r--src/net/java/sip/communicator/service/notification/NotificationService.java4
-rw-r--r--src/net/java/sip/communicator/service/systray/PopupMessage.java31
-rw-r--r--src/net/java/sip/communicator/service/systray/event/SystrayPopupMessageEvent.java32
-rw-r--r--src/net/java/sip/communicator/util/swing/LightGrayFilter.java (renamed from src/net/java/sip/communicator/impl/gui/utils/LightGrayFilter.java)6
-rw-r--r--src/net/java/sip/communicator/util/swing/PopupNotificationPanel.java66
-rwxr-xr-xsrc/net/java/sip/communicator/util/swing/SIPCommButton.java (renamed from src/net/java/sip/communicator/impl/gui/customcontrols/SIPCommButton.java)21
-rw-r--r--src/net/java/sip/communicator/util/swing/SIPCommToggleButton.java (renamed from src/net/java/sip/communicator/impl/gui/customcontrols/SIPCommToggleButton.java)23
33 files changed, 263 insertions, 227 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/customcontrols/ChatToolbarButton.java b/src/net/java/sip/communicator/impl/gui/customcontrols/ChatToolbarButton.java
index 319f800..0f3297b 100644
--- a/src/net/java/sip/communicator/impl/gui/customcontrols/ChatToolbarButton.java
+++ b/src/net/java/sip/communicator/impl/gui/customcontrols/ChatToolbarButton.java
@@ -7,6 +7,7 @@
package net.java.sip.communicator.impl.gui.customcontrols;
import java.awt.*;
+import net.java.sip.communicator.util.swing.*;
/**
* The <tt>MsgToolbarButton</tt> is a <tt>SIPCommButton</tt> that has
diff --git a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommLookAndFeel.java b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommLookAndFeel.java
index 1d9cf3c..f2a453e 100644
--- a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommLookAndFeel.java
+++ b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommLookAndFeel.java
@@ -9,8 +9,7 @@ package net.java.sip.communicator.impl.gui.lookandfeel;
import javax.swing.*;
import javax.swing.plaf.*;
import javax.swing.plaf.metal.*;
-
-import net.java.sip.communicator.impl.gui.utils.*;
+import net.java.sip.communicator.util.swing.*;
/**
* The default SIP-Communicator look&feel.
diff --git a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommTextFieldUI.java b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommTextFieldUI.java
index 2fbf4b4..616689b 100644
--- a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommTextFieldUI.java
+++ b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommTextFieldUI.java
@@ -13,7 +13,6 @@ import javax.swing.plaf.*;
import javax.swing.plaf.metal.*;
import javax.swing.text.*;
-import net.java.sip.communicator.impl.gui.customcontrols.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.util.swing.*;
diff --git a/src/net/java/sip/communicator/impl/gui/main/call/CallDialog.java b/src/net/java/sip/communicator/impl/gui/main/call/CallDialog.java
index d23f56d..43bebab 100644
--- a/src/net/java/sip/communicator/impl/gui/main/call/CallDialog.java
+++ b/src/net/java/sip/communicator/impl/gui/main/call/CallDialog.java
@@ -14,7 +14,6 @@ import javax.swing.*;
import javax.swing.border.*;
import net.java.sip.communicator.impl.gui.*;
-import net.java.sip.communicator.impl.gui.customcontrols.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.util.swing.*;
diff --git a/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java b/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java
index 2af9286..a042a37 100644
--- a/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java
+++ b/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java
@@ -57,8 +57,7 @@ public class CallManager
// FIXME: I18N
NotificationManager.fireNotification(
NotificationManager.INCOMING_CALL,
- GuiActivator.getResources().getSettingsString(
- "service.gui.APPLICATION_NAME"),
+ "",
"Incoming call received from: "
+ sourceCall.getCallParticipants().next());
}
diff --git a/src/net/java/sip/communicator/impl/gui/main/call/CallParticipantPanel.java b/src/net/java/sip/communicator/impl/gui/main/call/CallParticipantPanel.java
index 2e66bd0..36342e4 100644
--- a/src/net/java/sip/communicator/impl/gui/main/call/CallParticipantPanel.java
+++ b/src/net/java/sip/communicator/impl/gui/main/call/CallParticipantPanel.java
@@ -14,7 +14,6 @@ import javax.swing.*;
import javax.swing.Timer;
import net.java.sip.communicator.impl.gui.*;
-import net.java.sip.communicator.impl.gui.customcontrols.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
diff --git a/src/net/java/sip/communicator/impl/gui/main/call/DialPanel.java b/src/net/java/sip/communicator/impl/gui/main/call/DialPanel.java
index 2e3e151..d4ff3e1 100755
--- a/src/net/java/sip/communicator/impl/gui/main/call/DialPanel.java
+++ b/src/net/java/sip/communicator/impl/gui/main/call/DialPanel.java
@@ -15,12 +15,12 @@ import javax.swing.*;
import javax.swing.Timer;
import net.java.sip.communicator.impl.gui.*;
-import net.java.sip.communicator.impl.gui.customcontrols.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.audionotifier.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.resources.*;
import net.java.sip.communicator.util.*;
+import net.java.sip.communicator.util.swing.*;
/**
* The <tt>DialPanel</tt> is the panel that contains the buttons to dial a
diff --git a/src/net/java/sip/communicator/impl/gui/main/call/HoldButton.java b/src/net/java/sip/communicator/impl/gui/main/call/HoldButton.java
index fce4b8f..0402bef 100644
--- a/src/net/java/sip/communicator/impl/gui/main/call/HoldButton.java
+++ b/src/net/java/sip/communicator/impl/gui/main/call/HoldButton.java
@@ -10,9 +10,9 @@ import java.awt.event.*;
import java.util.*;
import net.java.sip.communicator.impl.gui.*;
-import net.java.sip.communicator.impl.gui.customcontrols.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.protocol.*;
+import net.java.sip.communicator.util.swing.*;
/**
* Represents an UI means to put an associated <tt>CallPariticant</tt> on/off
diff --git a/src/net/java/sip/communicator/impl/gui/main/call/MuteButton.java b/src/net/java/sip/communicator/impl/gui/main/call/MuteButton.java
index 88660c6..1d1fa53 100644
--- a/src/net/java/sip/communicator/impl/gui/main/call/MuteButton.java
+++ b/src/net/java/sip/communicator/impl/gui/main/call/MuteButton.java
@@ -10,9 +10,9 @@ import java.awt.event.*;
import java.util.*;
import net.java.sip.communicator.impl.gui.*;
-import net.java.sip.communicator.impl.gui.customcontrols.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.protocol.*;
+import net.java.sip.communicator.util.swing.*;
/**
* Represents an UI means to mute the audio stream sent to an associated
diff --git a/src/net/java/sip/communicator/impl/gui/main/call/ReceivedCallDialog.java b/src/net/java/sip/communicator/impl/gui/main/call/ReceivedCallDialog.java
index 2bfdd29..6177230 100644
--- a/src/net/java/sip/communicator/impl/gui/main/call/ReceivedCallDialog.java
+++ b/src/net/java/sip/communicator/impl/gui/main/call/ReceivedCallDialog.java
@@ -13,7 +13,6 @@ import java.util.*;
import javax.swing.*;
import net.java.sip.communicator.impl.gui.*;
-import net.java.sip.communicator.impl.gui.customcontrols.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.contactlist.*;
import net.java.sip.communicator.service.protocol.*;
diff --git a/src/net/java/sip/communicator/impl/gui/main/call/SecurityPanel.java b/src/net/java/sip/communicator/impl/gui/main/call/SecurityPanel.java
index e93c469..057976e 100755
--- a/src/net/java/sip/communicator/impl/gui/main/call/SecurityPanel.java
+++ b/src/net/java/sip/communicator/impl/gui/main/call/SecurityPanel.java
@@ -12,7 +12,6 @@ import java.awt.event.*;
import javax.swing.*;
import net.java.sip.communicator.impl.gui.*;
-import net.java.sip.communicator.impl.gui.customcontrols.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.notification.*;
import net.java.sip.communicator.service.protocol.*;
diff --git a/src/net/java/sip/communicator/impl/gui/main/call/TransferCallButton.java b/src/net/java/sip/communicator/impl/gui/main/call/TransferCallButton.java
index aea3805..932be47 100644
--- a/src/net/java/sip/communicator/impl/gui/main/call/TransferCallButton.java
+++ b/src/net/java/sip/communicator/impl/gui/main/call/TransferCallButton.java
@@ -13,11 +13,11 @@ import java.util.*;
import org.osgi.framework.*;
import net.java.sip.communicator.impl.gui.*;
-import net.java.sip.communicator.impl.gui.customcontrols.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.util.*;
+import net.java.sip.communicator.util.swing.*;
/**
* Represents an UI means to transfer (the <code>Call</code> of) an associated
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/ChatConversationPanel.java b/src/net/java/sip/communicator/impl/gui/main/chat/ChatConversationPanel.java
index 55c0eff..39fefc0 100755
--- a/src/net/java/sip/communicator/impl/gui/main/chat/ChatConversationPanel.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/ChatConversationPanel.java
@@ -107,6 +107,8 @@ public class ChatConversationPanel
this.chatEditorPane.addHyperlinkListener(this);
this.chatEditorPane.addMouseListener(this);
+ this.chatEditorPane.setCursor(
+ Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
this.setWheelScrollingEnabled(true);
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/ChatWritePanel.java b/src/net/java/sip/communicator/impl/gui/main/chat/ChatWritePanel.java
index 62e6279..5699402 100755
--- a/src/net/java/sip/communicator/impl/gui/main/chat/ChatWritePanel.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/ChatWritePanel.java
@@ -77,6 +77,8 @@ public class ChatWritePanel
this.editorPane.getDocument().addUndoableEditListener(this);
this.editorPane.addKeyListener(this);
this.editorPane.addMouseListener(this);
+ this.editorPane.setCursor(
+ Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
//set our own transfer (i.e. copy/paste) handler
this.editorPane.setTransferHandler(new ChatWritePanelTransferHandler());
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/toolBars/EditTextToolBar.java b/src/net/java/sip/communicator/impl/gui/main/chat/toolBars/EditTextToolBar.java
index 9f3520e..e37789c 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chat/toolBars/EditTextToolBar.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/toolBars/EditTextToolBar.java
@@ -14,7 +14,6 @@ import javax.swing.text.*;
import javax.swing.text.html.*;
import net.java.sip.communicator.impl.gui.*;
-import net.java.sip.communicator.impl.gui.customcontrols.*;
import net.java.sip.communicator.impl.gui.main.chat.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.util.*;
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/ActionMenuPanel.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/ActionMenuPanel.java
index 62b95a6..5186f85 100644
--- a/src/net/java/sip/communicator/impl/gui/main/contactlist/ActionMenuPanel.java
+++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/ActionMenuPanel.java
@@ -12,7 +12,6 @@ import java.awt.event.*;
import javax.swing.*;
import net.java.sip.communicator.impl.gui.*;
-import net.java.sip.communicator.impl.gui.customcontrols.*;
import net.java.sip.communicator.impl.gui.main.chatroomslist.*;
import net.java.sip.communicator.impl.gui.main.contactlist.addcontact.*;
import net.java.sip.communicator.impl.gui.utils.*;
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactProtocolButton.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactProtocolButton.java
index fc4deef..743f4a2 100644
--- a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactProtocolButton.java
+++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactProtocolButton.java
@@ -2,8 +2,8 @@ package net.java.sip.communicator.impl.gui.main.contactlist;
import java.awt.*;
-import net.java.sip.communicator.impl.gui.customcontrols.*;
import net.java.sip.communicator.service.protocol.*;
+import net.java.sip.communicator.util.swing.*;
/**
* The ContactProtocolButton is a button behind a "meta contact" in the
diff --git a/src/net/java/sip/communicator/impl/gui/utils/ConfigurationManager.java b/src/net/java/sip/communicator/impl/gui/utils/ConfigurationManager.java
index 4c876c8..777152d 100644
--- a/src/net/java/sip/communicator/impl/gui/utils/ConfigurationManager.java
+++ b/src/net/java/sip/communicator/impl/gui/utils/ConfigurationManager.java
@@ -31,7 +31,7 @@ public class ConfigurationManager
private static boolean isShowOffline = true;
private static boolean isApplicationVisible = true;
-
+
private static boolean isQuitWarningShown = true;
private static boolean isSendTypingNotifications;
@@ -96,7 +96,7 @@ public class ConfigurationManager
if(callPanelShown != null && callPanelShown.length() > 0)
{
- isCallPanelShown = new Boolean(callPanelShown).booleanValue();
+ isCallPanelShown = Boolean.parseBoolean(callPanelShown);
}
// Load the "showOffline" property.
@@ -105,7 +105,7 @@ public class ConfigurationManager
if(showOffline != null && showOffline.length() > 0)
{
- isShowOffline = new Boolean(showOffline).booleanValue();
+ isShowOffline = Boolean.parseBoolean(showOffline);
}
// Load the "showApplication" property.
@@ -124,7 +124,7 @@ public class ConfigurationManager
if(quitWarningShown != null && quitWarningShown.length() > 0)
{
isQuitWarningShown
- = new Boolean(quitWarningShown).booleanValue();
+ = Boolean.parseBoolean(quitWarningShown);
}
// Load the "sendTypingNotifications" property.
@@ -141,7 +141,7 @@ public class ConfigurationManager
if(isSendTypingNotif != null && isSendTypingNotif.length() > 0)
{
isSendTypingNotifications
- = new Boolean(isSendTypingNotif).booleanValue();
+ = Boolean.parseBoolean(isSendTypingNotif);
}
// Load the "isMoveContactConfirmationRequested" property.
@@ -153,8 +153,8 @@ public class ConfigurationManager
&& isMoveContactConfirmationRequestedString.length() > 0)
{
isMoveContactConfirmationRequested
- = new Boolean(isMoveContactConfirmationRequestedString)
- .booleanValue();
+ = Boolean.parseBoolean(isMoveContactConfirmationRequestedString)
+ ;
}
// Load the "isMultiChatWindowEnabled" property.
@@ -173,8 +173,8 @@ public class ConfigurationManager
&& isMultiChatWindowEnabledString.length() > 0)
{
isMultiChatWindowEnabled
- = new Boolean(isMultiChatWindowEnabledString)
- .booleanValue();
+ = Boolean.parseBoolean(isMultiChatWindowEnabledString)
+ ;
}
// Load the "isHistoryLoggingEnabled" property.
@@ -186,8 +186,8 @@ public class ConfigurationManager
&& isHistoryLoggingEnabledString.length() > 0)
{
isHistoryLoggingEnabled
- = new Boolean(isHistoryLoggingEnabledString)
- .booleanValue();
+ = Boolean.parseBoolean(isHistoryLoggingEnabledString)
+ ;
}
// Load the "isHistoryShown" property.
@@ -206,8 +206,8 @@ public class ConfigurationManager
&& isHistoryShownString.length() > 0)
{
isHistoryShown
- = new Boolean(isHistoryShownString)
- .booleanValue();
+ = Boolean.parseBoolean(isHistoryShownString)
+ ;
}
// Load the "chatHistorySize" property.
@@ -245,7 +245,7 @@ public class ConfigurationManager
&& isTransparentWindowEnabledString.length() > 0)
{
isTransparentWindowEnabled
- = new Boolean(isTransparentWindowEnabledString).booleanValue();
+ = Boolean.parseBoolean(isTransparentWindowEnabledString);
}
// Load the "windowTransparency" property.
@@ -283,7 +283,7 @@ public class ConfigurationManager
&& isWindowDecoratedString.length() > 0)
{
isWindowDecorated
- = new Boolean(isWindowDecoratedString).booleanValue();
+ = Boolean.parseBoolean(isWindowDecoratedString);
}
// Load the "lastContactParent" property.
@@ -524,14 +524,14 @@ public class ConfigurationManager
/**
* Updates the "showApplication" property through the
* <tt>ConfigurationService</tt>.
- *
+ *
* @param isVisible <code>true</code> to indicate that the
* application should be shown, <code>false</code> otherwise.
*/
public static void setApplicationVisible(boolean isVisible)
{
isApplicationVisible = isVisible;
-
+
configService.setProperty(
"net.java.sip.communicator.impl.systray.showApplication",
Boolean.toString(isVisible));
@@ -824,7 +824,7 @@ public class ConfigurationManager
String status = (String) configService
.getProperty( groupRootPropName + ".isClosed");
- return new Boolean(status).booleanValue();
+ return Boolean.parseBoolean(status);
}
}
@@ -845,7 +845,7 @@ public class ConfigurationManager
String autoPopupString = (String) evt.getNewValue();
autoPopupNewMessage
- = new Boolean(autoPopupString).booleanValue();
+ = Boolean.parseBoolean(autoPopupString);
}
else if (evt.getPropertyName().equals(
"service.gui.SEND_MESSAGE_COMMAND"))
@@ -859,7 +859,7 @@ public class ConfigurationManager
String showCallPanelString = (String) evt.getNewValue();
isCallPanelShown
- = new Boolean(showCallPanelString).booleanValue();
+ = Boolean.parseBoolean(showCallPanelString);
}
else if (evt.getPropertyName().equals(
"net.java.sip.communicator.impl.gui.showOffline"))
@@ -867,13 +867,13 @@ public class ConfigurationManager
String showOfflineString = (String) evt.getNewValue();
isShowOffline
- = new Boolean(showOfflineString).booleanValue();
+ = Boolean.parseBoolean(showOfflineString);
}
else if (evt.getPropertyName().equals(
"net.java.sip.communicator.impl.systray.showApplication"))
{
String showApplicationString = (String) evt.getNewValue();
-
+
isApplicationVisible
= new Boolean(showApplicationString).booleanValue();
}
@@ -883,7 +883,7 @@ public class ConfigurationManager
String showQuitWarningString = (String) evt.getNewValue();
isQuitWarningShown
- = new Boolean(showQuitWarningString).booleanValue();
+ = Boolean.parseBoolean(showQuitWarningString);
}
else if (evt.getPropertyName().equals(
"service.gui.SEND_TYPING_NOTIFICATIONS_ENABLED"))
@@ -891,7 +891,7 @@ public class ConfigurationManager
String sendTypingNorifString = (String) evt.getNewValue();
isSendTypingNotifications
- = new Boolean(sendTypingNorifString).booleanValue();
+ = Boolean.parseBoolean(sendTypingNorifString);
}
else if (evt.getPropertyName().equals(
"net.java.sip.communicator.impl.gui.isMoveContactConfirmationRequested"))
@@ -899,7 +899,7 @@ public class ConfigurationManager
String moveContactConfirmString = (String) evt.getNewValue();
isMoveContactConfirmationRequested
- = new Boolean(moveContactConfirmString).booleanValue();
+ = Boolean.parseBoolean(moveContactConfirmString);
}
else if (evt.getPropertyName().equals(
"service.gui.IS_MULTI_CHAT_WINDOW_ENABLED"))
@@ -907,7 +907,7 @@ public class ConfigurationManager
String multiChatWindowString = (String) evt.getNewValue();
isMultiChatWindowEnabled
- = new Boolean(multiChatWindowString).booleanValue();
+ = Boolean.parseBoolean(multiChatWindowString);
}
else if (evt.getPropertyName().equals(
"net.java.sip.communicator.impl.gui.isHistoryLoggingEnabled"))
@@ -915,7 +915,7 @@ public class ConfigurationManager
String historyLoggingString = (String) evt.getNewValue();
isHistoryLoggingEnabled
- = new Boolean(historyLoggingString).booleanValue();
+ = Boolean.parseBoolean(historyLoggingString);
}
else if (evt.getPropertyName().equals(
"service.gui.IS_MESSAGE_HISTORY_SHOWN"))
@@ -923,7 +923,7 @@ public class ConfigurationManager
String historyShownString = (String) evt.getNewValue();
isHistoryShown
- = new Boolean(historyShownString).booleanValue();
+ = Boolean.parseBoolean(historyShownString);
}
else if (evt.getPropertyName().equals(
"service.gui.MESSAGE_HISTORY_SIZE"))
@@ -939,7 +939,7 @@ public class ConfigurationManager
String isTransparentString = (String) evt.getNewValue();
isTransparentWindowEnabled
- = new Boolean(isTransparentString).booleanValue();
+ = Boolean.parseBoolean(isTransparentString);
}
else if (evt.getPropertyName().equals(
"impl.gui.WINDOW_TRANSPARENCY"))
diff --git a/src/net/java/sip/communicator/impl/gui/utils/NotificationManager.java b/src/net/java/sip/communicator/impl/gui/utils/NotificationManager.java
index 5dd3ed9..005d9ee 100644
--- a/src/net/java/sip/communicator/impl/gui/utils/NotificationManager.java
+++ b/src/net/java/sip/communicator/impl/gui/utils/NotificationManager.java
@@ -115,7 +115,7 @@ public class NotificationManager
if(notificationService == null)
return;
- notificationService.fireNotification(eventType, messageTitle, message);
+ notificationService.fireNotification(eventType, messageTitle, message, null);
}
/**
@@ -148,8 +148,7 @@ public class NotificationManager
else if (contact instanceof ChatRoom)
{
// For system rooms we don't want to send notification events.
- if ((contact instanceof ChatRoom)
- && ((ChatRoom) contact).isSystem())
+ if (((ChatRoom) contact).isSystem())
return;
chatPanel = GuiActivator.getUIService().getChat((ChatRoom) contact);
@@ -166,7 +165,8 @@ public class NotificationManager
popupActionHandler.setEnabled(false);
}
- notificationService.fireNotification(eventType, messageTitle, message);
+ notificationService.fireNotification(
+ eventType, messageTitle, message, contact);
if(popupActionHandler != null)
popupActionHandler.setEnabled(true);
diff --git a/src/net/java/sip/communicator/impl/notification/NotificationServiceImpl.java b/src/net/java/sip/communicator/impl/notification/NotificationServiceImpl.java
index cd635fe..e7e6533 100644
--- a/src/net/java/sip/communicator/impl/notification/NotificationServiceImpl.java
+++ b/src/net/java/sip/communicator/impl/notification/NotificationServiceImpl.java
@@ -376,8 +376,13 @@ public class NotificationServiceImpl
* @param title the title of the given message
* @param message the message to use if and where appropriate (e.g. with
* systray or log notification.)
+ * @param tag additional info to be used by the notification handler
*/
- public void fireNotification(String eventType, String title, String message)
+ public void fireNotification(
+ String eventType,
+ String title,
+ String message,
+ Object tag)
{
EventNotification notification
= (EventNotification) notificationsTable.get(eventType);
@@ -401,7 +406,7 @@ public class NotificationServiceImpl
if (actionType.equals(NotificationService.ACTION_POPUP_MESSAGE))
{
((PopupMessageNotificationHandler) handler)
- .popupMessage(new PopupMessage(title, message));
+ .popupMessage(new PopupMessage(title, message, tag));
}
else if (actionType.equals(NotificationService.ACTION_LOG_MESSAGE))
{
@@ -431,7 +436,7 @@ public class NotificationServiceImpl
*/
public void fireNotification(String eventType)
{
- this.fireNotification(eventType, null, null);
+ this.fireNotification(eventType, null, null, null);
}
/**
diff --git a/src/net/java/sip/communicator/impl/swingnotification/PopupMessageHandlerSwingImpl.java b/src/net/java/sip/communicator/impl/swingnotification/PopupMessageHandlerSwingImpl.java
index 79748e1..38c1d39 100644
--- a/src/net/java/sip/communicator/impl/swingnotification/PopupMessageHandlerSwingImpl.java
+++ b/src/net/java/sip/communicator/impl/swingnotification/PopupMessageHandlerSwingImpl.java
@@ -13,6 +13,7 @@ import java.util.List;
import javax.swing.*;
import javax.swing.Timer;
+import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.systray.*;
import net.java.sip.communicator.service.systray.event.*;
import net.java.sip.communicator.util.*;
@@ -36,7 +37,7 @@ public class PopupMessageHandlerSwingImpl implements PopupMessageHandler
/** An icon representing the contact from which the notification comes */
private ImageIcon defaultIcon =
SwingNotificationActivator.getResources().getImage(
- "service.gui.DEFAULT_USER_PHOTO");;
+ "service.gui.SIP_COMMUNICATOR_LOGO_39x58");;
/**
* Adds a listerner to receive popup events
@@ -76,11 +77,9 @@ public class PopupMessageHandlerSwingImpl implements PopupMessageHandler
getDefaultConfiguration();
final JWindow notificationWindow = new JWindow(graphicsConf);
- notificationWindow.setPreferredSize(new Dimension(225, 125));
final Timer popupTimer = new Timer(10000, new ActionListener()
{
-
public void actionPerformed(ActionEvent e)
{
if (notificationWindow.isVisible())
@@ -108,18 +107,27 @@ public class PopupMessageHandlerSwingImpl implements PopupMessageHandler
@Override
public void mouseClicked(MouseEvent e)
{
- firePopupMessageClicked(new SystrayPopupMessageEvent(e));
+ Container container = notificationWindow.getContentPane();
+ PopupNotificationPanel notif =
+ (PopupNotificationPanel) container.getComponent(0);
+ firePopupMessageClicked(
+ new SystrayPopupMessageEvent(e, notif.getTag()));
notificationWindow.dispose();
}
});
if (popupMessage.getComponent() != null)
+ {
notificationWindow.add(popupMessage.getComponent());
+ }
else
+ {
notificationWindow.add(createPopup(
popupMessage.getMessageTitle(),
popupMessage.getMessage(),
- popupMessage.getIcon()));
+ popupMessage.getTag()));
+ notificationWindow.setPreferredSize(new Dimension(225, 120));
+ }
notificationWindow.setAlwaysOnTop(true);
notificationWindow.pack();
@@ -136,38 +144,46 @@ public class PopupMessageHandlerSwingImpl implements PopupMessageHandler
* @return
*/
private JComponent createPopup(String title, String message,
- ImageIcon icon)
+ Object tag)
{
- String msg;
-
- if (message.length() > 70)
- msg = "<html><b>" + message.substring(0, 77) + "...";
- else
- msg = "<html><b>" + message;
-
- JLabel msgContent = new JLabel(msg);
-
- if (title.length() > 40)
- title = title.substring(0, 28) + "...";
- JLabel msgFrom = new JLabel(title);
- msgFrom.setForeground(Color.DARK_GRAY);
-
- JLabel msgIcon = (icon == null) ?
- new JLabel(defaultIcon) :
- new JLabel(icon);
- msgIcon.setOpaque(false);
+ String ttle = title;
+ if (title.length() > 50)
+ ttle = title.substring(0, 47) + "...";
+ JLabel msgTitle = new JLabel("<html>" + ttle);
+ msgTitle.setForeground(Color.DARK_GRAY);
+
+ String msg = message;
+ if (message.length() > 90)
+ msg = message.substring(0, 87) + "...";
+ JLabel msgContent = new JLabel("<html><b>" + msg);
+
+ JPanel notificationBody = new JPanel(new BorderLayout());
+ notificationBody.setOpaque(false);
+ notificationBody.add(msgTitle, BorderLayout.NORTH);
+ notificationBody.add(msgContent, BorderLayout.CENTER);
+
+ JLabel msgIcon = new JLabel(defaultIcon);
+ if (tag instanceof Contact)
+ {
+ byte[] b = ((Contact) tag).getImage();
+ if (b != null)
+ msgIcon = new JLabel(new ImageIcon(b));
+ }
+ else if (tag instanceof ImageIcon)
+ {
+ msgIcon = new JLabel((ImageIcon) tag);
+ }
msgIcon.setPreferredSize(new Dimension(45, 45));
- JPanel notificationContent = new JPanel(new BorderLayout(5, 1));
+ JPanel notificationContent = new JPanel(new BorderLayout(5, 0));
notificationContent.setBorder(
- BorderFactory.createEmptyBorder(10, 10, 10, 10));
+ BorderFactory.createEmptyBorder(0, 3, 3, 3));
notificationContent.setOpaque(false);
- notificationContent.add(msgFrom, BorderLayout.NORTH);
- notificationContent.add(msgContent, BorderLayout.CENTER);
notificationContent.add(msgIcon, BorderLayout.WEST);
+ notificationContent.add(notificationBody, BorderLayout.CENTER);
- return new PopupNotificationPanel(notificationContent);
+ return new PopupNotificationPanel(notificationContent, tag);
}
/**
diff --git a/src/net/java/sip/communicator/impl/swingnotification/swingnotification.manifest.mf b/src/net/java/sip/communicator/impl/swingnotification/swingnotification.manifest.mf
index edaf035..5dc5835 100644
--- a/src/net/java/sip/communicator/impl/swingnotification/swingnotification.manifest.mf
+++ b/src/net/java/sip/communicator/impl/swingnotification/swingnotification.manifest.mf
@@ -6,6 +6,7 @@ Bundle-Version: 0.0.1
System-Bundle: yes
Import-Package: org.osgi.framework,
net.java.sip.communicator.service.configuration,
+ net.java.sip.communicator.service.protocol,
net.java.sip.communicator.service.resources,
net.java.sip.communicator.service.systray,
net.java.sip.communicator.service.systray.event,
diff --git a/src/net/java/sip/communicator/impl/systray/jdic/LightGrayFilter.java b/src/net/java/sip/communicator/impl/systray/jdic/LightGrayFilter.java
deleted file mode 100644
index 3c72127..0000000
--- a/src/net/java/sip/communicator/impl/systray/jdic/LightGrayFilter.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.impl.systray.jdic;
-
-import java.awt.*;
-import java.awt.image.*;
-import javax.swing.*;
-
-/**
- * An image filter that "disables" an image by turning
- * it into a grayscale image, and brightening the pixels
- * in the image. Used by buttons to create an image for
- * a disabled button. Creates a more brighter image than
- * the javax.swing.GrayFilter.
- *
- * @author Yana Stamcheva
- */
-public class LightGrayFilter extends GrayFilter {
-
- /**
- * Creates an instance of a LightGrayFilter.
- * @param b a boolean -- true if the pixels should be brightened
- * @param p an int in the range 0..100 that determines the percentage
- * of gray, where 100 is the darkest gray, and 0 is the lightest
- */
- public LightGrayFilter(boolean b, int p) {
- super(b, p);
- }
-
- /**
- * Creates a disabled image.
- * @param i The source image.
- * @return A disabled image based on the source image.
- */
- public static Image createDisabledImage(Image i) {
- LightGrayFilter filter = new LightGrayFilter(true, 65);
- ImageProducer prod = new FilteredImageSource(i.getSource(), filter);
- Image grayImage = Toolkit.getDefaultToolkit().createImage(prod);
-
- return grayImage;
- }
-}
diff --git a/src/net/java/sip/communicator/impl/systray/jdic/StatusSimpleSelector.java b/src/net/java/sip/communicator/impl/systray/jdic/StatusSimpleSelector.java
index 0d4cdbb..dfb71fb 100644
--- a/src/net/java/sip/communicator/impl/systray/jdic/StatusSimpleSelector.java
+++ b/src/net/java/sip/communicator/impl/systray/jdic/StatusSimpleSelector.java
@@ -14,6 +14,7 @@ import javax.swing.*;
import net.java.sip.communicator.impl.systray.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.util.*;
+import net.java.sip.communicator.util.swing.*;
/**
* The <tt>StatusSimpleSelector</tt> is a submenu which allow to select a status
diff --git a/src/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java b/src/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java
index 9ccc8b0..b44ca19 100644
--- a/src/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java
+++ b/src/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java
@@ -8,7 +8,6 @@ package net.java.sip.communicator.impl.systray.jdic;
import org.osgi.framework.*;
-import java.awt.Toolkit;
import java.awt.event.*;
import java.net.*;
import java.util.*;
@@ -65,11 +64,6 @@ public class SystrayServiceJdicImpl
new Hashtable<String, PopupMessageHandler>();
/**
- * Stores the system time, when the main window was restored the last time
- */
- private long setVisibleTime = 0;
-
- /**
* A reference of the <tt>ConfigurationService</tt> obtained from the
* <tt>SystrayServiceActivator</tt>
*/
@@ -137,9 +131,7 @@ public class SystrayServiceJdicImpl
UIService ui = SystrayActivator.getUIService();
if (ui != null)
- {
ui.setExitOnMainWindowClose(false);
- }
}
}
@@ -148,13 +140,6 @@ public class SystrayServiceJdicImpl
*/
private void initSystray()
{
-
- // Get the system's double click speed
- Object o = Toolkit.getDefaultToolkit().getDesktopProperty(
- "awt.multiClickInterval");
- final int doubleClickSpeed = (o instanceof Integer ? ((Integer) o).
- intValue() : 500);
-
menu = TrayMenuFactory.createTrayMenu(this, systray.isSwing());
String osName = System.getProperty("os.name");
@@ -222,29 +207,19 @@ public class SystrayServiceJdicImpl
//Show/hide the contact list when user clicks on the systray.
trayIcon.addActionListener(new ActionListener()
{
-
public void actionPerformed(ActionEvent e)
{
- long currentTime = System.currentTimeMillis();
UIService uiService = SystrayActivator.getUIService();
- boolean isVisible = !uiService.isVisible();
-
- if (isVisible)
+ ExportedWindow win =
+ uiService.getExportedWindow(ExportedWindow.MAIN_WINDOW);
+ if (!win.isVisible())
{
- setVisibleTime = currentTime;
- } else if (currentTime < (setVisibleTime + doubleClickSpeed))
- {
- // Do nothing. the last restore is less than 2 seconds, so it is very
- // likely, that the user made a double click. prevent the main window
- // from opening and immediately closing again.
- return;
+ win.setVisible(true);
+ configService.setProperty(
+ "net.java.sip.communicator.impl.systray.showApplication",
+ Boolean.toString(true));
}
-
- uiService.setVisible(isVisible);
-
- configService.setProperty(
- "net.java.sip.communicator.impl.systray.showApplication",
- Boolean.toString(isVisible));
+ win.bringToFront();
}
});
@@ -288,12 +263,15 @@ public class SystrayServiceJdicImpl
});
}
- PopupMessageHandler pph = new PopupMessageHandlerTrayIconImpl(trayIcon);
- popupHandlerSet.put(pph.getClass().getName(), pph);
- SystrayActivator.bundleContext.registerService(
- PopupMessageHandler.class.getName(),
- pph, null);
-
+ PopupMessageHandler pph = null;
+ if (!osName.startsWith("Mac OS X"))
+ {
+ pph = new PopupMessageHandlerTrayIconImpl(trayIcon);
+ popupHandlerSet.put(pph.getClass().getName(), pph);
+ SystrayActivator.bundleContext.registerService(
+ PopupMessageHandler.class.getName(),
+ pph, null);
+ }
try
{
SystrayActivator.bundleContext.addServiceListener(
@@ -611,9 +589,12 @@ public class SystrayServiceJdicImpl
UIService uiService = SystrayActivator.getUIService();
ExportedWindow chatWindow = uiService.getExportedWindow(
ExportedWindow.CHAT_WINDOW);
- if (chatWindow != null && chatWindow.isVisible())
- {
+ if (chatWindow != null)
chatWindow.bringToFront();
+ Object o = evt.getTag();
+ if (o instanceof Contact)
+ {
+// TODO: bring the chat with that contact to front
}
}
}
diff --git a/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigurationPanel.java b/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigurationPanel.java
index 81dc7a5..9dba131 100644
--- a/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigurationPanel.java
+++ b/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigurationPanel.java
@@ -65,8 +65,7 @@ public class GeneralConfigurationPanel
this.setOpaque(false);
this.mainPanel.setOpaque(false);
- BoxLayout boxLayout = new BoxLayout(
- mainPanel, javax.swing.BoxLayout.Y_AXIS);
+ BoxLayout boxLayout = new BoxLayout(mainPanel, BoxLayout.Y_AXIS);
mainPanel.setLayout(boxLayout);
this.add(mainPanel, BorderLayout.NORTH);
@@ -101,8 +100,7 @@ public class GeneralConfigurationPanel
mainPanel.add(logHistoryPanel);
mainPanel.add(Box.createVerticalStrut(10));
logHistoryPanel.setLayout(null);
- logHistoryPanel.setPreferredSize(
- new java.awt.Dimension(380, 57));
+ logHistoryPanel.setPreferredSize(new Dimension(380, 57));
logHistoryPanel.setAlignmentX(0.0f);
{
logHistoryCheckBox = new SIPCommCheckBox();
@@ -174,8 +172,7 @@ public class GeneralConfigurationPanel
mainPanel.add(sendMessagePanel);
mainPanel.add(Box.createVerticalStrut(10));
sendMessagePanel.setAlignmentX(0.0f);
- sendMessagePanel.setPreferredSize(
- new java.awt.Dimension(380, 22));
+ sendMessagePanel.setPreferredSize(new Dimension(380, 22));
{
sendMessageLabel = new JLabel();
sendMessagePanel.add(
@@ -211,7 +208,7 @@ public class GeneralConfigurationPanel
enableTypingNotifiCheckBox.setText(
Resources.getString("service.gui.ENABLE_TYPING_NOTIFICATIONS"));
enableTypingNotifiCheckBox.setPreferredSize(
- new java.awt.Dimension(253, 20));
+ new Dimension(253, 20));
enableTypingNotifiCheckBox.setAlignmentY(0.0f);
enableTypingNotifiCheckBox.addActionListener(this);
}
@@ -236,15 +233,13 @@ public class GeneralConfigurationPanel
{
logger.warn("Error while retrieving service refs", ex);
}
- // user has choice only if there is more than one handler
- if ((handlerRefs != null) && (handlerRefs.length > 1))
+ if (handlerRefs != null)
{
notifConfigPanel = new JPanel();
notifConfigPanel.setOpaque(false);
notifConfigPanel.setLayout(new BorderLayout(10, 10));
notifConfigPanel.setAlignmentX(0.0f);
- notifConfigPanel.setPreferredSize(
- new java.awt.Dimension(380, 22));
+ notifConfigPanel.setPreferredSize(new Dimension(380, 22));
mainPanel.add(notifConfigPanel);
mainPanel.add(Box.createVerticalStrut(10));
diff --git a/src/net/java/sip/communicator/service/notification/NotificationService.java b/src/net/java/sip/communicator/service/notification/NotificationService.java
index 6026354..1998426 100644
--- a/src/net/java/sip/communicator/service/notification/NotificationService.java
+++ b/src/net/java/sip/communicator/service/notification/NotificationService.java
@@ -333,10 +333,12 @@ public interface NotificationService
* (e.g. with systray)
* @param message the message to use if and where appropriate (e.g. with
* systray or log notification.)
+ * @param tag additional info to be used by the notification handler
*/
public void fireNotification( String eventType,
String messageTitle,
- String message);
+ String message,
+ Object tag);
/**
* Fires all notifications registered for the specified <tt>eventType</tt>
diff --git a/src/net/java/sip/communicator/service/systray/PopupMessage.java b/src/net/java/sip/communicator/service/systray/PopupMessage.java
index 3f82324..60c97e0 100644
--- a/src/net/java/sip/communicator/service/systray/PopupMessage.java
+++ b/src/net/java/sip/communicator/service/systray/PopupMessage.java
@@ -35,8 +35,8 @@ public class PopupMessage
/** type of the message */
private int messageType;
- /** the contact which is the cause of this popup message */
- private Contact contact;
+ /** additional info to be used by the <tt>PopupMessageHandler</tt> */
+ private Object tag;
/**
* Creates a <tt>PopupMessage</tt> with the given title and message inside
@@ -95,6 +95,21 @@ public class PopupMessage
}
/**
+ * Creates a new <tt>PopupMessage</tt> with the given
+ * <tt>JComponent</tt> as its content. This constructor also takes a title
+ * and a message as replacements in cases the component is not usable.
+ *
+ * @param component the component to put in the <tt>PopupMessage</tt>
+ * @param title of the message
+ * @param tag additional info to be used by the <tt>PopupMessageHandler</tt>
+ */
+ public PopupMessage(String title, String message, Object tag)
+ {
+ this(title, message);
+ this.tag = tag;
+ }
+
+ /**
* @return the message
*/
public String getMessage()
@@ -175,18 +190,18 @@ public class PopupMessage
}
/**
- * @return the contact
+ * @return the object used to tag this <tt>PopupMessage</tt>
*/
- public Contact getContact()
+ public Object getTag()
{
- return contact;
+ return tag;
}
/**
- * @param contact the contact to set
+ * @param tag the object to set
*/
- public void setContact(Contact contact)
+ public void setTag(Object tag)
{
- this.contact = contact;
+ this.tag = tag;
}
}
diff --git a/src/net/java/sip/communicator/service/systray/event/SystrayPopupMessageEvent.java b/src/net/java/sip/communicator/service/systray/event/SystrayPopupMessageEvent.java
index ac0f7ef..bdc8318 100644
--- a/src/net/java/sip/communicator/service/systray/event/SystrayPopupMessageEvent.java
+++ b/src/net/java/sip/communicator/service/systray/event/SystrayPopupMessageEvent.java
@@ -17,8 +17,40 @@ import java.util.*;
public class SystrayPopupMessageEvent
extends EventObject
{
+ /** an object to distinguish this <tt>SystrayPopupMessageEvent</tt> */
+ private Object tag;
+
public SystrayPopupMessageEvent(Object source)
{
super(source);
}
+
+ /**
+ * Creates a new <tt>SystrayPopupMessageEvent</tt> with the source of the
+ * event and additional info provided by the popup handler.
+ * @param source the source of the event
+ * @param tag additional info for listeners
+ */
+ public SystrayPopupMessageEvent(Object source, Object tag)
+ {
+ super(source);
+ this.tag = tag;
+ }
+
+ /**
+ * @return the tag
+ */
+ public Object getTag()
+ {
+ return tag;
+ }
+
+ /**
+ * @param tag the tag to set
+ */
+ public void setTag(Object tag)
+ {
+ this.tag = tag;
+ }
+
}
diff --git a/src/net/java/sip/communicator/impl/gui/utils/LightGrayFilter.java b/src/net/java/sip/communicator/util/swing/LightGrayFilter.java
index a0660dd..6282d2d 100644
--- a/src/net/java/sip/communicator/impl/gui/utils/LightGrayFilter.java
+++ b/src/net/java/sip/communicator/util/swing/LightGrayFilter.java
@@ -4,7 +4,7 @@
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
-package net.java.sip.communicator.impl.gui.utils;
+package net.java.sip.communicator.util.swing;
import java.awt.*;
import java.awt.image.*;
@@ -14,9 +14,9 @@ import javax.swing.*;
* An image filter that "disables" an image by turning
* it into a grayscale image, and brightening the pixels
* in the image. Used by buttons to create an image for
- * a disabled button. Creates a more brighter image than
+ * a disabled button. Creates a more brighter image than
* the javax.swing.GrayFilter.
- *
+ *
* @author Yana Stamcheva
*/
public class LightGrayFilter extends GrayFilter {
diff --git a/src/net/java/sip/communicator/util/swing/PopupNotificationPanel.java b/src/net/java/sip/communicator/util/swing/PopupNotificationPanel.java
index 7933b51..606a843 100644
--- a/src/net/java/sip/communicator/util/swing/PopupNotificationPanel.java
+++ b/src/net/java/sip/communicator/util/swing/PopupNotificationPanel.java
@@ -23,6 +23,9 @@ public class PopupNotificationPanel extends SIPCommFrame.MainContentPane
/** logger for this class */
private final Logger logger = Logger.getLogger(SIPCommFrame.class);
+ /** an object to distinguish this <tt>PopupNotificationPanel</tt> */
+ private Object tag;
+
/**
* Creates a new <tt>PopupNotificationPanel</tt> with a customized panel title
*/
@@ -35,15 +38,20 @@ public class PopupNotificationPanel extends SIPCommFrame.MainContentPane
"service.gui.SIP_COMMUNICATOR_LOGO"),
SwingConstants.LEFT);
- final JLabel notifClose = new JLabel(
+// JLabel notifClose = new JLabel(
+// UtilActivator.getResources()
+// .getImage("service.gui.lookandfeel.CLOSE_TAB_ICON"));
+
+ final SIPCommButton notifClose = new SIPCommButton(
UtilActivator.getResources()
- .getImage("service.gui.lookandfeel.CLOSE_TAB_ICON"));
+ .getImage("service.gui.lookandfeel.CLOSE_TAB_ICON").getImage());
notifClose.setToolTipText(UtilActivator.getResources()
.getI18NString("service.gui.CLOSE"));
+ //notifClose.
- notifClose.addMouseListener(new MouseAdapter()
+ notifClose.addActionListener(new ActionListener()
{
- @Override
+ //@Override
public void mouseClicked(MouseEvent e)
{
try
@@ -63,22 +71,40 @@ public class PopupNotificationPanel extends SIPCommFrame.MainContentPane
, ex);
}
}
- });
- BorderLayout borderLayout = new BorderLayout();
- borderLayout.setVgap(5);
+ public void actionPerformed(ActionEvent e)
+ {
+ try
+ {
+ // TODO : that is pretty ugly. It will be nice if
+ // it is possible to reach the top window in a better way
+ JWindow jw = (JWindow) notifClose
+ .getParent().getParent().getParent()
+ .getParent().getParent().getParent();
+ jw.dispose();
+ }
+ catch (Exception ex)
+ {
+ // should never happens : if the user clicks on the close
+ // icon, it means that the popup window were visible
+ logger.warn("error while getting the popup window :"
+ , ex);
+ }
+ }
+ });
- JPanel notificationWindowTitle = new JPanel(borderLayout);
+ JPanel notificationWindowTitle =
+ new JPanel(new BorderLayout(0, 2));
notificationWindowTitle
- .setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
+ .setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
notificationWindowTitle.setOpaque(false);
-
notificationWindowTitle.add(notifTitle, BorderLayout.WEST);
notificationWindowTitle.add(notifClose, BorderLayout.EAST);
JSeparator jSep = new JSeparator();
notificationWindowTitle.add(jSep, BorderLayout.SOUTH);
+
add(notificationWindowTitle, BorderLayout.NORTH);
setBorder(BorderFactory.createLineBorder(Color.GRAY));
}
@@ -89,10 +115,28 @@ public class PopupNotificationPanel extends SIPCommFrame.MainContentPane
*
* @param notificationContent content to add in the new created
* <tt>PopupNotificationPanel</tt>
+ * @param tag an object to distinguish this <tt>PopupNotificationPanel</tt>
*/
- public PopupNotificationPanel(JPanel notificationContent)
+ public PopupNotificationPanel(JPanel notificationContent, Object tag)
{
this();
add(notificationContent, BorderLayout.CENTER);
+ this.tag = tag;
+ }
+
+ /**
+ * @return the tag
+ */
+ public Object getTag()
+ {
+ return tag;
+ }
+
+ /**
+ * @param tag the tag to set
+ */
+ public void setTag(Object tag)
+ {
+ this.tag = tag;
}
}
diff --git a/src/net/java/sip/communicator/impl/gui/customcontrols/SIPCommButton.java b/src/net/java/sip/communicator/util/swing/SIPCommButton.java
index 6ec3199..e0c5e8f 100755
--- a/src/net/java/sip/communicator/impl/gui/customcontrols/SIPCommButton.java
+++ b/src/net/java/sip/communicator/util/swing/SIPCommButton.java
@@ -4,7 +4,7 @@
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
-package net.java.sip.communicator.impl.gui.customcontrols;
+package net.java.sip.communicator.util.swing;
import java.awt.*;
import java.awt.event.*;
@@ -13,13 +13,10 @@ import javax.swing.*;
import org.jvnet.lafwidget.animation.*;
-import net.java.sip.communicator.impl.gui.utils.*;
-import net.java.sip.communicator.util.swing.*;
-
/**
* The <tt>SIPCommButton</tt> is a very flexible <tt>JButton</tt> that allows
* to configure its background, its icon, the look when a mouse is over it, etc.
- *
+ *
* @author Yana Stamcheva
*/
public class SIPCommButton
@@ -33,7 +30,7 @@ public class SIPCommButton
/**
* Creates a button with custom background image and icon image.
- *
+ *
* @param bgImage The background image.
* @param pressedImage The pressed image.
* @param iconImage The icon.
@@ -69,7 +66,7 @@ public class SIPCommButton
/**
* Creates a button with custom background image.
- *
+ *
* @param bgImage The background button image.
*/
public SIPCommButton( Image bgImage,
@@ -80,7 +77,7 @@ public class SIPCommButton
/**
* Creates a button with custom background image.
- *
+ *
* @param bgImage The background button image.
*/
public SIPCommButton(Image bgImage)
@@ -90,7 +87,7 @@ public class SIPCommButton
/**
* Resets the background image for this button.
- *
+ *
* @param bgImage the new image to set.
*/
public void setImage(Image bgImage)
@@ -104,7 +101,7 @@ public class SIPCommButton
* Overrides the <code>paintComponent</code> method of <tt>JButton</tt> to
* paint the button background and icon, and all additional effects of this
* configurable button.
- *
+ *
* @param g The Graphics object.
*/
protected void paintComponent(Graphics g)
@@ -219,7 +216,7 @@ public class SIPCommButton
/**
* Returns the background image of this button.
- *
+ *
* @return the background image of this button.
*/
public Image getBackgroundImage()
@@ -229,7 +226,7 @@ public class SIPCommButton
/**
* Sets the background image of this button.
- *
+ *
* @param bgImage the background image of this button.
*/
public void setBackgroundImage(Image bgImage)
diff --git a/src/net/java/sip/communicator/impl/gui/customcontrols/SIPCommToggleButton.java b/src/net/java/sip/communicator/util/swing/SIPCommToggleButton.java
index 823822b..d6eef54 100644
--- a/src/net/java/sip/communicator/impl/gui/customcontrols/SIPCommToggleButton.java
+++ b/src/net/java/sip/communicator/util/swing/SIPCommToggleButton.java
@@ -4,23 +4,20 @@
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
-package net.java.sip.communicator.impl.gui.customcontrols;
+package net.java.sip.communicator.util.swing;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
-import net.java.sip.communicator.impl.gui.utils.*;
-import net.java.sip.communicator.util.swing.*;
-
import org.jvnet.lafwidget.animation.*;
/**
* The <tt>SIPCommToggleButton</tt> is a flexible <tt>JToggleButton</tt> that
* allows to configure its background, its icon, the look when a mouse is over
* it, etc.
- *
+ *
* @author Yana Stamcheva
*/
public class SIPCommToggleButton
@@ -49,14 +46,14 @@ public class SIPCommToggleButton
/**
* Creates a button with custom background image, rollover image and
* icon image.
- *
+ *
* @param bgImage The background image.
* @param rolloverImage The roll over image.
* @param iconImage The icon.
* @param pressedImage The image used to paint the pressed state.
*/
public SIPCommToggleButton( Image bgImage,
- Image rolloverImage,
+ Image rolloverImage,
Image iconImage,
Image pressedImage)
{
@@ -77,7 +74,7 @@ public class SIPCommToggleButton
/**
* Creates a button with custom background image and rollover image.
- *
+ *
* @param bgImage The background button image.
* @param rolloverImage The rollover button image.
*/
@@ -90,10 +87,10 @@ public class SIPCommToggleButton
* Overrides the <code>paintComponent</code> method of <tt>JButton</tt>
* to paint the button background and icon, and all additional effects
* of this configurable button.
- *
+ *
* @param g The Graphics object.
*/
-
+
public void paintComponent(Graphics g)
{
g = g.create();
@@ -109,7 +106,7 @@ public class SIPCommToggleButton
/**
* Paints this button.
- *
+ *
* @param g The Graphics object.
*/
private void internalPaintComponent(Graphics g)
@@ -249,10 +246,10 @@ public class SIPCommToggleButton
this.iconImage = iconImage;
this.repaint();
}
-
+
/**
* Sets the image representing the pressed state of this button.
- *
+ *
* @param pressedImage The image representing the pressed state of this
* button.
*/