diff options
author | Lyubomir Marinov <lyubomir.marinov@jitsi.org> | 2008-12-04 21:10:07 +0000 |
---|---|---|
committer | Lyubomir Marinov <lyubomir.marinov@jitsi.org> | 2008-12-04 21:10:07 +0000 |
commit | d2f28137d645b042a95455d71a7d4b8daee80742 (patch) | |
tree | b3ed57f0f632997dd6069013e1564e1866728c7b /src/net/java/sip | |
parent | 332089235bc7a78e24f172fdb0987ccf5b207ea8 (diff) | |
download | jitsi-d2f28137d645b042a95455d71a7d4b8daee80742.zip jitsi-d2f28137d645b042a95455d71a7d4b8daee80742.tar.gz jitsi-d2f28137d645b042a95455d71a7d4b8daee80742.tar.bz2 |
Moves SIPCommDialog into public visibility out of its defining bundle so that it can be used not only in the main UI but also in the plugins. Also tries to use it for all JDialogs created by the application.
Diffstat (limited to 'src/net/java/sip')
20 files changed, 131 insertions, 195 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/main/call/TransferCallDialog.java b/src/net/java/sip/communicator/impl/gui/main/call/TransferCallDialog.java index dc2c027..28560eb 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/TransferCallDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/TransferCallDialog.java @@ -15,6 +15,7 @@ import javax.swing.event.*; import net.java.sip.communicator.impl.gui.customcontrols.*;
import net.java.sip.communicator.impl.gui.i18n.*;
import net.java.sip.communicator.impl.gui.lookandfeel.*;
+import net.java.sip.communicator.swing.*;
/**
* Represents a <code>Dialog</code> which allows specifying the target contact
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/SendSmsDialog.java b/src/net/java/sip/communicator/impl/gui/main/chat/SendSmsDialog.java index 732e7cf..9815c64 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chat/SendSmsDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/chat/SendSmsDialog.java @@ -12,9 +12,9 @@ import java.util.*; import javax.swing.*; -import net.java.sip.communicator.impl.gui.customcontrols.*; import net.java.sip.communicator.impl.gui.i18n.*; import net.java.sip.communicator.impl.gui.utils.*; +import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; /** diff --git a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/createforms/CreateChatRoomDialog.java b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/createforms/CreateChatRoomDialog.java index 8f69048..8ac60a3 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/createforms/CreateChatRoomDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/createforms/CreateChatRoomDialog.java @@ -12,10 +12,9 @@ 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.i18n.*; import net.java.sip.communicator.impl.gui.main.chat.conference.*; -import net.java.sip.communicator.service.protocol.*; +import net.java.sip.communicator.swing.*; /** * The <tt>CreateChatRoomDialog</tt> is the dialog containing the form for adding diff --git a/src/net/java/sip/communicator/impl/protocol/ssh/SSHContactInfo.java b/src/net/java/sip/communicator/impl/protocol/ssh/SSHContactInfo.java index 0180dac..e508786 100644 --- a/src/net/java/sip/communicator/impl/protocol/ssh/SSHContactInfo.java +++ b/src/net/java/sip/communicator/impl/protocol/ssh/SSHContactInfo.java @@ -9,30 +9,31 @@ * SSH Suport in SIP Communicator - GSoC' 07 Project * */ - package net.java.sip.communicator.impl.protocol.ssh; -import java.text.ParseException; -import net.java.sip.communicator.service.gui.*; - import java.awt.*; import java.awt.event.*; +import java.text.ParseException; + import javax.swing.*; import javax.swing.text.*; +import net.java.sip.communicator.service.gui.*; +import net.java.sip.communicator.swing.*; + /** * * @author Shobhit Jindal */ -class SSHContactInfo extends JDialog +class SSHContactInfo extends SIPCommDialog implements ConfigurationForm { private ContactSSH sshContact; - private JPanel mainPanel = new JPanel(); - private JPanel machinePanel = new JPanel(); - private JPanel detailNamesPanel = new JPanel(); - private JPanel detailFieldsPanel = new JPanel(); - private JPanel detailsPanel = new JPanel(); + private JPanel mainPanel = new TransparentPanel(); + private JPanel machinePanel = new TransparentPanel(); + private JPanel detailNamesPanel = new TransparentPanel(); + private JPanel detailFieldsPanel = new TransparentPanel(); + private JPanel detailsPanel = new TransparentPanel(); private JCheckBox addDetailsCheckBox = new JCheckBox("Add Details"); @@ -52,27 +53,27 @@ class SSHContactInfo extends JDialog private JTextField terminalTypeField = new JTextField("SIP Communicator"); private JSpinner updateTimer = new JSpinner(); - private JPanel emptyPanel1 = new JPanel(); + private JPanel emptyPanel1 = new TransparentPanel(); - private JPanel emptyPanel2 = new JPanel(); + private JPanel emptyPanel2 = new TransparentPanel(); - private JPanel emptyPanel3 = new JPanel(); + private JPanel emptyPanel3 = new TransparentPanel(); - private JPanel emptyPanel4 = new JPanel(); + private JPanel emptyPanel4 = new TransparentPanel(); - private JPanel emptyPanel5 = new JPanel(); + private JPanel emptyPanel5 = new TransparentPanel(); - private JPanel emptyPanel6 = new JPanel(); + private JPanel emptyPanel6 = new TransparentPanel(); - private JPanel emptyPanel7 = new JPanel(); + private JPanel emptyPanel7 = new TransparentPanel(); - private JPanel emptyPanel8 = new JPanel(); + private JPanel emptyPanel8 = new TransparentPanel(); - private JPanel emptyPanel9 = new JPanel(); + private JPanel emptyPanel9 = new TransparentPanel(); - private JPanel emptyPanel10 = new JPanel(); + private JPanel emptyPanel10 = new TransparentPanel(); - private JPanel emptyPanel11 = new JPanel(); + private JPanel emptyPanel11 = new TransparentPanel(); // private ContactGroup contactGroup = null; @@ -340,4 +341,8 @@ class SSHContactInfo extends JDialog { return -1; } + + protected void close(boolean isEscaped) + { + } } diff --git a/src/net/java/sip/communicator/impl/protocol/ssh/ssh.provider.manifest.mf b/src/net/java/sip/communicator/impl/protocol/ssh/ssh.provider.manifest.mf index c77a0e9..2701876 100644 --- a/src/net/java/sip/communicator/impl/protocol/ssh/ssh.provider.manifest.mf +++ b/src/net/java/sip/communicator/impl/protocol/ssh/ssh.provider.manifest.mf @@ -4,16 +4,17 @@ Bundle-Description: A bundle providing support for the SSH protocol. Bundle-Vendor: sip-communicator.org Bundle-Version: 0.0.1 Import-Package: org.osgi.framework, + javax.crypto, + javax.crypto.interfaces, + javax.crypto.spec, javax.swing, javax.swing.border, javax.swing.text, - javax.crypto, - javax.crypto.spec, - javax.crypto.interfaces, net.java.sip.communicator.service.configuration, net.java.sip.communicator.service.configuration.event, - net.java.sip.communicator.service.resources, - net.java.sip.communicator.util, + net.java.sip.communicator.service.gui, net.java.sip.communicator.service.protocol, net.java.sip.communicator.service.protocol.event, - net.java.sip.communicator.service.gui + net.java.sip.communicator.service.resources, + net.java.sip.communicator.swing, + net.java.sip.communicator.util diff --git a/src/net/java/sip/communicator/impl/systray/NewStatusMessageDialog.java b/src/net/java/sip/communicator/impl/systray/NewStatusMessageDialog.java index aab5468..db3c35e 100644 --- a/src/net/java/sip/communicator/impl/systray/NewStatusMessageDialog.java +++ b/src/net/java/sip/communicator/impl/systray/NewStatusMessageDialog.java @@ -12,6 +12,7 @@ import java.awt.event.*; import javax.swing.*; import net.java.sip.communicator.service.protocol.*; +import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; /** @@ -21,19 +22,19 @@ import net.java.sip.communicator.util.*; * @author Yana Stamcheva */ public class NewStatusMessageDialog - extends JDialog + extends SIPCommDialog implements ActionListener { private Logger logger = Logger.getLogger(NewStatusMessageDialog.class); - private JPanel messagePanel = new JPanel(new BorderLayout()); + private JPanel messagePanel = new TransparentPanel(new BorderLayout()); private JLabel messageLabel = new JLabel( Resources.getString("newStatusMessage")); private JTextField messageTextField = new JTextField(); - private JPanel dataPanel = new JPanel(new BorderLayout(5, 5)); + private JPanel dataPanel = new TransparentPanel(new BorderLayout(5, 5)); private JTextArea infoLabel = new JTextArea( Resources.getString("statusMessageInfo")); @@ -44,17 +45,18 @@ public class NewStatusMessageDialog private JLabel iconLabel = new JLabel( Resources.getImage("newStatusMessageIcon")); - private JPanel labelsPanel = new JPanel(new GridLayout(0, 1)); + private JPanel labelsPanel = new TransparentPanel(new GridLayout(0, 1)); - private JPanel rightPanel = new JPanel(new BorderLayout()); + private JPanel rightPanel = new TransparentPanel(new BorderLayout()); private JButton okButton = new JButton(Resources.getString("ok")); private JButton cancelButton = new JButton(Resources.getString("cancel")); - private JPanel buttonsPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); + private JPanel buttonsPanel = + new TransparentPanel(new FlowLayout(FlowLayout.RIGHT)); - private JPanel mainPanel = new JPanel(new BorderLayout()); + private JPanel mainPanel = new TransparentPanel(new BorderLayout()); private ProtocolProviderService protocolProvider; @@ -151,6 +153,11 @@ public class NewStatusMessageDialog this.messageTextField.requestFocus(); } + protected void close(boolean isEscaped) + { + cancelButton.doClick(); + } + /** * This class allow to use a thread to change the presence status. */ diff --git a/src/net/java/sip/communicator/impl/systray/systray.manifest.mf b/src/net/java/sip/communicator/impl/systray/systray.manifest.mf index 2693328..893d5bd 100644 --- a/src/net/java/sip/communicator/impl/systray/systray.manifest.mf +++ b/src/net/java/sip/communicator/impl/systray/systray.manifest.mf @@ -10,6 +10,7 @@ Import-Package: org.osgi.framework, com.apple.cocoa.application,
com.apple.cocoa.foundation,
net.java.sip.communicator.util,
+ net.java.sip.communicator.swing,
net.java.sip.communicator.service.configuration,
net.java.sip.communicator.service.resources,
net.java.sip.communicator.service.protocol,
diff --git a/src/net/java/sip/communicator/plugin/exampleplugin/PluginDialog.java b/src/net/java/sip/communicator/plugin/exampleplugin/PluginDialog.java index 8313e92..b162637 100644 --- a/src/net/java/sip/communicator/plugin/exampleplugin/PluginDialog.java +++ b/src/net/java/sip/communicator/plugin/exampleplugin/PluginDialog.java @@ -11,6 +11,7 @@ import java.awt.*; import javax.swing.*; import net.java.sip.communicator.service.contactlist.*; +import net.java.sip.communicator.swing.*; /** * A plugin dialog that is open through the right button menu over a contact and @@ -19,11 +20,11 @@ import net.java.sip.communicator.service.contactlist.*; * @author Yana Stamcheva */ public class PluginDialog - extends JDialog + extends SIPCommDialog { private JTextArea infoTextArea = new JTextArea(); - private JPanel mainPanel = new JPanel(); + private JPanel mainPanel = new TransparentPanel(); private JLabel contactLabel = new JLabel(); private JLabel nameLabel = new JLabel(); @@ -73,4 +74,8 @@ public class PluginDialog this.contactLabel.setAlignmentY(JLabel.TOP_ALIGNMENT); this.contactLabel.setFont(contactLabel.getFont().deriveFont(Font.BOLD)); } + + protected void close(boolean isEscaped) + { + } } diff --git a/src/net/java/sip/communicator/plugin/exampleplugin/exampleplugin.manifest.mf b/src/net/java/sip/communicator/plugin/exampleplugin/exampleplugin.manifest.mf index ae203bc..6d48c82 100644 --- a/src/net/java/sip/communicator/plugin/exampleplugin/exampleplugin.manifest.mf +++ b/src/net/java/sip/communicator/plugin/exampleplugin/exampleplugin.manifest.mf @@ -5,6 +5,7 @@ Bundle-Vendor: sip-communicator.org Bundle-Version: 0.0.1 Import-Package: org.osgi.framework, net.java.sip.communicator.util, + net.java.sip.communicator.swing, net.java.sip.communicator.service.contactlist, net.java.sip.communicator.service.contactlist.event, net.java.sip.communicator.service.gui, diff --git a/src/net/java/sip/communicator/plugin/extendedcallhistorysearch/ExtendedCallHistorySearchDialog.java b/src/net/java/sip/communicator/plugin/extendedcallhistorysearch/ExtendedCallHistorySearchDialog.java index decaef3..1105945 100644 --- a/src/net/java/sip/communicator/plugin/extendedcallhistorysearch/ExtendedCallHistorySearchDialog.java +++ b/src/net/java/sip/communicator/plugin/extendedcallhistorysearch/ExtendedCallHistorySearchDialog.java @@ -4,7 +4,6 @@ * Distributable under LGPL license. * See terms of license at gnu.org. */ - package net.java.sip.communicator.plugin.extendedcallhistorysearch; import java.awt.*; @@ -14,6 +13,7 @@ import java.util.*; import javax.swing.*; import net.java.sip.communicator.service.callhistory.*; +import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; import com.toedter.calendar.*; @@ -26,20 +26,21 @@ import com.toedter.calendar.*; * @author Maxime Bourdon & Thomas Meyer */ public class ExtendedCallHistorySearchDialog - extends JDialog + extends SIPCommDialog implements ActionListener, ItemListener { /* PANEL */ - private JPanel mainSearchPanel = new JPanel(new BorderLayout()); + private JPanel mainSearchPanel = new TransparentPanel(new BorderLayout()); - private JPanel mainPanel = new JPanel(new BorderLayout(3, 1)); + private JPanel mainPanel = new TransparentPanel(new BorderLayout(3, 1)); - private JPanel searchPanel = new JPanel(new GridBagLayout()); + private JPanel searchPanel = new TransparentPanel(new GridBagLayout()); - private JPanel callTypePanel = new JPanel(new GridBagLayout()); + private JPanel callTypePanel = new TransparentPanel(new GridBagLayout()); - private JPanel callListResultPanel = new JPanel(new BorderLayout()); + private JPanel callListResultPanel = + new TransparentPanel(new BorderLayout()); /* BUTTON */ private JButton searchButton = new JButton( @@ -487,4 +488,8 @@ public class ExtendedCallHistorySearchDialog callList.addItem(ExtendedCallHistorySearchActivator.getResources() .getI18NString("olderCalls") + "..."); } + + protected void close(boolean isEscaped) + { + } } diff --git a/src/net/java/sip/communicator/plugin/extendedcallhistorysearch/extendedcallhistorysearch.manifest.mf b/src/net/java/sip/communicator/plugin/extendedcallhistorysearch/extendedcallhistorysearch.manifest.mf index df4af89..bcaf123 100644 --- a/src/net/java/sip/communicator/plugin/extendedcallhistorysearch/extendedcallhistorysearch.manifest.mf +++ b/src/net/java/sip/communicator/plugin/extendedcallhistorysearch/extendedcallhistorysearch.manifest.mf @@ -5,6 +5,7 @@ Bundle-Vendor: sip-communicator.org Bundle-Version: 0.0.1 Import-Package: org.osgi.framework, net.java.sip.communicator.util, + net.java.sip.communicator.swing, net.java.sip.communicator.service.resources, net.java.sip.communicator.service.contactlist, net.java.sip.communicator.service.contactlist.event, diff --git a/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberNewAccountDialog.java b/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberNewAccountDialog.java index 139d393..0f09402 100644 --- a/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberNewAccountDialog.java +++ b/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberNewAccountDialog.java @@ -26,9 +26,8 @@ import org.jivesoftware.smack.*; * @author Nicolas Grandclaude */ public class JabberNewAccountDialog - extends JDialog - implements - DocumentListener + extends SIPCommDialog + implements DocumentListener { private static final Logger logger = Logger .getLogger(JabberNewAccountDialog.class); @@ -358,7 +357,12 @@ public class JabberNewAccountDialog public void pageBack() { } - + + protected void close(boolean isEscaped) + { + cancelButton.doClick(); + } + /** * A GlassPane that would change the cursor to a waiting cursor until the * new account is registered. diff --git a/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberServerChooserDialog.java b/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberServerChooserDialog.java index cb168b8..ccabf34 100644 --- a/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberServerChooserDialog.java +++ b/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberServerChooserDialog.java @@ -33,7 +33,7 @@ import org.xml.sax.*; * @author Nicolas Grandclaude */ public class JabberServerChooserDialog - extends JDialog + extends SIPCommDialog implements ListSelectionListener { private static final Logger logger = Logger @@ -288,9 +288,13 @@ public class JabberServerChooserDialog { okButton.setEnabled(false); } + } + protected void close(boolean isEscaped) + { + cancelButton.doClick(); } - + /** * The table model used for the table containing all servers. */ diff --git a/src/net/java/sip/communicator/plugin/pluginmanager/NewBundleDialog.java b/src/net/java/sip/communicator/plugin/pluginmanager/NewBundleDialog.java index c57bc7d..ec07d76 100644 --- a/src/net/java/sip/communicator/plugin/pluginmanager/NewBundleDialog.java +++ b/src/net/java/sip/communicator/plugin/pluginmanager/NewBundleDialog.java @@ -4,21 +4,22 @@ * Distributable under LGPL license. * See terms of license at gnu.org. */ - package net.java.sip.communicator.plugin.pluginmanager; import java.awt.*; import java.awt.event.*; import java.io.*; import java.net.*; + import javax.swing.*; import net.java.sip.communicator.service.gui.*; +import net.java.sip.communicator.swing.*; import org.osgi.framework.*; public class NewBundleDialog - extends JDialog + extends SIPCommDialog implements ActionListener { private JButton installButton = new JButton(Resources.getString("install")); @@ -29,15 +30,15 @@ public class NewBundleDialog private JLabel bundlePathLabel = new JLabel(Resources.getString("url") + ": "); - private JPanel buttonsPanel = new JPanel(new FlowLayout(FlowLayout.CENTER)); - - private JPanel dataPanel = new JPanel(new BorderLayout(5, 5)); + private JPanel buttonsPanel = new TransparentPanel(new FlowLayout(FlowLayout.CENTER)); - private JPanel mainPanel = new JPanel(new BorderLayout()); - - private JButton fileChooserButton = new JButton(Resources.getString("chooseFile") - ); + private JPanel dataPanel = new TransparentPanel(new BorderLayout(5, 5)); + private JPanel mainPanel = new TransparentPanel(new BorderLayout()); + + private JButton fileChooserButton = + new JButton(Resources.getString("chooseFile")); + public NewBundleDialog () { this.mainPanel.setPreferredSize(new Dimension(450, 150)); @@ -119,4 +120,9 @@ public class NewBundleDialog else dispose(); } + + protected void close(boolean isEscaped) + { + cancelButton.doClick(); + } } diff --git a/src/net/java/sip/communicator/plugin/updatechecker/UpdateCheckActivator.java b/src/net/java/sip/communicator/plugin/updatechecker/UpdateCheckActivator.java index 36a988e..9fe2061 100644 --- a/src/net/java/sip/communicator/plugin/updatechecker/UpdateCheckActivator.java +++ b/src/net/java/sip/communicator/plugin/updatechecker/UpdateCheckActivator.java @@ -11,20 +11,15 @@ import java.awt.FlowLayout; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.awt.image.*; -import java.io.*; import java.net.*; -import java.text.MessageFormat; import java.util.*; import javax.swing.*; -import javax.swing.text.*; -import javax.swing.text.html.*; import net.java.sip.communicator.service.browserlauncher.*; -import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.resources.*; import net.java.sip.communicator.service.version.VersionService; +import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; import org.osgi.framework.*; @@ -79,7 +74,12 @@ public class UpdateCheckActivator if(isNewestVersion(ver.toString())) return; - final JDialog dialog = new JDialog(); + final JDialog dialog = new SIPCommDialog() + { + protected void close(boolean isEscaped) + { + } + }; dialog.setTitle( getResources().getI18NString("dialogTitle")); @@ -102,12 +102,12 @@ public class UpdateCheckActivator contentMessage.setText(dialogMsg); - JPanel contentPane = new JPanel(new BorderLayout(5,5)); + JPanel contentPane = new TransparentPanel(new BorderLayout(5,5)); contentPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); contentPane.add(contentMessage, BorderLayout.CENTER); JPanel buttonPanel - = new JPanel(new FlowLayout(FlowLayout.CENTER, 10, 10)); + = new TransparentPanel(new FlowLayout(FlowLayout.CENTER, 10, 10)); JButton closeButton = new JButton( getResources().getI18NString("buttonClose")); diff --git a/src/net/java/sip/communicator/plugin/updatechecker/updatecheck.manifest.mf b/src/net/java/sip/communicator/plugin/updatechecker/updatecheck.manifest.mf index fed044d..bf08da5 100644 --- a/src/net/java/sip/communicator/plugin/updatechecker/updatecheck.manifest.mf +++ b/src/net/java/sip/communicator/plugin/updatechecker/updatecheck.manifest.mf @@ -5,6 +5,7 @@ Bundle-Vendor: sip-communicator.org Bundle-Version: 0.0.1 Import-Package: org.osgi.framework, net.java.sip.communicator.util, + net.java.sip.communicator.swing, net.java.sip.communicator.service.resources, net.java.sip.communicator.service.gui, net.java.sip.communicator.service.version, diff --git a/src/net/java/sip/communicator/plugin/whiteboard/gui/InvitationReceivedDialog.java b/src/net/java/sip/communicator/plugin/whiteboard/gui/InvitationReceivedDialog.java index a706d9b..b38758a 100644 --- a/src/net/java/sip/communicator/plugin/whiteboard/gui/InvitationReceivedDialog.java +++ b/src/net/java/sip/communicator/plugin/whiteboard/gui/InvitationReceivedDialog.java @@ -13,6 +13,7 @@ import javax.swing.*; import net.java.sip.communicator.plugin.whiteboard.*; import net.java.sip.communicator.service.protocol.*; +import net.java.sip.communicator.swing.*; /** * The dialog that pops up when a chat room invitation is received. @@ -20,23 +21,23 @@ import net.java.sip.communicator.service.protocol.*; * @author Yana Stamcheva */ public class InvitationReceivedDialog - extends JDialog + extends SIPCommDialog implements ActionListener { private JTextArea infoTextArea = new JTextArea(); private JTextArea invitationReasonTextArea = new JTextArea(); - private JPanel reasonPanel = new JPanel(new BorderLayout()); + private JPanel reasonPanel = new TransparentPanel(new BorderLayout()); private JLabel reasonLabel = new JLabel( Resources.getString("reason") + ": "); private JTextField reasonField = new JTextField(); - private JPanel dataPanel = new JPanel(new BorderLayout(10, 10)); + private JPanel dataPanel = new TransparentPanel(new BorderLayout(10, 10)); - private JPanel buttonsPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); + private JPanel buttonsPanel = new TransparentPanel(new FlowLayout(FlowLayout.RIGHT)); private JButton acceptButton = new JButton(Resources.getString("accept")); @@ -44,9 +45,9 @@ public class InvitationReceivedDialog private JButton ignoreButton = new JButton(Resources.getString("ignore")); - private JPanel mainPanel = new JPanel(new BorderLayout(10, 10)); + private JPanel mainPanel = new TransparentPanel(new BorderLayout(10, 10)); - private JPanel northPanel = new JPanel(new BorderLayout(10, 10)); + private JPanel northPanel = new TransparentPanel(new BorderLayout(10, 10)); private JLabel iconLabel = new JLabel(Resources.getImage("inviteIcon")); @@ -171,5 +172,7 @@ public class InvitationReceivedDialog } protected void close(boolean isEscaped) - {} -}
\ No newline at end of file + { + rejectButton.doClick(); + } +} diff --git a/src/net/java/sip/communicator/plugin/whiteboard/whiteboard.manifest.mf b/src/net/java/sip/communicator/plugin/whiteboard/whiteboard.manifest.mf index 1688917..9827a73 100644 --- a/src/net/java/sip/communicator/plugin/whiteboard/whiteboard.manifest.mf +++ b/src/net/java/sip/communicator/plugin/whiteboard/whiteboard.manifest.mf @@ -5,6 +5,7 @@ Bundle-Vendor: sip-communicator.org Bundle-Version: 0.0.1 Import-Package: org.osgi.framework, net.java.sip.communicator.util, + net.java.sip.communicator.swing, net.java.sip.communicator.service.resources, net.java.sip.communicator.service.contactlist, net.java.sip.communicator.service.contactlist.event, diff --git a/src/net/java/sip/communicator/impl/gui/customcontrols/SIPCommDialog.java b/src/net/java/sip/communicator/swing/SIPCommDialog.java index 8389f46..89fe82c 100644 --- a/src/net/java/sip/communicator/impl/gui/customcontrols/SIPCommDialog.java +++ b/src/net/java/sip/communicator/swing/SIPCommDialog.java @@ -4,17 +4,14 @@ * Distributable under LGPL license. * See terms of license at gnu.org. */ -package net.java.sip.communicator.impl.gui.customcontrols; +package net.java.sip.communicator.swing; import java.awt.*; import java.awt.event.*; -import java.awt.geom.*; import javax.swing.*; -import net.java.sip.communicator.impl.gui.*; import net.java.sip.communicator.service.configuration.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; public abstract class SIPCommDialog extends JDialog @@ -66,7 +63,7 @@ public abstract class SIPCommDialog extends JDialog */ private void init() { - this.setContentPane(new MainContentPane()); + this.setContentPane(new SIPCommFrame.MainContentPane()); this.addWindowListener(new DialogWindowAdapter()); @@ -136,9 +133,9 @@ public abstract class SIPCommDialog extends JDialog */ private void saveSizeAndLocation() { - ConfigurationService configService - = GuiActivator.getConfigurationService(); - + ConfigurationService configService = + SwingCommonActivator.getConfigurationService(); + String className = this.getClass().getName(); try { @@ -169,8 +166,8 @@ public abstract class SIPCommDialog extends JDialog */ private void setSizeAndLocation() { - ConfigurationService configService - = GuiActivator.getConfigurationService(); + ConfigurationService configService = + SwingCommonActivator.getConfigurationService(); String className = this.getClass().getName(); @@ -371,112 +368,6 @@ public abstract class SIPCommDialog extends JDialog super.dispose(); } - - private class MainContentPane extends JPanel - { - String isColorBgEnabledProp - = "impl.gui.IS_WINDOW_COLOR_BACKGROUND_ENABLED"; - - boolean isColorBgEnabled = new Boolean( - GuiActivator.getResources().getSettingsString(isColorBgEnabledProp)) - .booleanValue(); - - Color bgStartColor = new Color(GuiActivator.getResources() - .getColor("service.gui.MAIN_BACKGROUND")); - - Color bgEndColor = new Color(GuiActivator.getResources() - .getColor("service.gui.MAIN_BACKGROUND_GRADIENT")); - - GeneralPath headerBackground = new GeneralPath(); - - public MainContentPane() - { - super(new BorderLayout()); - - int borderSize = GuiActivator.getResources() - .getSettingsInt("impl.gui.MAIN_WINDOW_BORDER_SIZE"); - - if (isColorBgEnabled) - { - this.setBorder(BorderFactory - .createEmptyBorder( borderSize, - borderSize, - borderSize, - borderSize)); - } - } - - protected void paintComponent(Graphics g) - { - super.paintComponent(g); - - g = g.create(); - try - { - internalPaintComponent(g); - } - finally - { - g.dispose(); - } - } - - private void internalPaintComponent(Graphics g) - { - // If the custom color window background is not enabled we have - // nothing to do here. - if (!isColorBgEnabled) - return; - - Graphics2D g2 = (Graphics2D) g; - - AntialiasingManager.activateAntialiasing(g2); - - GradientPaint bgGradientColor - = new GradientPaint(this.getWidth()/2, 0, - bgStartColor, - this.getWidth()/2, - 80, - bgEndColor); - - g2.setPaint(bgGradientColor); - g2.fillRect(0, 0, this.getWidth(), 80); - - g2.setColor(bgEndColor); - g2.fillRect(0, 78, - this.getWidth(), - this.getHeight()); - - GradientPaint curveShadow = new GradientPaint(0, 0, - new Color(255, 255, 255, 150), - this.getWidth(), - this.getHeight(), - new Color(255, 255, 255, 50)); - - g2.setPaint(curveShadow); - g2.setStroke(new BasicStroke(1f)); - CubicCurve2D curve1 = new CubicCurve2D.Float( - 50, -1, 250, 30, 50, 150, 0, 300); - - g2.draw(curve1); - - CubicCurve2D curve2 = new CubicCurve2D.Float( - this.getWidth() - 20, 0, - this.getWidth(), 100, - this.getWidth()/2, 100, - 0, 150); - - g2.draw(curve2); - - CubicCurve2D curve3 = new CubicCurve2D.Float( - 0, 90, - this.getWidth()/3, 60, - 2*this.getWidth()/3, 60, - this.getWidth(), 90); - - g2.draw(curve3); - } - } /** * All functions implemented in this method will be invoked when user diff --git a/src/net/java/sip/communicator/swing/SIPCommFrame.java b/src/net/java/sip/communicator/swing/SIPCommFrame.java index 7967ef0..987ca3a 100644 --- a/src/net/java/sip/communicator/swing/SIPCommFrame.java +++ b/src/net/java/sip/communicator/swing/SIPCommFrame.java @@ -392,7 +392,7 @@ public abstract class SIPCommFrame } } - private static class MainContentPane + static class MainContentPane extends JPanel { private final boolean isColorBgEnabled; |