From a83833f3575ef30b5df74abf49b7eec71867dd7e Mon Sep 17 00:00:00 2001 From: Lyubomir Marinov Date: Mon, 8 Dec 2008 18:18:30 +0000 Subject: Moves the functionality of swing-common.jar into util.jar and removes swing-common.jar. --- .../impl/gui/customcontrols/ErrorDialog.java | 2 +- .../gui/customcontrols/ExtListCellRenderer.java | 2 +- .../impl/gui/customcontrols/MessageDialog.java | 2 +- .../impl/gui/customcontrols/SCScrollPane.java | 2 +- .../impl/gui/customcontrols/SIPCommButton.java | 2 +- .../gui/customcontrols/SIPCommToggleButton.java | 2 +- .../impl/gui/customcontrols/TitlePanel.java | 2 +- .../gui/customcontrols/TransparentBackground.java | 2 +- .../impl/gui/customcontrols/wizard/Wizard.java | 2 +- .../impl/gui/lookandfeel/SIPCommButtonUI.java | 2 +- .../gui/lookandfeel/SIPCommChatSelectorMenuUI.java | 2 +- .../gui/lookandfeel/SIPCommCheckBoxMenuItemUI.java | 2 +- .../impl/gui/lookandfeel/SIPCommCheckBoxUI.java | 2 +- .../gui/lookandfeel/SIPCommComboBoxEditor.java | 2 +- .../impl/gui/lookandfeel/SIPCommComboBoxUI.java | 2 +- .../impl/gui/lookandfeel/SIPCommEditorPaneUI.java | 2 +- .../impl/gui/lookandfeel/SIPCommLFUtils.java | 2 +- .../impl/gui/lookandfeel/SIPCommLabelUI.java | 2 +- .../impl/gui/lookandfeel/SIPCommListUI.java | 2 +- .../impl/gui/lookandfeel/SIPCommMenuItemUI.java | 2 +- .../impl/gui/lookandfeel/SIPCommMenuUI.java | 2 +- .../impl/gui/lookandfeel/SIPCommOptionPaneUI.java | 2 +- .../gui/lookandfeel/SIPCommPasswordFieldUI.java | 2 +- .../impl/gui/lookandfeel/SIPCommPopupMenuUI.java | 2 +- .../gui/lookandfeel/SIPCommSelectorMenuUI.java | 2 +- .../impl/gui/lookandfeel/SIPCommStatusMenuUI.java | 2 +- .../impl/gui/lookandfeel/SIPCommTextAreaUI.java | 2 +- .../impl/gui/lookandfeel/SIPCommTextFieldUI.java | 2 +- .../impl/gui/lookandfeel/SIPCommTextPaneUI.java | 2 +- .../gui/lookandfeel/SIPCommToggleButtonUI.java | 2 +- .../impl/gui/lookandfeel/SIPCommToolBarUI.java | 2 +- .../impl/gui/lookandfeel/SIPCommToolTipUI.java | 2 +- .../sip/communicator/impl/gui/main/MainFrame.java | 2 +- .../gui/main/account/AccountRegSummaryPage.java | 2 +- .../main/account/AccountsConfigurationForm.java | 2 +- .../impl/gui/main/account/NewAccountDialog.java | 2 +- .../AuthorizationRequestedDialog.java | 2 +- .../authorization/AuthorizationResponseDialog.java | 2 +- .../authorization/RequestAuthorizationDialog.java | 2 +- .../impl/gui/main/call/AccountSelectorBox.java | 2 +- .../impl/gui/main/call/CallDialog.java | 2 +- .../communicator/impl/gui/main/call/CallPanel.java | 2 +- .../impl/gui/main/call/CallParticipantPanel.java | 2 +- .../impl/gui/main/call/MainCallPanel.java | 2 +- .../impl/gui/main/call/ReceivedCallDialog.java | 2 +- .../impl/gui/main/call/TransferCallDialog.java | 2 +- .../communicator/impl/gui/main/call/ZrtpPanel.java | 2 +- .../gui/main/chat/ChatContactRightButtonMenu.java | 2 +- .../communicator/impl/gui/main/chat/ChatPanel.java | 2 +- .../impl/gui/main/chat/ChatSendPanel.java | 2 +- .../gui/main/chat/ChatTransportSelectorBox.java | 2 +- .../impl/gui/main/chat/ChatWindow.java | 4 +- .../impl/gui/main/chat/ChatWritePanel.java | 2 +- .../impl/gui/main/chat/SendSmsDialog.java | 2 +- .../gui/main/chat/conference/ChatInviteDialog.java | 2 +- .../conference/ChatRoomConfigurationWindow.java | 2 +- .../chat/conference/InvitationReceivedDialog.java | 2 +- .../gui/main/chat/history/DatesListRenderer.java | 2 +- .../impl/gui/main/chat/history/HistoryWindow.java | 2 +- .../impl/gui/main/chat/history/SearchPanel.java | 2 +- .../gui/main/chat/toolBars/EditTextToolBar.java | 2 +- .../main/chat/toolBars/ExtendedMainToolBar.java | 2 +- .../impl/gui/main/chat/toolBars/MainToolBar.java | 2 +- .../gui/main/chatroomslist/ChatRoomListDialog.java | 2 +- .../chatroomslist/ChatRoomsListCellRenderer.java | 2 +- .../createforms/ChatRoomNamePanel.java | 2 +- .../createforms/CreateChatRoomDialog.java | 2 +- .../createforms/SelectAccountPanel.java | 2 +- .../joinforms/ChatRoomAuthenticationWindow.java | 2 +- .../chatroomslist/joinforms/ChatRoomNamePanel.java | 2 +- .../joinforms/JoinChatRoomDialog.java | 2 +- .../joinforms/SearchChatRoomPanel.java | 2 +- .../joinforms/SelectAccountPanel.java | 2 +- .../gui/main/configforms/ConfigurationFrame.java | 2 +- .../gui/main/contactlist/ActionMenuGlassPane.java | 2 +- .../impl/gui/main/contactlist/ActionMenuPanel.java | 2 +- .../gui/main/contactlist/ContactInfoDialog.java | 2 +- .../main/contactlist/ContactListCellRenderer.java | 2 +- .../main/contactlist/ContactRightButtonMenu.java | 2 +- .../gui/main/contactlist/GroupRightButtonMenu.java | 2 +- .../contactlist/MoveSubcontactMessageDialog.java | 2 +- .../gui/main/contactlist/RenameContactDialog.java | 2 +- .../gui/main/contactlist/RenameContactPanel.java | 2 +- .../gui/main/contactlist/RenameGroupDialog.java | 2 +- .../gui/main/contactlist/RenameGroupPanel.java | 2 +- .../contactlist/addcontact/AddContactDialog.java | 2 +- .../contactlist/addcontact/AddContactPanel.java | 2 +- .../contactlist/addcontact/SelectAccountPanel.java | 2 +- .../contactlist/addcontact/SelectGroupPanel.java | 2 +- .../contactlist/addgroup/CreateGroupDialog.java | 2 +- .../contactlist/addgroup/CreateGroupPanel.java | 2 +- .../impl/gui/main/login/AuthenticationWindow.java | 2 +- .../impl/gui/main/menus/ExtendedQuickMenu.java | 2 +- .../impl/gui/main/presence/AccountStatusPanel.java | 2 +- .../gui/main/presence/GlobalStatusSelectorBox.java | 2 +- .../presence/message/NewStatusMessageDialog.java | 2 +- .../sip/communicator/impl/gui/swing.ui.manifest.mf | 28 +- .../impl/media/MediaConfigurationPanel.java | 2 +- .../sip/communicator/impl/media/media.manifest.mf | 2 +- .../impl/protocol/ssh/SSHContactInfo.java | 2 +- .../impl/protocol/ssh/ssh.provider.manifest.mf | 4 +- .../impl/systray/NewStatusMessageDialog.java | 2 +- .../communicator/impl/systray/systray.manifest.mf | 10 +- .../plugin/accountinfo/AccountDetailsPanel.java | 2 +- .../plugin/accountinfo/AccountInfoForm.java | 2 +- .../plugin/accountinfo/accountinfo.manifest.mf | 8 +- .../plugin/aimaccregwizz/FirstWizardPage.java | 2 +- .../plugin/aimaccregwizz/aimaccregwizz.manifest.mf | 16 +- .../plugin/autoaway/AutoAwayConfigForm.java | 2 +- .../plugin/autoaway/autoaway.manifest.mf | 8 +- .../contactinfo/ContactInfoContactPanel.java | 2 +- .../contactinfo/ContactInfoDetailsPanel.java | 2 +- .../plugin/contactinfo/ContactInfoDialog.java | 2 +- .../plugin/contactinfo/contactinfo.manifest.mf | 8 +- .../plugin/dictaccregwizz/FirstWizardPage.java | 2 +- .../plugin/dictaccregwizz/ProgressPanel.java | 2 +- .../dictaccregwizz/dictaccregwizz.manifest.mf | 14 +- .../plugin/exampleplugin/PluginDialog.java | 2 +- .../plugin/exampleplugin/exampleplugin.manifest.mf | 4 +- .../ExtendedCallHistorySearchDialog.java | 2 +- .../extendedcallhistorysearch.manifest.mf | 10 +- .../generalconfig/GeneralConfigurationForm.java | 2 +- .../plugin/generalconfig/generalconfig.manifest.mf | 8 +- .../gibberishaccregwizz/FirstWizardPage.java | 2 +- .../gibberishaccregwizz.manifest.mf | 12 +- .../googletalkaccregwizz/FirstWizardPage.java | 2 +- .../googletalkaccregwizz.manifest.mf | 16 +- .../plugin/icqaccregwizz/FirstWizardPage.java | 2 +- .../plugin/icqaccregwizz/icqaccregwizz.manifest.mf | 14 +- .../plugin/ircaccregwizz/FirstWizardPage.java | 2 +- .../plugin/ircaccregwizz/ircaccregwizz.manifest.mf | 12 +- .../plugin/jabberaccregwizz/FirstWizardPage.java | 2 +- .../jabberaccregwizz/JabberNewAccountDialog.java | 2 +- .../JabberServerChooserDialog.java | 2 +- .../jabberaccregwizz/jabberaccregwizz.manifest.mf | 16 +- .../keybindingchooser/KeybindingsConfigPanel.java | 2 +- .../keybindingChooser.manifest.mf | 6 +- .../plugin/mailbox/MailboxConfigurationForm.java | 2 +- .../plugin/mailbox/mailbox.manifest.mf | 10 +- .../plugin/msnaccregwizz/FirstWizardPage.java | 2 +- .../plugin/msnaccregwizz/msnaccregwizz.manifest.mf | 14 +- .../NotificationConfigurationPanel.java | 2 +- .../notificationconfiguration.manifest.mf | 8 +- .../plugin/pluginmanager/ManageButtonsPanel.java | 2 +- .../plugin/pluginmanager/NewBundleDialog.java | 2 +- .../plugin/pluginmanager/PluginManagerPanel.java | 2 +- .../plugin/pluginmanager/pluginmanager.manifest.mf | 2 +- .../plugin/rssaccregwizz/FirstWizardPage.java | 2 +- .../plugin/rssaccregwizz/rssaccregwizz.manifest.mf | 12 +- .../plugin/sipaccregwizz/FirstWizardPage.java | 2 +- .../plugin/sipaccregwizz/sipaccregwizz.manifest.mf | 14 +- .../plugin/sshaccregwizz/FirstWizardPage.java | 2 +- .../plugin/sshaccregwizz/sshaccregwizz.manifest.mf | 12 +- .../plugin/updatechecker/UpdateCheckActivator.java | 2 +- .../plugin/updatechecker/updatecheck.manifest.mf | 8 +- .../whiteboard/gui/InvitationReceivedDialog.java | 2 +- .../plugin/whiteboard/gui/WhiteboardFrame.java | 2 +- .../plugin/whiteboard/whiteboard.manifest.mf | 8 +- .../plugin/yahooaccregwizz/FirstWizardPage.java | 2 +- .../yahooaccregwizz/yahooaccregwizz.manifest.mf | 14 +- .../plugin/zeroconfaccregwizz/FirstWizardPage.java | 2 +- .../zeroconfaccregwizz.manifest.mf | 12 +- .../communicator/swing/AntialiasingManager.java | 32 - src/net/java/sip/communicator/swing/FitLayout.java | 136 -- .../java/sip/communicator/swing/ImageCanvas.java | 72 - .../sip/communicator/swing/SIPCommCheckBox.java | 49 - .../java/sip/communicator/swing/SIPCommDialog.java | 384 ----- .../java/sip/communicator/swing/SIPCommFrame.java | 507 ------ .../sip/communicator/swing/SIPCommTabbedPane.java | 469 ----- .../sip/communicator/swing/ScreenInformation.java | 90 - .../communicator/swing/SwingCommonActivator.java | 116 -- .../sip/communicator/swing/TransparentPanel.java | 32 - .../sip/communicator/swing/VideoContainer.java | 113 -- .../java/sip/communicator/swing/VideoLayout.java | 102 -- .../communicator/swing/event/CloseListener.java | 22 - .../swing/event/DoubleClickListener.java | 22 - .../sip/communicator/swing/event/MaxListener.java | 22 - .../swing/event/PopupOutsideListener.java | 22 - .../swing/plaf/SIPCommTabbedPaneEnhancedUI.java | 383 ----- .../swing/plaf/SIPCommTabbedPaneUI.java | 1811 ------------------- .../communicator/swing/swing.common.manifest.mf | 20 - .../java/sip/communicator/util/UtilActivator.java | 72 +- .../util/swing/AntialiasingManager.java | 32 + .../sip/communicator/util/swing/FitLayout.java | 136 ++ .../sip/communicator/util/swing/ImageCanvas.java | 72 + .../communicator/util/swing/SIPCommCheckBox.java | 49 + .../sip/communicator/util/swing/SIPCommDialog.java | 384 +++++ .../sip/communicator/util/swing/SIPCommFrame.java | 507 ++++++ .../communicator/util/swing/SIPCommTabbedPane.java | 469 +++++ .../communicator/util/swing/ScreenInformation.java | 90 + .../communicator/util/swing/TransparentPanel.java | 32 + .../communicator/util/swing/VideoContainer.java | 113 ++ .../sip/communicator/util/swing/VideoLayout.java | 102 ++ .../util/swing/event/CloseListener.java | 22 + .../util/swing/event/DoubleClickListener.java | 22 + .../communicator/util/swing/event/MaxListener.java | 22 + .../util/swing/event/PopupOutsideListener.java | 22 + .../swing/plaf/SIPCommTabbedPaneEnhancedUI.java | 383 +++++ .../util/swing/plaf/SIPCommTabbedPaneUI.java | 1812 ++++++++++++++++++++ .../java/sip/communicator/util/util.manifest.mf | 30 +- 200 files changed, 4648 insertions(+), 4705 deletions(-) delete mode 100644 src/net/java/sip/communicator/swing/AntialiasingManager.java delete mode 100644 src/net/java/sip/communicator/swing/FitLayout.java delete mode 100644 src/net/java/sip/communicator/swing/ImageCanvas.java delete mode 100644 src/net/java/sip/communicator/swing/SIPCommCheckBox.java delete mode 100644 src/net/java/sip/communicator/swing/SIPCommDialog.java delete mode 100644 src/net/java/sip/communicator/swing/SIPCommFrame.java delete mode 100644 src/net/java/sip/communicator/swing/SIPCommTabbedPane.java delete mode 100644 src/net/java/sip/communicator/swing/ScreenInformation.java delete mode 100644 src/net/java/sip/communicator/swing/SwingCommonActivator.java delete mode 100644 src/net/java/sip/communicator/swing/TransparentPanel.java delete mode 100644 src/net/java/sip/communicator/swing/VideoContainer.java delete mode 100644 src/net/java/sip/communicator/swing/VideoLayout.java delete mode 100644 src/net/java/sip/communicator/swing/event/CloseListener.java delete mode 100644 src/net/java/sip/communicator/swing/event/DoubleClickListener.java delete mode 100644 src/net/java/sip/communicator/swing/event/MaxListener.java delete mode 100644 src/net/java/sip/communicator/swing/event/PopupOutsideListener.java delete mode 100644 src/net/java/sip/communicator/swing/plaf/SIPCommTabbedPaneEnhancedUI.java delete mode 100644 src/net/java/sip/communicator/swing/plaf/SIPCommTabbedPaneUI.java delete mode 100644 src/net/java/sip/communicator/swing/swing.common.manifest.mf create mode 100644 src/net/java/sip/communicator/util/swing/AntialiasingManager.java create mode 100644 src/net/java/sip/communicator/util/swing/FitLayout.java create mode 100644 src/net/java/sip/communicator/util/swing/ImageCanvas.java create mode 100644 src/net/java/sip/communicator/util/swing/SIPCommCheckBox.java create mode 100644 src/net/java/sip/communicator/util/swing/SIPCommDialog.java create mode 100644 src/net/java/sip/communicator/util/swing/SIPCommFrame.java create mode 100644 src/net/java/sip/communicator/util/swing/SIPCommTabbedPane.java create mode 100644 src/net/java/sip/communicator/util/swing/ScreenInformation.java create mode 100644 src/net/java/sip/communicator/util/swing/TransparentPanel.java create mode 100644 src/net/java/sip/communicator/util/swing/VideoContainer.java create mode 100644 src/net/java/sip/communicator/util/swing/VideoLayout.java create mode 100644 src/net/java/sip/communicator/util/swing/event/CloseListener.java create mode 100644 src/net/java/sip/communicator/util/swing/event/DoubleClickListener.java create mode 100644 src/net/java/sip/communicator/util/swing/event/MaxListener.java create mode 100644 src/net/java/sip/communicator/util/swing/event/PopupOutsideListener.java create mode 100644 src/net/java/sip/communicator/util/swing/plaf/SIPCommTabbedPaneEnhancedUI.java create mode 100644 src/net/java/sip/communicator/util/swing/plaf/SIPCommTabbedPaneUI.java (limited to 'src/net/java') diff --git a/src/net/java/sip/communicator/impl/gui/customcontrols/ErrorDialog.java b/src/net/java/sip/communicator/impl/gui/customcontrols/ErrorDialog.java index 22f9bc6..8f3966d 100644 --- a/src/net/java/sip/communicator/impl/gui/customcontrols/ErrorDialog.java +++ b/src/net/java/sip/communicator/impl/gui/customcontrols/ErrorDialog.java @@ -16,8 +16,8 @@ import javax.swing.event.*; import net.java.sip.communicator.impl.gui.i18n.*; import net.java.sip.communicator.impl.gui.lookandfeel.*; import net.java.sip.communicator.impl.gui.utils.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; /** * The MessageDialog is a JDialog that contains a question diff --git a/src/net/java/sip/communicator/impl/gui/customcontrols/ExtListCellRenderer.java b/src/net/java/sip/communicator/impl/gui/customcontrols/ExtListCellRenderer.java index 89867b4..9267203 100644 --- a/src/net/java/sip/communicator/impl/gui/customcontrols/ExtListCellRenderer.java +++ b/src/net/java/sip/communicator/impl/gui/customcontrols/ExtListCellRenderer.java @@ -11,7 +11,7 @@ import java.awt.*; import javax.swing.*; import net.java.sip.communicator.impl.gui.utils.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * @author Yana Stamcheva diff --git a/src/net/java/sip/communicator/impl/gui/customcontrols/MessageDialog.java b/src/net/java/sip/communicator/impl/gui/customcontrols/MessageDialog.java index 028f48d..caa7fa5 100644 --- a/src/net/java/sip/communicator/impl/gui/customcontrols/MessageDialog.java +++ b/src/net/java/sip/communicator/impl/gui/customcontrols/MessageDialog.java @@ -14,7 +14,7 @@ import javax.swing.*; 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.swing.*; /** * The MessageDialog is a JDialog that contains a question diff --git a/src/net/java/sip/communicator/impl/gui/customcontrols/SCScrollPane.java b/src/net/java/sip/communicator/impl/gui/customcontrols/SCScrollPane.java index 35bcf20..4042011 100644 --- a/src/net/java/sip/communicator/impl/gui/customcontrols/SCScrollPane.java +++ b/src/net/java/sip/communicator/impl/gui/customcontrols/SCScrollPane.java @@ -13,7 +13,7 @@ import javax.swing.*; import net.java.sip.communicator.impl.gui.*; import net.java.sip.communicator.impl.gui.utils.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; public class SCScrollPane extends JScrollPane diff --git a/src/net/java/sip/communicator/impl/gui/customcontrols/SIPCommButton.java b/src/net/java/sip/communicator/impl/gui/customcontrols/SIPCommButton.java index dea87a1..87e21f7 100755 --- a/src/net/java/sip/communicator/impl/gui/customcontrols/SIPCommButton.java +++ b/src/net/java/sip/communicator/impl/gui/customcontrols/SIPCommButton.java @@ -14,7 +14,7 @@ import javax.swing.*; import org.jvnet.lafwidget.animation.*; import net.java.sip.communicator.impl.gui.utils.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The SIPCommButton is a very flexible JButton that allows diff --git a/src/net/java/sip/communicator/impl/gui/customcontrols/SIPCommToggleButton.java b/src/net/java/sip/communicator/impl/gui/customcontrols/SIPCommToggleButton.java index c2e0f0d..6cbd4e5 100644 --- a/src/net/java/sip/communicator/impl/gui/customcontrols/SIPCommToggleButton.java +++ b/src/net/java/sip/communicator/impl/gui/customcontrols/SIPCommToggleButton.java @@ -11,7 +11,7 @@ import java.awt.*; import javax.swing.*; import net.java.sip.communicator.impl.gui.utils.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The SIPCommToggleButton is a flexible JToggleButton that diff --git a/src/net/java/sip/communicator/impl/gui/customcontrols/TitlePanel.java b/src/net/java/sip/communicator/impl/gui/customcontrols/TitlePanel.java index 34fa4ef..758ee71 100644 --- a/src/net/java/sip/communicator/impl/gui/customcontrols/TitlePanel.java +++ b/src/net/java/sip/communicator/impl/gui/customcontrols/TitlePanel.java @@ -10,7 +10,7 @@ import java.awt.*; import javax.swing.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The TitlePanel is a decorated panel, that could be used for a header diff --git a/src/net/java/sip/communicator/impl/gui/customcontrols/TransparentBackground.java b/src/net/java/sip/communicator/impl/gui/customcontrols/TransparentBackground.java index 116c395..4d427f3 100644 --- a/src/net/java/sip/communicator/impl/gui/customcontrols/TransparentBackground.java +++ b/src/net/java/sip/communicator/impl/gui/customcontrols/TransparentBackground.java @@ -12,7 +12,7 @@ import java.awt.image.*; import javax.swing.*; import net.java.sip.communicator.impl.gui.utils.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The TransparentBackground is a JComponent, which is diff --git a/src/net/java/sip/communicator/impl/gui/customcontrols/wizard/Wizard.java b/src/net/java/sip/communicator/impl/gui/customcontrols/wizard/Wizard.java index 378a3cd..10ae623 100644 --- a/src/net/java/sip/communicator/impl/gui/customcontrols/wizard/Wizard.java +++ b/src/net/java/sip/communicator/impl/gui/customcontrols/wizard/Wizard.java @@ -16,7 +16,7 @@ import javax.swing.border.*; import net.java.sip.communicator.impl.gui.i18n.*; import net.java.sip.communicator.service.gui.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * This class implements a basic wizard dialog, where the programmer can insert diff --git a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommButtonUI.java b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommButtonUI.java index 898e778..382e673 100644 --- a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommButtonUI.java +++ b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommButtonUI.java @@ -14,7 +14,7 @@ import javax.swing.plaf.*; import javax.swing.plaf.metal.*; import net.java.sip.communicator.impl.gui.utils.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * SIPCommButtonUI implementation. diff --git a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommChatSelectorMenuUI.java b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommChatSelectorMenuUI.java index 1d1778d..22befe0 100644 --- a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommChatSelectorMenuUI.java +++ b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommChatSelectorMenuUI.java @@ -14,7 +14,7 @@ import javax.swing.plaf.basic.*; import net.java.sip.communicator.impl.gui.*; import net.java.sip.communicator.impl.gui.utils.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The SIPCommChatSelectorMenuUI implementation. diff --git a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommCheckBoxMenuItemUI.java b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommCheckBoxMenuItemUI.java index b763f5c..403d0e6 100644 --- a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommCheckBoxMenuItemUI.java +++ b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommCheckBoxMenuItemUI.java @@ -12,7 +12,7 @@ import javax.swing.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The SIPCommCheckBoxMenuItemUI implementation. diff --git a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommCheckBoxUI.java b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommCheckBoxUI.java index 0bbc3a4..909d36b 100644 --- a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommCheckBoxUI.java +++ b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommCheckBoxUI.java @@ -12,7 +12,7 @@ import javax.swing.*; import javax.swing.plaf.*; import javax.swing.plaf.metal.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * SIPCommCheckBoxUI implementation. diff --git a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommComboBoxEditor.java b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommComboBoxEditor.java index c31cf74..7b669e7 100644 --- a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommComboBoxEditor.java +++ b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommComboBoxEditor.java @@ -12,7 +12,7 @@ import java.awt.geom.*; import javax.swing.border.*; import javax.swing.plaf.metal.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The default editor for SIPCommunicator editable combo boxes. diff --git a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommComboBoxUI.java b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommComboBoxUI.java index 7a817fb..e6a5336 100644 --- a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommComboBoxUI.java +++ b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommComboBoxUI.java @@ -11,7 +11,7 @@ import javax.swing.*; import javax.swing.plaf.*; import javax.swing.plaf.metal.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * SIPCommComboBoxUI implementation. diff --git a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommEditorPaneUI.java b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommEditorPaneUI.java index cf55d0b..5d7992d 100644 --- a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommEditorPaneUI.java +++ b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommEditorPaneUI.java @@ -12,7 +12,7 @@ import javax.swing.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The SIPCommEditorPaneUI implementation. diff --git a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommLFUtils.java b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommLFUtils.java index e9aef89..8dcb715 100644 --- a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommLFUtils.java +++ b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommLFUtils.java @@ -9,7 +9,7 @@ package net.java.sip.communicator.impl.gui.lookandfeel; import java.awt.*; import net.java.sip.communicator.impl.gui.utils.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * diff --git a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommLabelUI.java b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommLabelUI.java index d785c86..9f12927 100644 --- a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommLabelUI.java +++ b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommLabelUI.java @@ -12,7 +12,7 @@ import javax.swing.*; import javax.swing.plaf.*; import javax.swing.plaf.metal.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The SIPCommLabelUI implementation. diff --git a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommListUI.java b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommListUI.java index dff8f08..f9734d2 100644 --- a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommListUI.java +++ b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommListUI.java @@ -12,7 +12,7 @@ import javax.swing.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * SIPCommListUI is an implementation of the BasicListUI. diff --git a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommMenuItemUI.java b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommMenuItemUI.java index 9e164e7..38d43f3 100644 --- a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommMenuItemUI.java +++ b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommMenuItemUI.java @@ -12,7 +12,7 @@ import javax.swing.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The SIPCommMenuItemUI implementation. diff --git a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommMenuUI.java b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommMenuUI.java index 086c6a7..9d92062 100644 --- a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommMenuUI.java +++ b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommMenuUI.java @@ -11,7 +11,7 @@ import javax.swing.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The SIPCommMenuUI implementation. diff --git a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommOptionPaneUI.java b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommOptionPaneUI.java index f252bbf..4882256 100644 --- a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommOptionPaneUI.java +++ b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommOptionPaneUI.java @@ -12,7 +12,7 @@ import javax.swing.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The SIPCommOptionPaneUI implementation. diff --git a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommPasswordFieldUI.java b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommPasswordFieldUI.java index 80bf980..848bba8 100644 --- a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommPasswordFieldUI.java +++ b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommPasswordFieldUI.java @@ -13,7 +13,7 @@ import javax.swing.plaf.*; import javax.swing.plaf.basic.*; import javax.swing.text.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The SIPCommPasswordFieldUI implementation. diff --git a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommPopupMenuUI.java b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommPopupMenuUI.java index 8369d95..6281207 100644 --- a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommPopupMenuUI.java +++ b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommPopupMenuUI.java @@ -12,7 +12,7 @@ import javax.swing.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * SIPCommPopupMenuUI implementation. diff --git a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommSelectorMenuUI.java b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommSelectorMenuUI.java index 31cf18f..b542546 100644 --- a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommSelectorMenuUI.java +++ b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommSelectorMenuUI.java @@ -13,7 +13,7 @@ import javax.swing.plaf.*; import javax.swing.plaf.basic.*; import net.java.sip.communicator.impl.gui.utils.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The SIPCommSelectorMenuUI implementation. diff --git a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommStatusMenuUI.java b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommStatusMenuUI.java index 172b21e..8f9a7b3 100644 --- a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommStatusMenuUI.java +++ b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommStatusMenuUI.java @@ -11,7 +11,7 @@ import javax.swing.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The SIPCommMenuUI implementation. diff --git a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommTextAreaUI.java b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommTextAreaUI.java index d886477..1b637bc 100644 --- a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommTextAreaUI.java +++ b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommTextAreaUI.java @@ -11,7 +11,7 @@ import javax.swing.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * SIPCommTextAreaUI implementation. 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 9904e8f..8c6721c 100644 --- a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommTextFieldUI.java +++ b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommTextFieldUI.java @@ -15,7 +15,7 @@ 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.swing.*; +import net.java.sip.communicator.util.swing.*; /** * SIPCommTextFieldUI implementation. diff --git a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommTextPaneUI.java b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommTextPaneUI.java index f7cfac8..e2cad56 100644 --- a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommTextPaneUI.java +++ b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommTextPaneUI.java @@ -12,7 +12,7 @@ import javax.swing.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * SIPCommTextPaneUI implementation. diff --git a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommToggleButtonUI.java b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommToggleButtonUI.java index bd33f59..cec5d03 100644 --- a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommToggleButtonUI.java +++ b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommToggleButtonUI.java @@ -13,7 +13,7 @@ import javax.swing.plaf.*; import javax.swing.plaf.basic.*; import net.java.sip.communicator.impl.gui.utils.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * SIPCommToggleButtonUI implementation. diff --git a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommToolBarUI.java b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommToolBarUI.java index 7234361..2c3ac7b 100644 --- a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommToolBarUI.java +++ b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommToolBarUI.java @@ -12,7 +12,7 @@ import javax.swing.*; import javax.swing.plaf.*; import javax.swing.plaf.metal.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * SIPCommToolBarUI implementation. diff --git a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommToolTipUI.java b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommToolTipUI.java index 387b1e0..1746041 100644 --- a/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommToolTipUI.java +++ b/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommToolTipUI.java @@ -12,7 +12,7 @@ import javax.swing.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * SIPCommToolTipUI implementation. diff --git a/src/net/java/sip/communicator/impl/gui/main/MainFrame.java b/src/net/java/sip/communicator/impl/gui/main/MainFrame.java index 48f15d1..13911e4 100755 --- a/src/net/java/sip/communicator/impl/gui/main/MainFrame.java +++ b/src/net/java/sip/communicator/impl/gui/main/MainFrame.java @@ -35,8 +35,8 @@ import net.java.sip.communicator.service.keybindings.*; import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.service.protocol.event.*; import net.java.sip.communicator.service.resources.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; import org.osgi.framework.*; diff --git a/src/net/java/sip/communicator/impl/gui/main/account/AccountRegSummaryPage.java b/src/net/java/sip/communicator/impl/gui/main/account/AccountRegSummaryPage.java index a03d410..2be2ecc 100644 --- a/src/net/java/sip/communicator/impl/gui/main/account/AccountRegSummaryPage.java +++ b/src/net/java/sip/communicator/impl/gui/main/account/AccountRegSummaryPage.java @@ -15,7 +15,7 @@ import net.java.sip.communicator.impl.gui.i18n.*; import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The AccountRegSummaryPage is the last page of the account diff --git a/src/net/java/sip/communicator/impl/gui/main/account/AccountsConfigurationForm.java b/src/net/java/sip/communicator/impl/gui/main/account/AccountsConfigurationForm.java index a6a0035..9316f25 100644 --- a/src/net/java/sip/communicator/impl/gui/main/account/AccountsConfigurationForm.java +++ b/src/net/java/sip/communicator/impl/gui/main/account/AccountsConfigurationForm.java @@ -21,8 +21,8 @@ import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.service.configuration.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; import org.osgi.framework.*; diff --git a/src/net/java/sip/communicator/impl/gui/main/account/NewAccountDialog.java b/src/net/java/sip/communicator/impl/gui/main/account/NewAccountDialog.java index f2b0128..10f4243 100644 --- a/src/net/java/sip/communicator/impl/gui/main/account/NewAccountDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/account/NewAccountDialog.java @@ -17,8 +17,8 @@ import net.java.sip.communicator.impl.gui.i18n.*; import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; import org.osgi.framework.*; diff --git a/src/net/java/sip/communicator/impl/gui/main/authorization/AuthorizationRequestedDialog.java b/src/net/java/sip/communicator/impl/gui/main/authorization/AuthorizationRequestedDialog.java index 7d0cb93..07720a3 100644 --- a/src/net/java/sip/communicator/impl/gui/main/authorization/AuthorizationRequestedDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/authorization/AuthorizationRequestedDialog.java @@ -16,7 +16,7 @@ import net.java.sip.communicator.impl.gui.lookandfeel.*; import net.java.sip.communicator.impl.gui.main.*; import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * @author Yana Stamcheva diff --git a/src/net/java/sip/communicator/impl/gui/main/authorization/AuthorizationResponseDialog.java b/src/net/java/sip/communicator/impl/gui/main/authorization/AuthorizationResponseDialog.java index 3c8b4a6..508a408 100644 --- a/src/net/java/sip/communicator/impl/gui/main/authorization/AuthorizationResponseDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/authorization/AuthorizationResponseDialog.java @@ -16,7 +16,7 @@ import net.java.sip.communicator.impl.gui.lookandfeel.*; import net.java.sip.communicator.impl.gui.main.*; import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; public class AuthorizationResponseDialog extends SIPCommDialog implements ActionListener { diff --git a/src/net/java/sip/communicator/impl/gui/main/authorization/RequestAuthorizationDialog.java b/src/net/java/sip/communicator/impl/gui/main/authorization/RequestAuthorizationDialog.java index 763cc28..1ed011d 100644 --- a/src/net/java/sip/communicator/impl/gui/main/authorization/RequestAuthorizationDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/authorization/RequestAuthorizationDialog.java @@ -15,7 +15,7 @@ import net.java.sip.communicator.impl.gui.i18n.*; import net.java.sip.communicator.impl.gui.main.*; import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The RequestAuthorisationDialog is a JDialog that is diff --git a/src/net/java/sip/communicator/impl/gui/main/call/AccountSelectorBox.java b/src/net/java/sip/communicator/impl/gui/main/call/AccountSelectorBox.java index f0e3375..3839364 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/AccountSelectorBox.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/AccountSelectorBox.java @@ -16,8 +16,8 @@ import net.java.sip.communicator.impl.gui.customcontrols.*; import net.java.sip.communicator.impl.gui.lookandfeel.*; import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; /** * The AccountSelectorBox is located in the main application window under the 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 91995b0..fc1e390 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 @@ -17,7 +17,7 @@ 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.service.protocol.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The dialog created for a given call. diff --git a/src/net/java/sip/communicator/impl/gui/main/call/CallPanel.java b/src/net/java/sip/communicator/impl/gui/main/call/CallPanel.java index 7c8ac83..7d964d8 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/CallPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/CallPanel.java @@ -16,7 +16,7 @@ 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.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The CallPanel is the panel containing call information. It's created 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 5b41132..b19648e 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 @@ -18,8 +18,8 @@ import net.java.sip.communicator.impl.gui.i18n.*; 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.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; /** * The CallParticipantPanel is the panel containing data for a call diff --git a/src/net/java/sip/communicator/impl/gui/main/call/MainCallPanel.java b/src/net/java/sip/communicator/impl/gui/main/call/MainCallPanel.java index f272b59..84c6571 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/MainCallPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/MainCallPanel.java @@ -24,8 +24,8 @@ import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.gui.Container; import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.service.protocol.event.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; import org.osgi.framework.*; 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 04bb687..7dc8d04 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 @@ -18,8 +18,8 @@ import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.service.contactlist.*; import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.service.protocol.event.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; /** * The dialog created when an incoming call is received. 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 d2a8c6a..9493c2a 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,7 +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.*; +import net.java.sip.communicator.util.swing.*; /** * Represents a Dialog which allows specifying the target contact diff --git a/src/net/java/sip/communicator/impl/gui/main/call/ZrtpPanel.java b/src/net/java/sip/communicator/impl/gui/main/call/ZrtpPanel.java index 7566c05..bda14d3 100755 --- a/src/net/java/sip/communicator/impl/gui/main/call/ZrtpPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/ZrtpPanel.java @@ -17,7 +17,7 @@ import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.service.protocol.event.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; public class ZrtpPanel extends TransparentPanel { /** diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/ChatContactRightButtonMenu.java b/src/net/java/sip/communicator/impl/gui/main/chat/ChatContactRightButtonMenu.java index 093fcb4..fbd1fdc 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chat/ChatContactRightButtonMenu.java +++ b/src/net/java/sip/communicator/impl/gui/main/chat/ChatContactRightButtonMenu.java @@ -16,8 +16,8 @@ import net.java.sip.communicator.impl.gui.i18n.*; import net.java.sip.communicator.impl.gui.main.chat.conference.*; import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; /** * The ChatContactRightButtonMenu is the menu, opened when user clicks diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java b/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java index 51a164b..892bf41 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java @@ -29,8 +29,8 @@ import net.java.sip.communicator.service.gui.event.*; import net.java.sip.communicator.service.msghistory.*; import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.service.protocol.event.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; /** * The ChatPanel is the panel, where users can write and send messages, diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/ChatSendPanel.java b/src/net/java/sip/communicator/impl/gui/main/chat/ChatSendPanel.java index 43b12c9..48fddc3 100755 --- a/src/net/java/sip/communicator/impl/gui/main/chat/ChatSendPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/chat/ChatSendPanel.java @@ -13,8 +13,8 @@ import javax.swing.*; 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.*; +import net.java.sip.communicator.util.swing.*; /** * The ChatSendPanel is the panel in the bottom of the chat. It diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/ChatTransportSelectorBox.java b/src/net/java/sip/communicator/impl/gui/main/chat/ChatTransportSelectorBox.java index 56114c4..303442c 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chat/ChatTransportSelectorBox.java +++ b/src/net/java/sip/communicator/impl/gui/main/chat/ChatTransportSelectorBox.java @@ -17,8 +17,8 @@ import net.java.sip.communicator.impl.gui.*; import net.java.sip.communicator.impl.gui.customcontrols.*; import net.java.sip.communicator.impl.gui.lookandfeel.*; import net.java.sip.communicator.impl.gui.utils.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; /** * The ChatTransportSelectorBox represents the send via menu in the diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindow.java b/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindow.java index aecf871..88c017a 100755 --- a/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindow.java +++ b/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindow.java @@ -24,9 +24,9 @@ import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.gui.Container; import net.java.sip.communicator.service.keybindings.*; -import net.java.sip.communicator.swing.*; -import net.java.sip.communicator.swing.event.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; +import net.java.sip.communicator.util.swing.event.*; import org.osgi.framework.*; 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 9dbece0..ef64326 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 @@ -23,8 +23,8 @@ import net.java.sip.communicator.impl.gui.main.chat.toolBars.*; import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.service.configuration.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; /** * The ChatWritePanel is the panel, where user writes her messages. 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 9815c64..6348c0d 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 @@ -14,8 +14,8 @@ import javax.swing.*; 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.*; +import net.java.sip.communicator.util.swing.*; /** * The dialog, shown when user click on the chat "Send" button, while the diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatInviteDialog.java b/src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatInviteDialog.java index 9c85c54..54f208e 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatInviteDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatInviteDialog.java @@ -21,7 +21,7 @@ import net.java.sip.communicator.impl.gui.main.contactlist.*; import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.service.contactlist.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The invite dialog is the one shown when the user clicks on the conference diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatRoomConfigurationWindow.java b/src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatRoomConfigurationWindow.java index e36d02a..edd5f06 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatRoomConfigurationWindow.java +++ b/src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatRoomConfigurationWindow.java @@ -16,7 +16,7 @@ import javax.swing.text.*; import net.java.sip.communicator.impl.gui.customcontrols.*; import net.java.sip.communicator.impl.gui.i18n.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The configuration window for the chat room. diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/conference/InvitationReceivedDialog.java b/src/net/java/sip/communicator/impl/gui/main/chat/conference/InvitationReceivedDialog.java index 320ac33..37795a5 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chat/conference/InvitationReceivedDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/chat/conference/InvitationReceivedDialog.java @@ -15,7 +15,7 @@ import net.java.sip.communicator.impl.gui.*; import net.java.sip.communicator.impl.gui.i18n.*; import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The dialog that pops up when a chat room invitation is received. diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/history/DatesListRenderer.java b/src/net/java/sip/communicator/impl/gui/main/chat/history/DatesListRenderer.java index 9f67906..6df7927 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chat/history/DatesListRenderer.java +++ b/src/net/java/sip/communicator/impl/gui/main/chat/history/DatesListRenderer.java @@ -12,8 +12,8 @@ import java.util.*; import javax.swing.*; import net.java.sip.communicator.impl.gui.utils.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; /** * The DatesListRenderer is a ListCellRenderer, specialized diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/history/HistoryWindow.java b/src/net/java/sip/communicator/impl/gui/main/chat/history/HistoryWindow.java index 3b2942e..3c125a6 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chat/history/HistoryWindow.java +++ b/src/net/java/sip/communicator/impl/gui/main/chat/history/HistoryWindow.java @@ -26,8 +26,8 @@ import net.java.sip.communicator.service.msghistory.*; import net.java.sip.communicator.service.msghistory.event.*; import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.service.protocol.event.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; /** * The HistoryWindow is the window, where user could view or search diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/history/SearchPanel.java b/src/net/java/sip/communicator/impl/gui/main/chat/history/SearchPanel.java index 63a82b0..df62720 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chat/history/SearchPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/chat/history/SearchPanel.java @@ -14,7 +14,7 @@ import javax.swing.event.*; 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.swing.*; /** * The SearchPanel is the panel, where user could make a search in 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 2527e8e..17b9359 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 @@ -17,8 +17,8 @@ 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.*; import net.java.sip.communicator.impl.gui.utils.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; import say.swing.*; diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/toolBars/ExtendedMainToolBar.java b/src/net/java/sip/communicator/impl/gui/main/chat/toolBars/ExtendedMainToolBar.java index 02cb753..8941e57 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chat/toolBars/ExtendedMainToolBar.java +++ b/src/net/java/sip/communicator/impl/gui/main/chat/toolBars/ExtendedMainToolBar.java @@ -23,8 +23,8 @@ import net.java.sip.communicator.service.contactlist.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.gui.Container; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; import org.osgi.framework.*; diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/toolBars/MainToolBar.java b/src/net/java/sip/communicator/impl/gui/main/chat/toolBars/MainToolBar.java index b37dd60..76f25ef 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chat/toolBars/MainToolBar.java +++ b/src/net/java/sip/communicator/impl/gui/main/chat/toolBars/MainToolBar.java @@ -22,8 +22,8 @@ import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.gui.Container; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; import org.osgi.framework.*; diff --git a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomListDialog.java b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomListDialog.java index d9e7945..5f4fd40 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomListDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomListDialog.java @@ -15,7 +15,7 @@ import net.java.sip.communicator.impl.gui.i18n.*; import net.java.sip.communicator.impl.gui.main.*; import net.java.sip.communicator.impl.gui.main.chatroomslist.createforms.*; import net.java.sip.communicator.impl.gui.main.chatroomslist.joinforms.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The dialog containing a list of all chat rooms ever joined by the user and diff --git a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomsListCellRenderer.java b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomsListCellRenderer.java index c6d2ecd..b6d064b 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomsListCellRenderer.java +++ b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomsListCellRenderer.java @@ -13,7 +13,7 @@ import javax.swing.*; import net.java.sip.communicator.impl.gui.main.chat.conference.*; import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The ChatRoomsListCellRenderer is the custom cell renderer used in the diff --git a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/createforms/ChatRoomNamePanel.java b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/createforms/ChatRoomNamePanel.java index 6e417c3..9fd0ac7 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/createforms/ChatRoomNamePanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/createforms/ChatRoomNamePanel.java @@ -15,7 +15,7 @@ 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.service.gui.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The ChatRoomNamePanel is the form, where we should enter the chat 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 e5a9412..957d48f 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 @@ -14,7 +14,7 @@ import javax.swing.*; import net.java.sip.communicator.impl.gui.*; import net.java.sip.communicator.impl.gui.i18n.*; import net.java.sip.communicator.impl.gui.main.chat.conference.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The CreateChatRoomDialog is the dialog containing the form for adding diff --git a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/createforms/SelectAccountPanel.java b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/createforms/SelectAccountPanel.java index cc0e579..d03b117 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/createforms/SelectAccountPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/createforms/SelectAccountPanel.java @@ -19,8 +19,8 @@ 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.service.protocol.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; /** * The SelectAccountPanel is where the user should select the account, diff --git a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/joinforms/ChatRoomAuthenticationWindow.java b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/joinforms/ChatRoomAuthenticationWindow.java index 7d003b3..17e2b9a 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/joinforms/ChatRoomAuthenticationWindow.java +++ b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/joinforms/ChatRoomAuthenticationWindow.java @@ -15,7 +15,7 @@ import net.java.sip.communicator.impl.gui.*; import net.java.sip.communicator.impl.gui.i18n.*; import net.java.sip.communicator.impl.gui.main.chat.conference.*; import net.java.sip.communicator.impl.gui.utils.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The ChatRoomAuthenticationWindow is the the authentication window diff --git a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/joinforms/ChatRoomNamePanel.java b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/joinforms/ChatRoomNamePanel.java index d0dafb9..fd6e7e4 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/joinforms/ChatRoomNamePanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/joinforms/ChatRoomNamePanel.java @@ -14,7 +14,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.utils.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The ChatRoomNamePanel is the form, where we should enter the chat diff --git a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/joinforms/JoinChatRoomDialog.java b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/joinforms/JoinChatRoomDialog.java index 063994a..721a054 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/joinforms/JoinChatRoomDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/joinforms/JoinChatRoomDialog.java @@ -15,8 +15,8 @@ import net.java.sip.communicator.impl.gui.*; import net.java.sip.communicator.impl.gui.i18n.*; import net.java.sip.communicator.impl.gui.main.chat.conference.*; import net.java.sip.communicator.impl.gui.utils.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; /** * The JoinChatRoomDialog is the dialog containing the form for joining diff --git a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/joinforms/SearchChatRoomPanel.java b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/joinforms/SearchChatRoomPanel.java index 25fcb73..1010fbb 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/joinforms/SearchChatRoomPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/joinforms/SearchChatRoomPanel.java @@ -18,8 +18,8 @@ import net.java.sip.communicator.impl.gui.*; import net.java.sip.communicator.impl.gui.i18n.*; import net.java.sip.communicator.impl.gui.main.chat.conference.*; import net.java.sip.communicator.service.gui.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; public class SearchChatRoomPanel extends TransparentPanel diff --git a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/joinforms/SelectAccountPanel.java b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/joinforms/SelectAccountPanel.java index 89d3098..f612a73 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/joinforms/SelectAccountPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/joinforms/SelectAccountPanel.java @@ -17,8 +17,8 @@ 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.impl.gui.utils.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; /** * The SelectAccountPanel is where the user should select the account, diff --git a/src/net/java/sip/communicator/impl/gui/main/configforms/ConfigurationFrame.java b/src/net/java/sip/communicator/impl/gui/main/configforms/ConfigurationFrame.java index 307933b..9aff530 100644 --- a/src/net/java/sip/communicator/impl/gui/main/configforms/ConfigurationFrame.java +++ b/src/net/java/sip/communicator/impl/gui/main/configforms/ConfigurationFrame.java @@ -16,8 +16,8 @@ import net.java.sip.communicator.impl.gui.main.*; import net.java.sip.communicator.impl.gui.main.account.*; import net.java.sip.communicator.impl.gui.utils.Constants; import net.java.sip.communicator.service.gui.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; import org.osgi.framework.*; diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/ActionMenuGlassPane.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/ActionMenuGlassPane.java index 749466b..c5c75bc 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/ActionMenuGlassPane.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/ActionMenuGlassPane.java @@ -12,7 +12,7 @@ import javax.swing.*; import net.java.sip.communicator.impl.gui.*; import net.java.sip.communicator.impl.gui.main.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; public class ActionMenuGlassPane extends TransparentPanel 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 78e6c33..03a2715 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 @@ -17,8 +17,8 @@ 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.*; import net.java.sip.communicator.service.gui.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; import org.jvnet.lafwidget.animation.*; import org.osgi.framework.*; diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactInfoDialog.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactInfoDialog.java index f9ee824..8395e27 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactInfoDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactInfoDialog.java @@ -13,7 +13,7 @@ import javax.swing.*; import net.java.sip.communicator.impl.gui.customcontrols.*; import net.java.sip.communicator.service.contactlist.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The ContactInfoPanel is a popup dialog containing the contact diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListCellRenderer.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListCellRenderer.java index 1f4c051..ce60649 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListCellRenderer.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListCellRenderer.java @@ -14,8 +14,8 @@ import net.java.sip.communicator.impl.gui.*; import net.java.sip.communicator.impl.gui.i18n.*; import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.service.contactlist.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; /** * The ContactListCellRenderer is the custom cell renderer used in the diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactRightButtonMenu.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactRightButtonMenu.java index 62b0403..a50f32b 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactRightButtonMenu.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactRightButtonMenu.java @@ -27,8 +27,8 @@ import net.java.sip.communicator.service.contactlist.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.gui.Container; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; import org.osgi.framework.*; diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/GroupRightButtonMenu.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/GroupRightButtonMenu.java index ea0533c..1dcb1a6 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/GroupRightButtonMenu.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/GroupRightButtonMenu.java @@ -28,8 +28,8 @@ import net.java.sip.communicator.service.contactlist.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.gui.Container; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; /** * The GroupRightButtonMenu is the menu, opened when user clicks with the diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/MoveSubcontactMessageDialog.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/MoveSubcontactMessageDialog.java index 1d354ff..e30e473 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/MoveSubcontactMessageDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/MoveSubcontactMessageDialog.java @@ -15,7 +15,7 @@ import net.java.sip.communicator.impl.gui.customcontrols.*; import net.java.sip.communicator.impl.gui.i18n.*; import net.java.sip.communicator.impl.gui.main.*; import net.java.sip.communicator.impl.gui.utils.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The MoveSubcontactMessageDialog is the the dialog shown when user diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/RenameContactDialog.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/RenameContactDialog.java index 626d353..0325b33 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/RenameContactDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/RenameContactDialog.java @@ -14,7 +14,7 @@ import javax.swing.*; import net.java.sip.communicator.impl.gui.i18n.*; import net.java.sip.communicator.impl.gui.main.*; import net.java.sip.communicator.service.contactlist.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The RenameContactDialog is the dialog containing the form for diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/RenameContactPanel.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/RenameContactPanel.java index 256bc01..c63670d 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/RenameContactPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/RenameContactPanel.java @@ -12,7 +12,7 @@ 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.swing.*; /** * The RenameContactPanel is where the user could change the name of a diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/RenameGroupDialog.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/RenameGroupDialog.java index 6adc803..35f8a39 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/RenameGroupDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/RenameGroupDialog.java @@ -14,7 +14,7 @@ import javax.swing.*; import net.java.sip.communicator.impl.gui.i18n.*; import net.java.sip.communicator.impl.gui.main.*; import net.java.sip.communicator.service.contactlist.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The RenameGroupDialog is the dialog containing the form for diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/RenameGroupPanel.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/RenameGroupPanel.java index 99b72db..3efaf51 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/RenameGroupPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/RenameGroupPanel.java @@ -11,7 +11,7 @@ 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.swing.*; /** * The RenameGroupPanel is where the user could change the name of a diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/AddContactDialog.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/AddContactDialog.java index 32d28d4..3422e17 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/AddContactDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/AddContactDialog.java @@ -16,8 +16,8 @@ import net.java.sip.communicator.impl.gui.main.*; import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.service.contactlist.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; /** * The AddContactDialog is the dialog containing the form for adding diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/AddContactPanel.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/AddContactPanel.java index 3cf2813..c4d9e0e 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/AddContactPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/AddContactPanel.java @@ -14,7 +14,7 @@ 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.service.gui.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The AddContactPanel is the form for adding a contact. It's used diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/SelectAccountPanel.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/SelectAccountPanel.java index 7c426bf..9ca207a 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/SelectAccountPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/SelectAccountPanel.java @@ -22,8 +22,8 @@ import net.java.sip.communicator.impl.gui.main.account.*; import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.impl.gui.utils.Constants; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; import org.osgi.framework.*; diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/SelectGroupPanel.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/SelectGroupPanel.java index 36040cc..d2cbc62 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/SelectGroupPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/SelectGroupPanel.java @@ -16,7 +16,7 @@ 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.service.contactlist.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The SelectGroupPanel is where the user should select the group, diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/addgroup/CreateGroupDialog.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/addgroup/CreateGroupDialog.java index 71dc714..c617d41 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/addgroup/CreateGroupDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/addgroup/CreateGroupDialog.java @@ -14,8 +14,8 @@ import javax.swing.*; import net.java.sip.communicator.impl.gui.i18n.*; import net.java.sip.communicator.impl.gui.main.*; import net.java.sip.communicator.service.contactlist.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; /** * The CreateGroupDialog is the dialog containing the form for creating diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/addgroup/CreateGroupPanel.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/addgroup/CreateGroupPanel.java index d607e06..ebcc797 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/addgroup/CreateGroupPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/addgroup/CreateGroupPanel.java @@ -13,7 +13,7 @@ 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.swing.*; /** * The CreateGroupPanel is the form for creating a group. diff --git a/src/net/java/sip/communicator/impl/gui/main/login/AuthenticationWindow.java b/src/net/java/sip/communicator/impl/gui/main/login/AuthenticationWindow.java index 21bd146..f354f54 100644 --- a/src/net/java/sip/communicator/impl/gui/main/login/AuthenticationWindow.java +++ b/src/net/java/sip/communicator/impl/gui/main/login/AuthenticationWindow.java @@ -16,7 +16,7 @@ import net.java.sip.communicator.impl.gui.main.*; import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The LoginWindow is the window where the user should type his diff --git a/src/net/java/sip/communicator/impl/gui/main/menus/ExtendedQuickMenu.java b/src/net/java/sip/communicator/impl/gui/main/menus/ExtendedQuickMenu.java index 18f4120..a2e2349 100644 --- a/src/net/java/sip/communicator/impl/gui/main/menus/ExtendedQuickMenu.java +++ b/src/net/java/sip/communicator/impl/gui/main/menus/ExtendedQuickMenu.java @@ -27,8 +27,8 @@ import net.java.sip.communicator.service.contactlist.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.gui.Container; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; import org.osgi.framework.*; diff --git a/src/net/java/sip/communicator/impl/gui/main/presence/AccountStatusPanel.java b/src/net/java/sip/communicator/impl/gui/main/presence/AccountStatusPanel.java index 3e8382e..61268d7 100644 --- a/src/net/java/sip/communicator/impl/gui/main/presence/AccountStatusPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/presence/AccountStatusPanel.java @@ -17,7 +17,7 @@ import net.java.sip.communicator.impl.gui.main.*; 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.swing.*; +import net.java.sip.communicator.util.swing.*; public class AccountStatusPanel extends TransparentPanel diff --git a/src/net/java/sip/communicator/impl/gui/main/presence/GlobalStatusSelectorBox.java b/src/net/java/sip/communicator/impl/gui/main/presence/GlobalStatusSelectorBox.java index eccce7d..7e1361a 100644 --- a/src/net/java/sip/communicator/impl/gui/main/presence/GlobalStatusSelectorBox.java +++ b/src/net/java/sip/communicator/impl/gui/main/presence/GlobalStatusSelectorBox.java @@ -22,8 +22,8 @@ import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.service.configuration.*; import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.service.systray.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; /** * The GlobalStatusSelectorBox is a global status selector box, which diff --git a/src/net/java/sip/communicator/impl/gui/main/presence/message/NewStatusMessageDialog.java b/src/net/java/sip/communicator/impl/gui/main/presence/message/NewStatusMessageDialog.java index 20f291d..ded60ea 100644 --- a/src/net/java/sip/communicator/impl/gui/main/presence/message/NewStatusMessageDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/presence/message/NewStatusMessageDialog.java @@ -14,8 +14,8 @@ import javax.swing.*; import net.java.sip.communicator.impl.gui.i18n.*; import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; /** * The NewStatusMessageDialog is the dialog containing the form for diff --git a/src/net/java/sip/communicator/impl/gui/swing.ui.manifest.mf b/src/net/java/sip/communicator/impl/gui/swing.ui.manifest.mf index 0187000..60dcc82 100644 --- a/src/net/java/sip/communicator/impl/gui/swing.ui.manifest.mf +++ b/src/net/java/sip/communicator/impl/gui/swing.ui.manifest.mf @@ -4,26 +4,30 @@ Bundle-Description: An implementation of the UI service. Bundle-Vendor: sip-communicator.org Bundle-Version: 0.0.1 Import-Package: org.osgi.framework, - net.java.sip.communicator.util, + net.java.sip.communicator.service.audionotifier, + net.java.sip.communicator.service.browserlauncher, + net.java.sip.communicator.service.callhistory, + net.java.sip.communicator.service.callhistory.event, net.java.sip.communicator.service.configuration, net.java.sip.communicator.service.configuration.event, - net.java.sip.communicator.service.protocol, - net.java.sip.communicator.service.protocol.icqconstants, - net.java.sip.communicator.service.protocol.event, + net.java.sip.communicator.service.contacteventhandler, net.java.sip.communicator.service.contactlist, net.java.sip.communicator.service.contactlist.event, net.java.sip.communicator.service.gui, net.java.sip.communicator.service.gui.event, + net.java.sip.communicator.service.keybindings, net.java.sip.communicator.service.msghistory, net.java.sip.communicator.service.msghistory.event, - net.java.sip.communicator.service.callhistory, - net.java.sip.communicator.service.callhistory.event, - net.java.sip.communicator.service.browserlauncher, net.java.sip.communicator.service.notification, - net.java.sip.communicator.service.systray, - net.java.sip.communicator.service.contacteventhandler, - net.java.sip.communicator.service.keybindings, + net.java.sip.communicator.service.protocol, + net.java.sip.communicator.service.protocol.icqconstants, + net.java.sip.communicator.service.protocol.event, net.java.sip.communicator.service.resources, + net.java.sip.communicator.service.systray, + net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, + net.java.sip.communicator.util.swing.event, + net.java.sip.communicator.util.swing.plaf, javax.swing, javax.swing.event, javax.swing.table, @@ -38,10 +42,6 @@ Import-Package: org.osgi.framework, javax.swing.tree, javax.swing.undo, javax.swing.border, - net.java.sip.communicator.service.audionotifier, - net.java.sip.communicator.swing, - net.java.sip.communicator.swing.event, - net.java.sip.communicator.swing.plaf, org.jdesktop.jdic.desktop, say.swing, com.apple.eawt diff --git a/src/net/java/sip/communicator/impl/media/MediaConfigurationPanel.java b/src/net/java/sip/communicator/impl/media/MediaConfigurationPanel.java index b1f3746..e6fbe0a 100644 --- a/src/net/java/sip/communicator/impl/media/MediaConfigurationPanel.java +++ b/src/net/java/sip/communicator/impl/media/MediaConfigurationPanel.java @@ -17,8 +17,8 @@ import javax.swing.table.*; import net.java.sip.communicator.service.media.*; import net.java.sip.communicator.service.resources.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; import org.osgi.framework.*; diff --git a/src/net/java/sip/communicator/impl/media/media.manifest.mf b/src/net/java/sip/communicator/impl/media/media.manifest.mf index 69ab1b3..aae28d2 100644 --- a/src/net/java/sip/communicator/impl/media/media.manifest.mf +++ b/src/net/java/sip/communicator/impl/media/media.manifest.mf @@ -24,8 +24,8 @@ Import-Package: org.osgi.framework, net.java.sip.communicator.service.protocol, net.java.sip.communicator.service.protocol.event, net.java.sip.communicator.service.resources, - net.java.sip.communicator.swing, net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, quicktime, quicktime.std.sg, quicktime.qd, 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 e48bc5d..7fcd1b1 100644 --- a/src/net/java/sip/communicator/impl/protocol/ssh/SSHContactInfo.java +++ b/src/net/java/sip/communicator/impl/protocol/ssh/SSHContactInfo.java @@ -19,7 +19,7 @@ import javax.swing.*; import javax.swing.text.*; import net.java.sip.communicator.service.gui.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * 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 2701876..d36636b 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 @@ -16,5 +16,5 @@ Import-Package: org.osgi.framework, net.java.sip.communicator.service.protocol, net.java.sip.communicator.service.protocol.event, net.java.sip.communicator.service.resources, - net.java.sip.communicator.swing, - net.java.sip.communicator.util + net.java.sip.communicator.util, + net.java.sip.communicator.util.swing diff --git a/src/net/java/sip/communicator/impl/systray/NewStatusMessageDialog.java b/src/net/java/sip/communicator/impl/systray/NewStatusMessageDialog.java index db3c35e..bc0ca71 100644 --- a/src/net/java/sip/communicator/impl/systray/NewStatusMessageDialog.java +++ b/src/net/java/sip/communicator/impl/systray/NewStatusMessageDialog.java @@ -12,8 +12,8 @@ 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.*; +import net.java.sip.communicator.util.swing.*; /** * The NewStatusMessageDialog is the dialog containing the form for 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 893d5bd..aa4b520 100644 --- a/src/net/java/sip/communicator/impl/systray/systray.manifest.mf +++ b/src/net/java/sip/communicator/impl/systray/systray.manifest.mf @@ -9,16 +9,16 @@ Import-Package: org.osgi.framework, org.jdesktop.jdic.tray, 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, - net.java.sip.communicator.service.protocol.event, net.java.sip.communicator.service.gui, net.java.sip.communicator.service.gui.event, + net.java.sip.communicator.service.protocol, + net.java.sip.communicator.service.protocol.event, + net.java.sip.communicator.service.resources, net.java.sip.communicator.service.systray, net.java.sip.communicator.service.systray.event, + net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, javax.swing, javax.swing.event, javax.swing.table, diff --git a/src/net/java/sip/communicator/plugin/accountinfo/AccountDetailsPanel.java b/src/net/java/sip/communicator/plugin/accountinfo/AccountDetailsPanel.java index 7ea8eec..21e2bf4 100644 --- a/src/net/java/sip/communicator/plugin/accountinfo/AccountDetailsPanel.java +++ b/src/net/java/sip/communicator/plugin/accountinfo/AccountDetailsPanel.java @@ -18,8 +18,8 @@ import javax.swing.filechooser.FileFilter; import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.service.protocol.ServerStoredDetails.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; /** * The right side panel of AccountDetailsDialog. Shows one tab of a summary of diff --git a/src/net/java/sip/communicator/plugin/accountinfo/AccountInfoForm.java b/src/net/java/sip/communicator/plugin/accountinfo/AccountInfoForm.java index fb382e0..a0e5241 100644 --- a/src/net/java/sip/communicator/plugin/accountinfo/AccountInfoForm.java +++ b/src/net/java/sip/communicator/plugin/accountinfo/AccountInfoForm.java @@ -13,7 +13,7 @@ import javax.swing.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.service.protocol.event.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; import org.osgi.framework.*; diff --git a/src/net/java/sip/communicator/plugin/accountinfo/accountinfo.manifest.mf b/src/net/java/sip/communicator/plugin/accountinfo/accountinfo.manifest.mf index 4ec1392..f1ae175 100644 --- a/src/net/java/sip/communicator/plugin/accountinfo/accountinfo.manifest.mf +++ b/src/net/java/sip/communicator/plugin/accountinfo/accountinfo.manifest.mf @@ -4,16 +4,16 @@ Bundle-Description: A plug-in that can set cross protocol account info. 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.browserlauncher, net.java.sip.communicator.service.contactlist, net.java.sip.communicator.service.contactlist.event, net.java.sip.communicator.service.gui, net.java.sip.communicator.service.gui.event, net.java.sip.communicator.service.protocol, net.java.sip.communicator.service.protocol.event, - net.java.sip.communicator.service.browserlauncher, + net.java.sip.communicator.service.resources, + net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, javax.swing, javax.swing.event, javax.swing.table, diff --git a/src/net/java/sip/communicator/plugin/aimaccregwizz/FirstWizardPage.java b/src/net/java/sip/communicator/plugin/aimaccregwizz/FirstWizardPage.java index aac686b..bb56dfb 100644 --- a/src/net/java/sip/communicator/plugin/aimaccregwizz/FirstWizardPage.java +++ b/src/net/java/sip/communicator/plugin/aimaccregwizz/FirstWizardPage.java @@ -14,7 +14,7 @@ import javax.swing.event.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The FirstWizardPage is the page, where user could enter the uin diff --git a/src/net/java/sip/communicator/plugin/aimaccregwizz/aimaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/aimaccregwizz/aimaccregwizz.manifest.mf index 22fd0b9..41da269 100644 --- a/src/net/java/sip/communicator/plugin/aimaccregwizz/aimaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/aimaccregwizz/aimaccregwizz.manifest.mf @@ -4,20 +4,20 @@ Bundle-Description: AIM account registration wizard. 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.browserlauncher, net.java.sip.communicator.service.configuration, net.java.sip.communicator.service.configuration.event, - net.java.sip.communicator.service.protocol, - net.java.sip.communicator.service.protocol.icqconstants, - net.java.sip.communicator.service.protocol.aimconstants, - net.java.sip.communicator.service.protocol.event, net.java.sip.communicator.service.contactlist, net.java.sip.communicator.service.contactlist.event, net.java.sip.communicator.service.gui, net.java.sip.communicator.service.gui.event, - net.java.sip.communicator.service.browserlauncher, + net.java.sip.communicator.service.protocol, + net.java.sip.communicator.service.protocol.aimconstants, + net.java.sip.communicator.service.protocol.event, + net.java.sip.communicator.service.protocol.icqconstants, + net.java.sip.communicator.service.resources, + net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, javax.swing, javax.swing.event, javax.swing.table, diff --git a/src/net/java/sip/communicator/plugin/autoaway/AutoAwayConfigForm.java b/src/net/java/sip/communicator/plugin/autoaway/AutoAwayConfigForm.java index f27d303..43eddd8 100644 --- a/src/net/java/sip/communicator/plugin/autoaway/AutoAwayConfigForm.java +++ b/src/net/java/sip/communicator/plugin/autoaway/AutoAwayConfigForm.java @@ -15,7 +15,7 @@ import javax.swing.event.*; import net.java.sip.communicator.service.configuration.*; import net.java.sip.communicator.service.gui.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The ConfigurationForm that would be added in the user interface diff --git a/src/net/java/sip/communicator/plugin/autoaway/autoaway.manifest.mf b/src/net/java/sip/communicator/plugin/autoaway/autoaway.manifest.mf index f049a76..feed9c0 100644 --- a/src/net/java/sip/communicator/plugin/autoaway/autoaway.manifest.mf +++ b/src/net/java/sip/communicator/plugin/autoaway/autoaway.manifest.mf @@ -4,12 +4,12 @@ Bundle-Description: A bundle that would automatically put your protocols in the Bundle-Vendor: sip-communicator.org Bundle-Version: 0.0.2 Import-Package: org.osgi.framework, - net.java.sip.communicator.util, - net.java.sip.communicator.service.resources, - net.java.sip.communicator.service.protocol, net.java.sip.communicator.service.configuration, net.java.sip.communicator.service.gui, - net.java.sip.communicator.swing, + net.java.sip.communicator.service.protocol, + net.java.sip.communicator.service.resources, + net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, javax.swing, javax.swing.event, javax.swing.border, diff --git a/src/net/java/sip/communicator/plugin/contactinfo/ContactInfoContactPanel.java b/src/net/java/sip/communicator/plugin/contactinfo/ContactInfoContactPanel.java index a87b540..7a1c5ae 100644 --- a/src/net/java/sip/communicator/plugin/contactinfo/ContactInfoContactPanel.java +++ b/src/net/java/sip/communicator/plugin/contactinfo/ContactInfoContactPanel.java @@ -12,7 +12,7 @@ import javax.swing.*; import javax.swing.event.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The left side panel of ContactInfoDialog. Display all associated subcontacts diff --git a/src/net/java/sip/communicator/plugin/contactinfo/ContactInfoDetailsPanel.java b/src/net/java/sip/communicator/plugin/contactinfo/ContactInfoDetailsPanel.java index 48e680a..ae23f64 100644 --- a/src/net/java/sip/communicator/plugin/contactinfo/ContactInfoDetailsPanel.java +++ b/src/net/java/sip/communicator/plugin/contactinfo/ContactInfoDetailsPanel.java @@ -15,8 +15,8 @@ import javax.swing.event.*; import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.service.protocol.ServerStoredDetails.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; /** * The right side panel of ContactInfoDialog. Shows one tab of a summary of diff --git a/src/net/java/sip/communicator/plugin/contactinfo/ContactInfoDialog.java b/src/net/java/sip/communicator/plugin/contactinfo/ContactInfoDialog.java index e34920c..b96f65a 100644 --- a/src/net/java/sip/communicator/plugin/contactinfo/ContactInfoDialog.java +++ b/src/net/java/sip/communicator/plugin/contactinfo/ContactInfoDialog.java @@ -11,7 +11,7 @@ import java.util.*; import net.java.sip.communicator.service.contactlist.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * A GUI plug-in for SIP Communicator that will allow cross protocol contact diff --git a/src/net/java/sip/communicator/plugin/contactinfo/contactinfo.manifest.mf b/src/net/java/sip/communicator/plugin/contactinfo/contactinfo.manifest.mf index 70a896d..e3a4bfc 100644 --- a/src/net/java/sip/communicator/plugin/contactinfo/contactinfo.manifest.mf +++ b/src/net/java/sip/communicator/plugin/contactinfo/contactinfo.manifest.mf @@ -4,15 +4,15 @@ Bundle-Description: A plug-in that can show cross protocol user info. 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.browserlauncher, net.java.sip.communicator.service.contactlist, net.java.sip.communicator.service.contactlist.event, net.java.sip.communicator.service.gui, net.java.sip.communicator.service.gui.event, net.java.sip.communicator.service.protocol, - net.java.sip.communicator.service.browserlauncher, + net.java.sip.communicator.service.resources, + net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, javax.swing, javax.swing.event, javax.swing.table, diff --git a/src/net/java/sip/communicator/plugin/dictaccregwizz/FirstWizardPage.java b/src/net/java/sip/communicator/plugin/dictaccregwizz/FirstWizardPage.java index 5c0f059..83d1f1d 100644 --- a/src/net/java/sip/communicator/plugin/dictaccregwizz/FirstWizardPage.java +++ b/src/net/java/sip/communicator/plugin/dictaccregwizz/FirstWizardPage.java @@ -16,7 +16,7 @@ import javax.swing.event.*; import net.java.dict4j.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The FirstWizardPage is the page, where user could enter the host, diff --git a/src/net/java/sip/communicator/plugin/dictaccregwizz/ProgressPanel.java b/src/net/java/sip/communicator/plugin/dictaccregwizz/ProgressPanel.java index 976da00..6a788cb 100755 --- a/src/net/java/sip/communicator/plugin/dictaccregwizz/ProgressPanel.java +++ b/src/net/java/sip/communicator/plugin/dictaccregwizz/ProgressPanel.java @@ -10,7 +10,7 @@ import java.awt.event.*; import javax.swing.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * Panel showing the current status of the search of the strategies diff --git a/src/net/java/sip/communicator/plugin/dictaccregwizz/dictaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/dictaccregwizz/dictaccregwizz.manifest.mf index 9ed3613..0166229 100644 --- a/src/net/java/sip/communicator/plugin/dictaccregwizz/dictaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/dictaccregwizz/dictaccregwizz.manifest.mf @@ -5,19 +5,19 @@ Bundle-Vendor: sip-communicator.org Bundle-Version: 0.0.1 Import-Package: org.osgi.framework, net.java.dict4j, - net.java.sip.communicator.util, - net.java.sip.communicator.swing, - net.java.sip.communicator.service.resources, + net.java.sip.communicator.service.browserlauncher, net.java.sip.communicator.service.configuration, net.java.sip.communicator.service.configuration.event, - net.java.sip.communicator.service.protocol, - net.java.sip.communicator.service.protocol.icqconstants, - net.java.sip.communicator.service.protocol.event, net.java.sip.communicator.service.contactlist, net.java.sip.communicator.service.contactlist.event, net.java.sip.communicator.service.gui, net.java.sip.communicator.service.gui.event, - net.java.sip.communicator.service.browserlauncher, + net.java.sip.communicator.service.protocol, + net.java.sip.communicator.service.protocol.event, + net.java.sip.communicator.service.protocol.icqconstants, + net.java.sip.communicator.service.resources, + net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, javax.swing, javax.swing.event, javax.swing.table, diff --git a/src/net/java/sip/communicator/plugin/exampleplugin/PluginDialog.java b/src/net/java/sip/communicator/plugin/exampleplugin/PluginDialog.java index b162637..fd34ccd 100644 --- a/src/net/java/sip/communicator/plugin/exampleplugin/PluginDialog.java +++ b/src/net/java/sip/communicator/plugin/exampleplugin/PluginDialog.java @@ -11,7 +11,7 @@ import java.awt.*; import javax.swing.*; import net.java.sip.communicator.service.contactlist.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * A plugin dialog that is open through the right button menu over a contact and 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 6d48c82..26d4992 100644 --- a/src/net/java/sip/communicator/plugin/exampleplugin/exampleplugin.manifest.mf +++ b/src/net/java/sip/communicator/plugin/exampleplugin/exampleplugin.manifest.mf @@ -4,12 +4,12 @@ Bundle-Description: An example showing how to make plugins for the ui. 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, net.java.sip.communicator.service.gui.event, + net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, javax.swing, javax.swing.event, javax.swing.table, diff --git a/src/net/java/sip/communicator/plugin/extendedcallhistorysearch/ExtendedCallHistorySearchDialog.java b/src/net/java/sip/communicator/plugin/extendedcallhistorysearch/ExtendedCallHistorySearchDialog.java index 2a0e05d..3f9f60b 100644 --- a/src/net/java/sip/communicator/plugin/extendedcallhistorysearch/ExtendedCallHistorySearchDialog.java +++ b/src/net/java/sip/communicator/plugin/extendedcallhistorysearch/ExtendedCallHistorySearchDialog.java @@ -13,8 +13,8 @@ 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 net.java.sip.communicator.util.swing.*; import com.toedter.calendar.*; 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 bcaf123..9335d32 100644 --- a/src/net/java/sip/communicator/plugin/extendedcallhistorysearch/extendedcallhistorysearch.manifest.mf +++ b/src/net/java/sip/communicator/plugin/extendedcallhistorysearch/extendedcallhistorysearch.manifest.mf @@ -4,15 +4,15 @@ Bundle-Description: An Extended Call History Search 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.callhistory, + net.java.sip.communicator.service.configuration, net.java.sip.communicator.service.contactlist, net.java.sip.communicator.service.contactlist.event, net.java.sip.communicator.service.gui, net.java.sip.communicator.service.gui.event, - net.java.sip.communicator.service.callhistory, - net.java.sip.communicator.service.configuration, + net.java.sip.communicator.service.resources, + net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, javax.swing, javax.swing.event, javax.swing.table, diff --git a/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigurationForm.java b/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigurationForm.java index 98a444e..ed57a2e 100644 --- a/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigurationForm.java +++ b/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigurationForm.java @@ -14,8 +14,8 @@ import javax.swing.*; import javax.swing.event.*; import net.java.sip.communicator.service.gui.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; import com.izforge.izpack.util.os.*; diff --git a/src/net/java/sip/communicator/plugin/generalconfig/generalconfig.manifest.mf b/src/net/java/sip/communicator/plugin/generalconfig/generalconfig.manifest.mf index 2ade50b..be3709a 100644 --- a/src/net/java/sip/communicator/plugin/generalconfig/generalconfig.manifest.mf +++ b/src/net/java/sip/communicator/plugin/generalconfig/generalconfig.manifest.mf @@ -4,14 +4,14 @@ Bundle-Description: The plugin offering general configuration page. 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.configuration, net.java.sip.communicator.service.contactlist, net.java.sip.communicator.service.contactlist.event, net.java.sip.communicator.service.gui, net.java.sip.communicator.service.gui.event, - net.java.sip.communicator.service.configuration, + net.java.sip.communicator.service.resources, + net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, javax.swing, javax.swing.event, javax.swing.table, diff --git a/src/net/java/sip/communicator/plugin/gibberishaccregwizz/FirstWizardPage.java b/src/net/java/sip/communicator/plugin/gibberishaccregwizz/FirstWizardPage.java index e2cacc0..945574b 100644 --- a/src/net/java/sip/communicator/plugin/gibberishaccregwizz/FirstWizardPage.java +++ b/src/net/java/sip/communicator/plugin/gibberishaccregwizz/FirstWizardPage.java @@ -14,7 +14,7 @@ import javax.swing.event.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The FirstWizardPage is the page, where user could enter the user ID diff --git a/src/net/java/sip/communicator/plugin/gibberishaccregwizz/gibberishaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/gibberishaccregwizz/gibberishaccregwizz.manifest.mf index 965dc29..4ebcd1f 100644 --- a/src/net/java/sip/communicator/plugin/gibberishaccregwizz/gibberishaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/gibberishaccregwizz/gibberishaccregwizz.manifest.mf @@ -4,18 +4,18 @@ Bundle-Description: Gibberish account registration wizard. 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.browserlauncher, net.java.sip.communicator.service.configuration, net.java.sip.communicator.service.configuration.event, - net.java.sip.communicator.service.protocol, - net.java.sip.communicator.service.protocol.event, net.java.sip.communicator.service.contactlist, net.java.sip.communicator.service.contactlist.event, net.java.sip.communicator.service.gui, net.java.sip.communicator.service.gui.event, - net.java.sip.communicator.service.browserlauncher, + net.java.sip.communicator.service.protocol, + net.java.sip.communicator.service.protocol.event, + net.java.sip.communicator.service.resources, + net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, javax.swing, javax.swing.event, javax.swing.table, diff --git a/src/net/java/sip/communicator/plugin/googletalkaccregwizz/FirstWizardPage.java b/src/net/java/sip/communicator/plugin/googletalkaccregwizz/FirstWizardPage.java index 227e7cb..83d73be 100644 --- a/src/net/java/sip/communicator/plugin/googletalkaccregwizz/FirstWizardPage.java +++ b/src/net/java/sip/communicator/plugin/googletalkaccregwizz/FirstWizardPage.java @@ -15,8 +15,8 @@ import javax.swing.event.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; /** * The FirstWizardPage is the page, where user could enter the user diff --git a/src/net/java/sip/communicator/plugin/googletalkaccregwizz/googletalkaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/googletalkaccregwizz/googletalkaccregwizz.manifest.mf index da6c361..f85b003 100644 --- a/src/net/java/sip/communicator/plugin/googletalkaccregwizz/googletalkaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/googletalkaccregwizz/googletalkaccregwizz.manifest.mf @@ -4,20 +4,20 @@ Bundle-Description: Google Talk account registration wizard. 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.browserlauncher, net.java.sip.communicator.service.configuration, - net.java.sip.communicator.service.resources, net.java.sip.communicator.service.configuration.event, - net.java.sip.communicator.service.protocol, - net.java.sip.communicator.service.protocol.icqconstants, - net.java.sip.communicator.service.protocol.event, net.java.sip.communicator.service.contactlist, net.java.sip.communicator.service.contactlist.event, + net.java.sip.communicator.service.fileaccess, net.java.sip.communicator.service.gui, net.java.sip.communicator.service.gui.event, - net.java.sip.communicator.service.fileaccess, - net.java.sip.communicator.service.browserlauncher, + net.java.sip.communicator.service.protocol, + net.java.sip.communicator.service.protocol.event, + net.java.sip.communicator.service.protocol.icqconstants, + net.java.sip.communicator.service.resources, + net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, javax.naming, javax.naming.directory, javax.xml.parsers, diff --git a/src/net/java/sip/communicator/plugin/icqaccregwizz/FirstWizardPage.java b/src/net/java/sip/communicator/plugin/icqaccregwizz/FirstWizardPage.java index d1eb2de..7f56c2f 100644 --- a/src/net/java/sip/communicator/plugin/icqaccregwizz/FirstWizardPage.java +++ b/src/net/java/sip/communicator/plugin/icqaccregwizz/FirstWizardPage.java @@ -14,7 +14,7 @@ import javax.swing.event.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The FirstWizardPage is the page, where user could enter the uin diff --git a/src/net/java/sip/communicator/plugin/icqaccregwizz/icqaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/icqaccregwizz/icqaccregwizz.manifest.mf index 9630f4f..7a1dec1 100644 --- a/src/net/java/sip/communicator/plugin/icqaccregwizz/icqaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/icqaccregwizz/icqaccregwizz.manifest.mf @@ -4,19 +4,19 @@ Bundle-Description: ICQ account registration wizard. 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.browserlauncher, net.java.sip.communicator.service.configuration, net.java.sip.communicator.service.configuration.event, - net.java.sip.communicator.service.resources, - net.java.sip.communicator.service.protocol, - net.java.sip.communicator.service.protocol.icqconstants, - net.java.sip.communicator.service.protocol.event, net.java.sip.communicator.service.contactlist, net.java.sip.communicator.service.contactlist.event, net.java.sip.communicator.service.gui, net.java.sip.communicator.service.gui.event, - net.java.sip.communicator.service.browserlauncher, + net.java.sip.communicator.service.protocol, + net.java.sip.communicator.service.protocol.event, + net.java.sip.communicator.service.protocol.icqconstants, + net.java.sip.communicator.service.resources, + net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, javax.swing, javax.swing.event, javax.swing.table, diff --git a/src/net/java/sip/communicator/plugin/ircaccregwizz/FirstWizardPage.java b/src/net/java/sip/communicator/plugin/ircaccregwizz/FirstWizardPage.java index ad9011d..1054057 100644 --- a/src/net/java/sip/communicator/plugin/ircaccregwizz/FirstWizardPage.java +++ b/src/net/java/sip/communicator/plugin/ircaccregwizz/FirstWizardPage.java @@ -17,7 +17,7 @@ import javax.swing.event.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The FirstWizardPage is the page, where user could enter the user ID diff --git a/src/net/java/sip/communicator/plugin/ircaccregwizz/ircaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/ircaccregwizz/ircaccregwizz.manifest.mf index 747443d..02e5d96 100644 --- a/src/net/java/sip/communicator/plugin/ircaccregwizz/ircaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/ircaccregwizz/ircaccregwizz.manifest.mf @@ -4,16 +4,16 @@ Bundle-Description: IRC account registration wizard. 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.browserlauncher, net.java.sip.communicator.service.configuration, net.java.sip.communicator.service.configuration.event, - net.java.sip.communicator.service.protocol, - net.java.sip.communicator.service.protocol.event, net.java.sip.communicator.service.gui, net.java.sip.communicator.service.gui.event, - net.java.sip.communicator.service.browserlauncher, + net.java.sip.communicator.service.protocol, + net.java.sip.communicator.service.protocol.event, + net.java.sip.communicator.service.resources, + net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, javax.swing, javax.swing.event, javax.swing.table, diff --git a/src/net/java/sip/communicator/plugin/jabberaccregwizz/FirstWizardPage.java b/src/net/java/sip/communicator/plugin/jabberaccregwizz/FirstWizardPage.java index 014a34b..c38e410 100644 --- a/src/net/java/sip/communicator/plugin/jabberaccregwizz/FirstWizardPage.java +++ b/src/net/java/sip/communicator/plugin/jabberaccregwizz/FirstWizardPage.java @@ -15,8 +15,8 @@ import javax.swing.event.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; /** * The FirstWizardPage is the page, where user could enter the user diff --git a/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberNewAccountDialog.java b/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberNewAccountDialog.java index 0f09402..0c5217e 100644 --- a/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberNewAccountDialog.java +++ b/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberNewAccountDialog.java @@ -15,8 +15,8 @@ import javax.swing.*; import javax.swing.border.*; import javax.swing.event.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; import org.jivesoftware.smack.*; diff --git a/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberServerChooserDialog.java b/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberServerChooserDialog.java index ccabf34..b6efedc 100644 --- a/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberServerChooserDialog.java +++ b/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberServerChooserDialog.java @@ -20,8 +20,8 @@ import javax.swing.table.*; import javax.xml.parsers.*; import net.java.sip.communicator.service.fileaccess.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; import org.osgi.framework.*; import org.w3c.dom.*; diff --git a/src/net/java/sip/communicator/plugin/jabberaccregwizz/jabberaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/jabberaccregwizz/jabberaccregwizz.manifest.mf index 1c9a612..4ff5349 100755 --- a/src/net/java/sip/communicator/plugin/jabberaccregwizz/jabberaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/jabberaccregwizz/jabberaccregwizz.manifest.mf @@ -4,20 +4,20 @@ Bundle-Description: Jabber account registration wizard. 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.browserlauncher, net.java.sip.communicator.service.configuration, net.java.sip.communicator.service.configuration.event, - net.java.sip.communicator.service.protocol, - net.java.sip.communicator.service.protocol.icqconstants, - net.java.sip.communicator.service.protocol.event, net.java.sip.communicator.service.contactlist, net.java.sip.communicator.service.contactlist.event, + net.java.sip.communicator.service.fileaccess, net.java.sip.communicator.service.gui, net.java.sip.communicator.service.gui.event, - net.java.sip.communicator.service.fileaccess, - net.java.sip.communicator.service.browserlauncher, + net.java.sip.communicator.service.protocol, + net.java.sip.communicator.service.protocol.event, + net.java.sip.communicator.service.protocol.icqconstants, + net.java.sip.communicator.service.resources, + net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, javax.naming, javax.naming.directory, javax.xml.parsers, diff --git a/src/net/java/sip/communicator/plugin/keybindingchooser/KeybindingsConfigPanel.java b/src/net/java/sip/communicator/plugin/keybindingchooser/KeybindingsConfigPanel.java index 2b23c1d..6ecd153 100644 --- a/src/net/java/sip/communicator/plugin/keybindingchooser/KeybindingsConfigPanel.java +++ b/src/net/java/sip/communicator/plugin/keybindingchooser/KeybindingsConfigPanel.java @@ -15,7 +15,7 @@ import javax.swing.*; import chooser.*; import net.java.sip.communicator.service.keybindings.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The ConfigurationForm that would be added to the settings diff --git a/src/net/java/sip/communicator/plugin/keybindingchooser/keybindingChooser.manifest.mf b/src/net/java/sip/communicator/plugin/keybindingchooser/keybindingChooser.manifest.mf index 8092f15..6787861 100644 --- a/src/net/java/sip/communicator/plugin/keybindingchooser/keybindingChooser.manifest.mf +++ b/src/net/java/sip/communicator/plugin/keybindingchooser/keybindingChooser.manifest.mf @@ -4,10 +4,10 @@ Bundle-Description: Provides configuring UI for keyboard shortcuts. Bundle-Vendor: sip-communicator.org Bundle-Version: 0.0.1 Import-Package: org.osgi.framework, - net.java.sip.communicator.util, net.java.sip.communicator.service.gui, net.java.sip.communicator.service.keybindings, net.java.sip.communicator.service.resources, - net.java.sip.communicator.swing, + net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, javax.swing, - javax.swing.event \ No newline at end of file + javax.swing.event diff --git a/src/net/java/sip/communicator/plugin/mailbox/MailboxConfigurationForm.java b/src/net/java/sip/communicator/plugin/mailbox/MailboxConfigurationForm.java index 933f615..cac2b95 100644 --- a/src/net/java/sip/communicator/plugin/mailbox/MailboxConfigurationForm.java +++ b/src/net/java/sip/communicator/plugin/mailbox/MailboxConfigurationForm.java @@ -14,7 +14,7 @@ import javax.swing.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.configuration.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The ConfigurationForm that would be added in the user interface diff --git a/src/net/java/sip/communicator/plugin/mailbox/mailbox.manifest.mf b/src/net/java/sip/communicator/plugin/mailbox/mailbox.manifest.mf index af093f7..89e15e4 100644 --- a/src/net/java/sip/communicator/plugin/mailbox/mailbox.manifest.mf +++ b/src/net/java/sip/communicator/plugin/mailbox/mailbox.manifest.mf @@ -4,18 +4,18 @@ Bundle-Description: A bundle that implements the Mailbox Package. Bundle-Vendor: sip-communicator.org Bundle-Version: 0.0.1 Import-Package: org.osgi.framework, + net.java.sip.communicator.service.configuration, + net.java.sip.communicator.service.contactlist, net.java.sip.communicator.service.fileaccess, + net.java.sip.communicator.service.gui, net.java.sip.communicator.service.history, net.java.sip.communicator.service.history.event, - net.java.sip.communicator.service.contactlist, net.java.sip.communicator.service.history.records, - net.java.sip.communicator.service.gui, + net.java.sip.communicator.service.media, net.java.sip.communicator.service.protocol, net.java.sip.communicator.service.protocol.event, - net.java.sip.communicator.service.media, - net.java.sip.communicator.service.configuration, - net.java.sip.communicator.swing, net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, javax.swing, javax.swing.event, javax.swing.filechooser, diff --git a/src/net/java/sip/communicator/plugin/msnaccregwizz/FirstWizardPage.java b/src/net/java/sip/communicator/plugin/msnaccregwizz/FirstWizardPage.java index badc603..7b33402 100644 --- a/src/net/java/sip/communicator/plugin/msnaccregwizz/FirstWizardPage.java +++ b/src/net/java/sip/communicator/plugin/msnaccregwizz/FirstWizardPage.java @@ -13,7 +13,7 @@ import javax.swing.event.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The FirstWizardPage is the page, where user could enter the uin diff --git a/src/net/java/sip/communicator/plugin/msnaccregwizz/msnaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/msnaccregwizz/msnaccregwizz.manifest.mf index 020fef9..b70f82a 100755 --- a/src/net/java/sip/communicator/plugin/msnaccregwizz/msnaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/msnaccregwizz/msnaccregwizz.manifest.mf @@ -4,19 +4,19 @@ Bundle-Description: Msn account registration wizard. 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.browserlauncher, net.java.sip.communicator.service.configuration, net.java.sip.communicator.service.configuration.event, - net.java.sip.communicator.service.protocol, - net.java.sip.communicator.service.protocol.icqconstants, - net.java.sip.communicator.service.protocol.event, net.java.sip.communicator.service.contactlist, net.java.sip.communicator.service.contactlist.event, net.java.sip.communicator.service.gui, net.java.sip.communicator.service.gui.event, - net.java.sip.communicator.service.browserlauncher, + net.java.sip.communicator.service.protocol, + net.java.sip.communicator.service.protocol.event, + net.java.sip.communicator.service.protocol.icqconstants, + net.java.sip.communicator.service.resources, + net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, javax.swing, javax.swing.event, javax.swing.table, diff --git a/src/net/java/sip/communicator/plugin/notificationconfiguration/NotificationConfigurationPanel.java b/src/net/java/sip/communicator/plugin/notificationconfiguration/NotificationConfigurationPanel.java index f62fc13..2dc6194 100644 --- a/src/net/java/sip/communicator/plugin/notificationconfiguration/NotificationConfigurationPanel.java +++ b/src/net/java/sip/communicator/plugin/notificationconfiguration/NotificationConfigurationPanel.java @@ -19,8 +19,8 @@ import javax.swing.event.*; import net.java.sip.communicator.service.audionotifier.*; import net.java.sip.communicator.service.notification.*; import net.java.sip.communicator.service.notification.event.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; /** * The UI of ConfigurationForm that would be added in the user diff --git a/src/net/java/sip/communicator/plugin/notificationconfiguration/notificationconfiguration.manifest.mf b/src/net/java/sip/communicator/plugin/notificationconfiguration/notificationconfiguration.manifest.mf index 660681d..6c766c6 100644 --- a/src/net/java/sip/communicator/plugin/notificationconfiguration/notificationconfiguration.manifest.mf +++ b/src/net/java/sip/communicator/plugin/notificationconfiguration/notificationconfiguration.manifest.mf @@ -5,15 +5,15 @@ Bundle-Vendor: sip-communicator.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, - net.java.sip.communicator.util, + net.java.sip.communicator.service.audionotifier, + net.java.sip.communicator.service.configuration, net.java.sip.communicator.service.gui, net.java.sip.communicator.service.gui.event, - net.java.sip.communicator.service.configuration, - net.java.sip.communicator.service.audionotifier, net.java.sip.communicator.service.notification, net.java.sip.communicator.service.notification.event, net.java.sip.communicator.service.resources, - net.java.sip.communicator.swing, + net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, javax.swing, javax.swing.event, javax.swing.table, diff --git a/src/net/java/sip/communicator/plugin/pluginmanager/ManageButtonsPanel.java b/src/net/java/sip/communicator/plugin/pluginmanager/ManageButtonsPanel.java index 4c12a28..30ecb87 100644 --- a/src/net/java/sip/communicator/plugin/pluginmanager/ManageButtonsPanel.java +++ b/src/net/java/sip/communicator/plugin/pluginmanager/ManageButtonsPanel.java @@ -13,8 +13,8 @@ import javax.swing.*; import javax.swing.event.*; import net.java.sip.communicator.service.gui.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; import org.osgi.framework.*; diff --git a/src/net/java/sip/communicator/plugin/pluginmanager/NewBundleDialog.java b/src/net/java/sip/communicator/plugin/pluginmanager/NewBundleDialog.java index ec07d76..0b30e6d 100644 --- a/src/net/java/sip/communicator/plugin/pluginmanager/NewBundleDialog.java +++ b/src/net/java/sip/communicator/plugin/pluginmanager/NewBundleDialog.java @@ -14,7 +14,7 @@ import java.net.*; import javax.swing.*; import net.java.sip.communicator.service.gui.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; import org.osgi.framework.*; diff --git a/src/net/java/sip/communicator/plugin/pluginmanager/PluginManagerPanel.java b/src/net/java/sip/communicator/plugin/pluginmanager/PluginManagerPanel.java index b3f86f7..ee69f83 100644 --- a/src/net/java/sip/communicator/plugin/pluginmanager/PluginManagerPanel.java +++ b/src/net/java/sip/communicator/plugin/pluginmanager/PluginManagerPanel.java @@ -12,7 +12,7 @@ import javax.swing.*; import javax.swing.event.*; import javax.swing.table.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; import org.osgi.framework.*; diff --git a/src/net/java/sip/communicator/plugin/pluginmanager/pluginmanager.manifest.mf b/src/net/java/sip/communicator/plugin/pluginmanager/pluginmanager.manifest.mf index f71d412..d34c0c7 100644 --- a/src/net/java/sip/communicator/plugin/pluginmanager/pluginmanager.manifest.mf +++ b/src/net/java/sip/communicator/plugin/pluginmanager/pluginmanager.manifest.mf @@ -9,8 +9,8 @@ Import-Package: org.osgi.framework, net.java.sip.communicator.service.gui, net.java.sip.communicator.service.gui.event, net.java.sip.communicator.service.resources, - net.java.sip.communicator.swing, net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, javax.swing, javax.swing.event, javax.swing.table, diff --git a/src/net/java/sip/communicator/plugin/rssaccregwizz/FirstWizardPage.java b/src/net/java/sip/communicator/plugin/rssaccregwizz/FirstWizardPage.java index bba600c..b5a6288 100644 --- a/src/net/java/sip/communicator/plugin/rssaccregwizz/FirstWizardPage.java +++ b/src/net/java/sip/communicator/plugin/rssaccregwizz/FirstWizardPage.java @@ -15,7 +15,7 @@ import javax.swing.event.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The FirstWizardPage is the page, where user could enter the user ID diff --git a/src/net/java/sip/communicator/plugin/rssaccregwizz/rssaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/rssaccregwizz/rssaccregwizz.manifest.mf index 691c91f..fb4829f 100644 --- a/src/net/java/sip/communicator/plugin/rssaccregwizz/rssaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/rssaccregwizz/rssaccregwizz.manifest.mf @@ -4,18 +4,18 @@ Bundle-Description: Rss account registration wizard. 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.browserlauncher, net.java.sip.communicator.service.configuration, net.java.sip.communicator.service.configuration.event, - net.java.sip.communicator.service.protocol, - net.java.sip.communicator.service.protocol.event, net.java.sip.communicator.service.contactlist, net.java.sip.communicator.service.contactlist.event, net.java.sip.communicator.service.gui, net.java.sip.communicator.service.gui.event, - net.java.sip.communicator.service.browserlauncher, + net.java.sip.communicator.service.protocol, + net.java.sip.communicator.service.protocol.event, + net.java.sip.communicator.service.resources, + net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, javax.swing, javax.swing.event, javax.swing.table, diff --git a/src/net/java/sip/communicator/plugin/sipaccregwizz/FirstWizardPage.java b/src/net/java/sip/communicator/plugin/sipaccregwizz/FirstWizardPage.java index 4880da1..8e24b5f 100644 --- a/src/net/java/sip/communicator/plugin/sipaccregwizz/FirstWizardPage.java +++ b/src/net/java/sip/communicator/plugin/sipaccregwizz/FirstWizardPage.java @@ -14,7 +14,7 @@ import javax.swing.event.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The FirstWizardPage is the page, where user could enter the uin diff --git a/src/net/java/sip/communicator/plugin/sipaccregwizz/sipaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/sipaccregwizz/sipaccregwizz.manifest.mf index 25ad690..09b4a1a 100755 --- a/src/net/java/sip/communicator/plugin/sipaccregwizz/sipaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/sipaccregwizz/sipaccregwizz.manifest.mf @@ -4,19 +4,19 @@ Bundle-Description: SIP account registration wizard. 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.browserlauncher, net.java.sip.communicator.service.configuration, net.java.sip.communicator.service.configuration.event, - net.java.sip.communicator.service.resources, - net.java.sip.communicator.service.protocol, - net.java.sip.communicator.service.protocol.icqconstants, - net.java.sip.communicator.service.protocol.event, net.java.sip.communicator.service.contactlist, net.java.sip.communicator.service.contactlist.event, net.java.sip.communicator.service.gui, net.java.sip.communicator.service.gui.event, - net.java.sip.communicator.service.browserlauncher, + net.java.sip.communicator.service.protocol, + net.java.sip.communicator.service.protocol.event, + net.java.sip.communicator.service.protocol.icqconstants, + net.java.sip.communicator.service.resources, + net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, javax.swing, javax.swing.event, javax.swing.table, diff --git a/src/net/java/sip/communicator/plugin/sshaccregwizz/FirstWizardPage.java b/src/net/java/sip/communicator/plugin/sshaccregwizz/FirstWizardPage.java index 09fb974..b934f32 100644 --- a/src/net/java/sip/communicator/plugin/sshaccregwizz/FirstWizardPage.java +++ b/src/net/java/sip/communicator/plugin/sshaccregwizz/FirstWizardPage.java @@ -22,7 +22,7 @@ import javax.swing.event.*; import net.java.sip.communicator.impl.protocol.ssh.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The FirstWizardPage is the page, where user could enter the user ID diff --git a/src/net/java/sip/communicator/plugin/sshaccregwizz/sshaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/sshaccregwizz/sshaccregwizz.manifest.mf index 0694f25..c50ebd5 100644 --- a/src/net/java/sip/communicator/plugin/sshaccregwizz/sshaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/sshaccregwizz/sshaccregwizz.manifest.mf @@ -4,18 +4,18 @@ Bundle-Description: SSH account registration wizard. 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.browserlauncher, net.java.sip.communicator.service.configuration, net.java.sip.communicator.service.configuration.event, - net.java.sip.communicator.service.protocol, - net.java.sip.communicator.service.protocol.event, net.java.sip.communicator.service.contactlist, net.java.sip.communicator.service.contactlist.event, net.java.sip.communicator.service.gui, net.java.sip.communicator.service.gui.event, - net.java.sip.communicator.service.browserlauncher, + net.java.sip.communicator.service.protocol, + net.java.sip.communicator.service.protocol.event, + net.java.sip.communicator.service.resources, + net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, javax.swing, javax.swing.event, javax.swing.table, diff --git a/src/net/java/sip/communicator/plugin/updatechecker/UpdateCheckActivator.java b/src/net/java/sip/communicator/plugin/updatechecker/UpdateCheckActivator.java index 9fe2061..cb9b86e 100644 --- a/src/net/java/sip/communicator/plugin/updatechecker/UpdateCheckActivator.java +++ b/src/net/java/sip/communicator/plugin/updatechecker/UpdateCheckActivator.java @@ -19,8 +19,8 @@ import javax.swing.*; import net.java.sip.communicator.service.browserlauncher.*; 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 net.java.sip.communicator.util.swing.*; import org.osgi.framework.*; 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 bf08da5..eb16831 100644 --- a/src/net/java/sip/communicator/plugin/updatechecker/updatecheck.manifest.mf +++ b/src/net/java/sip/communicator/plugin/updatechecker/updatecheck.manifest.mf @@ -4,12 +4,12 @@ Bundle-Description: A bundle that implements the UpdateCheck Plugin Package. 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.browserlauncher, net.java.sip.communicator.service.gui, + net.java.sip.communicator.service.resources, net.java.sip.communicator.service.version, - net.java.sip.communicator.service.browserlauncher, + net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, javax.swing, javax.swing.event, javax.swing.text, 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 b38758a..22f414d 100644 --- a/src/net/java/sip/communicator/plugin/whiteboard/gui/InvitationReceivedDialog.java +++ b/src/net/java/sip/communicator/plugin/whiteboard/gui/InvitationReceivedDialog.java @@ -13,7 +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.*; +import net.java.sip.communicator.util.swing.*; /** * The dialog that pops up when a chat room invitation is received. diff --git a/src/net/java/sip/communicator/plugin/whiteboard/gui/WhiteboardFrame.java b/src/net/java/sip/communicator/plugin/whiteboard/gui/WhiteboardFrame.java index 467bda5..88fe32e 100644 --- a/src/net/java/sip/communicator/plugin/whiteboard/gui/WhiteboardFrame.java +++ b/src/net/java/sip/communicator/plugin/whiteboard/gui/WhiteboardFrame.java @@ -22,8 +22,8 @@ import net.java.sip.communicator.plugin.whiteboard.gui.whiteboardshapes.*; import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.service.protocol.event.*; import net.java.sip.communicator.service.protocol.whiteboardobjects.*; -import net.java.sip.communicator.swing.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; /** * The frame for the Whiteboard 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 9827a73..d0802e5 100644 --- a/src/net/java/sip/communicator/plugin/whiteboard/whiteboard.manifest.mf +++ b/src/net/java/sip/communicator/plugin/whiteboard/whiteboard.manifest.mf @@ -4,16 +4,16 @@ Bundle-Description: A whiteboard for SIP-Communicator. 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, net.java.sip.communicator.service.gui, net.java.sip.communicator.service.gui.event, - net.java.sip.communicator.service.protocol.event, net.java.sip.communicator.service.protocol, + net.java.sip.communicator.service.protocol.event, net.java.sip.communicator.service.protocol.whiteboardobjects, + net.java.sip.communicator.service.resources, + net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, javax.swing, javax.swing.event, javax.swing.table, diff --git a/src/net/java/sip/communicator/plugin/yahooaccregwizz/FirstWizardPage.java b/src/net/java/sip/communicator/plugin/yahooaccregwizz/FirstWizardPage.java index 9ee87f8..6361527 100644 --- a/src/net/java/sip/communicator/plugin/yahooaccregwizz/FirstWizardPage.java +++ b/src/net/java/sip/communicator/plugin/yahooaccregwizz/FirstWizardPage.java @@ -13,7 +13,7 @@ import javax.swing.event.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The FirstWizardPage is the page, where user could enter the uin diff --git a/src/net/java/sip/communicator/plugin/yahooaccregwizz/yahooaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/yahooaccregwizz/yahooaccregwizz.manifest.mf index ebd3daa..a9418de 100644 --- a/src/net/java/sip/communicator/plugin/yahooaccregwizz/yahooaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/yahooaccregwizz/yahooaccregwizz.manifest.mf @@ -4,19 +4,19 @@ Bundle-Description: Yahoo account registration wizard. 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.browserlauncher, net.java.sip.communicator.service.configuration, net.java.sip.communicator.service.configuration.event, - net.java.sip.communicator.service.protocol, - net.java.sip.communicator.service.protocol.icqconstants, - net.java.sip.communicator.service.protocol.event, net.java.sip.communicator.service.contactlist, net.java.sip.communicator.service.contactlist.event, net.java.sip.communicator.service.gui, net.java.sip.communicator.service.gui.event, - net.java.sip.communicator.service.browserlauncher, + net.java.sip.communicator.service.protocol, + net.java.sip.communicator.service.protocol.event, + net.java.sip.communicator.service.protocol.icqconstants, + net.java.sip.communicator.service.resources, + net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, javax.swing, javax.swing.event, javax.swing.table, diff --git a/src/net/java/sip/communicator/plugin/zeroconfaccregwizz/FirstWizardPage.java b/src/net/java/sip/communicator/plugin/zeroconfaccregwizz/FirstWizardPage.java index e71ef92..0a86fc4 100644 --- a/src/net/java/sip/communicator/plugin/zeroconfaccregwizz/FirstWizardPage.java +++ b/src/net/java/sip/communicator/plugin/zeroconfaccregwizz/FirstWizardPage.java @@ -14,7 +14,7 @@ import javax.swing.event.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.protocol.*; -import net.java.sip.communicator.swing.*; +import net.java.sip.communicator.util.swing.*; /** * The FirstWizardPage is the page, where user could enter the user ID diff --git a/src/net/java/sip/communicator/plugin/zeroconfaccregwizz/zeroconfaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/zeroconfaccregwizz/zeroconfaccregwizz.manifest.mf index b1250c6..6710544 100644 --- a/src/net/java/sip/communicator/plugin/zeroconfaccregwizz/zeroconfaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/zeroconfaccregwizz/zeroconfaccregwizz.manifest.mf @@ -4,18 +4,18 @@ Bundle-Description: Zeroconf account registration wizard. 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.browserlauncher, net.java.sip.communicator.service.configuration, net.java.sip.communicator.service.configuration.event, - net.java.sip.communicator.service.protocol, - net.java.sip.communicator.service.protocol.event, net.java.sip.communicator.service.contactlist, net.java.sip.communicator.service.contactlist.event, net.java.sip.communicator.service.gui, net.java.sip.communicator.service.gui.event, - net.java.sip.communicator.service.browserlauncher, + net.java.sip.communicator.service.protocol, + net.java.sip.communicator.service.protocol.event, + net.java.sip.communicator.service.resources, + net.java.sip.communicator.util, + net.java.sip.communicator.util.swing, javax.swing, javax.swing.event, javax.swing.table, diff --git a/src/net/java/sip/communicator/swing/AntialiasingManager.java b/src/net/java/sip/communicator/swing/AntialiasingManager.java deleted file mode 100644 index 1577159..0000000 --- a/src/net/java/sip/communicator/swing/AntialiasingManager.java +++ /dev/null @@ -1,32 +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.swing; - -import java.awt.*; - -/** - * Through the AntialiasingManager the developer could activate the - * antialiasing mechanism when painting. The method that do the job is - * the activateAntialiasing method. It takes a Graphics - * object and activates the antialiasing for it. - * - * @author Yana Stamcheva - */ -public class AntialiasingManager { - - /** - * Activates the antialiasing mechanism for the given Graphics - * object. - * @param g The Graphics object. - */ - public static void activateAntialiasing(Graphics g) { - Graphics2D g2d = (Graphics2D) g; - - g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, - RenderingHints.VALUE_ANTIALIAS_ON); - } -} diff --git a/src/net/java/sip/communicator/swing/FitLayout.java b/src/net/java/sip/communicator/swing/FitLayout.java deleted file mode 100644 index bca9a07..0000000 --- a/src/net/java/sip/communicator/swing/FitLayout.java +++ /dev/null @@ -1,136 +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.swing; - -import java.awt.*; - -/** - * Represents a LayoutManager which centers the first - * Component within its Container and, if the - * preferred size of the Component is larger than the size of the - * Container, scales the former within the bounds of the latter - * while preserving the aspect ratio. FitLayout is appropriate for - * Containers which display a single image or video - * Component in its entirety for which preserving the aspect ratio - * is important. - * - * @author Lubomir Marinov - */ -public class FitLayout - implements LayoutManager -{ - - /* - * Does nothing because this LayoutManager lays out only the first Component - * of the parent Container and thus doesn't need String associations. - */ - public void addLayoutComponent(String name, Component comp) - { - } - - /** - * Gets the first Component of a specific - * Container if there is such a Component. - * - * @param parent the Container to retrieve the first - * Component of - * @return the first Component of a specific - * Container if there is such a Component; - * otherwise, null - */ - protected Component getComponent(Container parent) - { - Component[] components = parent.getComponents(); - - return (components.length > 0) ? components[0] : null; - } - - protected void layoutComponent(Component component, Rectangle bounds, - float alignmentX, float alignmentY) - { - Dimension componentSize = component.getPreferredSize(); - boolean scale = false; - double ratio = 1; - - if ((componentSize.width != bounds.width) && (componentSize.width > 0)) - { - scale = true; - ratio = bounds.width / (double) componentSize.width; - } - if ((componentSize.height != bounds.height) - && (componentSize.height > 0)) - { - scale = true; - ratio = - Math.min(bounds.height / (double) componentSize.height, ratio); - } - if (scale) - { - componentSize.width = (int) (componentSize.width * ratio); - componentSize.height = (int) (componentSize.height * ratio); - } - - component.setBounds(bounds.x - + Math.round((bounds.width - componentSize.width) * alignmentX), - bounds.y - + Math.round((bounds.height - componentSize.height) - * alignmentY), componentSize.width, componentSize.height); - } - - /* - * Scales the first Component if its preferred size is larger than the size - * of its parent Container in order to display the Component in its entirety - * and then centers it within the display area of the parent. - */ - public void layoutContainer(Container parent) - { - layoutContainer(parent, Component.CENTER_ALIGNMENT); - } - - protected void layoutContainer(Container parent, float componentAlignmentX) - { - Component component = getComponent(parent); - - if (component != null) - layoutComponent(component, new Rectangle(parent.getSize()), - componentAlignmentX, Component.CENTER_ALIGNMENT); - } - - /* - * Since this LayoutManager lays out only the first Component of the - * specified parent Container, the minimum size of the Container is the - * minimum size of the mentioned Component. - */ - public Dimension minimumLayoutSize(Container parent) - { - Component component = getComponent(parent); - - return (component != null) ? component.getMinimumSize() - : new Dimension(0, 0); - } - - /* - * Since this LayoutManager lays out only the first Component of the - * specified parent Container, the preferred size of the Container is the - * preferred size of the mentioned Component. - */ - public Dimension preferredLayoutSize(Container parent) - { - Component component = getComponent(parent); - - return (component != null) ? component.getPreferredSize() - : new Dimension(0, 0); - } - - /* - * Does nothing because this LayoutManager lays out only the first Component - * of the parent Container and thus doesn't need String associations. - */ - public void removeLayoutComponent(Component comp) - { - } -} diff --git a/src/net/java/sip/communicator/swing/ImageCanvas.java b/src/net/java/sip/communicator/swing/ImageCanvas.java deleted file mode 100644 index 6c90c79..0000000 --- a/src/net/java/sip/communicator/swing/ImageCanvas.java +++ /dev/null @@ -1,72 +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.swing; - -import java.awt.*; - -import javax.swing.*; - -/** - * @author Lubomir Marinov - */ -public class ImageCanvas - extends TransparentPanel -{ - private final ImageIcon icon; - - public ImageCanvas(Image image) - { - icon = (image == null) ? null : new ImageIcon(image); - - if (icon != null) - { - final int preferredWidth = icon.getIconWidth(); - final int preferredHeight = icon.getIconHeight(); - setMinimumSize(new Dimension(preferredWidth / 2, - preferredHeight / 2)); - setPreferredSize(new Dimension(preferredWidth, preferredHeight)); - } - } - - protected void paintComponent(Graphics g) - { - super.paintComponent(g); - - if (icon == null) - return; - - int imageWidth = icon.getIconWidth(); - if (imageWidth < 1) - return; - int imageHeight = icon.getIconHeight(); - if (imageHeight < 1) - return; - - int width = getWidth(); - boolean scale = false; - float scaleFactor = 1; - if (imageWidth > width) - { - scale = true; - scaleFactor = width / (float) imageWidth; - } - int height = getHeight(); - if (imageHeight > height) - { - scale = true; - scaleFactor = Math.min(scaleFactor, height / (float) imageHeight); - } - if (scale) - { - imageWidth = Math.round(imageWidth * scaleFactor); - imageHeight = Math.round(imageHeight * scaleFactor); - } - - g.drawImage(icon.getImage(), (width - imageWidth) / 2, - (height - imageHeight) / 2, imageWidth, imageHeight, null); - } -} diff --git a/src/net/java/sip/communicator/swing/SIPCommCheckBox.java b/src/net/java/sip/communicator/swing/SIPCommCheckBox.java deleted file mode 100644 index d2b359c..0000000 --- a/src/net/java/sip/communicator/swing/SIPCommCheckBox.java +++ /dev/null @@ -1,49 +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.swing; - -import javax.swing.*; - -/** - * @author Lubomir Marinov - */ -public class SIPCommCheckBox - extends JCheckBox -{ - private static final boolean setContentAreaFilled = isWindows(); - - private static boolean isWindows() - { - String osName = System.getProperty("os.name"); - return (osName != null) && (osName.indexOf("Windows") != -1); - } - - public SIPCommCheckBox() - { - init(); - } - - public SIPCommCheckBox(String text) - { - super(text); - - init(); - } - - public SIPCommCheckBox(String text, boolean selected) - { - super(text, selected); - - init(); - } - - private void init() - { - if (setContentAreaFilled) - setContentAreaFilled(false); - } -} diff --git a/src/net/java/sip/communicator/swing/SIPCommDialog.java b/src/net/java/sip/communicator/swing/SIPCommDialog.java deleted file mode 100644 index 562d9fa..0000000 --- a/src/net/java/sip/communicator/swing/SIPCommDialog.java +++ /dev/null @@ -1,384 +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.swing; - -import java.awt.*; -import java.awt.event.*; - -import javax.swing.*; - -import net.java.sip.communicator.service.configuration.*; -import net.java.sip.communicator.util.*; - -public abstract class SIPCommDialog extends JDialog -{ - private Logger logger = Logger.getLogger(SIPCommDialog.class); - - private ActionMap amap; - private InputMap imap; - - private boolean isSaveSizeAndLocation = true; - - public SIPCommDialog() - { - super(); - - this.init(); - } - - public SIPCommDialog(Dialog owner) - { - super(owner); - - this.init(); - } - - public SIPCommDialog(Frame owner) - { - super(owner); - - this.init(); - } - - public SIPCommDialog(boolean isSaveSizeAndLocation) - { - this(); - - this.isSaveSizeAndLocation = isSaveSizeAndLocation; - } - - public SIPCommDialog(Dialog owner, boolean isSaveSizeAndLocation) - { - this(owner); - - this.isSaveSizeAndLocation = isSaveSizeAndLocation; - } - - public SIPCommDialog(Frame owner, boolean isSaveSizeAndLocation) - { - this(owner); - - this.isSaveSizeAndLocation = isSaveSizeAndLocation; - } - - /** - * Initializes this dialog. - */ - private void init() - { - this.setContentPane(new SIPCommFrame.MainContentPane()); - - this.addWindowListener(new DialogWindowAdapter()); - - this.initInputMap(); - } - - private void initInputMap() - { - amap = this.getRootPane().getActionMap(); - - amap.put("close", new CloseAction()); - - imap = this.getRootPane().getInputMap( - JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); - - imap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "close"); - } - - /** - * The action invoked when user presses Escape key. - */ - private class CloseAction extends AbstractAction - { - public void actionPerformed(ActionEvent e) - { - if(isSaveSizeAndLocation) - saveSizeAndLocation(); - - close(true); - } - } - - /** - * Adds a key - action pair for this frame. - * - * @param keyStroke the key combination - * @param action the action which will be executed when user presses the - * given key combination - */ - protected void addKeyBinding(KeyStroke keyStroke, Action action) - { - String actionID = action.getClass().getName(); - - amap.put(actionID, action); - - imap.put(keyStroke, actionID); - } - - /** - * Before closing the application window saves the current size and position - * through the ConfigurationService. - */ - public class DialogWindowAdapter extends WindowAdapter - { - public void windowClosing(WindowEvent e) - { - if(isSaveSizeAndLocation) - saveSizeAndLocation(); - - close(false); - } - } - - /** - * Saves the size and the location of this dialog through the - * ConfigurationService. - */ - private void saveSizeAndLocation() - { - ConfigurationService configService = - SwingCommonActivator.getConfigurationService(); - - String className = this.getClass().getName(); - - try { - configService.setProperty( - className + ".width", - new Integer(getWidth())); - - configService.setProperty( - className + ".height", - new Integer(getHeight())); - - configService.setProperty( - className + ".x", - new Integer(getX())); - - configService.setProperty( - className + ".y", - new Integer(getY())); - } - catch (PropertyVetoException e1) { - logger.error("The proposed property change " - + "represents an unacceptable value"); - } - } - - /** - * Sets window size and position. - */ - private void setSizeAndLocation() - { - ConfigurationService configService = - SwingCommonActivator.getConfigurationService(); - - String className = this.getClass().getName(); - - String widthString = configService.getString( - className + ".width"); - - String heightString = configService.getString( - className + ".height"); - - String xString = configService.getString( - className + ".x"); - - String yString = configService.getString( - className + ".y"); - - int width = 0; - int height = 0; - - if(widthString != null && heightString != null) - { - width = new Integer(widthString).intValue(); - height = new Integer(heightString).intValue(); - - if(width > 0 && height > 0) - this.setSize(width, height); - } - - if(xString != null && yString != null) - { - this.setLocation(new Integer(xString).intValue(), - new Integer(yString).intValue()); - } - else { - this.setCenterLocation(); - } - } - - /** - * Positions this window in the center of the screen. - */ - private void setCenterLocation() - { - this.setLocation( - Toolkit.getDefaultToolkit().getScreenSize().width/2 - - this.getWidth()/2, - Toolkit.getDefaultToolkit().getScreenSize().height/2 - - this.getHeight()/2 - ); - } - - /** - * Checks whether the current component will - * exceeds the screen size and if it do will set a default size - */ - private void ensureOnScreenLocationAndSize() - { - int x = this.getX(); - int y = this.getY(); - - int width = this.getWidth(); - int height = this.getHeight(); - - Rectangle virtualBounds = ScreenInformation.getScreenBounds(); - - // the default distance to the screen border - final int borderDistance = 10; - - // in case any of the sizes exceeds the screen size - // we set default one - // get the left upper point of the window - if (!(virtualBounds.contains(x, y))) - { - // top left exceeds screen bounds - if (x < virtualBounds.x) - { - // window is too far to the left - // move it to the right - x = virtualBounds.x + borderDistance; - } else if (x > virtualBounds.x) - { - // window is too far to the right - // can only occour, when screen resolution is - // changed or displayed are disconnected - - // move the window in the bounds to the very right - x = virtualBounds.x + virtualBounds.width - width - - borderDistance; - if (x < virtualBounds.x + borderDistance) - { - x = virtualBounds.x + borderDistance; - } - } - - // top left exceeds screen bounds - if (y < virtualBounds.y) - { - // window is too far to the top - // move it to the bottom - y = virtualBounds.y + borderDistance; - } else if (y > virtualBounds.y) - { - // window is too far to the bottom - // can only occour, when screen resolution is - // changed or displayed are disconnected - - // move the window in the bounds to the very bottom - y = virtualBounds.y + virtualBounds.height - height - - borderDistance; - if (y < virtualBounds.y + borderDistance) - { - y = virtualBounds.y + borderDistance; - } - } - this.setLocation(x, y); - } - - // check the lower right corder - if (!(virtualBounds.contains(x + width, y + height))) - { - - if (x + width > virtualBounds.x + virtualBounds.width) - { - // location of window is too far to the right, its right - // border is out of bounds - - // calculate a new horizontal position - // move the whole window to the left - x = virtualBounds.x + virtualBounds.width - width - - borderDistance; - if (x < virtualBounds.x + borderDistance) - { - // window is already on left side, it is too wide. - x = virtualBounds.x + borderDistance; - // reduce the width, so it surely fits - width = virtualBounds.width - 2 * borderDistance; - } - } - if (y + height > virtualBounds.y + virtualBounds.height) - { - // location of window is too far to the bottom, its bottom - // border is out of bounds - - // calculate a new vertical position - // move the whole window to the top - y = virtualBounds.y + virtualBounds.height - height - - borderDistance; - if (y < virtualBounds.y + borderDistance) - { - // window is already on top, it is too high. - y = virtualBounds.y + borderDistance; - // reduce the width, so it surely fits - height = virtualBounds.height - 2 * borderDistance; - } - } - this.setPreferredSize(new Dimension(width, height)); - this.setSize(width, height); - this.setLocation(x, y); - } - } - - /** - * Overwrites the setVisible method in order to set the size and the - * position of this window before showing it. - */ - public void setVisible(boolean isVisible) - { - if(isVisible) - { - this.pack(); - - if(isSaveSizeAndLocation) - this.setSizeAndLocation(); - else - { - this.pack(); - this.setCenterLocation(); - } - - ensureOnScreenLocationAndSize(); - - JButton button = this.getRootPane().getDefaultButton(); - - if(button != null) - button.requestFocus(); - } - - super.setVisible(isVisible); - } - - /** - * Overwrites the dispose method in order to save the size and the position - * of this window before closing it. - */ - public void dispose() - { - if(isSaveSizeAndLocation) - this.saveSizeAndLocation(); - - super.dispose(); - } - - /** - * All functions implemented in this method will be invoked when user - * presses the Escape key. - */ - protected abstract void close(boolean isEscaped); -} diff --git a/src/net/java/sip/communicator/swing/SIPCommFrame.java b/src/net/java/sip/communicator/swing/SIPCommFrame.java deleted file mode 100644 index 60cd23d..0000000 --- a/src/net/java/sip/communicator/swing/SIPCommFrame.java +++ /dev/null @@ -1,507 +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.swing; - -import java.awt.*; -import java.awt.event.*; -import java.awt.geom.*; -import java.util.*; - -import javax.swing.*; - -import net.java.sip.communicator.service.configuration.*; -import net.java.sip.communicator.service.keybindings.*; -import net.java.sip.communicator.service.resources.*; -import net.java.sip.communicator.util.*; - -/** - * A custom frame that remembers its size and location and could have a semi - * transparent background. - * - * @author Yana Stamcheva - */ -public abstract class SIPCommFrame - extends JFrame - implements Observer -{ - private static final String SIP_COMMUNICATOR_LOGO = - "service.gui.SIP_COMMUNICATOR_LOGO"; - - private final Logger logger = Logger.getLogger(SIPCommFrame.class); - - private final ActionMap amap; - - private final InputMap imap; - - private KeybindingSet bindings = null; - - public SIPCommFrame() - { - this.setContentPane(new MainContentPane()); - - Image scLogo = SwingCommonActivator.getImage(SIP_COMMUNICATOR_LOGO); - this.setIconImage(scLogo); - - // In order to have the same icon when using option panes - JOptionPane.getRootFrame().setIconImage(scLogo); - - this.addWindowListener(new FrameWindowAdapter()); - - JRootPane rootPane = getRootPane(); - amap = rootPane.getActionMap(); - amap.put("close", new CloseAction()); - - imap = - rootPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); - } - - /** - * The action invoked when user presses Escape key. - */ - private class CloseAction - extends AbstractAction - { - public void actionPerformed(ActionEvent e) - { - saveSizeAndLocation(); - close(true); - } - } - - /** - * Sets the input map to utilize a given category of keybindings. The frame - * is updated to reflect the new bindings when they change. This replaces - * any previous bindings that have been added. - * - * @param category set of keybindings to be utilized - */ - protected void setKeybindingInput(KeybindingSet.Category category) - { - // Removes old binding set - if (this.bindings != null) - { - this.bindings.deleteObserver(this); - resetInputMap(); - } - - // Adds new bindings to input map - this.bindings = - SwingCommonActivator.getKeybindingsService().getBindings(category); - - for (Map.Entry key2action : this.bindings - .getBindings().entrySet()) - { - imap.put(key2action.getKey(), key2action.getValue()); - } - - this.bindings.addObserver(this); - } - - /** - * Bindings the string representation for a keybinding to the action that - * will be executed. - * - * @param binding string representation of action used by input map - * @param action the action which will be executed when user presses the - * given key combination - */ - protected void addKeybindingAction(String binding, Action action) - { - amap.put(binding, action); - } - - /** - * Before closing the application window saves the current size and position - * through the ConfigurationService. - */ - public class FrameWindowAdapter - extends WindowAdapter - { - public void windowClosing(WindowEvent e) - { - saveSizeAndLocation(); - - close(false); - } - } - - /** - * Saves the size and the location of this frame through the - * ConfigurationService. - */ - private void saveSizeAndLocation() - { - ConfigurationService configService = - SwingCommonActivator.getConfigurationService(); - - String className = this.getClass().getName(); - - try - { - configService.setProperty(className + ".width", new Integer( - getWidth())); - - configService.setProperty(className + ".height", new Integer( - getHeight())); - - configService.setProperty(className + ".x", new Integer(getX())); - - configService.setProperty(className + ".y", new Integer(getY())); - } - catch (PropertyVetoException e1) - { - logger.error("The proposed property change " - + "represents an unacceptable value"); - } - } - - /** - * Sets window size and position. - */ - public void setSizeAndLocation() - { - ConfigurationService configService = - SwingCommonActivator.getConfigurationService(); - - String className = this.getClass().getName(); - - String widthString = configService.getString(className + ".width"); - - String heightString = configService.getString(className + ".height"); - - String xString = configService.getString(className + ".x"); - - String yString = configService.getString(className + ".y"); - - int width = 0; - int height = 0; - - if (widthString != null && heightString != null) - { - width = new Integer(widthString).intValue(); - height = new Integer(heightString).intValue(); - - if (width > 0 && height > 0) - { - Dimension screenSize = - Toolkit.getDefaultToolkit().getScreenSize(); - if (width <= screenSize.width && height <= screenSize.height) - this.setSize(width, height); - } - } - - int x = 0; - int y = 0; - - if (xString != null && yString != null) - { - x = new Integer(xString).intValue(); - y = new Integer(yString).intValue(); - - this.setLocation(x, y); - } - else - { - this.setCenterLocation(); - } - } - - /** - * Positions this window in the center of the screen. - */ - private void setCenterLocation() - { - Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); - this.setLocation(screenSize.width / 2 - this.getWidth() / 2, - screenSize.height / 2 - this.getHeight() / 2); - } - - /** - * Checks whether the current component will exceeds the screen size and if - * it do will set a default size - */ - private void ensureOnScreenLocationAndSize() - { - int x = this.getX(); - int y = this.getY(); - - int width = this.getWidth(); - int height = this.getHeight(); - - Rectangle virtualBounds = ScreenInformation.getScreenBounds(); - - // the default distance to the screen border - final int borderDistance = 10; - - // in case any of the sizes exceeds the screen size - // we set default one - // get the left upper point of the window - if (!(virtualBounds.contains(x, y))) - { - // top left exceeds screen bounds - if (x < virtualBounds.x) - { - // window is too far to the left - // move it to the right - x = virtualBounds.x + borderDistance; - } - else if (x > virtualBounds.x) - { - // window is too far to the right - // can only occour, when screen resolution is - // changed or displayed are disconnected - - // move the window in the bounds to the very right - x = - virtualBounds.x + virtualBounds.width - width - - borderDistance; - if (x < virtualBounds.x + borderDistance) - { - x = virtualBounds.x + borderDistance; - } - } - - // top left exceeds screen bounds - if (y < virtualBounds.y) - { - // window is too far to the top - // move it to the bottom - y = virtualBounds.y + borderDistance; - } - else if (y > virtualBounds.y) - { - // window is too far to the bottom - // can only occour, when screen resolution is - // changed or displayed are disconnected - - // move the window in the bounds to the very bottom - y = - virtualBounds.y + virtualBounds.height - height - - borderDistance; - if (y < virtualBounds.y + borderDistance) - { - y = virtualBounds.y + borderDistance; - } - } - this.setLocation(x, y); - } - - // check the lower right corder - if (!(virtualBounds.contains(x + width, y + height))) - { - - if (x + width > virtualBounds.x + virtualBounds.width) - { - // location of window is too far to the right, its right - // border is out of bounds - - // calculate a new horizontal position - // move the whole window to the left - x = - virtualBounds.x + virtualBounds.width - width - - borderDistance; - if (x < virtualBounds.x + borderDistance) - { - // window is already on left side, it is too wide. - x = virtualBounds.x + borderDistance; - // reduce the width, so it surely fits - width = virtualBounds.width - 2 * borderDistance; - } - } - if (y + height > virtualBounds.y + virtualBounds.height) - { - // location of window is too far to the bottom, its bottom - // border is out of bounds - - // calculate a new vertical position - // move the whole window to the top - y = - virtualBounds.y + virtualBounds.height - height - - borderDistance; - if (y < virtualBounds.y + borderDistance) - { - // window is already on top, it is too high. - y = virtualBounds.y + borderDistance; - // reduce the width, so it surely fits - height = virtualBounds.height - 2 * borderDistance; - } - } - this.setPreferredSize(new Dimension(width, height)); - this.setSize(width, height); - this.setLocation(x, y); - } - } - - /** - * Overwrites the setVisible method in order to set the size and the - * position of this window before showing it. - */ - public void setVisible(boolean isVisible) - { - if (isVisible) - { - this.setSizeAndLocation(); - - this.ensureOnScreenLocationAndSize(); - } - - super.setVisible(isVisible); - } - - /** - * Overwrites the dispose method in order to save the size and the position - * of this window before closing it. - */ - public void dispose() - { - this.saveSizeAndLocation(); - - /* - * The keybinding service will outlive us so don't let us retain our - * memory. - */ - if (bindings != null) - bindings.deleteObserver(this); - - super.dispose(); - } - - private void resetInputMap() - { - imap.clear(); - imap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "close"); - } - - /** - * Listens for changes in binding sets so they can be reflected in the input - * map - */ - public void update(Observable obs, Object arg) - { - if (obs instanceof KeybindingSet) - { - KeybindingSet changedBindings = (KeybindingSet) obs; - - resetInputMap(); - for (Map.Entry key2action : changedBindings - .getBindings().entrySet()) - { - imap.put(key2action.getKey(), key2action.getValue()); - } - } - } - - static class MainContentPane - extends JPanel - { - private final boolean isColorBgEnabled; - - private final Color bgStartColor; - - private final Color bgEndColor; - - public MainContentPane() - { - super(new BorderLayout()); - - ResourceManagementService resources = - SwingCommonActivator.getResources(); - - isColorBgEnabled = - new Boolean(resources.getSettingsString( - "impl.gui.IS_WINDOW_COLOR_BACKGROUND_ENABLED")) - .booleanValue(); - if (isColorBgEnabled) - { - bgStartColor = - new Color(resources.getColor("service.gui.MAIN_BACKGROUND")); - bgEndColor = - new Color(resources - .getColor("service.gui.MAIN_BACKGROUND_GRADIENT")); - - int borderSize = - resources - .getSettingsInt("impl.gui.MAIN_WINDOW_BORDER_SIZE"); - this.setBorder(BorderFactory.createEmptyBorder(borderSize, - borderSize, borderSize, borderSize)); - } - else - { - bgStartColor = null; - bgEndColor = null; - } - } - - public void paintComponent(Graphics g) - { - super.paintComponent(g); - - // If the custom color window background is not enabled we have - // nothing to do here. - if (!isColorBgEnabled) - return; - - g = g.create(); - try - { - internalPaintComponent(g); - } - finally - { - g.dispose(); - } - } - - private void internalPaintComponent(Graphics g) - { - AntialiasingManager.activateAntialiasing(g); - - Graphics2D g2 = (Graphics2D) g; - int width = getWidth(); - int height = getHeight(); - - GradientPaint bgGradientColor = - new GradientPaint(width / 2, 0, bgStartColor, width / 2, 80, - bgEndColor); - - g2.setPaint(bgGradientColor); - g2.fillRect(0, 0, width, 80); - - g2.setColor(bgEndColor); - g2.fillRect(0, 78, width, height); - - GradientPaint curveShadow = - new GradientPaint(0, 0, new Color(255, 255, 255, 150), width, - height, 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(width - 20, 0, width, 100, width / 2, - 100, 0, 150); - - g2.draw(curve2); - - CubicCurve2D curve3 = - new CubicCurve2D.Float(0, 90, width / 3, 60, 2 * width / 3, 60, - width, 90); - - g2.draw(curve3); - } - } - - /** - * All functions implemented in this method will be invoked when user - * presses the Escape key. - */ - protected abstract void close(boolean isEscaped); -} diff --git a/src/net/java/sip/communicator/swing/SIPCommTabbedPane.java b/src/net/java/sip/communicator/swing/SIPCommTabbedPane.java deleted file mode 100644 index 0ee7ebc..0000000 --- a/src/net/java/sip/communicator/swing/SIPCommTabbedPane.java +++ /dev/null @@ -1,469 +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.swing; - -/* - * The following code borrowed from David Bismut, davidou@mageos.com Intern, - * SETLabs, Infosys Technologies Ltd. May 2004 - Jul 2004 Ecole des Mines de - * Nantes, France - */ -import java.awt.*; -import java.awt.event.*; -import java.util.*; - -import javax.swing.*; -import javax.swing.border.*; -import javax.swing.event.*; - -import net.java.sip.communicator.swing.event.*; -import net.java.sip.communicator.swing.plaf.*; - -/** - * A JTabbedPane with some added UI functionalities. A close and max/detach - * icons are added to every tab, typically to let the user close or detach the - * tab by clicking on these icons. - * - * @author Yana Stamcheva - */ -public class SIPCommTabbedPane - extends JTabbedPane - implements ChangeListener -{ - private int overTabIndex = -1; - - private int lastSelectedIndex; - - /** - * Creates the CloseAndMaxTabbedPane with an enhanced UI if - * enhancedUI parameter is set to true. - * - * @param closingTabs support for closable tabs - * @param maximizingTabs support for maximisable tabs - */ - public SIPCommTabbedPane(boolean closingTabs, boolean maximizingTabs) - { - super.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); - - UIManager.getDefaults() - .put("TabbedPane.tabAreaInsets", new Insets(0, 5, 0, 0)); - - UIManager.getDefaults() - .put("TabbedPane.contentBorderInsets", new Insets(0, 0, 0, 0)); - - this.setUI(new SIPCommTabbedPaneEnhancedUI()); - - if(closingTabs) - this.setCloseIcon(true); - - if(maximizingTabs) - this.setMaxIcon(true); - - this.addChangeListener(this); - } - - /** - * Returns the index of the last tab on which the mouse did an action. - */ - public int getOverTabIndex() - { - return overTabIndex; - } - - /** - * Returns true if the close icon is enabled. - */ - public boolean isCloseEnabled() - { - SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) this.getUI(); - return ui.isCloseEnabled(); - } - - /** - * Returns true if the max/detach icon is enabled. - */ - public boolean isMaxEnabled() - { - SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) this.getUI(); - return ui.isMaxEnabled(); - } - - /** - * Override JTabbedPane method. Does nothing. - * @param tabLayoutPolicy The tab layout policy. - */ - public void setTabLayoutPolicy(int tabLayoutPolicy) - { - } - - /** - * Override JTabbedPane method. Does nothing. - * @param tabPlacement The tab placement. - */ - public void setTabPlacement(int tabPlacement) - { - } - - /** - * Sets whether the tabbedPane should have a close icon or not. - * - * @param b whether the tabbedPane should have a close icon or not - */ - public void setCloseIcon(boolean b) - { - SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) this.getUI(); - ui.setCloseIcon(b); - } - - /** - * Sets whether the tabbedPane should have a max/detach icon or not. - * - * @param b whether the tabbedPane should have a max/detach icon or not - */ - public void setMaxIcon(boolean b) - { - SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) this.getUI(); - ui.setMaxIcon(b); - } - - /** - * Detaches the index tab in a seperate frame. When the frame - * is closed, the tab is automatically reinserted into the tabbedPane. - * - * @param index index of the tabbedPane to be detached - */ - public void detachTab(int index) - { - if (index < 0 || index >= getTabCount()) - return; - - final int tabIndex = index; - final JComponent c = (JComponent) getComponentAt(tabIndex); - - final Icon icon = getIconAt(tabIndex); - final String title = getTitleAt(tabIndex); - final String toolTip = getToolTipTextAt(tabIndex); - final Border border = c.getBorder(); - - final JFrame frame = new SIPCommFrame() - { - protected void close(boolean isEscaped) - { - if (isEscaped) - return; - - dispose(); - - insertTab(title, icon, c, toolTip, Math.min(tabIndex, - getTabCount())); - - c.setBorder(border); - setSelectedComponent(c); - } - }; - - Window parentWindow = SwingUtilities.windowForComponent(this); - - removeTabAt(index); - - c.setPreferredSize(c.getSize()); - - frame.setTitle(title); - frame.getContentPane().add(c); - frame.setLocation(parentWindow.getLocation()); - frame.pack(); - - WindowFocusListener windowFocusListener = new WindowFocusListener() { - long start; - - long end; - - public void windowGainedFocus(WindowEvent e) { - start = System.currentTimeMillis(); - } - - public void windowLostFocus(WindowEvent e) { - end = System.currentTimeMillis(); - long elapsed = end - start; - - if (elapsed < 100) - frame.toFront(); - - frame.removeWindowFocusListener(this); - } - }; - - /* - * This is a small hack to avoid Windows GUI bug, that prevent a new - * window from stealing focus (without this windowFocusListener, most of - * the time the new frame would just blink from foreground to - * background). A windowFocusListener is added to the frame, and if the - * time between the frame beeing in foreground and the frame beeing in - * background is less that 100ms, it just brings the windows to the - * front once again. Then it removes the windowFocusListener. Note that - * this hack would not be required on Linux or UNIX based systems. - */ - - frame.addWindowFocusListener(windowFocusListener); - - // frame.show(); - frame.setVisible(true); - frame.toFront(); - - } - - /** - * Adds a CloseListener to the tabbedPane. - * - * @param l the CloseListener to add - * @see #fireCloseTabEvent - * @see #removeCloseListener - */ - public synchronized void addCloseListener(CloseListener l) - { - listenerList.add(CloseListener.class, l); - } - - /** - * Adds a MaxListener to the tabbedPane. - * - * @param l the MaxListener to add - * @see #fireMaxTabEvent - * @see #removeMaxListener - */ - public synchronized void addMaxListener(MaxListener l) - { - listenerList.add(MaxListener.class, l); - } - - /** - * Adds a DoubleClickListener to the tabbedPane. - * - * @param l the DoubleClickListener to add - * @see #fireDoubleClickTabEvent - * @see #removeDoubleClickListener - */ - public synchronized void addDoubleClickListener(DoubleClickListener l) - { - listenerList.add(DoubleClickListener.class, l); - } - - /** - * Adds a PopupOutsideListener to the tabbedPane. - * - * @param l the PopupOutsideListener to add - * @see #firePopupOutsideTabEvent - * @see #removePopupOutsideListener - */ - public synchronized void addPopupOutsideListener(PopupOutsideListener l) - { - listenerList.add(PopupOutsideListener.class, l); - } - - /** - * Removes a CloseListener from this tabbedPane. - * - * @param l the CloseListener to remove - * @see #fireCloseTabEvent - * @see #addCloseListener - */ - public synchronized void removeCloseListener(CloseListener l) - { - listenerList.remove(CloseListener.class, l); - } - - /** - * Removes a MaxListener from this tabbedPane. - * - * @param l the MaxListener to remove - * @see #fireMaxTabEvent - * @see #addMaxListener - */ - public synchronized void removeMaxListener(MaxListener l) - { - listenerList.remove(MaxListener.class, l); - } - - /** - * Removes a DoubleClickListener from this tabbedPane. - * - * @param l - * the DoubleClickListener to remove - * @see #fireDoubleClickTabEvent - * @see #addDoubleClickListener - */ - public synchronized void removeDoubleClickListener(DoubleClickListener l) - { - listenerList.remove(DoubleClickListener.class, l); - } - - /** - * Removes a PopupOutsideListener from this tabbedPane. - * - * @param l - * the PopupOutsideListener to remove - * @see #firePopupOutsideTabEvent - * @see #addPopupOutsideListener - */ - public synchronized void removePopupOutsideListener( - PopupOutsideListener l) - { - listenerList.remove(PopupOutsideListener.class, l); - } - - /** - * Sends a MouseEvent, whose source is this tabbedpane, to - * every CloseListener. The method also updates the - * overTabIndex of the tabbedPane with a value coming from - * the UI. This method method is called each time a MouseEvent - * is received from the UI when the user clicks on the close icon of the tab - * which index is overTabIndex. - * - * @param e - * the MouseEvent to be sent - * @param overTabIndex - * the index of a tab, usually the tab over which the mouse is - * - * @see #addCloseListener - */ - public void fireCloseTabEvent(MouseEvent e, int overTabIndex) - { - this.overTabIndex = overTabIndex; - - EventListener[] closeListeners = getListeners(CloseListener.class); - for (int i = 0; i < closeListeners.length; i++) - { - ((CloseListener) closeListeners[i]).closeOperation(e); - } - } - - /** - * Sends a MouseEvent, whose source is this tabbedpane, to - * every MaxListener. The method also updates the - * overTabIndex of the tabbedPane with a value coming from - * the UI. This method method is called each time a MouseEvent - * is received from the UI when the user clicks on the max icon of the tab - * which index is overTabIndex. - * - * @param e - * the MouseEvent to be sent - * @param overTabIndex - * the index of a tab, usually the tab over which the mouse is - * - * @see #addMaxListener - */ - public void fireMaxTabEvent(MouseEvent e, int overTabIndex) - { - this.overTabIndex = overTabIndex; - - EventListener[] maxListeners = getListeners(MaxListener.class); - for (int i = 0; i < maxListeners.length; i++) - { - ((MaxListener) maxListeners[i]).maxOperation(e); - } - } - - /** - * Sends a MouseEvent, whose source is this tabbedpane, to - * every DoubleClickListener. The method also updates the - * overTabIndex of the tabbedPane with a value coming from - * the UI. This method method is called each time a MouseEvent - * is received from the UI when the user double-clicks on the tab which - * index is overTabIndex. - * - * @param e - * the MouseEvent to be sent - * @param overTabIndex - * the index of a tab, usually the tab over which the mouse is - * - * @see #addDoubleClickListener - */ - public void fireDoubleClickTabEvent(MouseEvent e, int overTabIndex) - { - this.overTabIndex = overTabIndex; - - EventListener[] dClickListeners - = getListeners(DoubleClickListener.class); - for (int i = 0; i < dClickListeners.length; i++) - { - ((DoubleClickListener) dClickListeners[i]).doubleClickOperation(e); - } - } - - /** - * Sends a MouseEvent, whose source is this tabbedpane, to - * every PopupOutsideListener. The method also sets the - * overTabIndex to -1. This method method is called each time - * a MouseEvent is received from the UI when the user - * right-clicks on the inactive part of a tabbedPane. - * - * @param e - * the MouseEvent to be sent - * - * @see #addPopupOutsideListener - */ - public void firePopupOutsideTabEvent(MouseEvent e) - { - this.overTabIndex = -1; - - EventListener[] popupListeners - = getListeners(PopupOutsideListener.class); - for (int i = 0; i < popupListeners.length; i++) - { - ((PopupOutsideListener) popupListeners[i]).popupOutsideOperation(e); - } - } - - /** - * Overrides setSelectedIndex in JTabbedPane in order to remove the - * hightlight if the tab which is selected. - * @param tabIndex The index of the tab to be selected. - */ - public void setSelectedIndex(int tabIndex) - { - SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) this.getUI(); - if (ui.isTabHighlighted(tabIndex)) - { - ui.tabRemoveHighlight(tabIndex); - } - super.setSelectedIndex(tabIndex); - } - - /** - * Highlights the tab with the given index. - * - * @param tabIndex The tab index. - */ - public void highlightTab(int tabIndex) - { - SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) this.getUI(); - - if (!ui.isTabHighlighted(tabIndex) - && this.getSelectedIndex() != tabIndex) - ui.tabAddHightlight(tabIndex); - - this.repaint(); - } - - public void removeTabAt(int index) - { - if (index < lastSelectedIndex) - { - this.setSelectedIndex(lastSelectedIndex - 1); - } - else if (index > lastSelectedIndex) - { - this.setSelectedIndex(lastSelectedIndex); - } - - super.removeTabAt(index); - } - - public void stateChanged(ChangeEvent e) - { - lastSelectedIndex = this.getSelectedIndex(); - } -} diff --git a/src/net/java/sip/communicator/swing/ScreenInformation.java b/src/net/java/sip/communicator/swing/ScreenInformation.java deleted file mode 100644 index f8cd6ee..0000000 --- a/src/net/java/sip/communicator/swing/ScreenInformation.java +++ /dev/null @@ -1,90 +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.swing; - -import java.awt.*; - -/** - * A class which reads the screen bounds once and provides this information - * - * @author Thomas Hofer - * - */ -public class ScreenInformation -{ - private static Rectangle screenBounds = null; - - public static synchronized void init() - { - if (screenBounds == null) - { - final GraphicsEnvironment ge = GraphicsEnvironment - .getLocalGraphicsEnvironment(); - final GraphicsDevice[] gs = ge.getScreenDevices(); - - screenBounds = new Rectangle(); - - if (gs.length > 1) - { - - // create a thread for each display, as the query is very slow - Thread thread[] = new Thread[gs.length]; - for (int j = 0; j < gs.length; j++) - { - final int j1 = j; - thread[j] = new Thread(new Runnable() - { - public void run() - { - Rectangle screenDeviceBounds = new Rectangle(); - GraphicsDevice gd = gs[j1]; - GraphicsConfiguration[] gc = gd.getConfigurations(); - for (int i = 0; i < gc.length; i++) - { - screenDeviceBounds = screenDeviceBounds - .union(gc[i].getBounds()); - } - screenBounds.setBounds(screenBounds - .union(screenDeviceBounds)); - - } - }); - thread[j].start(); - } - for (int j = 0; j < gs.length; j++) - { - // wait for all threads here - try - { - thread[j].join(); - } catch (InterruptedException e) - { - } - } - } else - { - // only one display, get the screen size directy. this method - // is much faster, but can only handle the primary display - Dimension dim = Toolkit.getDefaultToolkit().getScreenSize(); - screenBounds.setBounds(0, 0, dim.width, dim.height); - } - - } - } - - public static synchronized Rectangle getScreenBounds() - { - // the initialization needs a moment - // prevent a concurrent initalization - if (screenBounds == null) - { - init(); - } - - return screenBounds; - } -} diff --git a/src/net/java/sip/communicator/swing/SwingCommonActivator.java b/src/net/java/sip/communicator/swing/SwingCommonActivator.java deleted file mode 100644 index c0a0db1..0000000 --- a/src/net/java/sip/communicator/swing/SwingCommonActivator.java +++ /dev/null @@ -1,116 +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.swing; - -import java.awt.image.*; -import java.io.*; -import java.net.*; -import java.util.*; - -import javax.imageio.*; - -import net.java.sip.communicator.service.configuration.*; -import net.java.sip.communicator.service.keybindings.*; -import net.java.sip.communicator.service.resources.*; -import net.java.sip.communicator.util.*; - -import org.osgi.framework.*; - -/** - * @author Lubomir Marinov - */ -public class SwingCommonActivator - implements BundleActivator -{ - private static BundleContext bundleContext; - - private static ConfigurationService configurationService; - - private static final Map imageCache = - new HashMap(); - - private static KeybindingsService keybindingsService; - - private static final Logger logger = - Logger.getLogger(SwingCommonActivator.class); - - private static ResourceManagementService resources; - - public static ConfigurationService getConfigurationService() - { - if (configurationService == null) - { - ServiceReference serviceReference = - bundleContext.getServiceReference(ConfigurationService.class - .getName()); - - if (serviceReference != null) - configurationService = - (ConfigurationService) bundleContext - .getService(serviceReference); - } - return configurationService; - } - - public static KeybindingsService getKeybindingsService() - { - if (keybindingsService == null) - { - ServiceReference serviceReference = - bundleContext.getServiceReference(KeybindingsService.class - .getName()); - - if (serviceReference != null) - keybindingsService = - (KeybindingsService) bundleContext - .getService(serviceReference); - } - return keybindingsService; - } - - public static BufferedImage getImage(String key) - { - if (imageCache.containsKey(key)) - return imageCache.get(key); - - URL url = getResources().getImageURL(key); - BufferedImage image = null; - if (url != null) - { - try - { - image = ImageIO.read(url); - - imageCache.put(key, image); - } - catch (IOException ex) - { - logger.error("Failed to load image " + key, ex); - } - } - return image; - } - - public static ResourceManagementService getResources() - { - if (resources == null) - resources = - ResourceManagementServiceUtils.getService(bundleContext); - return resources; - } - - public void start(BundleContext bundleContext) - { - SwingCommonActivator.bundleContext = bundleContext; - } - - public void stop(BundleContext bundleContext) - { - if (SwingCommonActivator.bundleContext == bundleContext) - SwingCommonActivator.bundleContext = null; - } -} diff --git a/src/net/java/sip/communicator/swing/TransparentPanel.java b/src/net/java/sip/communicator/swing/TransparentPanel.java deleted file mode 100644 index a8574e4..0000000 --- a/src/net/java/sip/communicator/swing/TransparentPanel.java +++ /dev/null @@ -1,32 +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.swing; - -import java.awt.*; - -import javax.swing.*; - -/** - * @author Yana Stamcheva - */ -public class TransparentPanel - extends JPanel -{ - private static final long serialVersionUID = 0L; - - public TransparentPanel() - { - this.setOpaque(false); - } - - public TransparentPanel(LayoutManager layout) - { - super(layout); - - this.setOpaque(false); - } -} diff --git a/src/net/java/sip/communicator/swing/VideoContainer.java b/src/net/java/sip/communicator/swing/VideoContainer.java deleted file mode 100644 index a4dc2f2..0000000 --- a/src/net/java/sip/communicator/swing/VideoContainer.java +++ /dev/null @@ -1,113 +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.swing; - -import java.awt.*; -import java.awt.event.*; - -/** - * @author Lubomir Marinov - */ -public class VideoContainer - extends TransparentPanel -{ - private final ContainerListener containerListener = new ContainerListener() - { - - /* - * Since the videoContainer displays either noVideoComponent or a single - * visual Component which represents video, ensures the last Component - * added to the Container is the only Component it contains i.e. - * noVideoComponent goes away when the video is displayed and the video - * goes away when noVideoComponent is displayed. - */ - public void componentAdded(ContainerEvent event) - { - Container container = event.getContainer(); - Component local = ((VideoLayout) container.getLayout()).getLocal(); - Component added = event.getChild(); - - if ((local != null) && (added == local)) - return; - - Component[] components = container.getComponents(); - boolean validate = false; - - for (int i = 0; i < components.length; i++) - { - Component component = components[i]; - - if ((component != added) && (component != local)) - { - container.remove(component); - validate = true; - } - } - if (validate) - container.validate(); - }; - - /* - * Displays noVideoComponent when there is no visual Component which - * represents video to be displayed. - */ - public void componentRemoved(ContainerEvent event) - { - Container container = event.getContainer(); - - if ((container.getComponentCount() <= 0) - || (((VideoLayout) container.getLayout()).getRemote() == null)) - { - container.add(noVideoComponent, VideoLayout.CENTER_REMOTE); - container.validate(); - } - } - }; - - private final Component noVideoComponent; - - public VideoContainer(Component noVideoComponent) - { - setLayout(new VideoLayout()); - - this.noVideoComponent = noVideoComponent; - - addContainerListener(containerListener); - add(this.noVideoComponent, VideoLayout.CENTER_REMOTE); - validate(); - } - - public Component add(Component comp) - { - add(comp, VideoLayout.CENTER_REMOTE); - return comp; - } - - /* - * Ensures noVideoComponent is displayed even when the clients of the - * videoContainer invoke its #removeAll() to remove their previous visual - * Components representing video. Just adding noVideoComponent upon - * ContainerEvent#COMPONENT_REMOVED when there is no other Component left in - * the Container will cause an infinite loop because Container#removeAll() - * will detect that a new Component has been added while dispatching the - * event and will then try to remove the new Component. - */ - public void removeAll() - { - removeContainerListener(containerListener); - try - { - super.removeAll(); - } - finally - { - addContainerListener(containerListener); - containerListener.componentRemoved(new ContainerEvent(this, - ContainerEvent.COMPONENT_REMOVED, null)); - } - } -} diff --git a/src/net/java/sip/communicator/swing/VideoLayout.java b/src/net/java/sip/communicator/swing/VideoLayout.java deleted file mode 100644 index 8c624e8..0000000 --- a/src/net/java/sip/communicator/swing/VideoLayout.java +++ /dev/null @@ -1,102 +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.swing; - -import java.awt.*; - -/** - * @author Lubomir Marinov - */ -public class VideoLayout extends FitLayout -{ - public static final String CENTER_REMOTE = "CENTER_REMOTE"; - - public static final String EAST_REMOTE = "EAST_REMOTE"; - - public static final String LOCAL = "LOCAL"; - - private static final float LOCAL_TO_REMOTE_RATIO = 0.30f; - - private Component local; - - private Component remote; - - private float remoteAlignmentX = Component.CENTER_ALIGNMENT; - - public void addLayoutComponent(String name, Component comp) - { - super.addLayoutComponent(name, comp); - - if ((name == null) || name.equals(CENTER_REMOTE)) - { - remote = comp; - remoteAlignmentX = Component.CENTER_ALIGNMENT; - } - else if (name.equals(EAST_REMOTE)) - { - remote = comp; - remoteAlignmentX = Component.RIGHT_ALIGNMENT; - } - else if (name.equals(LOCAL)) - local = comp; - } - - protected Component getComponent(Container parent) - { - return getRemote(); - } - - public Component getLocal() - { - return local; - } - - public Component getRemote() - { - return remote; - } - - public void layoutContainer(Container parent) - { - Component local = getLocal(); - - super.layoutContainer(parent, - (local == null) ? Component.CENTER_ALIGNMENT : remoteAlignmentX); - - if (local != null) - { - Dimension parentSize = parent.getSize(); - int height = Math.round(parentSize.height * LOCAL_TO_REMOTE_RATIO); - - super.layoutComponent(local, new Rectangle(0, parentSize.height - - height, Math.round(parentSize.width * LOCAL_TO_REMOTE_RATIO), - height), Component.LEFT_ALIGNMENT, Component.BOTTOM_ALIGNMENT); - } - } - - public Dimension minimumLayoutSize(Container parent) - { - // TODO Auto-generated method stub - return super.minimumLayoutSize(parent); - } - - public Dimension preferredLayoutSize(Container parent) - { - // TODO Auto-generated method stub - return super.preferredLayoutSize(parent); - } - - public void removeLayoutComponent(Component comp) - { - super.removeLayoutComponent(comp); - - if (remote == comp) - remote = null; - else if (local == comp) - local = null; - } -} diff --git a/src/net/java/sip/communicator/swing/event/CloseListener.java b/src/net/java/sip/communicator/swing/event/CloseListener.java deleted file mode 100644 index 8a2d301..0000000 --- a/src/net/java/sip/communicator/swing/event/CloseListener.java +++ /dev/null @@ -1,22 +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.swing.event; - -/* - * The content of this file was based on code borrowed from David Bismut, - * davidou@mageos.com Intern, SETLabs, Infosys Technologies Ltd. May 2004 - Jul - * 2004 Ecole des Mines de Nantes, France - */ -import java.awt.event.*; -import java.util.*; - -/** - * @author Yana Stamcheva - */ -public interface CloseListener extends EventListener { - public void closeOperation(MouseEvent e); -} diff --git a/src/net/java/sip/communicator/swing/event/DoubleClickListener.java b/src/net/java/sip/communicator/swing/event/DoubleClickListener.java deleted file mode 100644 index 7a8987e..0000000 --- a/src/net/java/sip/communicator/swing/event/DoubleClickListener.java +++ /dev/null @@ -1,22 +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.swing.event; - -/* - * The following code borrowed from David Bismut, davidou@mageos.com Intern, - * SETLabs, Infosys Technologies Ltd. May 2004 - Jul 2004 Ecole des Mines de - * Nantes, France - */ -import java.awt.event.*; -import java.util.*; - -/** - * @author Yana Stamcheva - */ -public interface DoubleClickListener extends EventListener { - public void doubleClickOperation(MouseEvent e); -} diff --git a/src/net/java/sip/communicator/swing/event/MaxListener.java b/src/net/java/sip/communicator/swing/event/MaxListener.java deleted file mode 100644 index 2ab27aa..0000000 --- a/src/net/java/sip/communicator/swing/event/MaxListener.java +++ /dev/null @@ -1,22 +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.swing.event; - -/* - * The following code borrowed from David Bismut, davidou@mageos.com Intern, - * SETLabs, Infosys Technologies Ltd. May 2004 - Jul 2004 Ecole des Mines de - * Nantes, France - */ -import java.awt.event.*; -import java.util.*; - -/** - * @author Yana Stamcheva - */ -public interface MaxListener extends EventListener { - public void maxOperation(MouseEvent e); -} diff --git a/src/net/java/sip/communicator/swing/event/PopupOutsideListener.java b/src/net/java/sip/communicator/swing/event/PopupOutsideListener.java deleted file mode 100644 index 14c6a11..0000000 --- a/src/net/java/sip/communicator/swing/event/PopupOutsideListener.java +++ /dev/null @@ -1,22 +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.swing.event; - -/* - * The following code borrowed from David Bismut, davidou@mageos.com Intern, - * SETLabs, Infosys Technologies Ltd. May 2004 - Jul 2004 Ecole des Mines de - * Nantes, France - */ -import java.awt.event.*; -import java.util.*; - -/** - * @author Yana Stamcheva - */ -public interface PopupOutsideListener extends EventListener { - public void popupOutsideOperation(MouseEvent e); -} diff --git a/src/net/java/sip/communicator/swing/plaf/SIPCommTabbedPaneEnhancedUI.java b/src/net/java/sip/communicator/swing/plaf/SIPCommTabbedPaneEnhancedUI.java deleted file mode 100644 index 51ec16b..0000000 --- a/src/net/java/sip/communicator/swing/plaf/SIPCommTabbedPaneEnhancedUI.java +++ /dev/null @@ -1,383 +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.swing.plaf; - -/* - * The content of this file was based on code borrowed from David Bismut, - * davidou@mageos.com Intern, SETLabs, Infosys Technologies Ltd. May 2004 - Jul - * 2004 Ecole des Mines de Nantes, France - */ - -import java.awt.*; -import java.awt.image.*; - -import javax.swing.*; -import javax.swing.plaf.*; -import javax.swing.plaf.basic.*; -import javax.swing.text.*; - -import net.java.sip.communicator.swing.*; - -/** - * This UI displays a different interface, which is independent from the look - * and feel. - * - * @author David Bismut, davidou@mageos.com - * @author Yana Stamcheva - */ -public class SIPCommTabbedPaneEnhancedUI - extends SIPCommTabbedPaneUI -{ - private static final Color whiteColor = Color.white; - - private static final int TAB_OVERLAP - = new Integer(SwingCommonActivator.getResources(). - getSettingsString("impl.gui.TAB_OVERLAP")).intValue(); - - private static final int PREFERRED_WIDTH = 150; - - /** - * The image used in the SIPCommLookAndFeel to paint the background - * of a selected tab. - */ - private static final String SELECTED_TAB_LEFT_BG = - "service.gui.lookandfeel.SELECTED_TAB_LEFT_BG"; - - /** - * The image used in the SIPCommLookAndFeel to paint the background - * of a selected tab. - */ - private static final String SELECTED_TAB_MIDDLE_BG = - "service.gui.lookandfeel.SELECTED_TAB_MIDDLE_BG"; - - /** - * The image used in the SIPCommLookAndFeel to paint the background - * of a selected tab. - */ - private static final String SELECTED_TAB_RIGHT_BG = - "service.gui.lookandfeel.SELECTED_TAB_RIGHT_BG"; - - /** - * The image used in the SIPCommLookAndFeel to paint the background - * of a tab. - */ - private static final String TAB_LEFT_BG = - "service.gui.lookandfeel.TAB_LEFT_BG"; - - /** - * The image used in the SIPCommLookAndFeel to paint the background - * of a tab. - */ - private static final String TAB_MIDDLE_BG = - "service.gui.lookandfeel.TAB_MIDDLE_BG"; - - /** - * The image used in the SIPCommLookAndFeel to paint the background - * of a tab. - */ - private static final String TAB_RIGHT_BG = - "service.gui.lookandfeel.TAB_RIGHT_BG"; - - public static ComponentUI createUI(JComponent c) { - return new SIPCommTabbedPaneEnhancedUI(); - } - - protected void paintFocusIndicator(Graphics g, int tabPlacement, - Rectangle[] rects, int tabIndex, Rectangle iconRect, - Rectangle textRect, boolean isSelected) { - } - - /** - * Overriden to paint nothing. - */ - protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, - int x, int y, int w, int h, boolean isSelected) { - } - - protected void paintContentBorderTopEdge(Graphics g, int tabPlacement, - int selectedIndex, int x, int y, int w, int h) { - - if (tabPane.getTabCount() < 1) - return; - - g.setColor(shadow); - g.drawLine(x, y, x + w - 2, y); - } - - protected void paintContentBorderLeftEdge(Graphics g, int tabPlacement, - int selectedIndex, int x, int y, int w, int h) { - - if (tabPane.getTabCount() < 1) - return; - - g.setColor(shadow); - - g.drawLine(x, y, x, y + h - 3); - } - - protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, - int selectedIndex, int x, int y, int w, int h) { - - if (tabPane.getTabCount() < 1) - return; - - g.setColor(shadow); - g.drawLine(x + 1, y + h - 3, x + w - 2, y + h - 3); - g.drawLine(x + 1, y + h - 2, x + w - 2, y + h - 2); - g.setColor(shadow.brighter()); - g.drawLine(x + 2, y + h - 1, x + w - 1, y + h - 1); - - } - - protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, - int selectedIndex, int x, int y, int w, int h) { - - if (tabPane.getTabCount() < 1) - return; - - g.setColor(shadow); - - g.drawLine(x + w - 3, y + 1, x + w - 3, y + h - 3); - g.drawLine(x + w - 2, y + 1, x + w - 2, y + h - 3); - g.setColor(shadow.brighter()); - g.drawLine(x + w - 1, y + 2, x + w - 1, y + h - 2); - - } - - protected void paintTabBackground(Graphics g, int tabPlacement, - int tabIndex, int x, int y, int w, int h, boolean isSelected) { - - BufferedImage leftImg = null; - BufferedImage middleImg = null; - BufferedImage rightImg = null; - - Graphics2D g2 = (Graphics2D) g; - - AntialiasingManager.activateAntialiasing(g2); - - int tabOverlap = 0; - - if (isSelected) - { - if (tabPane.isEnabledAt(tabIndex)) - { - leftImg = SwingCommonActivator.getImage(SELECTED_TAB_LEFT_BG); - middleImg = - SwingCommonActivator.getImage(SELECTED_TAB_MIDDLE_BG); - rightImg = SwingCommonActivator.getImage(SELECTED_TAB_RIGHT_BG); - - tabOverlap = TAB_OVERLAP; - } - else - { - leftImg = SwingCommonActivator.getImage(TAB_LEFT_BG); - middleImg = SwingCommonActivator.getImage(TAB_MIDDLE_BG); - rightImg = SwingCommonActivator.getImage(TAB_RIGHT_BG); - } - } - else - { - leftImg = SwingCommonActivator.getImage(TAB_LEFT_BG); - middleImg = SwingCommonActivator.getImage(TAB_MIDDLE_BG); - rightImg = SwingCommonActivator.getImage(TAB_RIGHT_BG); - } - - g2.drawImage(leftImg, x, y, null); - g2.drawImage(middleImg, x + leftImg.getWidth(), y, - w - leftImg.getWidth() - rightImg.getWidth() + tabOverlap, - leftImg.getHeight(), null); - g2.drawImage(rightImg, x + w - rightImg.getWidth() + tabOverlap, y, null); - } - - protected void paintText(Graphics g, int tabPlacement, Font font, - FontMetrics metrics, int tabIndex, String title, - Rectangle textRect, boolean isSelected) { - - g.setFont(font); - - int titleWidth = SwingUtilities.computeStringWidth(metrics, title); - - int preferredWidth = 0; - if (isOneActionButtonEnabled()) { - preferredWidth = calculateTabWidth(tabPlacement, tabIndex, metrics) - - WIDTHDELTA - 15; - - if (isCloseEnabled()) - preferredWidth -= BUTTONSIZE; - - if (isMaxEnabled()) - preferredWidth -= BUTTONSIZE; - } - else { - preferredWidth = titleWidth; - } - - while (titleWidth > preferredWidth) { - if (title.endsWith("...")) - title = title.substring(0, title.indexOf("...") - 1) - .concat("..."); - else - title = title.substring(0, title.length() - 4) - .concat("..."); - - titleWidth = SwingUtilities.computeStringWidth(metrics, title); - } - - textRect.width = titleWidth; - - View v = getTextViewForTab(tabIndex); - if (v != null) { - // html - v.paint(g, textRect); - } else { - // plain text - int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex); - - if (tabPane.isEnabled() && tabPane.isEnabledAt(tabIndex)) { - if (isSelected) - g.setColor(whiteColor); - else { - if (this.isTabHighlighted(tabIndex)) { - g.setColor( - UIManager.getColor("TabbedPane.tabTitleHighlight")); - } else - g.setColor(tabPane.getForegroundAt(tabIndex)); - } - - BasicGraphicsUtils - .drawStringUnderlineCharAt(g, title, mnemIndex, - textRect.x, textRect.y + metrics.getAscent()); - - } else { // tab disabled - g.setColor(tabPane.getBackgroundAt(tabIndex).brighter()); - BasicGraphicsUtils - .drawStringUnderlineCharAt(g, title, mnemIndex, - textRect.x, textRect.y + metrics.getAscent()); - - g.setColor(tabPane.getBackgroundAt(tabIndex).darker()); - BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, - mnemIndex, textRect.x - 1, textRect.y - + metrics.getAscent() - 1); - } - } - } - - protected class ScrollableTabButton extends - SIPCommTabbedPaneUI.ScrollableTabButton { - - public ScrollableTabButton(int direction) { - super(direction); - setRolloverEnabled(true); - } - - public Dimension getPreferredSize() { - return new Dimension(16, calculateMaxTabHeight(0)); - } - - public void paint(Graphics g) { - Color origColor; - boolean isPressed, isRollOver, isEnabled; - int w, h, size; - - w = getSize().width; - h = getSize().height; - origColor = g.getColor(); - isPressed = getModel().isPressed(); - isRollOver = getModel().isRollover(); - isEnabled = isEnabled(); - - g.setColor(getBackground()); - g.fillRect(0, 0, w, h); - - g.setColor(shadow); - // Using the background color set above - if (direction == WEST) { - g.drawLine(0, 0, 0, h - 1); // left - g.drawLine(w - 1, 0, w - 1, 0); // right - } else - g.drawLine(w - 2, h - 1, w - 2, 0); // right - - g.drawLine(0, 0, w - 2, 0); // top - - if (isRollOver) { - // do highlights or shadows - - Color color1; - Color color2; - - if (isPressed) { - color2 = whiteColor; - color1 = shadow; - } else { - color1 = whiteColor; - color2 = shadow; - } - - g.setColor(color1); - - if (direction == WEST) { - g.drawLine(1, 1, 1, h - 1); // left - g.drawLine(1, 1, w - 2, 1); // top - g.setColor(color2); - g.drawLine(w - 1, h - 1, w - 1, 1); // right - } else { - g.drawLine(0, 1, 0, h - 1); - g.drawLine(0, 1, w - 3, 1); // top - g.setColor(color2); - g.drawLine(w - 3, h - 1, w - 3, 1); // right - } - - } - - // g.drawLine(0, h - 1, w - 1, h - 1); //bottom - - // If there's no room to draw arrow, bail - if (h < 5 || w < 5) { - g.setColor(origColor); - return; - } - - if (isPressed) { - g.translate(1, 1); - } - - // Draw the arrow - size = Math.min((h - 4) / 3, (w - 4) / 3); - size = Math.max(size, 2); - paintTriangle(g, (w - size) / 2, (h - size) / 2, size, direction, - isEnabled); - - // Reset the Graphics back to it's original settings - if (isPressed) { - g.translate(-1, -1); - } - g.setColor(origColor); - - } - - } - - protected SIPCommTabbedPaneUI.ScrollableTabButton createScrollableTabButton( - int direction) { - return new ScrollableTabButton(direction); - } - - - protected int calculateTabWidth(int tabPlacement, int tabIndex, - FontMetrics metrics) { - - int width = super.calculateTabWidth(tabPlacement, tabIndex, metrics); - - if (isOneActionButtonEnabled()) - { - if(width > PREFERRED_WIDTH) - width = PREFERRED_WIDTH; - } - - return width; - } -} \ No newline at end of file diff --git a/src/net/java/sip/communicator/swing/plaf/SIPCommTabbedPaneUI.java b/src/net/java/sip/communicator/swing/plaf/SIPCommTabbedPaneUI.java deleted file mode 100644 index 03ffd81..0000000 --- a/src/net/java/sip/communicator/swing/plaf/SIPCommTabbedPaneUI.java +++ /dev/null @@ -1,1811 +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.swing.plaf; - -/* - * The content of this file was based on code borrowed from David Bismut, - * davidou@mageos.com Intern, SETLabs, Infosys Technologies Ltd. May 2004 - Jul - * 2004 Ecole des Mines de Nantes, France - */ -import java.awt.*; -import java.awt.event.*; -import java.awt.image.*; -import java.util.*; - -import javax.swing.*; -import javax.swing.border.*; -import javax.swing.event.*; -import javax.swing.plaf.*; -import javax.swing.plaf.basic.*; -import javax.swing.text.*; - -import net.java.sip.communicator.swing.*; - -/** - * SIPCommTabbedPaneUI implementation. - */ -public class SIPCommTabbedPaneUI - extends BasicTabbedPaneUI -{ - - /** - * The image used in the SIPCommLookAndFeel to paint a close - * button on a tab. - */ - private static final String CLOSE_TAB_ICON = - "service.gui.lookandfeel.CLOSE_TAB_ICON"; - - /** - * The image used in the SIPCommLookAndFeel to paint a rollover - * close button on a tab. - */ - private static final String CLOSE_TAB_SELECTED_ICON = - "service.gui.lookandfeel.CLOSE_TAB_SELECTED_ICON"; - - // Instance variables initialized at installation - private ContainerListener containerListener; - - private Vector htmlViews; - - private Hashtable mnemonicToIndexMap; - - /** - * InputMap used for mnemonics. Only non-null if the JTabbedPane has - * mnemonics associated with it. Lazily created in initMnemonics. - */ - private InputMap mnemonicInputMap; - - // For use when tabLayoutPolicy = SCROLL_TAB_LAYOUT - protected ScrollableTabSupport tabScroller; - - private int tabCount; - - protected MyMouseMotionListener motionListener; - - // UI creation - - private static final int INACTIVE = 0; - - private static final int OVER = 1; - - private static final int PRESSED = 2; - - public static final int BUTTONSIZE = 15; - - public static final int WIDTHDELTA = 10; - - private static final Border PRESSEDBORDER = new SoftBevelBorder( - SoftBevelBorder.LOWERED); - - private static final Border OVERBORDER = new SoftBevelBorder( - SoftBevelBorder.RAISED); - - private Image closeImgB; - - private BufferedImage maxImgB; - - private Image closeImgI; - - private BufferedImage maxImgI; - - private int overTabIndex = -1; - - private int closeIndexStatus = INACTIVE; - - private int maxIndexStatus = INACTIVE; - - private boolean mousePressed = false; - - private boolean isCloseButtonEnabled = false; - - private boolean isMaxButtonEnabled = false; - - protected JPopupMenu actionPopupMenu; - - protected JMenuItem maxItem; - - protected JMenuItem closeItem; - - protected Vector highlightedTabs = new Vector(); - - public SIPCommTabbedPaneUI() - { - super(); - - closeImgB = SwingCommonActivator.getImage(CLOSE_TAB_SELECTED_ICON); - - maxImgB = new BufferedImage(BUTTONSIZE, BUTTONSIZE, - BufferedImage.TYPE_4BYTE_ABGR); - - closeImgI = SwingCommonActivator.getImage(CLOSE_TAB_ICON); - - maxImgI = new BufferedImage(BUTTONSIZE, BUTTONSIZE, - BufferedImage.TYPE_4BYTE_ABGR); - - actionPopupMenu = new JPopupMenu(); - - maxItem = new JMenuItem("Detach"); - closeItem = new JMenuItem("Close"); - - maxItem.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - ((SIPCommTabbedPane) tabPane).fireMaxTabEvent(null, tabPane - .getSelectedIndex()); - } - }); - - closeItem.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - ((SIPCommTabbedPane) tabPane).fireCloseTabEvent(null, tabPane - .getSelectedIndex()); - } - }); - - setPopupMenu(); - } - - protected boolean isOneActionButtonEnabled() - { - return isCloseButtonEnabled || isMaxButtonEnabled; - } - - public boolean isCloseEnabled() - { - return isCloseButtonEnabled; - } - - public boolean isMaxEnabled() - { - return isMaxButtonEnabled; - } - - public void setCloseIcon(boolean b) - { - isCloseButtonEnabled = b; - setPopupMenu(); - } - - public void setMaxIcon(boolean b) - { - isMaxButtonEnabled = b; - setPopupMenu(); - } - - private void setPopupMenu() - { - actionPopupMenu.removeAll(); - if (isMaxButtonEnabled) - actionPopupMenu.add(maxItem); - if (isMaxButtonEnabled && isCloseButtonEnabled) - actionPopupMenu.addSeparator(); - if (isCloseButtonEnabled) - actionPopupMenu.add(closeItem); - } - - protected int calculateTabWidth(int tabPlacement, int tabIndex, - FontMetrics metrics) - { - int delta = 0; - - Insets tabInsets = getTabInsets(tabPlacement, tabIndex); - - if (isOneActionButtonEnabled()) - { - tabInsets.right = 0; - - if (isCloseButtonEnabled) - delta += BUTTONSIZE; - if (isMaxButtonEnabled) - delta += BUTTONSIZE; - } - - return super.calculateTabWidth(tabPlacement, tabIndex, metrics) + delta; - } - - protected int calculateTabHeight(int tabPlacement, int tabIndex, - int fontHeight) - { - return super.calculateTabHeight(tabPlacement, tabIndex, fontHeight + 4); - } - - protected void layoutLabel(int tabPlacement, FontMetrics metrics, - int tabIndex, String title, Icon icon, Rectangle tabRect, - Rectangle iconRect, Rectangle textRect, boolean isSelected) - { - textRect.x = textRect.y = iconRect.x = iconRect.y = 0; - - View v = getTextViewForTab(tabIndex); - if (v != null) { - tabPane.putClientProperty("html", v); - } - - SwingUtilities.layoutCompoundLabel((JComponent) tabPane, - metrics, - title, - icon, - SwingUtilities.CENTER, - SwingUtilities.LEFT, - SwingUtilities.CENTER, - SwingUtilities.CENTER, - tabRect, - iconRect, - textRect, - 0); - - tabPane.putClientProperty("html", null); - - iconRect.x = tabRect.x + 5; - textRect.x = iconRect.x + iconRect.width + 5; - - } - - protected MouseListener createMouseListener() - { - return new MyMouseHandler(); - } - - protected ScrollableTabButton createScrollableTabButton(int direction) - { - return new ScrollableTabButton(direction); - } - - protected Rectangle newCloseRect(Rectangle rect) - { - int dx = rect.x + rect.width; - int dy = (rect.y + rect.height) / 2 - 6; - return new Rectangle(dx - BUTTONSIZE - WIDTHDELTA, dy, BUTTONSIZE, - BUTTONSIZE); - } - - protected Rectangle newMaxRect(Rectangle rect) - { - int dx = rect.x + rect.width; - int dy = (rect.y + rect.height) / 2 - 6; - if (isCloseButtonEnabled) - dx -= BUTTONSIZE; - - return new Rectangle(dx - BUTTONSIZE - WIDTHDELTA, dy, BUTTONSIZE, - BUTTONSIZE); - } - - protected void updateOverTab(int x, int y) - { - if (overTabIndex != (overTabIndex = getTabAtLocation(x, y))) - tabScroller.tabPanel.repaint(); - - } - - protected void updateCloseIcon(int x, int y) - { - if (overTabIndex != -1) { - int newCloseIndexStatus = INACTIVE; - - Rectangle closeRect = newCloseRect(rects[overTabIndex]); - if (closeRect.contains(x, y)) - newCloseIndexStatus = mousePressed ? PRESSED : OVER; - - if (closeIndexStatus != (closeIndexStatus = newCloseIndexStatus)) - tabScroller.tabPanel.repaint(); - } - } - - protected void updateMaxIcon(int x, int y) - { - if (overTabIndex != -1) - { - int newMaxIndexStatus = INACTIVE; - - Rectangle maxRect = newMaxRect(rects[overTabIndex]); - - if (maxRect.contains(x, y)) - newMaxIndexStatus = mousePressed ? PRESSED : OVER; - - if (maxIndexStatus != (maxIndexStatus = newMaxIndexStatus)) - tabScroller.tabPanel.repaint(); - } - } - - private void setTabIcons(int x, int y) - { - // if the mouse isPressed - if (!mousePressed) - updateOverTab(x, y); - - if (isCloseButtonEnabled) - updateCloseIcon(x, y); - if (isMaxButtonEnabled) - updateMaxIcon(x, y); - } - - public static ComponentUI createUI(JComponent c) - { - return new SIPCommTabbedPaneUI(); - } - - /** - * Invoked by installUI to create a layout manager object to - * manage the JTabbedPane. - * - * @return a layout manager object - * - * @see javax.swing.JTabbedPane#getTabLayoutPolicy - */ - protected LayoutManager createLayoutManager() - { - return new TabbedPaneScrollLayout(); - } - - /* - * In an attempt to preserve backward compatibility for programs which have - * extended BasicTabbedPaneUI to do their own layout, the UI uses the - * installed layoutManager (and not tabLayoutPolicy) to determine if - * scrollTabLayout is enabled. - */ - - /** - * Creates and installs any required subcomponents for the JTabbedPane. - * Invoked by installUI. - * - * @since 1.4 - */ - protected void installComponents() - { - if (tabScroller == null) - { - tabScroller = new ScrollableTabSupport(tabPane.getTabPlacement()); - tabPane.add(tabScroller.viewport); - tabPane.add(tabScroller.scrollForwardButton); - tabPane.add(tabScroller.scrollBackwardButton); - } - } - - /** - * Removes any installed subcomponents from the JTabbedPane. Invoked by - * uninstallUI. - * - * @since 1.4 - */ - protected void uninstallComponents() - { - tabPane.remove(tabScroller.viewport); - tabPane.remove(tabScroller.scrollForwardButton); - tabPane.remove(tabScroller.scrollBackwardButton); - tabScroller = null; - } - - protected void installListeners() - { - if ((propertyChangeListener = createPropertyChangeListener()) != null) - { - tabPane.addPropertyChangeListener(propertyChangeListener); - } - if ((tabChangeListener = createChangeListener()) != null) - { - tabPane.addChangeListener(tabChangeListener); - } - if ((mouseListener = createMouseListener()) != null) - { - tabScroller.tabPanel.addMouseListener(mouseListener); - } - - if ((focusListener = createFocusListener()) != null) - { - tabPane.addFocusListener(focusListener); - } - - // PENDING(api) : See comment for ContainerHandler - if ((containerListener = new ContainerHandler()) != null) - { - tabPane.addContainerListener(containerListener); - if (tabPane.getTabCount() > 0) - { - htmlViews = createHTMLVector(); - } - } - - if ((motionListener = new MyMouseMotionListener()) != null) - { - tabScroller.tabPanel.addMouseMotionListener(motionListener); - } - - } - - protected void uninstallListeners() - { - if (mouseListener != null) - { - tabScroller.tabPanel.removeMouseListener(mouseListener); - mouseListener = null; - } - - if (motionListener != null) - { - tabScroller.tabPanel.removeMouseMotionListener(motionListener); - motionListener = null; - } - - if (focusListener != null) - { - tabPane.removeFocusListener(focusListener); - focusListener = null; - } - - // PENDING(api): See comment for ContainerHandler - if (containerListener != null) - { - tabPane.removeContainerListener(containerListener); - containerListener = null; - if (htmlViews != null) - { - htmlViews.removeAllElements(); - htmlViews = null; - } - } - if (tabChangeListener != null) - { - tabPane.removeChangeListener(tabChangeListener); - tabChangeListener = null; - } - if (propertyChangeListener != null) - { - tabPane.removePropertyChangeListener(propertyChangeListener); - propertyChangeListener = null; - } - - } - - protected ChangeListener createChangeListener() - { - return new TabSelectionHandler(); - } - - protected void installKeyboardActions() - { - InputMap km - = getMyInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); - - SwingUtilities.replaceUIInputMap(tabPane, - JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, km); - km = getMyInputMap(JComponent.WHEN_FOCUSED); - SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, km); - - ActionMap am = createMyActionMap(); - - SwingUtilities.replaceUIActionMap(tabPane, am); - - tabScroller.scrollForwardButton.setAction(am - .get("scrollTabsForwardAction")); - tabScroller.scrollBackwardButton.setAction(am - .get("scrollTabsBackwardAction")); - - } - - InputMap getMyInputMap(int condition) - { - if (condition == JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) - { - return (InputMap) UIManager.get("TabbedPane.ancestorInputMap"); - } - else if (condition == JComponent.WHEN_FOCUSED) - { - return (InputMap) UIManager.get("TabbedPane.focusInputMap"); - } - return null; - } - - ActionMap createMyActionMap() - { - ActionMap map = new ActionMapUIResource(); - map.put("navigateNext", new NextAction()); - map.put("navigatePrevious", new PreviousAction()); - map.put("navigateRight", new RightAction()); - map.put("navigateLeft", new LeftAction()); - map.put("navigateUp", new UpAction()); - map.put("navigateDown", new DownAction()); - map.put("navigatePageUp", new PageUpAction()); - map.put("navigatePageDown", new PageDownAction()); - map.put("requestFocus", new RequestFocusAction()); - map.put("requestFocusForVisibleComponent", - new RequestFocusForVisibleAction()); - map.put("setSelectedIndex", new SetSelectedIndexAction()); - map.put("scrollTabsForwardAction", new ScrollTabsForwardAction()); - map.put("scrollTabsBackwardAction", new ScrollTabsBackwardAction()); - return map; - } - - protected void uninstallKeyboardActions() - { - SwingUtilities.replaceUIActionMap(tabPane, null); - SwingUtilities.replaceUIInputMap(tabPane, - JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null); - SwingUtilities - .replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, null); - } - - /** - * Reloads the mnemonics. This should be invoked when a memonic changes, - * when the title of a mnemonic changes, or when tabs are added/removed. - */ - private void updateMnemonics() - { - resetMnemonics(); - for (int counter = tabPane.getTabCount() - 1; counter >= 0; counter--) - { - int mnemonic = tabPane.getMnemonicAt(counter); - - if (mnemonic > 0) - { - addMnemonic(counter, mnemonic); - } - } - } - - /** - * Resets the mnemonics bindings to an empty state. - */ - private void resetMnemonics() - { - if (mnemonicToIndexMap != null) - { - mnemonicToIndexMap.clear(); - mnemonicInputMap.clear(); - } - } - - /** - * Adds the specified mnemonic at the specified index. - */ - private void addMnemonic(int index, int mnemonic) - { - if (mnemonicToIndexMap == null) - { - initMnemonics(); - } - - mnemonicInputMap.put(KeyStroke.getKeyStroke(mnemonic, Event.ALT_MASK), - "setSelectedIndex"); - - mnemonicToIndexMap.put(new Integer(mnemonic), new Integer(index)); - } - - /** - * Installs the state needed for mnemonics. - */ - private void initMnemonics() - { - mnemonicToIndexMap = new Hashtable(); - mnemonicInputMap = new InputMapUIResource(); - mnemonicInputMap.setParent(SwingUtilities.getUIInputMap(tabPane, - JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)); - SwingUtilities - .replaceUIInputMap(tabPane, - JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, - mnemonicInputMap); - } - - // UI Rendering - - public void paint(Graphics g, JComponent c) - { - int tc = tabPane.getTabCount(); - - if (tabCount != tc) { - tabCount = tc; - updateMnemonics(); - } - - int selectedIndex = tabPane.getSelectedIndex(); - int tabPlacement = tabPane.getTabPlacement(); - - ensureCurrentLayout(); - - // Paint content border - paintContentBorder(g, tabPlacement, selectedIndex); - } - - protected void paintTab(Graphics g, int tabPlacement, Rectangle[] rects, - int tabIndex, Rectangle iconRect, Rectangle textRect) - { - Rectangle tabRect = rects[tabIndex]; - int selectedIndex = tabPane.getSelectedIndex(); - boolean isSelected = selectedIndex == tabIndex; - boolean isOver = overTabIndex == tabIndex; - Graphics2D g2 = null; - Shape save = null; - boolean cropShape = false; - int cropx = 0; - int cropy = 0; - - if (g instanceof Graphics2D) - { - g2 = (Graphics2D) g; - - // Render visual for cropped tab edge... - Rectangle viewRect = tabScroller.viewport.getViewRect(); - int cropline; - - cropline = viewRect.x + viewRect.width; - if ((tabRect.x < cropline) - && (tabRect.x + tabRect.width > cropline)) - { - - cropx = cropline - 1; - cropy = tabRect.y; - cropShape = true; - } - - if (cropShape) - { - save = g2.getClip(); - g2 - .clipRect(tabRect.x, tabRect.y, tabRect.width, - tabRect.height); - - } - } - - paintTabBackground(g, tabPlacement, tabIndex, tabRect.x, tabRect.y, - tabRect.width, tabRect.height, isSelected); - - paintTabBorder(g, tabPlacement, tabIndex, tabRect.x, tabRect.y, - tabRect.width, tabRect.height, isSelected); - - String title = tabPane.getTitleAt(tabIndex); - Font font = tabPane.getFont(); - FontMetrics metrics = g.getFontMetrics(font); - Icon icon = getIconForTab(tabIndex); - - layoutLabel(tabPlacement, metrics, tabIndex, title, icon, tabRect, - iconRect, textRect, isSelected); - - paintText(g, tabPlacement, font, metrics, tabIndex, title, textRect, - isSelected); - - paintIcon(g, tabPlacement, tabIndex, icon, iconRect, isSelected); - - paintFocusIndicator(g, tabPlacement, rects, tabIndex, iconRect, - textRect, isSelected); - - if (cropShape) - { - paintCroppedTabEdge(g, tabPlacement, tabIndex, isSelected, cropx, - cropy); - g2.setClip(save); - } - else if (isOver || isSelected) - { - int dx = tabRect.x + tabRect.width - BUTTONSIZE - WIDTHDELTA; - int dy = (tabRect.y + tabRect.height) / 2 - 7; - - if (isCloseButtonEnabled) - paintCloseIcon(g2, dx, dy, isOver); - if (isMaxButtonEnabled) - paintMaxIcon(g2, dx, dy, isOver); - } - - } - - protected void paintCloseIcon(Graphics g, int dx, int dy, boolean isOver) - { - // paintActionButton(g, dx, dy, closeIndexStatus, isOver, closeB, - // closeImgB); - g.drawImage(closeImgI, dx, dy + 1, null); - } - - protected void paintMaxIcon(Graphics g, int dx, int dy, boolean isOver) - { - if (isCloseButtonEnabled) - dx -= BUTTONSIZE; - - // paintActionButton(g, dx, dy, maxIndexStatus, isOver, maxB, maxImgB); - g.drawImage(maxImgI, dx, dy + 1, null); - } - - protected void paintActionButton(Graphics g, int dx, int dy, int status, - boolean isOver, JButton button, Image image) - { - button.setBorder(null); - - if (isOver) { - switch (status) { - case OVER: - button.setBorder(OVERBORDER); - break; - case PRESSED: - button.setBorder(PRESSEDBORDER); - break; - } - } - - button.setBackground(tabScroller.tabPanel.getBackground()); - button.paint(image.getGraphics()); - g.drawImage(image, dx, dy, null); - } - - /* - * This method will create and return a polygon shape for the given tab - * rectangle which has been cropped at the specified cropline with a torn - * edge visual. e.g. A "File" tab which has cropped been cropped just after - * the "i": ------------- | ..... | | . | | ... . | | . . | | . . | | . . | - * -------------- - * - * The x, y arrays below define the pattern used to create a "torn" edge - * segment which is repeated to fill the edge of the tab. For tabs placed on - * TOP and BOTTOM, this righthand torn edge is created by line segments - * which are defined by coordinates obtained by subtracting xCropLen[i] from - * (tab.x + tab.width) and adding yCroplen[i] to (tab.y). For tabs placed on - * LEFT or RIGHT, the bottom torn edge is created by subtracting xCropLen[i] - * from (tab.y + tab.height) and adding yCropLen[i] to (tab.x). - */ - - private static final int CROP_SEGMENT = 12; - - private void paintCroppedTabEdge(Graphics g, int tabPlacement, - int tabIndex, boolean isSelected, int x, int y) - { - g.setColor(shadow); - g.drawLine(x, y, x, y + rects[tabIndex].height); - - } - - private void ensureCurrentLayout() - { - if (!tabPane.isValid()) - { - tabPane.validate(); - } - /* - * If tabPane doesn't have a peer yet, the validate() call will silently - * fail. We handle that by forcing a layout if tabPane is still invalid. - * See bug 4237677. - */ - if (!tabPane.isValid()) - { - TabbedPaneLayout layout = (TabbedPaneLayout) tabPane.getLayout(); - layout.calculateLayoutInfo(); - } - } - - /** - * Returns the bounds of the specified tab in the coordinate space of the - * JTabbedPane component. This is required because the tab rects are by - * default defined in the coordinate space of the component where they are - * rendered, which could be the JTabbedPane (for WRAP_TAB_LAYOUT) or a - * ScrollableTabPanel (SCROLL_TAB_LAYOUT). This method should be used - * whenever the tab rectangle must be relative to the JTabbedPane itself and - * the result should be placed in a designated Rectangle object (rather than - * instantiating and returning a new Rectangle each time). The tab index - * parameter must be a valid tabbed pane tab index (0 to tab count - 1, - * inclusive). The destination rectangle parameter must be a valid - * Rectangle instance. The handling of invalid parameters is - * unspecified. - * - * @param tabIndex - * the index of the tab - * @param dest - * the rectangle where the result should be placed - * @return the resulting rectangle - * - * @since 1.4 - */ - - protected Rectangle getTabBounds(int tabIndex, Rectangle dest) - { - dest.width = rects[tabIndex].width; - dest.height = rects[tabIndex].height; - - Point vpp = tabScroller.viewport.getLocation(); - Point viewp = tabScroller.viewport.getViewPosition(); - dest.x = rects[tabIndex].x + vpp.x - viewp.x; - dest.y = rects[tabIndex].y + vpp.y - viewp.y; - - return dest; - } - - private int getTabAtLocation(int x, int y) - { - ensureCurrentLayout(); - - int tabCount = tabPane.getTabCount(); - for (int i = 0; i < tabCount; i++) - { - if (rects[i].contains(x, y)) - { - return i; - } - } - return -1; - } - - public int getOverTabIndex() - { - return overTabIndex; - } - - /** - * Returns the index of the tab closest to the passed in location, note that - * the returned tab may not contain the location x,y. - */ - private int getClosestTab(int x, int y) - { - int min = 0; - int tabCount = Math.min(rects.length, tabPane.getTabCount()); - int max = tabCount; - int tabPlacement = tabPane.getTabPlacement(); - boolean useX = (tabPlacement == TOP || tabPlacement == BOTTOM); - int want = (useX) ? x : y; - - while (min != max) - { - int current = (max + min) / 2; - int minLoc; - int maxLoc; - - if (useX) - { - minLoc = rects[current].x; - maxLoc = minLoc + rects[current].width; - } - else - { - minLoc = rects[current].y; - maxLoc = minLoc + rects[current].height; - } - if (want < minLoc) - { - max = current; - if (min == max) - { - return Math.max(0, current - 1); - } - } - else if (want >= maxLoc) - { - min = current; - if (max - min <= 1) - { - return Math.max(current + 1, tabCount - 1); - } - } - else - { - return current; - } - } - return min; - } - - /** - * Returns a point which is translated from the specified point in the - * JTabbedPane's coordinate space to the coordinate space of the - * ScrollableTabPanel. This is used for SCROLL_TAB_LAYOUT ONLY. - */ - private Point translatePointToTabPanel(int srcx, int srcy, Point dest) - { - Point vpp = tabScroller.viewport.getLocation(); - Point viewp = tabScroller.viewport.getViewPosition(); - dest.x = srcx + vpp.x + viewp.x; - dest.y = srcy + vpp.y + viewp.y; - return dest; - } - - // BasicTabbedPaneUI methods - - // Tab Navigation methods - - // REMIND(aim,7/29/98): This method should be made - // protected in the next release where - // API changes are allowed - // - boolean requestMyFocusForVisibleComponent() - { - Component visibleComponent = getVisibleComponent(); - if (visibleComponent.isFocusable()) - { - visibleComponent.requestFocus(); - return true; - } - else if (visibleComponent instanceof JComponent) - { - if (((JComponent) visibleComponent).requestFocusInWindow()) - { - return true; - } - } - return false; - } - - private static class RightAction extends AbstractAction - { - public void actionPerformed(ActionEvent e) - { - JTabbedPane pane = (JTabbedPane) e.getSource(); - SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) pane.getUI(); - ui.navigateSelectedTab(EAST); - } - }; - - private static class LeftAction extends AbstractAction - { - public void actionPerformed(ActionEvent e) - { - JTabbedPane pane = (JTabbedPane) e.getSource(); - SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) pane.getUI(); - ui.navigateSelectedTab(WEST); - } - }; - - private static class UpAction extends AbstractAction - { - public void actionPerformed(ActionEvent e) - { - JTabbedPane pane = (JTabbedPane) e.getSource(); - SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) pane.getUI(); - ui.navigateSelectedTab(NORTH); - } - }; - - private static class DownAction extends AbstractAction - { - public void actionPerformed(ActionEvent e) - { - JTabbedPane pane = (JTabbedPane) e.getSource(); - SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) pane.getUI(); - ui.navigateSelectedTab(SOUTH); - } - }; - - private static class NextAction extends AbstractAction - { - public void actionPerformed(ActionEvent e) - { - JTabbedPane pane = (JTabbedPane) e.getSource(); - SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) pane.getUI(); - ui.navigateSelectedTab(NEXT); - } - }; - - private static class PreviousAction extends AbstractAction - { - public void actionPerformed(ActionEvent e) - { - JTabbedPane pane = (JTabbedPane) e.getSource(); - SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) pane.getUI(); - ui.navigateSelectedTab(PREVIOUS); - } - }; - - private static class PageUpAction extends AbstractAction - { - public void actionPerformed(ActionEvent e) - { - JTabbedPane pane = (JTabbedPane) e.getSource(); - SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) pane.getUI(); - int tabPlacement = pane.getTabPlacement(); - if (tabPlacement == TOP || tabPlacement == BOTTOM) - { - ui.navigateSelectedTab(WEST); - } - else - { - ui.navigateSelectedTab(NORTH); - } - } - }; - - private static class PageDownAction extends AbstractAction - { - public void actionPerformed(ActionEvent e) { - JTabbedPane pane = (JTabbedPane) e.getSource(); - SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) pane.getUI(); - int tabPlacement = pane.getTabPlacement(); - if (tabPlacement == TOP || tabPlacement == BOTTOM) - { - ui.navigateSelectedTab(EAST); - } - else - { - ui.navigateSelectedTab(SOUTH); - } - } - }; - - private static class RequestFocusAction extends AbstractAction - { - public void actionPerformed(ActionEvent e) - { - JTabbedPane pane = (JTabbedPane) e.getSource(); - pane.requestFocus(); - } - }; - - private static class RequestFocusForVisibleAction extends AbstractAction - { - public void actionPerformed(ActionEvent e) - { - JTabbedPane pane = (JTabbedPane) e.getSource(); - SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) pane.getUI(); - ui.requestMyFocusForVisibleComponent(); - } - }; - - /** - * Selects a tab in the JTabbedPane based on the String of the action - * command. The tab selected is based on the first tab that has a mnemonic - * matching the first character of the action command. - */ - private static class SetSelectedIndexAction extends AbstractAction - { - public void actionPerformed(ActionEvent e) - { - JTabbedPane pane = (JTabbedPane) e.getSource(); - - if (pane != null && (pane.getUI() instanceof SIPCommTabbedPaneUI)) - { - SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) pane.getUI(); - String command = e.getActionCommand(); - - if (command != null && command.length() > 0) - { - int mnemonic = (int) e.getActionCommand().charAt(0); - if (mnemonic >= 'a' && mnemonic <= 'z') - { - mnemonic -= ('a' - 'A'); - } - - Integer index = (Integer) ui.mnemonicToIndexMap - .get(new Integer(mnemonic)); - if (index != null && pane.isEnabledAt(index.intValue())) - { - pane.setSelectedIndex(index.intValue()); - } - } - } - } - }; - - private static class ScrollTabsForwardAction - extends AbstractAction - { - public void actionPerformed(ActionEvent e) - { - JTabbedPane pane = null; - Object src = e.getSource(); - if (src instanceof JTabbedPane) - { - pane = (JTabbedPane) src; - } - else if (src instanceof ScrollableTabButton) - { - pane = (JTabbedPane) ((ScrollableTabButton) src).getParent(); - } - else - { - return; // shouldn't happen - } - SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) pane.getUI(); - - ui.tabScroller.scrollForward(pane.getTabPlacement()); - - } - } - - private static class ScrollTabsBackwardAction - extends AbstractAction - { - public void actionPerformed(ActionEvent e) - { - JTabbedPane pane = null; - Object src = e.getSource(); - if (src instanceof JTabbedPane) - { - pane = (JTabbedPane) src; - } - else if (src instanceof ScrollableTabButton) - { - pane = (JTabbedPane) ((ScrollableTabButton) src).getParent(); - } - else - { - return; // shouldn't happen - } - SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) pane.getUI(); - - ui.tabScroller.scrollBackward(pane.getTabPlacement()); - - } - } - - /** - * This inner class is marked "public" due to a compiler bug. This - * class should be treated as a "protected" inner class. - * Instantiate it only within subclasses of BasicTabbedPaneUI. - */ - private class TabbedPaneScrollLayout - extends TabbedPaneLayout - { - - protected int preferredTabAreaHeight(int tabPlacement, int width) - { - return calculateMaxTabHeight(tabPlacement); - } - - protected int preferredTabAreaWidth(int tabPlacement, int height) - { - return calculateMaxTabWidth(tabPlacement); - } - - public void layoutContainer(Container parent) - { - int tabPlacement = tabPane.getTabPlacement(); - int tabCount = tabPane.getTabCount(); - Insets insets = tabPane.getInsets(); - int selectedIndex = tabPane.getSelectedIndex(); - Component visibleComponent = getVisibleComponent(); - - calculateLayoutInfo(); - - if (selectedIndex < 0) - { - if (visibleComponent != null) - { - // The last tab was removed, so remove the component - setVisibleComponent(null); - } - } - else - { - Component selectedComponent = - tabPane.getComponentAt(selectedIndex); - boolean shouldChangeFocus = false; - - // In order to allow programs to use a single component - // as the display for multiple tabs, we will not change - // the visible compnent if the currently selected tab - // has a null component. This is a bit dicey, as we don't - // explicitly state we support this in the spec, but since - // programs are now depending on this, we're making it work. - // - if (selectedComponent != null) - { - if (selectedComponent != visibleComponent - && visibleComponent != null) - { - if (KeyboardFocusManager.getCurrentKeyboardFocusManager() - .getFocusOwner() != null) - { - shouldChangeFocus = true; - } - } - setVisibleComponent(selectedComponent); - } - int tx, ty, tw, th; // tab area bounds - int cx, cy, cw, ch; // content area bounds - Insets contentInsets = getContentBorderInsets(tabPlacement); - Rectangle bounds = tabPane.getBounds(); - int numChildren = tabPane.getComponentCount(); - - if (numChildren > 0) - { - - // calculate tab area bounds - tw = bounds.width - insets.left - insets.right; - th = - calculateTabAreaHeight(tabPlacement, runCount, - maxTabHeight); - tx = insets.left; - ty = insets.top; - - // calculate content area bounds - cx = tx + contentInsets.left; - cy = ty + th + contentInsets.top; - cw = - bounds.width - insets.left - insets.right - - contentInsets.left - contentInsets.right; - ch = - bounds.height - insets.top - insets.bottom - th - - contentInsets.top - contentInsets.bottom; - - for (int i = 0; i < numChildren; i++) - { - Component child = tabPane.getComponent(i); - - if (child instanceof ScrollableTabViewport) - { - JViewport viewport = (JViewport) child; - Rectangle viewRect = viewport.getViewRect(); - int vw = tw; - int vh = th; - - int totalTabWidth = - rects[tabCount - 1].x - + rects[tabCount - 1].width; - if (totalTabWidth > tw) - { - // Need to allow space for scrollbuttons - vw = Math.max(tw - 36, 36); - ; - if (totalTabWidth - viewRect.x <= vw) - { - // Scrolled to the end, so ensure the - // viewport size is - // such that the scroll offset aligns with a - // tab - vw = totalTabWidth - viewRect.x; - } - } - - child.setBounds(tx, ty, vw, vh); - - } - else if (child instanceof ScrollableTabButton) - { - ScrollableTabButton scrollbutton = - (ScrollableTabButton) child; - Dimension bsize = scrollbutton.getPreferredSize(); - int bx = 0; - int by = 0; - int bw = bsize.width; - int bh = bsize.height; - boolean visible = false; - - int totalTabWidth = - rects[tabCount - 1].x - + rects[tabCount - 1].width; - - if (totalTabWidth > tw) - { - int dir = - scrollbutton.scrollsForward() ? EAST : WEST; - scrollbutton.setDirection(dir); - visible = true; - bx = - dir == EAST ? bounds.width - insets.left - - bsize.width : bounds.width - - insets.left - 2 * bsize.width; - by = - (tabPlacement == TOP ? ty + th - - bsize.height : ty); - } - - child.setVisible(visible); - if (visible) - { - child.setBounds(bx, by, bw, bh); - } - - } - else - { - // All content children... - child.setBounds(cx, cy, cw, ch); - } - } - if (shouldChangeFocus) - { - if (!requestMyFocusForVisibleComponent()) - { - tabPane.requestFocus(); - } - } - } - } - } - - protected void calculateTabRects(int tabPlacement, int tabCount) - { - FontMetrics metrics = getFontMetrics(); - Dimension size = tabPane.getSize(); - Insets insets = tabPane.getInsets(); - Insets tabAreaInsets = getTabAreaInsets(tabPlacement); - int fontHeight = metrics.getHeight(); - int selectedIndex = tabPane.getSelectedIndex(); - int i, j; - - int x = tabAreaInsets.left - 2; - int y = tabAreaInsets.top; - int totalWidth = 0; - int totalHeight = 0; - - // - // Calculate bounds within which a tab run must fit - // - maxTabHeight = calculateMaxTabHeight(tabPlacement); - - runCount = 0; - selectedRun = -1; - - if (tabCount == 0) - return; - - selectedRun = 0; - runCount = 1; - - // Run through tabs and lay them out in a single run - Rectangle rect; - for (i = 0; i < tabCount; i++) - { - rect = rects[i]; - - if (i > 0) - { - rect.x = rects[i - 1].x + rects[i - 1].width - 1; - } - else - { - tabRuns[0] = 0; - maxTabWidth = 0; - totalHeight += maxTabHeight; - rect.x = x; - } - rect.width = calculateTabWidth(tabPlacement, i, metrics); - totalWidth = rect.x + rect.width; - maxTabWidth = Math.max(maxTabWidth, rect.width); - - rect.y = y; - rect.height = maxTabHeight /* - 2 */; - } - - // tabPanel.setSize(totalWidth, totalHeight); - tabScroller.tabPanel.setPreferredSize(new Dimension(totalWidth, - totalHeight)); - } - } - - private class ScrollableTabSupport implements ChangeListener - { - public ScrollableTabViewport viewport; - - public ScrollableTabPanel tabPanel; - - public ScrollableTabButton scrollForwardButton; - - public ScrollableTabButton scrollBackwardButton; - - public int leadingTabIndex; - - private Point tabViewPosition = new Point(0, 0); - - ScrollableTabSupport(int tabPlacement) - { - viewport = new ScrollableTabViewport(); - tabPanel = new ScrollableTabPanel(); - viewport.setView(tabPanel); - viewport.addChangeListener(this); - - scrollForwardButton = createScrollableTabButton(EAST); - scrollBackwardButton = createScrollableTabButton(WEST); - // scrollForwardButton = new ScrollableTabButton(EAST); - // scrollBackwardButton = new ScrollableTabButton(WEST); - } - - public void scrollForward(int tabPlacement) - { - Dimension viewSize = viewport.getViewSize(); - Rectangle viewRect = viewport.getViewRect(); - - if (tabPlacement == TOP || tabPlacement == BOTTOM) - { - if (viewRect.width >= viewSize.width - viewRect.x) - return; // no room left to scroll - } - else - { // tabPlacement == LEFT || tabPlacement == RIGHT - if (viewRect.height >= viewSize.height - viewRect.y) - return; - } - setLeadingTabIndex(tabPlacement, leadingTabIndex + 1); - } - - public void scrollBackward(int tabPlacement) - { - if (leadingTabIndex == 0) - return; // no room left to scroll - - setLeadingTabIndex(tabPlacement, leadingTabIndex - 1); - } - - public void setLeadingTabIndex(int tabPlacement, int index) - { - leadingTabIndex = index; - Dimension viewSize = viewport.getViewSize(); - Rectangle viewRect = viewport.getViewRect(); - - tabViewPosition.x = leadingTabIndex == 0 ? 0 - : rects[leadingTabIndex].x; - - if ((viewSize.width - tabViewPosition.x) < viewRect.width) - { - // We've scrolled to the end, so adjust the viewport size - // to ensure the view position remains aligned on a tab boundary - Dimension extentSize = new Dimension(viewSize.width - - tabViewPosition.x, viewRect.height); - viewport.setExtentSize(extentSize); - } - - viewport.setViewPosition(tabViewPosition); - } - - public void stateChanged(ChangeEvent e) - { - JViewport viewport = (JViewport) e.getSource(); - int tabPlacement = tabPane.getTabPlacement(); - int tabCount = tabPane.getTabCount(); - Rectangle vpRect = viewport.getBounds(); - Dimension viewSize = viewport.getViewSize(); - Rectangle viewRect = viewport.getViewRect(); - - leadingTabIndex = getClosestTab(viewRect.x, viewRect.y); - - // If the tab isn't right aligned, adjust it. - if (leadingTabIndex + 1 < tabCount) - { - - if (rects[leadingTabIndex].x < viewRect.x) - leadingTabIndex++; - } - Insets contentInsets = getContentBorderInsets(tabPlacement); - - tabPane.repaint(vpRect.x, vpRect.y + vpRect.height, vpRect.width, - contentInsets.top); - scrollBackwardButton.setEnabled(viewRect.x > 0); - scrollForwardButton.setEnabled(leadingTabIndex < tabCount - 1 - && viewSize.width - viewRect.x > viewRect.width); - - } - - public String toString() - { - return new String("viewport.viewSize=" + viewport.getViewSize() - + "\n" + "viewport.viewRectangle=" + viewport.getViewRect() - + "\n" + "leadingTabIndex=" + leadingTabIndex + "\n" - + "tabViewPosition=" + tabViewPosition); - } - - } - - private class ScrollableTabViewport - extends JViewport - implements UIResource - { - public ScrollableTabViewport() - { - super(); - setOpaque(false); - setScrollMode(SIMPLE_SCROLL_MODE); - } - } - - private class ScrollableTabPanel - extends TransparentPanel - implements UIResource - { - public ScrollableTabPanel() - { - setLayout(null); - } - - public void paintComponent(Graphics g) - { - super.paintComponent(g); - SIPCommTabbedPaneUI.this.paintTabArea(g, tabPane.getTabPlacement(), - tabPane.getSelectedIndex()); - } - } - - protected class ScrollableTabButton extends BasicArrowButton implements - UIResource, SwingConstants - { - public ScrollableTabButton(int direction) - { - super(direction, UIManager.getColor("TabbedPane.selected"), - UIManager.getColor("TabbedPane.shadow"), UIManager - .getColor("TabbedPane.darkShadow"), UIManager - .getColor("TabbedPane.highlight")); - - } - - public boolean scrollsForward() - { - return direction == EAST || direction == SOUTH; - } - - } - - /** - * This inner class is marked "public" due to a compiler bug. This - * class should be treated as a "protected" inner class. - * Instantiate it only within subclasses of BasicTabbedPaneUI. - */ - public class TabSelectionHandler implements ChangeListener - { - public void stateChanged(ChangeEvent e) - { - JTabbedPane tabPane = (JTabbedPane) e.getSource(); - tabPane.revalidate(); - tabPane.repaint(); - - if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) - { - int index = tabPane.getSelectedIndex(); - - if (index < rects.length && index != -1) - tabScroller.tabPanel.scrollRectToVisible(rects[index]); - } - } - } - - /** - * This inner class is marked "public" due to a compiler bug. This - * class should be treated as a "protected" inner class. - * Instantiate it only within subclasses of BasicTabbedPaneUI. - */ - - /* - * GES 2/3/99: The container listener code was added to support HTML - * rendering of tab titles. - * - * Ideally, we would be able to listen for property changes when a tab is - * added or its text modified. At the moment there are no such events - * because the Beans spec doesn't allow 'indexed' property changes (i.e. tab - * 2's text changed from A to B). - * - * In order to get around this, we listen for tabs to be added or removed by - * listening for the container events. we then queue up a runnable (so the - * component has a chance to complete the add) which checks the tab title of - * the new component to see if it requires HTML rendering. - * - * The Views (one per tab title requiring HTML rendering) are stored in the - * htmlViews Vector, which is only allocated after the first time we run - * into an HTML tab. Note that this vector is kept in step with the number - * of pages, and nulls are added for those pages whose tab title do not - * require HTML rendering. - * - * This makes it easy for the paint and layout code to tell whether to - * invoke the HTML engine without having to check the string during - * time-sensitive operations. - * - * When we have added a way to listen for tab additions and changes to tab - * text, this code should be removed and replaced by something which uses - * that. - */ - - private class ContainerHandler implements ContainerListener - { - public void componentAdded(ContainerEvent e) - { - JTabbedPane tp = (JTabbedPane) e.getContainer(); - Component child = e.getChild(); - if (child instanceof UIResource) - return; - - int index = tp.indexOfComponent(child); - String title = tp.getTitleAt(index); - - boolean isHTML = BasicHTML.isHTMLString(title); - if (isHTML) - { - if (htmlViews == null) - { // Initialize vector - htmlViews = createHTMLVector(); - } - else - { // Vector already exists - View v = BasicHTML.createHTMLView(tp, title); - htmlViews.insertElementAt(v, index); - } - } - else - { // Not HTML - if (htmlViews != null) - { // Add placeholder - htmlViews.insertElementAt(null, index); - } // else nada! - } - } - - public void componentRemoved(ContainerEvent e) - { - JTabbedPane tp = (JTabbedPane) e.getContainer(); - Component child = e.getChild(); - if (child instanceof UIResource) - return; - - // NOTE 4/15/2002 (joutwate): - // This fix is implemented using client properties since there is - // currently no IndexPropertyChangeEvent. Once - // IndexPropertyChangeEvents have been added this code should be - // modified to use it. - Integer indexObj = (Integer) tp - .getClientProperty("__index_to_remove__"); - if (indexObj != null) - { - int index = indexObj.intValue(); - if (htmlViews != null && htmlViews.size() >= index) - { - htmlViews.removeElementAt(index); - } - } - } - } - - private Vector createHTMLVector() - { - Vector htmlViews = new Vector(); - int count = tabPane.getTabCount(); - if (count > 0) { - for (int i = 0; i < count; i++) - { - String title = tabPane.getTitleAt(i); - if (BasicHTML.isHTMLString(title)) - { - htmlViews.addElement(BasicHTML.createHTMLView(tabPane, - title)); - } - else - { - htmlViews.addElement(null); - } - } - } - return htmlViews; - } - - class MyMouseHandler extends MouseHandler - { - public MyMouseHandler() - { - super(); - } - - public void mousePressed(MouseEvent e) - { - if (closeIndexStatus == OVER) - { - closeIndexStatus = PRESSED; - tabScroller.tabPanel.repaint(); - } - else if (maxIndexStatus == OVER) - { - maxIndexStatus = PRESSED; - tabScroller.tabPanel.repaint(); - } - else - { - super.mousePressed(e); - } - } - - public void mouseClicked(MouseEvent e) - { - if (e.getClickCount() > 1 && overTabIndex != -1) - { - ((SIPCommTabbedPane) tabPane).fireDoubleClickTabEvent(e, - overTabIndex); - } - } - - public void mouseReleased(MouseEvent e) - { - updateOverTab(e.getX(), e.getY()); - - if (overTabIndex == -1) { - if (e.isPopupTrigger()) - ((SIPCommTabbedPane) tabPane).firePopupOutsideTabEvent(e); - return; - } - - if (isOneActionButtonEnabled() && e.isPopupTrigger()) - { - super.mousePressed(e); - - closeIndexStatus = INACTIVE; // Prevent undesired action when - maxIndexStatus = INACTIVE; // right-clicking on icons - - actionPopupMenu.show(tabScroller.tabPanel, e.getX(), e.getY()); - return; - } - - if (closeIndexStatus == PRESSED) - { - closeIndexStatus = OVER; - tabScroller.tabPanel.repaint(); - ((SIPCommTabbedPane) tabPane) - .fireCloseTabEvent(e, overTabIndex); - return; - } - - if (maxIndexStatus == PRESSED) - { - maxIndexStatus = OVER; - tabScroller.tabPanel.repaint(); - ((SIPCommTabbedPane) tabPane).fireMaxTabEvent(e, overTabIndex); - return; - } - - } - - public void mouseExited(MouseEvent e) - { - if (!mousePressed) - { - overTabIndex = -1; - tabScroller.tabPanel.repaint(); - } - } - - } - - class MyMouseMotionListener - implements MouseMotionListener - { - - public void mouseMoved(MouseEvent e) - { - if (actionPopupMenu.isVisible()) - return; // No updates when popup is visible - mousePressed = false; - setTabIcons(e.getX(), e.getY()); - } - - public void mouseDragged(MouseEvent e) - { - if (actionPopupMenu.isVisible()) - return; // No updates when popup is visible - mousePressed = true; - setTabIcons(e.getX(), e.getY()); - } - } - - public void tabAddHightlight(int tabIndex) - { - this.highlightedTabs.add(new Integer(tabIndex)); - } - - public void tabRemoveHighlight(int tabIndex) - { - Enumeration highlightedEnum = this.highlightedTabs.elements(); - - while (highlightedEnum.hasMoreElements()) - { - Integer element = (Integer) highlightedEnum.nextElement(); - - if (element.intValue() == tabIndex) - { - this.highlightedTabs.remove(element); - break; - } - } - } - - public boolean isTabHighlighted(int tabIndex) - { - Enumeration highlightedEnum = this.highlightedTabs.elements(); - - while (highlightedEnum.hasMoreElements()) - { - Integer element = (Integer) highlightedEnum.nextElement(); - - if (element.intValue() == tabIndex) - return true; - } - return false; - } - - /** - * We don't want to have a content border. - */ - protected void paintContentBorder( Graphics g, - int tabPlacement, - int selectedIndex) - { - } -} \ No newline at end of file diff --git a/src/net/java/sip/communicator/swing/swing.common.manifest.mf b/src/net/java/sip/communicator/swing/swing.common.manifest.mf deleted file mode 100644 index 106517a..0000000 --- a/src/net/java/sip/communicator/swing/swing.common.manifest.mf +++ /dev/null @@ -1,20 +0,0 @@ -Bundle-Activator: net.java.sip.communicator.swing.SwingCommonActivator -Bundle-Name: Swing Common -Bundle-Description: Common/generic Swing additions not specific to SIP Communicator -Bundle-Vendor: sip-communicator.org -Bundle-Version: 0.0.1 -Import-Package: javax.imageio, - javax.swing, - javax.swing.border, - javax.swing.event, - javax.swing.plaf, - javax.swing.plaf.basic, - javax.swing.text, - net.java.sip.communicator.service.configuration, - net.java.sip.communicator.service.keybindings, - net.java.sip.communicator.service.resources, - net.java.sip.communicator.util, - org.osgi.framework -Export-Package: net.java.sip.communicator.swing, - net.java.sip.communicator.swing.event, - net.java.sip.communicator.swing.plaf diff --git a/src/net/java/sip/communicator/util/UtilActivator.java b/src/net/java/sip/communicator/util/UtilActivator.java index b7f6a5d..e271294 100644 --- a/src/net/java/sip/communicator/util/UtilActivator.java +++ b/src/net/java/sip/communicator/util/UtilActivator.java @@ -6,6 +6,15 @@ */ package net.java.sip.communicator.util; +import java.awt.image.*; +import java.io.*; +import java.net.*; +import java.util.*; + +import javax.imageio.*; + +import net.java.sip.communicator.service.configuration.*; +import net.java.sip.communicator.service.keybindings.*; import net.java.sip.communicator.service.resources.*; import org.osgi.framework.*; @@ -25,10 +34,17 @@ public class UtilActivator private static final Logger logger = Logger.getLogger(UtilActivator.class); + private static ConfigurationService configurationService; + + private static KeybindingsService keybindingsService; + private static ResourceManagementService resourceService; private static BundleContext bundleContext; + private static final Map imageCache = + new HashMap(); + /** * Calls Thread.setUncaughtExceptionHandler() * @@ -47,7 +63,6 @@ public class UtilActivator bundleContext = context; Thread.setDefaultUncaughtExceptionHandler(this); - Thread.currentThread().setDefaultUncaughtExceptionHandler(this); } /** @@ -85,6 +100,38 @@ public class UtilActivator } + public static ConfigurationService getConfigurationService() + { + if (configurationService == null) + { + ServiceReference serviceReference = + bundleContext.getServiceReference(ConfigurationService.class + .getName()); + + if (serviceReference != null) + configurationService = + (ConfigurationService) bundleContext + .getService(serviceReference); + } + return configurationService; + } + + public static KeybindingsService getKeybindingsService() + { + if (keybindingsService == null) + { + ServiceReference serviceReference = + bundleContext.getServiceReference(KeybindingsService.class + .getName()); + + if (serviceReference != null) + keybindingsService = + (KeybindingsService) bundleContext + .getService(serviceReference); + } + return keybindingsService; + } + /** * Returns the service giving access to all application resources. * @@ -98,4 +145,27 @@ public class UtilActivator return resourceService; } + + public static BufferedImage getImage(String key) + { + if (imageCache.containsKey(key)) + return imageCache.get(key); + + URL url = getResources().getImageURL(key); + BufferedImage image = null; + if (url != null) + { + try + { + image = ImageIO.read(url); + + imageCache.put(key, image); + } + catch (IOException ex) + { + logger.error("Failed to load image " + key, ex); + } + } + return image; + } } diff --git a/src/net/java/sip/communicator/util/swing/AntialiasingManager.java b/src/net/java/sip/communicator/util/swing/AntialiasingManager.java new file mode 100644 index 0000000..12c0bd7 --- /dev/null +++ b/src/net/java/sip/communicator/util/swing/AntialiasingManager.java @@ -0,0 +1,32 @@ +/* + * 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.util.swing; + +import java.awt.*; + +/** + * Through the AntialiasingManager the developer could activate the + * antialiasing mechanism when painting. The method that do the job is + * the activateAntialiasing method. It takes a Graphics + * object and activates the antialiasing for it. + * + * @author Yana Stamcheva + */ +public class AntialiasingManager { + + /** + * Activates the antialiasing mechanism for the given Graphics + * object. + * @param g The Graphics object. + */ + public static void activateAntialiasing(Graphics g) { + Graphics2D g2d = (Graphics2D) g; + + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + } +} diff --git a/src/net/java/sip/communicator/util/swing/FitLayout.java b/src/net/java/sip/communicator/util/swing/FitLayout.java new file mode 100644 index 0000000..f57d9b3 --- /dev/null +++ b/src/net/java/sip/communicator/util/swing/FitLayout.java @@ -0,0 +1,136 @@ +/* + * 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.util.swing; + +import java.awt.*; + +/** + * Represents a LayoutManager which centers the first + * Component within its Container and, if the + * preferred size of the Component is larger than the size of the + * Container, scales the former within the bounds of the latter + * while preserving the aspect ratio. FitLayout is appropriate for + * Containers which display a single image or video + * Component in its entirety for which preserving the aspect ratio + * is important. + * + * @author Lubomir Marinov + */ +public class FitLayout + implements LayoutManager +{ + + /* + * Does nothing because this LayoutManager lays out only the first Component + * of the parent Container and thus doesn't need String associations. + */ + public void addLayoutComponent(String name, Component comp) + { + } + + /** + * Gets the first Component of a specific + * Container if there is such a Component. + * + * @param parent the Container to retrieve the first + * Component of + * @return the first Component of a specific + * Container if there is such a Component; + * otherwise, null + */ + protected Component getComponent(Container parent) + { + Component[] components = parent.getComponents(); + + return (components.length > 0) ? components[0] : null; + } + + protected void layoutComponent(Component component, Rectangle bounds, + float alignmentX, float alignmentY) + { + Dimension componentSize = component.getPreferredSize(); + boolean scale = false; + double ratio = 1; + + if ((componentSize.width != bounds.width) && (componentSize.width > 0)) + { + scale = true; + ratio = bounds.width / (double) componentSize.width; + } + if ((componentSize.height != bounds.height) + && (componentSize.height > 0)) + { + scale = true; + ratio = + Math.min(bounds.height / (double) componentSize.height, ratio); + } + if (scale) + { + componentSize.width = (int) (componentSize.width * ratio); + componentSize.height = (int) (componentSize.height * ratio); + } + + component.setBounds(bounds.x + + Math.round((bounds.width - componentSize.width) * alignmentX), + bounds.y + + Math.round((bounds.height - componentSize.height) + * alignmentY), componentSize.width, componentSize.height); + } + + /* + * Scales the first Component if its preferred size is larger than the size + * of its parent Container in order to display the Component in its entirety + * and then centers it within the display area of the parent. + */ + public void layoutContainer(Container parent) + { + layoutContainer(parent, Component.CENTER_ALIGNMENT); + } + + protected void layoutContainer(Container parent, float componentAlignmentX) + { + Component component = getComponent(parent); + + if (component != null) + layoutComponent(component, new Rectangle(parent.getSize()), + componentAlignmentX, Component.CENTER_ALIGNMENT); + } + + /* + * Since this LayoutManager lays out only the first Component of the + * specified parent Container, the minimum size of the Container is the + * minimum size of the mentioned Component. + */ + public Dimension minimumLayoutSize(Container parent) + { + Component component = getComponent(parent); + + return (component != null) ? component.getMinimumSize() + : new Dimension(0, 0); + } + + /* + * Since this LayoutManager lays out only the first Component of the + * specified parent Container, the preferred size of the Container is the + * preferred size of the mentioned Component. + */ + public Dimension preferredLayoutSize(Container parent) + { + Component component = getComponent(parent); + + return (component != null) ? component.getPreferredSize() + : new Dimension(0, 0); + } + + /* + * Does nothing because this LayoutManager lays out only the first Component + * of the parent Container and thus doesn't need String associations. + */ + public void removeLayoutComponent(Component comp) + { + } +} diff --git a/src/net/java/sip/communicator/util/swing/ImageCanvas.java b/src/net/java/sip/communicator/util/swing/ImageCanvas.java new file mode 100644 index 0000000..6fe4347 --- /dev/null +++ b/src/net/java/sip/communicator/util/swing/ImageCanvas.java @@ -0,0 +1,72 @@ +/* + * 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.util.swing; + +import java.awt.*; + +import javax.swing.*; + +/** + * @author Lubomir Marinov + */ +public class ImageCanvas + extends TransparentPanel +{ + private final ImageIcon icon; + + public ImageCanvas(Image image) + { + icon = (image == null) ? null : new ImageIcon(image); + + if (icon != null) + { + final int preferredWidth = icon.getIconWidth(); + final int preferredHeight = icon.getIconHeight(); + setMinimumSize(new Dimension(preferredWidth / 2, + preferredHeight / 2)); + setPreferredSize(new Dimension(preferredWidth, preferredHeight)); + } + } + + protected void paintComponent(Graphics g) + { + super.paintComponent(g); + + if (icon == null) + return; + + int imageWidth = icon.getIconWidth(); + if (imageWidth < 1) + return; + int imageHeight = icon.getIconHeight(); + if (imageHeight < 1) + return; + + int width = getWidth(); + boolean scale = false; + float scaleFactor = 1; + if (imageWidth > width) + { + scale = true; + scaleFactor = width / (float) imageWidth; + } + int height = getHeight(); + if (imageHeight > height) + { + scale = true; + scaleFactor = Math.min(scaleFactor, height / (float) imageHeight); + } + if (scale) + { + imageWidth = Math.round(imageWidth * scaleFactor); + imageHeight = Math.round(imageHeight * scaleFactor); + } + + g.drawImage(icon.getImage(), (width - imageWidth) / 2, + (height - imageHeight) / 2, imageWidth, imageHeight, null); + } +} diff --git a/src/net/java/sip/communicator/util/swing/SIPCommCheckBox.java b/src/net/java/sip/communicator/util/swing/SIPCommCheckBox.java new file mode 100644 index 0000000..cabac5c --- /dev/null +++ b/src/net/java/sip/communicator/util/swing/SIPCommCheckBox.java @@ -0,0 +1,49 @@ +/* + * 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.util.swing; + +import javax.swing.*; + +/** + * @author Lubomir Marinov + */ +public class SIPCommCheckBox + extends JCheckBox +{ + private static final boolean setContentAreaFilled = isWindows(); + + private static boolean isWindows() + { + String osName = System.getProperty("os.name"); + return (osName != null) && (osName.indexOf("Windows") != -1); + } + + public SIPCommCheckBox() + { + init(); + } + + public SIPCommCheckBox(String text) + { + super(text); + + init(); + } + + public SIPCommCheckBox(String text, boolean selected) + { + super(text, selected); + + init(); + } + + private void init() + { + if (setContentAreaFilled) + setContentAreaFilled(false); + } +} diff --git a/src/net/java/sip/communicator/util/swing/SIPCommDialog.java b/src/net/java/sip/communicator/util/swing/SIPCommDialog.java new file mode 100644 index 0000000..8993565 --- /dev/null +++ b/src/net/java/sip/communicator/util/swing/SIPCommDialog.java @@ -0,0 +1,384 @@ +/* + * 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.util.swing; + +import java.awt.*; +import java.awt.event.*; + +import javax.swing.*; + +import net.java.sip.communicator.service.configuration.*; +import net.java.sip.communicator.util.*; + +public abstract class SIPCommDialog extends JDialog +{ + private Logger logger = Logger.getLogger(SIPCommDialog.class); + + private ActionMap amap; + private InputMap imap; + + private boolean isSaveSizeAndLocation = true; + + public SIPCommDialog() + { + super(); + + this.init(); + } + + public SIPCommDialog(Dialog owner) + { + super(owner); + + this.init(); + } + + public SIPCommDialog(Frame owner) + { + super(owner); + + this.init(); + } + + public SIPCommDialog(boolean isSaveSizeAndLocation) + { + this(); + + this.isSaveSizeAndLocation = isSaveSizeAndLocation; + } + + public SIPCommDialog(Dialog owner, boolean isSaveSizeAndLocation) + { + this(owner); + + this.isSaveSizeAndLocation = isSaveSizeAndLocation; + } + + public SIPCommDialog(Frame owner, boolean isSaveSizeAndLocation) + { + this(owner); + + this.isSaveSizeAndLocation = isSaveSizeAndLocation; + } + + /** + * Initializes this dialog. + */ + private void init() + { + this.setContentPane(new SIPCommFrame.MainContentPane()); + + this.addWindowListener(new DialogWindowAdapter()); + + this.initInputMap(); + } + + private void initInputMap() + { + amap = this.getRootPane().getActionMap(); + + amap.put("close", new CloseAction()); + + imap = this.getRootPane().getInputMap( + JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); + + imap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "close"); + } + + /** + * The action invoked when user presses Escape key. + */ + private class CloseAction extends AbstractAction + { + public void actionPerformed(ActionEvent e) + { + if(isSaveSizeAndLocation) + saveSizeAndLocation(); + + close(true); + } + } + + /** + * Adds a key - action pair for this frame. + * + * @param keyStroke the key combination + * @param action the action which will be executed when user presses the + * given key combination + */ + protected void addKeyBinding(KeyStroke keyStroke, Action action) + { + String actionID = action.getClass().getName(); + + amap.put(actionID, action); + + imap.put(keyStroke, actionID); + } + + /** + * Before closing the application window saves the current size and position + * through the ConfigurationService. + */ + public class DialogWindowAdapter extends WindowAdapter + { + public void windowClosing(WindowEvent e) + { + if(isSaveSizeAndLocation) + saveSizeAndLocation(); + + close(false); + } + } + + /** + * Saves the size and the location of this dialog through the + * ConfigurationService. + */ + private void saveSizeAndLocation() + { + ConfigurationService configService = + UtilActivator.getConfigurationService(); + + String className = this.getClass().getName(); + + try { + configService.setProperty( + className + ".width", + new Integer(getWidth())); + + configService.setProperty( + className + ".height", + new Integer(getHeight())); + + configService.setProperty( + className + ".x", + new Integer(getX())); + + configService.setProperty( + className + ".y", + new Integer(getY())); + } + catch (PropertyVetoException e1) { + logger.error("The proposed property change " + + "represents an unacceptable value"); + } + } + + /** + * Sets window size and position. + */ + private void setSizeAndLocation() + { + ConfigurationService configService = + UtilActivator.getConfigurationService(); + + String className = this.getClass().getName(); + + String widthString = configService.getString( + className + ".width"); + + String heightString = configService.getString( + className + ".height"); + + String xString = configService.getString( + className + ".x"); + + String yString = configService.getString( + className + ".y"); + + int width = 0; + int height = 0; + + if(widthString != null && heightString != null) + { + width = new Integer(widthString).intValue(); + height = new Integer(heightString).intValue(); + + if(width > 0 && height > 0) + this.setSize(width, height); + } + + if(xString != null && yString != null) + { + this.setLocation(new Integer(xString).intValue(), + new Integer(yString).intValue()); + } + else { + this.setCenterLocation(); + } + } + + /** + * Positions this window in the center of the screen. + */ + private void setCenterLocation() + { + this.setLocation( + Toolkit.getDefaultToolkit().getScreenSize().width/2 + - this.getWidth()/2, + Toolkit.getDefaultToolkit().getScreenSize().height/2 + - this.getHeight()/2 + ); + } + + /** + * Checks whether the current component will + * exceeds the screen size and if it do will set a default size + */ + private void ensureOnScreenLocationAndSize() + { + int x = this.getX(); + int y = this.getY(); + + int width = this.getWidth(); + int height = this.getHeight(); + + Rectangle virtualBounds = ScreenInformation.getScreenBounds(); + + // the default distance to the screen border + final int borderDistance = 10; + + // in case any of the sizes exceeds the screen size + // we set default one + // get the left upper point of the window + if (!(virtualBounds.contains(x, y))) + { + // top left exceeds screen bounds + if (x < virtualBounds.x) + { + // window is too far to the left + // move it to the right + x = virtualBounds.x + borderDistance; + } else if (x > virtualBounds.x) + { + // window is too far to the right + // can only occour, when screen resolution is + // changed or displayed are disconnected + + // move the window in the bounds to the very right + x = virtualBounds.x + virtualBounds.width - width + - borderDistance; + if (x < virtualBounds.x + borderDistance) + { + x = virtualBounds.x + borderDistance; + } + } + + // top left exceeds screen bounds + if (y < virtualBounds.y) + { + // window is too far to the top + // move it to the bottom + y = virtualBounds.y + borderDistance; + } else if (y > virtualBounds.y) + { + // window is too far to the bottom + // can only occour, when screen resolution is + // changed or displayed are disconnected + + // move the window in the bounds to the very bottom + y = virtualBounds.y + virtualBounds.height - height + - borderDistance; + if (y < virtualBounds.y + borderDistance) + { + y = virtualBounds.y + borderDistance; + } + } + this.setLocation(x, y); + } + + // check the lower right corder + if (!(virtualBounds.contains(x + width, y + height))) + { + + if (x + width > virtualBounds.x + virtualBounds.width) + { + // location of window is too far to the right, its right + // border is out of bounds + + // calculate a new horizontal position + // move the whole window to the left + x = virtualBounds.x + virtualBounds.width - width + - borderDistance; + if (x < virtualBounds.x + borderDistance) + { + // window is already on left side, it is too wide. + x = virtualBounds.x + borderDistance; + // reduce the width, so it surely fits + width = virtualBounds.width - 2 * borderDistance; + } + } + if (y + height > virtualBounds.y + virtualBounds.height) + { + // location of window is too far to the bottom, its bottom + // border is out of bounds + + // calculate a new vertical position + // move the whole window to the top + y = virtualBounds.y + virtualBounds.height - height + - borderDistance; + if (y < virtualBounds.y + borderDistance) + { + // window is already on top, it is too high. + y = virtualBounds.y + borderDistance; + // reduce the width, so it surely fits + height = virtualBounds.height - 2 * borderDistance; + } + } + this.setPreferredSize(new Dimension(width, height)); + this.setSize(width, height); + this.setLocation(x, y); + } + } + + /** + * Overwrites the setVisible method in order to set the size and the + * position of this window before showing it. + */ + public void setVisible(boolean isVisible) + { + if(isVisible) + { + this.pack(); + + if(isSaveSizeAndLocation) + this.setSizeAndLocation(); + else + { + this.pack(); + this.setCenterLocation(); + } + + ensureOnScreenLocationAndSize(); + + JButton button = this.getRootPane().getDefaultButton(); + + if(button != null) + button.requestFocus(); + } + + super.setVisible(isVisible); + } + + /** + * Overwrites the dispose method in order to save the size and the position + * of this window before closing it. + */ + public void dispose() + { + if(isSaveSizeAndLocation) + this.saveSizeAndLocation(); + + super.dispose(); + } + + /** + * All functions implemented in this method will be invoked when user + * presses the Escape key. + */ + protected abstract void close(boolean isEscaped); +} diff --git a/src/net/java/sip/communicator/util/swing/SIPCommFrame.java b/src/net/java/sip/communicator/util/swing/SIPCommFrame.java new file mode 100644 index 0000000..fbcbafa --- /dev/null +++ b/src/net/java/sip/communicator/util/swing/SIPCommFrame.java @@ -0,0 +1,507 @@ +/* + * 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.util.swing; + +import java.awt.*; +import java.awt.event.*; +import java.awt.geom.*; +import java.util.*; + +import javax.swing.*; + +import net.java.sip.communicator.service.configuration.*; +import net.java.sip.communicator.service.keybindings.*; +import net.java.sip.communicator.service.resources.*; +import net.java.sip.communicator.util.*; + +/** + * A custom frame that remembers its size and location and could have a semi + * transparent background. + * + * @author Yana Stamcheva + */ +public abstract class SIPCommFrame + extends JFrame + implements Observer +{ + private static final String SIP_COMMUNICATOR_LOGO = + "service.gui.SIP_COMMUNICATOR_LOGO"; + + private final Logger logger = Logger.getLogger(SIPCommFrame.class); + + private final ActionMap amap; + + private final InputMap imap; + + private KeybindingSet bindings = null; + + public SIPCommFrame() + { + this.setContentPane(new MainContentPane()); + + Image scLogo = UtilActivator.getImage(SIP_COMMUNICATOR_LOGO); + this.setIconImage(scLogo); + + // In order to have the same icon when using option panes + JOptionPane.getRootFrame().setIconImage(scLogo); + + this.addWindowListener(new FrameWindowAdapter()); + + JRootPane rootPane = getRootPane(); + amap = rootPane.getActionMap(); + amap.put("close", new CloseAction()); + + imap = + rootPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); + } + + /** + * The action invoked when user presses Escape key. + */ + private class CloseAction + extends AbstractAction + { + public void actionPerformed(ActionEvent e) + { + saveSizeAndLocation(); + close(true); + } + } + + /** + * Sets the input map to utilize a given category of keybindings. The frame + * is updated to reflect the new bindings when they change. This replaces + * any previous bindings that have been added. + * + * @param category set of keybindings to be utilized + */ + protected void setKeybindingInput(KeybindingSet.Category category) + { + // Removes old binding set + if (this.bindings != null) + { + this.bindings.deleteObserver(this); + resetInputMap(); + } + + // Adds new bindings to input map + this.bindings = + UtilActivator.getKeybindingsService().getBindings(category); + + for (Map.Entry key2action : this.bindings + .getBindings().entrySet()) + { + imap.put(key2action.getKey(), key2action.getValue()); + } + + this.bindings.addObserver(this); + } + + /** + * Bindings the string representation for a keybinding to the action that + * will be executed. + * + * @param binding string representation of action used by input map + * @param action the action which will be executed when user presses the + * given key combination + */ + protected void addKeybindingAction(String binding, Action action) + { + amap.put(binding, action); + } + + /** + * Before closing the application window saves the current size and position + * through the ConfigurationService. + */ + public class FrameWindowAdapter + extends WindowAdapter + { + public void windowClosing(WindowEvent e) + { + saveSizeAndLocation(); + + close(false); + } + } + + /** + * Saves the size and the location of this frame through the + * ConfigurationService. + */ + private void saveSizeAndLocation() + { + ConfigurationService configService = + UtilActivator.getConfigurationService(); + + String className = this.getClass().getName(); + + try + { + configService.setProperty(className + ".width", new Integer( + getWidth())); + + configService.setProperty(className + ".height", new Integer( + getHeight())); + + configService.setProperty(className + ".x", new Integer(getX())); + + configService.setProperty(className + ".y", new Integer(getY())); + } + catch (PropertyVetoException e1) + { + logger.error("The proposed property change " + + "represents an unacceptable value"); + } + } + + /** + * Sets window size and position. + */ + public void setSizeAndLocation() + { + ConfigurationService configService = + UtilActivator.getConfigurationService(); + + String className = this.getClass().getName(); + + String widthString = configService.getString(className + ".width"); + + String heightString = configService.getString(className + ".height"); + + String xString = configService.getString(className + ".x"); + + String yString = configService.getString(className + ".y"); + + int width = 0; + int height = 0; + + if (widthString != null && heightString != null) + { + width = new Integer(widthString).intValue(); + height = new Integer(heightString).intValue(); + + if (width > 0 && height > 0) + { + Dimension screenSize = + Toolkit.getDefaultToolkit().getScreenSize(); + if (width <= screenSize.width && height <= screenSize.height) + this.setSize(width, height); + } + } + + int x = 0; + int y = 0; + + if (xString != null && yString != null) + { + x = new Integer(xString).intValue(); + y = new Integer(yString).intValue(); + + this.setLocation(x, y); + } + else + { + this.setCenterLocation(); + } + } + + /** + * Positions this window in the center of the screen. + */ + private void setCenterLocation() + { + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + this.setLocation(screenSize.width / 2 - this.getWidth() / 2, + screenSize.height / 2 - this.getHeight() / 2); + } + + /** + * Checks whether the current component will exceeds the screen size and if + * it do will set a default size + */ + private void ensureOnScreenLocationAndSize() + { + int x = this.getX(); + int y = this.getY(); + + int width = this.getWidth(); + int height = this.getHeight(); + + Rectangle virtualBounds = ScreenInformation.getScreenBounds(); + + // the default distance to the screen border + final int borderDistance = 10; + + // in case any of the sizes exceeds the screen size + // we set default one + // get the left upper point of the window + if (!(virtualBounds.contains(x, y))) + { + // top left exceeds screen bounds + if (x < virtualBounds.x) + { + // window is too far to the left + // move it to the right + x = virtualBounds.x + borderDistance; + } + else if (x > virtualBounds.x) + { + // window is too far to the right + // can only occour, when screen resolution is + // changed or displayed are disconnected + + // move the window in the bounds to the very right + x = + virtualBounds.x + virtualBounds.width - width + - borderDistance; + if (x < virtualBounds.x + borderDistance) + { + x = virtualBounds.x + borderDistance; + } + } + + // top left exceeds screen bounds + if (y < virtualBounds.y) + { + // window is too far to the top + // move it to the bottom + y = virtualBounds.y + borderDistance; + } + else if (y > virtualBounds.y) + { + // window is too far to the bottom + // can only occour, when screen resolution is + // changed or displayed are disconnected + + // move the window in the bounds to the very bottom + y = + virtualBounds.y + virtualBounds.height - height + - borderDistance; + if (y < virtualBounds.y + borderDistance) + { + y = virtualBounds.y + borderDistance; + } + } + this.setLocation(x, y); + } + + // check the lower right corder + if (!(virtualBounds.contains(x + width, y + height))) + { + + if (x + width > virtualBounds.x + virtualBounds.width) + { + // location of window is too far to the right, its right + // border is out of bounds + + // calculate a new horizontal position + // move the whole window to the left + x = + virtualBounds.x + virtualBounds.width - width + - borderDistance; + if (x < virtualBounds.x + borderDistance) + { + // window is already on left side, it is too wide. + x = virtualBounds.x + borderDistance; + // reduce the width, so it surely fits + width = virtualBounds.width - 2 * borderDistance; + } + } + if (y + height > virtualBounds.y + virtualBounds.height) + { + // location of window is too far to the bottom, its bottom + // border is out of bounds + + // calculate a new vertical position + // move the whole window to the top + y = + virtualBounds.y + virtualBounds.height - height + - borderDistance; + if (y < virtualBounds.y + borderDistance) + { + // window is already on top, it is too high. + y = virtualBounds.y + borderDistance; + // reduce the width, so it surely fits + height = virtualBounds.height - 2 * borderDistance; + } + } + this.setPreferredSize(new Dimension(width, height)); + this.setSize(width, height); + this.setLocation(x, y); + } + } + + /** + * Overwrites the setVisible method in order to set the size and the + * position of this window before showing it. + */ + public void setVisible(boolean isVisible) + { + if (isVisible) + { + this.setSizeAndLocation(); + + this.ensureOnScreenLocationAndSize(); + } + + super.setVisible(isVisible); + } + + /** + * Overwrites the dispose method in order to save the size and the position + * of this window before closing it. + */ + public void dispose() + { + this.saveSizeAndLocation(); + + /* + * The keybinding service will outlive us so don't let us retain our + * memory. + */ + if (bindings != null) + bindings.deleteObserver(this); + + super.dispose(); + } + + private void resetInputMap() + { + imap.clear(); + imap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "close"); + } + + /** + * Listens for changes in binding sets so they can be reflected in the input + * map + */ + public void update(Observable obs, Object arg) + { + if (obs instanceof KeybindingSet) + { + KeybindingSet changedBindings = (KeybindingSet) obs; + + resetInputMap(); + for (Map.Entry key2action : changedBindings + .getBindings().entrySet()) + { + imap.put(key2action.getKey(), key2action.getValue()); + } + } + } + + static class MainContentPane + extends JPanel + { + private final boolean isColorBgEnabled; + + private final Color bgStartColor; + + private final Color bgEndColor; + + public MainContentPane() + { + super(new BorderLayout()); + + ResourceManagementService resources = + UtilActivator.getResources(); + + isColorBgEnabled = + new Boolean(resources.getSettingsString( + "impl.gui.IS_WINDOW_COLOR_BACKGROUND_ENABLED")) + .booleanValue(); + if (isColorBgEnabled) + { + bgStartColor = + new Color(resources.getColor("service.gui.MAIN_BACKGROUND")); + bgEndColor = + new Color(resources + .getColor("service.gui.MAIN_BACKGROUND_GRADIENT")); + + int borderSize = + resources + .getSettingsInt("impl.gui.MAIN_WINDOW_BORDER_SIZE"); + this.setBorder(BorderFactory.createEmptyBorder(borderSize, + borderSize, borderSize, borderSize)); + } + else + { + bgStartColor = null; + bgEndColor = null; + } + } + + public void paintComponent(Graphics g) + { + super.paintComponent(g); + + // If the custom color window background is not enabled we have + // nothing to do here. + if (!isColorBgEnabled) + return; + + g = g.create(); + try + { + internalPaintComponent(g); + } + finally + { + g.dispose(); + } + } + + private void internalPaintComponent(Graphics g) + { + AntialiasingManager.activateAntialiasing(g); + + Graphics2D g2 = (Graphics2D) g; + int width = getWidth(); + int height = getHeight(); + + GradientPaint bgGradientColor = + new GradientPaint(width / 2, 0, bgStartColor, width / 2, 80, + bgEndColor); + + g2.setPaint(bgGradientColor); + g2.fillRect(0, 0, width, 80); + + g2.setColor(bgEndColor); + g2.fillRect(0, 78, width, height); + + GradientPaint curveShadow = + new GradientPaint(0, 0, new Color(255, 255, 255, 150), width, + height, 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(width - 20, 0, width, 100, width / 2, + 100, 0, 150); + + g2.draw(curve2); + + CubicCurve2D curve3 = + new CubicCurve2D.Float(0, 90, width / 3, 60, 2 * width / 3, 60, + width, 90); + + g2.draw(curve3); + } + } + + /** + * All functions implemented in this method will be invoked when user + * presses the Escape key. + */ + protected abstract void close(boolean isEscaped); +} diff --git a/src/net/java/sip/communicator/util/swing/SIPCommTabbedPane.java b/src/net/java/sip/communicator/util/swing/SIPCommTabbedPane.java new file mode 100644 index 0000000..cac0463 --- /dev/null +++ b/src/net/java/sip/communicator/util/swing/SIPCommTabbedPane.java @@ -0,0 +1,469 @@ +/* + * 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.util.swing; + +/* + * The following code borrowed from David Bismut, davidou@mageos.com Intern, + * SETLabs, Infosys Technologies Ltd. May 2004 - Jul 2004 Ecole des Mines de + * Nantes, France + */ +import java.awt.*; +import java.awt.event.*; +import java.util.*; + +import javax.swing.*; +import javax.swing.border.*; +import javax.swing.event.*; + +import net.java.sip.communicator.util.swing.event.*; +import net.java.sip.communicator.util.swing.plaf.*; + +/** + * A JTabbedPane with some added UI functionalities. A close and max/detach + * icons are added to every tab, typically to let the user close or detach the + * tab by clicking on these icons. + * + * @author Yana Stamcheva + */ +public class SIPCommTabbedPane + extends JTabbedPane + implements ChangeListener +{ + private int overTabIndex = -1; + + private int lastSelectedIndex; + + /** + * Creates the CloseAndMaxTabbedPane with an enhanced UI if + * enhancedUI parameter is set to true. + * + * @param closingTabs support for closable tabs + * @param maximizingTabs support for maximisable tabs + */ + public SIPCommTabbedPane(boolean closingTabs, boolean maximizingTabs) + { + super.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); + + UIManager.getDefaults() + .put("TabbedPane.tabAreaInsets", new Insets(0, 5, 0, 0)); + + UIManager.getDefaults() + .put("TabbedPane.contentBorderInsets", new Insets(0, 0, 0, 0)); + + this.setUI(new SIPCommTabbedPaneEnhancedUI()); + + if(closingTabs) + this.setCloseIcon(true); + + if(maximizingTabs) + this.setMaxIcon(true); + + this.addChangeListener(this); + } + + /** + * Returns the index of the last tab on which the mouse did an action. + */ + public int getOverTabIndex() + { + return overTabIndex; + } + + /** + * Returns true if the close icon is enabled. + */ + public boolean isCloseEnabled() + { + SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) this.getUI(); + return ui.isCloseEnabled(); + } + + /** + * Returns true if the max/detach icon is enabled. + */ + public boolean isMaxEnabled() + { + SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) this.getUI(); + return ui.isMaxEnabled(); + } + + /** + * Override JTabbedPane method. Does nothing. + * @param tabLayoutPolicy The tab layout policy. + */ + public void setTabLayoutPolicy(int tabLayoutPolicy) + { + } + + /** + * Override JTabbedPane method. Does nothing. + * @param tabPlacement The tab placement. + */ + public void setTabPlacement(int tabPlacement) + { + } + + /** + * Sets whether the tabbedPane should have a close icon or not. + * + * @param b whether the tabbedPane should have a close icon or not + */ + public void setCloseIcon(boolean b) + { + SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) this.getUI(); + ui.setCloseIcon(b); + } + + /** + * Sets whether the tabbedPane should have a max/detach icon or not. + * + * @param b whether the tabbedPane should have a max/detach icon or not + */ + public void setMaxIcon(boolean b) + { + SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) this.getUI(); + ui.setMaxIcon(b); + } + + /** + * Detaches the index tab in a seperate frame. When the frame + * is closed, the tab is automatically reinserted into the tabbedPane. + * + * @param index index of the tabbedPane to be detached + */ + public void detachTab(int index) + { + if (index < 0 || index >= getTabCount()) + return; + + final int tabIndex = index; + final JComponent c = (JComponent) getComponentAt(tabIndex); + + final Icon icon = getIconAt(tabIndex); + final String title = getTitleAt(tabIndex); + final String toolTip = getToolTipTextAt(tabIndex); + final Border border = c.getBorder(); + + final JFrame frame = new SIPCommFrame() + { + protected void close(boolean isEscaped) + { + if (isEscaped) + return; + + dispose(); + + insertTab(title, icon, c, toolTip, Math.min(tabIndex, + getTabCount())); + + c.setBorder(border); + setSelectedComponent(c); + } + }; + + Window parentWindow = SwingUtilities.windowForComponent(this); + + removeTabAt(index); + + c.setPreferredSize(c.getSize()); + + frame.setTitle(title); + frame.getContentPane().add(c); + frame.setLocation(parentWindow.getLocation()); + frame.pack(); + + WindowFocusListener windowFocusListener = new WindowFocusListener() { + long start; + + long end; + + public void windowGainedFocus(WindowEvent e) { + start = System.currentTimeMillis(); + } + + public void windowLostFocus(WindowEvent e) { + end = System.currentTimeMillis(); + long elapsed = end - start; + + if (elapsed < 100) + frame.toFront(); + + frame.removeWindowFocusListener(this); + } + }; + + /* + * This is a small hack to avoid Windows GUI bug, that prevent a new + * window from stealing focus (without this windowFocusListener, most of + * the time the new frame would just blink from foreground to + * background). A windowFocusListener is added to the frame, and if the + * time between the frame beeing in foreground and the frame beeing in + * background is less that 100ms, it just brings the windows to the + * front once again. Then it removes the windowFocusListener. Note that + * this hack would not be required on Linux or UNIX based systems. + */ + + frame.addWindowFocusListener(windowFocusListener); + + // frame.show(); + frame.setVisible(true); + frame.toFront(); + + } + + /** + * Adds a CloseListener to the tabbedPane. + * + * @param l the CloseListener to add + * @see #fireCloseTabEvent + * @see #removeCloseListener + */ + public synchronized void addCloseListener(CloseListener l) + { + listenerList.add(CloseListener.class, l); + } + + /** + * Adds a MaxListener to the tabbedPane. + * + * @param l the MaxListener to add + * @see #fireMaxTabEvent + * @see #removeMaxListener + */ + public synchronized void addMaxListener(MaxListener l) + { + listenerList.add(MaxListener.class, l); + } + + /** + * Adds a DoubleClickListener to the tabbedPane. + * + * @param l the DoubleClickListener to add + * @see #fireDoubleClickTabEvent + * @see #removeDoubleClickListener + */ + public synchronized void addDoubleClickListener(DoubleClickListener l) + { + listenerList.add(DoubleClickListener.class, l); + } + + /** + * Adds a PopupOutsideListener to the tabbedPane. + * + * @param l the PopupOutsideListener to add + * @see #firePopupOutsideTabEvent + * @see #removePopupOutsideListener + */ + public synchronized void addPopupOutsideListener(PopupOutsideListener l) + { + listenerList.add(PopupOutsideListener.class, l); + } + + /** + * Removes a CloseListener from this tabbedPane. + * + * @param l the CloseListener to remove + * @see #fireCloseTabEvent + * @see #addCloseListener + */ + public synchronized void removeCloseListener(CloseListener l) + { + listenerList.remove(CloseListener.class, l); + } + + /** + * Removes a MaxListener from this tabbedPane. + * + * @param l the MaxListener to remove + * @see #fireMaxTabEvent + * @see #addMaxListener + */ + public synchronized void removeMaxListener(MaxListener l) + { + listenerList.remove(MaxListener.class, l); + } + + /** + * Removes a DoubleClickListener from this tabbedPane. + * + * @param l + * the DoubleClickListener to remove + * @see #fireDoubleClickTabEvent + * @see #addDoubleClickListener + */ + public synchronized void removeDoubleClickListener(DoubleClickListener l) + { + listenerList.remove(DoubleClickListener.class, l); + } + + /** + * Removes a PopupOutsideListener from this tabbedPane. + * + * @param l + * the PopupOutsideListener to remove + * @see #firePopupOutsideTabEvent + * @see #addPopupOutsideListener + */ + public synchronized void removePopupOutsideListener( + PopupOutsideListener l) + { + listenerList.remove(PopupOutsideListener.class, l); + } + + /** + * Sends a MouseEvent, whose source is this tabbedpane, to + * every CloseListener. The method also updates the + * overTabIndex of the tabbedPane with a value coming from + * the UI. This method method is called each time a MouseEvent + * is received from the UI when the user clicks on the close icon of the tab + * which index is overTabIndex. + * + * @param e + * the MouseEvent to be sent + * @param overTabIndex + * the index of a tab, usually the tab over which the mouse is + * + * @see #addCloseListener + */ + public void fireCloseTabEvent(MouseEvent e, int overTabIndex) + { + this.overTabIndex = overTabIndex; + + EventListener[] closeListeners = getListeners(CloseListener.class); + for (int i = 0; i < closeListeners.length; i++) + { + ((CloseListener) closeListeners[i]).closeOperation(e); + } + } + + /** + * Sends a MouseEvent, whose source is this tabbedpane, to + * every MaxListener. The method also updates the + * overTabIndex of the tabbedPane with a value coming from + * the UI. This method method is called each time a MouseEvent + * is received from the UI when the user clicks on the max icon of the tab + * which index is overTabIndex. + * + * @param e + * the MouseEvent to be sent + * @param overTabIndex + * the index of a tab, usually the tab over which the mouse is + * + * @see #addMaxListener + */ + public void fireMaxTabEvent(MouseEvent e, int overTabIndex) + { + this.overTabIndex = overTabIndex; + + EventListener[] maxListeners = getListeners(MaxListener.class); + for (int i = 0; i < maxListeners.length; i++) + { + ((MaxListener) maxListeners[i]).maxOperation(e); + } + } + + /** + * Sends a MouseEvent, whose source is this tabbedpane, to + * every DoubleClickListener. The method also updates the + * overTabIndex of the tabbedPane with a value coming from + * the UI. This method method is called each time a MouseEvent + * is received from the UI when the user double-clicks on the tab which + * index is overTabIndex. + * + * @param e + * the MouseEvent to be sent + * @param overTabIndex + * the index of a tab, usually the tab over which the mouse is + * + * @see #addDoubleClickListener + */ + public void fireDoubleClickTabEvent(MouseEvent e, int overTabIndex) + { + this.overTabIndex = overTabIndex; + + EventListener[] dClickListeners + = getListeners(DoubleClickListener.class); + for (int i = 0; i < dClickListeners.length; i++) + { + ((DoubleClickListener) dClickListeners[i]).doubleClickOperation(e); + } + } + + /** + * Sends a MouseEvent, whose source is this tabbedpane, to + * every PopupOutsideListener. The method also sets the + * overTabIndex to -1. This method method is called each time + * a MouseEvent is received from the UI when the user + * right-clicks on the inactive part of a tabbedPane. + * + * @param e + * the MouseEvent to be sent + * + * @see #addPopupOutsideListener + */ + public void firePopupOutsideTabEvent(MouseEvent e) + { + this.overTabIndex = -1; + + EventListener[] popupListeners + = getListeners(PopupOutsideListener.class); + for (int i = 0; i < popupListeners.length; i++) + { + ((PopupOutsideListener) popupListeners[i]).popupOutsideOperation(e); + } + } + + /** + * Overrides setSelectedIndex in JTabbedPane in order to remove the + * hightlight if the tab which is selected. + * @param tabIndex The index of the tab to be selected. + */ + public void setSelectedIndex(int tabIndex) + { + SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) this.getUI(); + if (ui.isTabHighlighted(tabIndex)) + { + ui.tabRemoveHighlight(tabIndex); + } + super.setSelectedIndex(tabIndex); + } + + /** + * Highlights the tab with the given index. + * + * @param tabIndex The tab index. + */ + public void highlightTab(int tabIndex) + { + SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) this.getUI(); + + if (!ui.isTabHighlighted(tabIndex) + && this.getSelectedIndex() != tabIndex) + ui.tabAddHightlight(tabIndex); + + this.repaint(); + } + + public void removeTabAt(int index) + { + if (index < lastSelectedIndex) + { + this.setSelectedIndex(lastSelectedIndex - 1); + } + else if (index > lastSelectedIndex) + { + this.setSelectedIndex(lastSelectedIndex); + } + + super.removeTabAt(index); + } + + public void stateChanged(ChangeEvent e) + { + lastSelectedIndex = this.getSelectedIndex(); + } +} diff --git a/src/net/java/sip/communicator/util/swing/ScreenInformation.java b/src/net/java/sip/communicator/util/swing/ScreenInformation.java new file mode 100644 index 0000000..3453b3d --- /dev/null +++ b/src/net/java/sip/communicator/util/swing/ScreenInformation.java @@ -0,0 +1,90 @@ +/* + * 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.util.swing; + +import java.awt.*; + +/** + * A class which reads the screen bounds once and provides this information + * + * @author Thomas Hofer + * + */ +public class ScreenInformation +{ + private static Rectangle screenBounds = null; + + public static synchronized void init() + { + if (screenBounds == null) + { + final GraphicsEnvironment ge = GraphicsEnvironment + .getLocalGraphicsEnvironment(); + final GraphicsDevice[] gs = ge.getScreenDevices(); + + screenBounds = new Rectangle(); + + if (gs.length > 1) + { + + // create a thread for each display, as the query is very slow + Thread thread[] = new Thread[gs.length]; + for (int j = 0; j < gs.length; j++) + { + final int j1 = j; + thread[j] = new Thread(new Runnable() + { + public void run() + { + Rectangle screenDeviceBounds = new Rectangle(); + GraphicsDevice gd = gs[j1]; + GraphicsConfiguration[] gc = gd.getConfigurations(); + for (int i = 0; i < gc.length; i++) + { + screenDeviceBounds = screenDeviceBounds + .union(gc[i].getBounds()); + } + screenBounds.setBounds(screenBounds + .union(screenDeviceBounds)); + + } + }); + thread[j].start(); + } + for (int j = 0; j < gs.length; j++) + { + // wait for all threads here + try + { + thread[j].join(); + } catch (InterruptedException e) + { + } + } + } else + { + // only one display, get the screen size directy. this method + // is much faster, but can only handle the primary display + Dimension dim = Toolkit.getDefaultToolkit().getScreenSize(); + screenBounds.setBounds(0, 0, dim.width, dim.height); + } + + } + } + + public static synchronized Rectangle getScreenBounds() + { + // the initialization needs a moment + // prevent a concurrent initalization + if (screenBounds == null) + { + init(); + } + + return screenBounds; + } +} diff --git a/src/net/java/sip/communicator/util/swing/TransparentPanel.java b/src/net/java/sip/communicator/util/swing/TransparentPanel.java new file mode 100644 index 0000000..ad95589 --- /dev/null +++ b/src/net/java/sip/communicator/util/swing/TransparentPanel.java @@ -0,0 +1,32 @@ +/* + * 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.util.swing; + +import java.awt.*; + +import javax.swing.*; + +/** + * @author Yana Stamcheva + */ +public class TransparentPanel + extends JPanel +{ + private static final long serialVersionUID = 0L; + + public TransparentPanel() + { + this.setOpaque(false); + } + + public TransparentPanel(LayoutManager layout) + { + super(layout); + + this.setOpaque(false); + } +} diff --git a/src/net/java/sip/communicator/util/swing/VideoContainer.java b/src/net/java/sip/communicator/util/swing/VideoContainer.java new file mode 100644 index 0000000..761d3f7 --- /dev/null +++ b/src/net/java/sip/communicator/util/swing/VideoContainer.java @@ -0,0 +1,113 @@ +/* + * 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.util.swing; + +import java.awt.*; +import java.awt.event.*; + +/** + * @author Lubomir Marinov + */ +public class VideoContainer + extends TransparentPanel +{ + private final ContainerListener containerListener = new ContainerListener() + { + + /* + * Since the videoContainer displays either noVideoComponent or a single + * visual Component which represents video, ensures the last Component + * added to the Container is the only Component it contains i.e. + * noVideoComponent goes away when the video is displayed and the video + * goes away when noVideoComponent is displayed. + */ + public void componentAdded(ContainerEvent event) + { + Container container = event.getContainer(); + Component local = ((VideoLayout) container.getLayout()).getLocal(); + Component added = event.getChild(); + + if ((local != null) && (added == local)) + return; + + Component[] components = container.getComponents(); + boolean validate = false; + + for (int i = 0; i < components.length; i++) + { + Component component = components[i]; + + if ((component != added) && (component != local)) + { + container.remove(component); + validate = true; + } + } + if (validate) + container.validate(); + }; + + /* + * Displays noVideoComponent when there is no visual Component which + * represents video to be displayed. + */ + public void componentRemoved(ContainerEvent event) + { + Container container = event.getContainer(); + + if ((container.getComponentCount() <= 0) + || (((VideoLayout) container.getLayout()).getRemote() == null)) + { + container.add(noVideoComponent, VideoLayout.CENTER_REMOTE); + container.validate(); + } + } + }; + + private final Component noVideoComponent; + + public VideoContainer(Component noVideoComponent) + { + setLayout(new VideoLayout()); + + this.noVideoComponent = noVideoComponent; + + addContainerListener(containerListener); + add(this.noVideoComponent, VideoLayout.CENTER_REMOTE); + validate(); + } + + public Component add(Component comp) + { + add(comp, VideoLayout.CENTER_REMOTE); + return comp; + } + + /* + * Ensures noVideoComponent is displayed even when the clients of the + * videoContainer invoke its #removeAll() to remove their previous visual + * Components representing video. Just adding noVideoComponent upon + * ContainerEvent#COMPONENT_REMOVED when there is no other Component left in + * the Container will cause an infinite loop because Container#removeAll() + * will detect that a new Component has been added while dispatching the + * event and will then try to remove the new Component. + */ + public void removeAll() + { + removeContainerListener(containerListener); + try + { + super.removeAll(); + } + finally + { + addContainerListener(containerListener); + containerListener.componentRemoved(new ContainerEvent(this, + ContainerEvent.COMPONENT_REMOVED, null)); + } + } +} diff --git a/src/net/java/sip/communicator/util/swing/VideoLayout.java b/src/net/java/sip/communicator/util/swing/VideoLayout.java new file mode 100644 index 0000000..dd16ec2 --- /dev/null +++ b/src/net/java/sip/communicator/util/swing/VideoLayout.java @@ -0,0 +1,102 @@ +/* + * 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.util.swing; + +import java.awt.*; + +/** + * @author Lubomir Marinov + */ +public class VideoLayout extends FitLayout +{ + public static final String CENTER_REMOTE = "CENTER_REMOTE"; + + public static final String EAST_REMOTE = "EAST_REMOTE"; + + public static final String LOCAL = "LOCAL"; + + private static final float LOCAL_TO_REMOTE_RATIO = 0.30f; + + private Component local; + + private Component remote; + + private float remoteAlignmentX = Component.CENTER_ALIGNMENT; + + public void addLayoutComponent(String name, Component comp) + { + super.addLayoutComponent(name, comp); + + if ((name == null) || name.equals(CENTER_REMOTE)) + { + remote = comp; + remoteAlignmentX = Component.CENTER_ALIGNMENT; + } + else if (name.equals(EAST_REMOTE)) + { + remote = comp; + remoteAlignmentX = Component.RIGHT_ALIGNMENT; + } + else if (name.equals(LOCAL)) + local = comp; + } + + protected Component getComponent(Container parent) + { + return getRemote(); + } + + public Component getLocal() + { + return local; + } + + public Component getRemote() + { + return remote; + } + + public void layoutContainer(Container parent) + { + Component local = getLocal(); + + super.layoutContainer(parent, + (local == null) ? Component.CENTER_ALIGNMENT : remoteAlignmentX); + + if (local != null) + { + Dimension parentSize = parent.getSize(); + int height = Math.round(parentSize.height * LOCAL_TO_REMOTE_RATIO); + + super.layoutComponent(local, new Rectangle(0, parentSize.height + - height, Math.round(parentSize.width * LOCAL_TO_REMOTE_RATIO), + height), Component.LEFT_ALIGNMENT, Component.BOTTOM_ALIGNMENT); + } + } + + public Dimension minimumLayoutSize(Container parent) + { + // TODO Auto-generated method stub + return super.minimumLayoutSize(parent); + } + + public Dimension preferredLayoutSize(Container parent) + { + // TODO Auto-generated method stub + return super.preferredLayoutSize(parent); + } + + public void removeLayoutComponent(Component comp) + { + super.removeLayoutComponent(comp); + + if (remote == comp) + remote = null; + else if (local == comp) + local = null; + } +} diff --git a/src/net/java/sip/communicator/util/swing/event/CloseListener.java b/src/net/java/sip/communicator/util/swing/event/CloseListener.java new file mode 100644 index 0000000..e0dcd8f --- /dev/null +++ b/src/net/java/sip/communicator/util/swing/event/CloseListener.java @@ -0,0 +1,22 @@ +/* + * 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.util.swing.event; + +/* + * The content of this file was based on code borrowed from David Bismut, + * davidou@mageos.com Intern, SETLabs, Infosys Technologies Ltd. May 2004 - Jul + * 2004 Ecole des Mines de Nantes, France + */ +import java.awt.event.*; +import java.util.*; + +/** + * @author Yana Stamcheva + */ +public interface CloseListener extends EventListener { + public void closeOperation(MouseEvent e); +} diff --git a/src/net/java/sip/communicator/util/swing/event/DoubleClickListener.java b/src/net/java/sip/communicator/util/swing/event/DoubleClickListener.java new file mode 100644 index 0000000..195ca8c --- /dev/null +++ b/src/net/java/sip/communicator/util/swing/event/DoubleClickListener.java @@ -0,0 +1,22 @@ +/* + * 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.util.swing.event; + +/* + * The following code borrowed from David Bismut, davidou@mageos.com Intern, + * SETLabs, Infosys Technologies Ltd. May 2004 - Jul 2004 Ecole des Mines de + * Nantes, France + */ +import java.awt.event.*; +import java.util.*; + +/** + * @author Yana Stamcheva + */ +public interface DoubleClickListener extends EventListener { + public void doubleClickOperation(MouseEvent e); +} diff --git a/src/net/java/sip/communicator/util/swing/event/MaxListener.java b/src/net/java/sip/communicator/util/swing/event/MaxListener.java new file mode 100644 index 0000000..f25c107 --- /dev/null +++ b/src/net/java/sip/communicator/util/swing/event/MaxListener.java @@ -0,0 +1,22 @@ +/* + * 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.util.swing.event; + +/* + * The following code borrowed from David Bismut, davidou@mageos.com Intern, + * SETLabs, Infosys Technologies Ltd. May 2004 - Jul 2004 Ecole des Mines de + * Nantes, France + */ +import java.awt.event.*; +import java.util.*; + +/** + * @author Yana Stamcheva + */ +public interface MaxListener extends EventListener { + public void maxOperation(MouseEvent e); +} diff --git a/src/net/java/sip/communicator/util/swing/event/PopupOutsideListener.java b/src/net/java/sip/communicator/util/swing/event/PopupOutsideListener.java new file mode 100644 index 0000000..2c73327 --- /dev/null +++ b/src/net/java/sip/communicator/util/swing/event/PopupOutsideListener.java @@ -0,0 +1,22 @@ +/* + * 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.util.swing.event; + +/* + * The following code borrowed from David Bismut, davidou@mageos.com Intern, + * SETLabs, Infosys Technologies Ltd. May 2004 - Jul 2004 Ecole des Mines de + * Nantes, France + */ +import java.awt.event.*; +import java.util.*; + +/** + * @author Yana Stamcheva + */ +public interface PopupOutsideListener extends EventListener { + public void popupOutsideOperation(MouseEvent e); +} diff --git a/src/net/java/sip/communicator/util/swing/plaf/SIPCommTabbedPaneEnhancedUI.java b/src/net/java/sip/communicator/util/swing/plaf/SIPCommTabbedPaneEnhancedUI.java new file mode 100644 index 0000000..5e406bc --- /dev/null +++ b/src/net/java/sip/communicator/util/swing/plaf/SIPCommTabbedPaneEnhancedUI.java @@ -0,0 +1,383 @@ +/* + * 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.util.swing.plaf; + +/* + * The content of this file was based on code borrowed from David Bismut, + * davidou@mageos.com Intern, SETLabs, Infosys Technologies Ltd. May 2004 - Jul + * 2004 Ecole des Mines de Nantes, France + */ + +import java.awt.*; +import java.awt.image.*; + +import javax.swing.*; +import javax.swing.plaf.*; +import javax.swing.plaf.basic.*; +import javax.swing.text.*; + +import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; + +/** + * This UI displays a different interface, which is independent from the look + * and feel. + * + * @author David Bismut, davidou@mageos.com + * @author Yana Stamcheva + */ +public class SIPCommTabbedPaneEnhancedUI + extends SIPCommTabbedPaneUI +{ + private static final Color whiteColor = Color.white; + + private static final int TAB_OVERLAP + = new Integer(UtilActivator.getResources(). + getSettingsString("impl.gui.TAB_OVERLAP")).intValue(); + + private static final int PREFERRED_WIDTH = 150; + + /** + * The image used in the SIPCommLookAndFeel to paint the background + * of a selected tab. + */ + private static final String SELECTED_TAB_LEFT_BG = + "service.gui.lookandfeel.SELECTED_TAB_LEFT_BG"; + + /** + * The image used in the SIPCommLookAndFeel to paint the background + * of a selected tab. + */ + private static final String SELECTED_TAB_MIDDLE_BG = + "service.gui.lookandfeel.SELECTED_TAB_MIDDLE_BG"; + + /** + * The image used in the SIPCommLookAndFeel to paint the background + * of a selected tab. + */ + private static final String SELECTED_TAB_RIGHT_BG = + "service.gui.lookandfeel.SELECTED_TAB_RIGHT_BG"; + + /** + * The image used in the SIPCommLookAndFeel to paint the background + * of a tab. + */ + private static final String TAB_LEFT_BG = + "service.gui.lookandfeel.TAB_LEFT_BG"; + + /** + * The image used in the SIPCommLookAndFeel to paint the background + * of a tab. + */ + private static final String TAB_MIDDLE_BG = + "service.gui.lookandfeel.TAB_MIDDLE_BG"; + + /** + * The image used in the SIPCommLookAndFeel to paint the background + * of a tab. + */ + private static final String TAB_RIGHT_BG = + "service.gui.lookandfeel.TAB_RIGHT_BG"; + + public static ComponentUI createUI(JComponent c) { + return new SIPCommTabbedPaneEnhancedUI(); + } + + protected void paintFocusIndicator(Graphics g, int tabPlacement, + Rectangle[] rects, int tabIndex, Rectangle iconRect, + Rectangle textRect, boolean isSelected) { + } + + /** + * Overriden to paint nothing. + */ + protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, + int x, int y, int w, int h, boolean isSelected) { + } + + protected void paintContentBorderTopEdge(Graphics g, int tabPlacement, + int selectedIndex, int x, int y, int w, int h) { + + if (tabPane.getTabCount() < 1) + return; + + g.setColor(shadow); + g.drawLine(x, y, x + w - 2, y); + } + + protected void paintContentBorderLeftEdge(Graphics g, int tabPlacement, + int selectedIndex, int x, int y, int w, int h) { + + if (tabPane.getTabCount() < 1) + return; + + g.setColor(shadow); + + g.drawLine(x, y, x, y + h - 3); + } + + protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, + int selectedIndex, int x, int y, int w, int h) { + + if (tabPane.getTabCount() < 1) + return; + + g.setColor(shadow); + g.drawLine(x + 1, y + h - 3, x + w - 2, y + h - 3); + g.drawLine(x + 1, y + h - 2, x + w - 2, y + h - 2); + g.setColor(shadow.brighter()); + g.drawLine(x + 2, y + h - 1, x + w - 1, y + h - 1); + + } + + protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, + int selectedIndex, int x, int y, int w, int h) { + + if (tabPane.getTabCount() < 1) + return; + + g.setColor(shadow); + + g.drawLine(x + w - 3, y + 1, x + w - 3, y + h - 3); + g.drawLine(x + w - 2, y + 1, x + w - 2, y + h - 3); + g.setColor(shadow.brighter()); + g.drawLine(x + w - 1, y + 2, x + w - 1, y + h - 2); + + } + + protected void paintTabBackground(Graphics g, int tabPlacement, + int tabIndex, int x, int y, int w, int h, boolean isSelected) { + + BufferedImage leftImg = null; + BufferedImage middleImg = null; + BufferedImage rightImg = null; + + Graphics2D g2 = (Graphics2D) g; + + AntialiasingManager.activateAntialiasing(g2); + + int tabOverlap = 0; + + if (isSelected) + { + if (tabPane.isEnabledAt(tabIndex)) + { + leftImg = UtilActivator.getImage(SELECTED_TAB_LEFT_BG); + middleImg = UtilActivator.getImage(SELECTED_TAB_MIDDLE_BG); + rightImg = UtilActivator.getImage(SELECTED_TAB_RIGHT_BG); + + tabOverlap = TAB_OVERLAP; + } + else + { + leftImg = UtilActivator.getImage(TAB_LEFT_BG); + middleImg = UtilActivator.getImage(TAB_MIDDLE_BG); + rightImg = UtilActivator.getImage(TAB_RIGHT_BG); + } + } + else + { + leftImg = UtilActivator.getImage(TAB_LEFT_BG); + middleImg = UtilActivator.getImage(TAB_MIDDLE_BG); + rightImg = UtilActivator.getImage(TAB_RIGHT_BG); + } + + g2.drawImage(leftImg, x, y, null); + g2.drawImage(middleImg, x + leftImg.getWidth(), y, + w - leftImg.getWidth() - rightImg.getWidth() + tabOverlap, + leftImg.getHeight(), null); + g2.drawImage(rightImg, x + w - rightImg.getWidth() + tabOverlap, y, null); + } + + protected void paintText(Graphics g, int tabPlacement, Font font, + FontMetrics metrics, int tabIndex, String title, + Rectangle textRect, boolean isSelected) { + + g.setFont(font); + + int titleWidth = SwingUtilities.computeStringWidth(metrics, title); + + int preferredWidth = 0; + if (isOneActionButtonEnabled()) { + preferredWidth = calculateTabWidth(tabPlacement, tabIndex, metrics) + - WIDTHDELTA - 15; + + if (isCloseEnabled()) + preferredWidth -= BUTTONSIZE; + + if (isMaxEnabled()) + preferredWidth -= BUTTONSIZE; + } + else { + preferredWidth = titleWidth; + } + + while (titleWidth > preferredWidth) { + if (title.endsWith("...")) + title = title.substring(0, title.indexOf("...") - 1) + .concat("..."); + else + title = title.substring(0, title.length() - 4) + .concat("..."); + + titleWidth = SwingUtilities.computeStringWidth(metrics, title); + } + + textRect.width = titleWidth; + + View v = getTextViewForTab(tabIndex); + if (v != null) { + // html + v.paint(g, textRect); + } else { + // plain text + int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex); + + if (tabPane.isEnabled() && tabPane.isEnabledAt(tabIndex)) { + if (isSelected) + g.setColor(whiteColor); + else { + if (this.isTabHighlighted(tabIndex)) { + g.setColor( + UIManager.getColor("TabbedPane.tabTitleHighlight")); + } else + g.setColor(tabPane.getForegroundAt(tabIndex)); + } + + BasicGraphicsUtils + .drawStringUnderlineCharAt(g, title, mnemIndex, + textRect.x, textRect.y + metrics.getAscent()); + + } else { // tab disabled + g.setColor(tabPane.getBackgroundAt(tabIndex).brighter()); + BasicGraphicsUtils + .drawStringUnderlineCharAt(g, title, mnemIndex, + textRect.x, textRect.y + metrics.getAscent()); + + g.setColor(tabPane.getBackgroundAt(tabIndex).darker()); + BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, + mnemIndex, textRect.x - 1, textRect.y + + metrics.getAscent() - 1); + } + } + } + + protected class ScrollableTabButton extends + SIPCommTabbedPaneUI.ScrollableTabButton { + + public ScrollableTabButton(int direction) { + super(direction); + setRolloverEnabled(true); + } + + public Dimension getPreferredSize() { + return new Dimension(16, calculateMaxTabHeight(0)); + } + + public void paint(Graphics g) { + Color origColor; + boolean isPressed, isRollOver, isEnabled; + int w, h, size; + + w = getSize().width; + h = getSize().height; + origColor = g.getColor(); + isPressed = getModel().isPressed(); + isRollOver = getModel().isRollover(); + isEnabled = isEnabled(); + + g.setColor(getBackground()); + g.fillRect(0, 0, w, h); + + g.setColor(shadow); + // Using the background color set above + if (direction == WEST) { + g.drawLine(0, 0, 0, h - 1); // left + g.drawLine(w - 1, 0, w - 1, 0); // right + } else + g.drawLine(w - 2, h - 1, w - 2, 0); // right + + g.drawLine(0, 0, w - 2, 0); // top + + if (isRollOver) { + // do highlights or shadows + + Color color1; + Color color2; + + if (isPressed) { + color2 = whiteColor; + color1 = shadow; + } else { + color1 = whiteColor; + color2 = shadow; + } + + g.setColor(color1); + + if (direction == WEST) { + g.drawLine(1, 1, 1, h - 1); // left + g.drawLine(1, 1, w - 2, 1); // top + g.setColor(color2); + g.drawLine(w - 1, h - 1, w - 1, 1); // right + } else { + g.drawLine(0, 1, 0, h - 1); + g.drawLine(0, 1, w - 3, 1); // top + g.setColor(color2); + g.drawLine(w - 3, h - 1, w - 3, 1); // right + } + + } + + // g.drawLine(0, h - 1, w - 1, h - 1); //bottom + + // If there's no room to draw arrow, bail + if (h < 5 || w < 5) { + g.setColor(origColor); + return; + } + + if (isPressed) { + g.translate(1, 1); + } + + // Draw the arrow + size = Math.min((h - 4) / 3, (w - 4) / 3); + size = Math.max(size, 2); + paintTriangle(g, (w - size) / 2, (h - size) / 2, size, direction, + isEnabled); + + // Reset the Graphics back to it's original settings + if (isPressed) { + g.translate(-1, -1); + } + g.setColor(origColor); + + } + + } + + protected SIPCommTabbedPaneUI.ScrollableTabButton createScrollableTabButton( + int direction) { + return new ScrollableTabButton(direction); + } + + + protected int calculateTabWidth(int tabPlacement, int tabIndex, + FontMetrics metrics) { + + int width = super.calculateTabWidth(tabPlacement, tabIndex, metrics); + + if (isOneActionButtonEnabled()) + { + if(width > PREFERRED_WIDTH) + width = PREFERRED_WIDTH; + } + + return width; + } +} \ No newline at end of file diff --git a/src/net/java/sip/communicator/util/swing/plaf/SIPCommTabbedPaneUI.java b/src/net/java/sip/communicator/util/swing/plaf/SIPCommTabbedPaneUI.java new file mode 100644 index 0000000..7e852fb --- /dev/null +++ b/src/net/java/sip/communicator/util/swing/plaf/SIPCommTabbedPaneUI.java @@ -0,0 +1,1812 @@ +/* + * 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.util.swing.plaf; + +/* + * The content of this file was based on code borrowed from David Bismut, + * davidou@mageos.com Intern, SETLabs, Infosys Technologies Ltd. May 2004 - Jul + * 2004 Ecole des Mines de Nantes, France + */ +import java.awt.*; +import java.awt.event.*; +import java.awt.image.*; +import java.util.*; + +import javax.swing.*; +import javax.swing.border.*; +import javax.swing.event.*; +import javax.swing.plaf.*; +import javax.swing.plaf.basic.*; +import javax.swing.text.*; + +import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.swing.*; + +/** + * SIPCommTabbedPaneUI implementation. + */ +public class SIPCommTabbedPaneUI + extends BasicTabbedPaneUI +{ + + /** + * The image used in the SIPCommLookAndFeel to paint a close + * button on a tab. + */ + private static final String CLOSE_TAB_ICON = + "service.gui.lookandfeel.CLOSE_TAB_ICON"; + + /** + * The image used in the SIPCommLookAndFeel to paint a rollover + * close button on a tab. + */ + private static final String CLOSE_TAB_SELECTED_ICON = + "service.gui.lookandfeel.CLOSE_TAB_SELECTED_ICON"; + + // Instance variables initialized at installation + private ContainerListener containerListener; + + private Vector htmlViews; + + private Hashtable mnemonicToIndexMap; + + /** + * InputMap used for mnemonics. Only non-null if the JTabbedPane has + * mnemonics associated with it. Lazily created in initMnemonics. + */ + private InputMap mnemonicInputMap; + + // For use when tabLayoutPolicy = SCROLL_TAB_LAYOUT + protected ScrollableTabSupport tabScroller; + + private int tabCount; + + protected MyMouseMotionListener motionListener; + + // UI creation + + private static final int INACTIVE = 0; + + private static final int OVER = 1; + + private static final int PRESSED = 2; + + public static final int BUTTONSIZE = 15; + + public static final int WIDTHDELTA = 10; + + private static final Border PRESSEDBORDER = new SoftBevelBorder( + SoftBevelBorder.LOWERED); + + private static final Border OVERBORDER = new SoftBevelBorder( + SoftBevelBorder.RAISED); + + private Image closeImgB; + + private BufferedImage maxImgB; + + private Image closeImgI; + + private BufferedImage maxImgI; + + private int overTabIndex = -1; + + private int closeIndexStatus = INACTIVE; + + private int maxIndexStatus = INACTIVE; + + private boolean mousePressed = false; + + private boolean isCloseButtonEnabled = false; + + private boolean isMaxButtonEnabled = false; + + protected JPopupMenu actionPopupMenu; + + protected JMenuItem maxItem; + + protected JMenuItem closeItem; + + protected Vector highlightedTabs = new Vector(); + + public SIPCommTabbedPaneUI() + { + super(); + + closeImgB = UtilActivator.getImage(CLOSE_TAB_SELECTED_ICON); + + maxImgB = new BufferedImage(BUTTONSIZE, BUTTONSIZE, + BufferedImage.TYPE_4BYTE_ABGR); + + closeImgI = UtilActivator.getImage(CLOSE_TAB_ICON); + + maxImgI = new BufferedImage(BUTTONSIZE, BUTTONSIZE, + BufferedImage.TYPE_4BYTE_ABGR); + + actionPopupMenu = new JPopupMenu(); + + maxItem = new JMenuItem("Detach"); + closeItem = new JMenuItem("Close"); + + maxItem.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + ((SIPCommTabbedPane) tabPane).fireMaxTabEvent(null, tabPane + .getSelectedIndex()); + } + }); + + closeItem.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + ((SIPCommTabbedPane) tabPane).fireCloseTabEvent(null, tabPane + .getSelectedIndex()); + } + }); + + setPopupMenu(); + } + + protected boolean isOneActionButtonEnabled() + { + return isCloseButtonEnabled || isMaxButtonEnabled; + } + + public boolean isCloseEnabled() + { + return isCloseButtonEnabled; + } + + public boolean isMaxEnabled() + { + return isMaxButtonEnabled; + } + + public void setCloseIcon(boolean b) + { + isCloseButtonEnabled = b; + setPopupMenu(); + } + + public void setMaxIcon(boolean b) + { + isMaxButtonEnabled = b; + setPopupMenu(); + } + + private void setPopupMenu() + { + actionPopupMenu.removeAll(); + if (isMaxButtonEnabled) + actionPopupMenu.add(maxItem); + if (isMaxButtonEnabled && isCloseButtonEnabled) + actionPopupMenu.addSeparator(); + if (isCloseButtonEnabled) + actionPopupMenu.add(closeItem); + } + + protected int calculateTabWidth(int tabPlacement, int tabIndex, + FontMetrics metrics) + { + int delta = 0; + + Insets tabInsets = getTabInsets(tabPlacement, tabIndex); + + if (isOneActionButtonEnabled()) + { + tabInsets.right = 0; + + if (isCloseButtonEnabled) + delta += BUTTONSIZE; + if (isMaxButtonEnabled) + delta += BUTTONSIZE; + } + + return super.calculateTabWidth(tabPlacement, tabIndex, metrics) + delta; + } + + protected int calculateTabHeight(int tabPlacement, int tabIndex, + int fontHeight) + { + return super.calculateTabHeight(tabPlacement, tabIndex, fontHeight + 4); + } + + protected void layoutLabel(int tabPlacement, FontMetrics metrics, + int tabIndex, String title, Icon icon, Rectangle tabRect, + Rectangle iconRect, Rectangle textRect, boolean isSelected) + { + textRect.x = textRect.y = iconRect.x = iconRect.y = 0; + + View v = getTextViewForTab(tabIndex); + if (v != null) { + tabPane.putClientProperty("html", v); + } + + SwingUtilities.layoutCompoundLabel((JComponent) tabPane, + metrics, + title, + icon, + SwingUtilities.CENTER, + SwingUtilities.LEFT, + SwingUtilities.CENTER, + SwingUtilities.CENTER, + tabRect, + iconRect, + textRect, + 0); + + tabPane.putClientProperty("html", null); + + iconRect.x = tabRect.x + 5; + textRect.x = iconRect.x + iconRect.width + 5; + + } + + protected MouseListener createMouseListener() + { + return new MyMouseHandler(); + } + + protected ScrollableTabButton createScrollableTabButton(int direction) + { + return new ScrollableTabButton(direction); + } + + protected Rectangle newCloseRect(Rectangle rect) + { + int dx = rect.x + rect.width; + int dy = (rect.y + rect.height) / 2 - 6; + return new Rectangle(dx - BUTTONSIZE - WIDTHDELTA, dy, BUTTONSIZE, + BUTTONSIZE); + } + + protected Rectangle newMaxRect(Rectangle rect) + { + int dx = rect.x + rect.width; + int dy = (rect.y + rect.height) / 2 - 6; + if (isCloseButtonEnabled) + dx -= BUTTONSIZE; + + return new Rectangle(dx - BUTTONSIZE - WIDTHDELTA, dy, BUTTONSIZE, + BUTTONSIZE); + } + + protected void updateOverTab(int x, int y) + { + if (overTabIndex != (overTabIndex = getTabAtLocation(x, y))) + tabScroller.tabPanel.repaint(); + + } + + protected void updateCloseIcon(int x, int y) + { + if (overTabIndex != -1) { + int newCloseIndexStatus = INACTIVE; + + Rectangle closeRect = newCloseRect(rects[overTabIndex]); + if (closeRect.contains(x, y)) + newCloseIndexStatus = mousePressed ? PRESSED : OVER; + + if (closeIndexStatus != (closeIndexStatus = newCloseIndexStatus)) + tabScroller.tabPanel.repaint(); + } + } + + protected void updateMaxIcon(int x, int y) + { + if (overTabIndex != -1) + { + int newMaxIndexStatus = INACTIVE; + + Rectangle maxRect = newMaxRect(rects[overTabIndex]); + + if (maxRect.contains(x, y)) + newMaxIndexStatus = mousePressed ? PRESSED : OVER; + + if (maxIndexStatus != (maxIndexStatus = newMaxIndexStatus)) + tabScroller.tabPanel.repaint(); + } + } + + private void setTabIcons(int x, int y) + { + // if the mouse isPressed + if (!mousePressed) + updateOverTab(x, y); + + if (isCloseButtonEnabled) + updateCloseIcon(x, y); + if (isMaxButtonEnabled) + updateMaxIcon(x, y); + } + + public static ComponentUI createUI(JComponent c) + { + return new SIPCommTabbedPaneUI(); + } + + /** + * Invoked by installUI to create a layout manager object to + * manage the JTabbedPane. + * + * @return a layout manager object + * + * @see javax.swing.JTabbedPane#getTabLayoutPolicy + */ + protected LayoutManager createLayoutManager() + { + return new TabbedPaneScrollLayout(); + } + + /* + * In an attempt to preserve backward compatibility for programs which have + * extended BasicTabbedPaneUI to do their own layout, the UI uses the + * installed layoutManager (and not tabLayoutPolicy) to determine if + * scrollTabLayout is enabled. + */ + + /** + * Creates and installs any required subcomponents for the JTabbedPane. + * Invoked by installUI. + * + * @since 1.4 + */ + protected void installComponents() + { + if (tabScroller == null) + { + tabScroller = new ScrollableTabSupport(tabPane.getTabPlacement()); + tabPane.add(tabScroller.viewport); + tabPane.add(tabScroller.scrollForwardButton); + tabPane.add(tabScroller.scrollBackwardButton); + } + } + + /** + * Removes any installed subcomponents from the JTabbedPane. Invoked by + * uninstallUI. + * + * @since 1.4 + */ + protected void uninstallComponents() + { + tabPane.remove(tabScroller.viewport); + tabPane.remove(tabScroller.scrollForwardButton); + tabPane.remove(tabScroller.scrollBackwardButton); + tabScroller = null; + } + + protected void installListeners() + { + if ((propertyChangeListener = createPropertyChangeListener()) != null) + { + tabPane.addPropertyChangeListener(propertyChangeListener); + } + if ((tabChangeListener = createChangeListener()) != null) + { + tabPane.addChangeListener(tabChangeListener); + } + if ((mouseListener = createMouseListener()) != null) + { + tabScroller.tabPanel.addMouseListener(mouseListener); + } + + if ((focusListener = createFocusListener()) != null) + { + tabPane.addFocusListener(focusListener); + } + + // PENDING(api) : See comment for ContainerHandler + if ((containerListener = new ContainerHandler()) != null) + { + tabPane.addContainerListener(containerListener); + if (tabPane.getTabCount() > 0) + { + htmlViews = createHTMLVector(); + } + } + + if ((motionListener = new MyMouseMotionListener()) != null) + { + tabScroller.tabPanel.addMouseMotionListener(motionListener); + } + + } + + protected void uninstallListeners() + { + if (mouseListener != null) + { + tabScroller.tabPanel.removeMouseListener(mouseListener); + mouseListener = null; + } + + if (motionListener != null) + { + tabScroller.tabPanel.removeMouseMotionListener(motionListener); + motionListener = null; + } + + if (focusListener != null) + { + tabPane.removeFocusListener(focusListener); + focusListener = null; + } + + // PENDING(api): See comment for ContainerHandler + if (containerListener != null) + { + tabPane.removeContainerListener(containerListener); + containerListener = null; + if (htmlViews != null) + { + htmlViews.removeAllElements(); + htmlViews = null; + } + } + if (tabChangeListener != null) + { + tabPane.removeChangeListener(tabChangeListener); + tabChangeListener = null; + } + if (propertyChangeListener != null) + { + tabPane.removePropertyChangeListener(propertyChangeListener); + propertyChangeListener = null; + } + + } + + protected ChangeListener createChangeListener() + { + return new TabSelectionHandler(); + } + + protected void installKeyboardActions() + { + InputMap km + = getMyInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); + + SwingUtilities.replaceUIInputMap(tabPane, + JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, km); + km = getMyInputMap(JComponent.WHEN_FOCUSED); + SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, km); + + ActionMap am = createMyActionMap(); + + SwingUtilities.replaceUIActionMap(tabPane, am); + + tabScroller.scrollForwardButton.setAction(am + .get("scrollTabsForwardAction")); + tabScroller.scrollBackwardButton.setAction(am + .get("scrollTabsBackwardAction")); + + } + + InputMap getMyInputMap(int condition) + { + if (condition == JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) + { + return (InputMap) UIManager.get("TabbedPane.ancestorInputMap"); + } + else if (condition == JComponent.WHEN_FOCUSED) + { + return (InputMap) UIManager.get("TabbedPane.focusInputMap"); + } + return null; + } + + ActionMap createMyActionMap() + { + ActionMap map = new ActionMapUIResource(); + map.put("navigateNext", new NextAction()); + map.put("navigatePrevious", new PreviousAction()); + map.put("navigateRight", new RightAction()); + map.put("navigateLeft", new LeftAction()); + map.put("navigateUp", new UpAction()); + map.put("navigateDown", new DownAction()); + map.put("navigatePageUp", new PageUpAction()); + map.put("navigatePageDown", new PageDownAction()); + map.put("requestFocus", new RequestFocusAction()); + map.put("requestFocusForVisibleComponent", + new RequestFocusForVisibleAction()); + map.put("setSelectedIndex", new SetSelectedIndexAction()); + map.put("scrollTabsForwardAction", new ScrollTabsForwardAction()); + map.put("scrollTabsBackwardAction", new ScrollTabsBackwardAction()); + return map; + } + + protected void uninstallKeyboardActions() + { + SwingUtilities.replaceUIActionMap(tabPane, null); + SwingUtilities.replaceUIInputMap(tabPane, + JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null); + SwingUtilities + .replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, null); + } + + /** + * Reloads the mnemonics. This should be invoked when a memonic changes, + * when the title of a mnemonic changes, or when tabs are added/removed. + */ + private void updateMnemonics() + { + resetMnemonics(); + for (int counter = tabPane.getTabCount() - 1; counter >= 0; counter--) + { + int mnemonic = tabPane.getMnemonicAt(counter); + + if (mnemonic > 0) + { + addMnemonic(counter, mnemonic); + } + } + } + + /** + * Resets the mnemonics bindings to an empty state. + */ + private void resetMnemonics() + { + if (mnemonicToIndexMap != null) + { + mnemonicToIndexMap.clear(); + mnemonicInputMap.clear(); + } + } + + /** + * Adds the specified mnemonic at the specified index. + */ + private void addMnemonic(int index, int mnemonic) + { + if (mnemonicToIndexMap == null) + { + initMnemonics(); + } + + mnemonicInputMap.put(KeyStroke.getKeyStroke(mnemonic, Event.ALT_MASK), + "setSelectedIndex"); + + mnemonicToIndexMap.put(new Integer(mnemonic), new Integer(index)); + } + + /** + * Installs the state needed for mnemonics. + */ + private void initMnemonics() + { + mnemonicToIndexMap = new Hashtable(); + mnemonicInputMap = new InputMapUIResource(); + mnemonicInputMap.setParent(SwingUtilities.getUIInputMap(tabPane, + JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)); + SwingUtilities + .replaceUIInputMap(tabPane, + JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, + mnemonicInputMap); + } + + // UI Rendering + + public void paint(Graphics g, JComponent c) + { + int tc = tabPane.getTabCount(); + + if (tabCount != tc) { + tabCount = tc; + updateMnemonics(); + } + + int selectedIndex = tabPane.getSelectedIndex(); + int tabPlacement = tabPane.getTabPlacement(); + + ensureCurrentLayout(); + + // Paint content border + paintContentBorder(g, tabPlacement, selectedIndex); + } + + protected void paintTab(Graphics g, int tabPlacement, Rectangle[] rects, + int tabIndex, Rectangle iconRect, Rectangle textRect) + { + Rectangle tabRect = rects[tabIndex]; + int selectedIndex = tabPane.getSelectedIndex(); + boolean isSelected = selectedIndex == tabIndex; + boolean isOver = overTabIndex == tabIndex; + Graphics2D g2 = null; + Shape save = null; + boolean cropShape = false; + int cropx = 0; + int cropy = 0; + + if (g instanceof Graphics2D) + { + g2 = (Graphics2D) g; + + // Render visual for cropped tab edge... + Rectangle viewRect = tabScroller.viewport.getViewRect(); + int cropline; + + cropline = viewRect.x + viewRect.width; + if ((tabRect.x < cropline) + && (tabRect.x + tabRect.width > cropline)) + { + + cropx = cropline - 1; + cropy = tabRect.y; + cropShape = true; + } + + if (cropShape) + { + save = g2.getClip(); + g2 + .clipRect(tabRect.x, tabRect.y, tabRect.width, + tabRect.height); + + } + } + + paintTabBackground(g, tabPlacement, tabIndex, tabRect.x, tabRect.y, + tabRect.width, tabRect.height, isSelected); + + paintTabBorder(g, tabPlacement, tabIndex, tabRect.x, tabRect.y, + tabRect.width, tabRect.height, isSelected); + + String title = tabPane.getTitleAt(tabIndex); + Font font = tabPane.getFont(); + FontMetrics metrics = g.getFontMetrics(font); + Icon icon = getIconForTab(tabIndex); + + layoutLabel(tabPlacement, metrics, tabIndex, title, icon, tabRect, + iconRect, textRect, isSelected); + + paintText(g, tabPlacement, font, metrics, tabIndex, title, textRect, + isSelected); + + paintIcon(g, tabPlacement, tabIndex, icon, iconRect, isSelected); + + paintFocusIndicator(g, tabPlacement, rects, tabIndex, iconRect, + textRect, isSelected); + + if (cropShape) + { + paintCroppedTabEdge(g, tabPlacement, tabIndex, isSelected, cropx, + cropy); + g2.setClip(save); + } + else if (isOver || isSelected) + { + int dx = tabRect.x + tabRect.width - BUTTONSIZE - WIDTHDELTA; + int dy = (tabRect.y + tabRect.height) / 2 - 7; + + if (isCloseButtonEnabled) + paintCloseIcon(g2, dx, dy, isOver); + if (isMaxButtonEnabled) + paintMaxIcon(g2, dx, dy, isOver); + } + + } + + protected void paintCloseIcon(Graphics g, int dx, int dy, boolean isOver) + { + // paintActionButton(g, dx, dy, closeIndexStatus, isOver, closeB, + // closeImgB); + g.drawImage(closeImgI, dx, dy + 1, null); + } + + protected void paintMaxIcon(Graphics g, int dx, int dy, boolean isOver) + { + if (isCloseButtonEnabled) + dx -= BUTTONSIZE; + + // paintActionButton(g, dx, dy, maxIndexStatus, isOver, maxB, maxImgB); + g.drawImage(maxImgI, dx, dy + 1, null); + } + + protected void paintActionButton(Graphics g, int dx, int dy, int status, + boolean isOver, JButton button, Image image) + { + button.setBorder(null); + + if (isOver) { + switch (status) { + case OVER: + button.setBorder(OVERBORDER); + break; + case PRESSED: + button.setBorder(PRESSEDBORDER); + break; + } + } + + button.setBackground(tabScroller.tabPanel.getBackground()); + button.paint(image.getGraphics()); + g.drawImage(image, dx, dy, null); + } + + /* + * This method will create and return a polygon shape for the given tab + * rectangle which has been cropped at the specified cropline with a torn + * edge visual. e.g. A "File" tab which has cropped been cropped just after + * the "i": ------------- | ..... | | . | | ... . | | . . | | . . | | . . | + * -------------- + * + * The x, y arrays below define the pattern used to create a "torn" edge + * segment which is repeated to fill the edge of the tab. For tabs placed on + * TOP and BOTTOM, this righthand torn edge is created by line segments + * which are defined by coordinates obtained by subtracting xCropLen[i] from + * (tab.x + tab.width) and adding yCroplen[i] to (tab.y). For tabs placed on + * LEFT or RIGHT, the bottom torn edge is created by subtracting xCropLen[i] + * from (tab.y + tab.height) and adding yCropLen[i] to (tab.x). + */ + + private static final int CROP_SEGMENT = 12; + + private void paintCroppedTabEdge(Graphics g, int tabPlacement, + int tabIndex, boolean isSelected, int x, int y) + { + g.setColor(shadow); + g.drawLine(x, y, x, y + rects[tabIndex].height); + + } + + private void ensureCurrentLayout() + { + if (!tabPane.isValid()) + { + tabPane.validate(); + } + /* + * If tabPane doesn't have a peer yet, the validate() call will silently + * fail. We handle that by forcing a layout if tabPane is still invalid. + * See bug 4237677. + */ + if (!tabPane.isValid()) + { + TabbedPaneLayout layout = (TabbedPaneLayout) tabPane.getLayout(); + layout.calculateLayoutInfo(); + } + } + + /** + * Returns the bounds of the specified tab in the coordinate space of the + * JTabbedPane component. This is required because the tab rects are by + * default defined in the coordinate space of the component where they are + * rendered, which could be the JTabbedPane (for WRAP_TAB_LAYOUT) or a + * ScrollableTabPanel (SCROLL_TAB_LAYOUT). This method should be used + * whenever the tab rectangle must be relative to the JTabbedPane itself and + * the result should be placed in a designated Rectangle object (rather than + * instantiating and returning a new Rectangle each time). The tab index + * parameter must be a valid tabbed pane tab index (0 to tab count - 1, + * inclusive). The destination rectangle parameter must be a valid + * Rectangle instance. The handling of invalid parameters is + * unspecified. + * + * @param tabIndex + * the index of the tab + * @param dest + * the rectangle where the result should be placed + * @return the resulting rectangle + * + * @since 1.4 + */ + + protected Rectangle getTabBounds(int tabIndex, Rectangle dest) + { + dest.width = rects[tabIndex].width; + dest.height = rects[tabIndex].height; + + Point vpp = tabScroller.viewport.getLocation(); + Point viewp = tabScroller.viewport.getViewPosition(); + dest.x = rects[tabIndex].x + vpp.x - viewp.x; + dest.y = rects[tabIndex].y + vpp.y - viewp.y; + + return dest; + } + + private int getTabAtLocation(int x, int y) + { + ensureCurrentLayout(); + + int tabCount = tabPane.getTabCount(); + for (int i = 0; i < tabCount; i++) + { + if (rects[i].contains(x, y)) + { + return i; + } + } + return -1; + } + + public int getOverTabIndex() + { + return overTabIndex; + } + + /** + * Returns the index of the tab closest to the passed in location, note that + * the returned tab may not contain the location x,y. + */ + private int getClosestTab(int x, int y) + { + int min = 0; + int tabCount = Math.min(rects.length, tabPane.getTabCount()); + int max = tabCount; + int tabPlacement = tabPane.getTabPlacement(); + boolean useX = (tabPlacement == TOP || tabPlacement == BOTTOM); + int want = (useX) ? x : y; + + while (min != max) + { + int current = (max + min) / 2; + int minLoc; + int maxLoc; + + if (useX) + { + minLoc = rects[current].x; + maxLoc = minLoc + rects[current].width; + } + else + { + minLoc = rects[current].y; + maxLoc = minLoc + rects[current].height; + } + if (want < minLoc) + { + max = current; + if (min == max) + { + return Math.max(0, current - 1); + } + } + else if (want >= maxLoc) + { + min = current; + if (max - min <= 1) + { + return Math.max(current + 1, tabCount - 1); + } + } + else + { + return current; + } + } + return min; + } + + /** + * Returns a point which is translated from the specified point in the + * JTabbedPane's coordinate space to the coordinate space of the + * ScrollableTabPanel. This is used for SCROLL_TAB_LAYOUT ONLY. + */ + private Point translatePointToTabPanel(int srcx, int srcy, Point dest) + { + Point vpp = tabScroller.viewport.getLocation(); + Point viewp = tabScroller.viewport.getViewPosition(); + dest.x = srcx + vpp.x + viewp.x; + dest.y = srcy + vpp.y + viewp.y; + return dest; + } + + // BasicTabbedPaneUI methods + + // Tab Navigation methods + + // REMIND(aim,7/29/98): This method should be made + // protected in the next release where + // API changes are allowed + // + boolean requestMyFocusForVisibleComponent() + { + Component visibleComponent = getVisibleComponent(); + if (visibleComponent.isFocusable()) + { + visibleComponent.requestFocus(); + return true; + } + else if (visibleComponent instanceof JComponent) + { + if (((JComponent) visibleComponent).requestFocusInWindow()) + { + return true; + } + } + return false; + } + + private static class RightAction extends AbstractAction + { + public void actionPerformed(ActionEvent e) + { + JTabbedPane pane = (JTabbedPane) e.getSource(); + SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) pane.getUI(); + ui.navigateSelectedTab(EAST); + } + }; + + private static class LeftAction extends AbstractAction + { + public void actionPerformed(ActionEvent e) + { + JTabbedPane pane = (JTabbedPane) e.getSource(); + SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) pane.getUI(); + ui.navigateSelectedTab(WEST); + } + }; + + private static class UpAction extends AbstractAction + { + public void actionPerformed(ActionEvent e) + { + JTabbedPane pane = (JTabbedPane) e.getSource(); + SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) pane.getUI(); + ui.navigateSelectedTab(NORTH); + } + }; + + private static class DownAction extends AbstractAction + { + public void actionPerformed(ActionEvent e) + { + JTabbedPane pane = (JTabbedPane) e.getSource(); + SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) pane.getUI(); + ui.navigateSelectedTab(SOUTH); + } + }; + + private static class NextAction extends AbstractAction + { + public void actionPerformed(ActionEvent e) + { + JTabbedPane pane = (JTabbedPane) e.getSource(); + SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) pane.getUI(); + ui.navigateSelectedTab(NEXT); + } + }; + + private static class PreviousAction extends AbstractAction + { + public void actionPerformed(ActionEvent e) + { + JTabbedPane pane = (JTabbedPane) e.getSource(); + SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) pane.getUI(); + ui.navigateSelectedTab(PREVIOUS); + } + }; + + private static class PageUpAction extends AbstractAction + { + public void actionPerformed(ActionEvent e) + { + JTabbedPane pane = (JTabbedPane) e.getSource(); + SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) pane.getUI(); + int tabPlacement = pane.getTabPlacement(); + if (tabPlacement == TOP || tabPlacement == BOTTOM) + { + ui.navigateSelectedTab(WEST); + } + else + { + ui.navigateSelectedTab(NORTH); + } + } + }; + + private static class PageDownAction extends AbstractAction + { + public void actionPerformed(ActionEvent e) { + JTabbedPane pane = (JTabbedPane) e.getSource(); + SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) pane.getUI(); + int tabPlacement = pane.getTabPlacement(); + if (tabPlacement == TOP || tabPlacement == BOTTOM) + { + ui.navigateSelectedTab(EAST); + } + else + { + ui.navigateSelectedTab(SOUTH); + } + } + }; + + private static class RequestFocusAction extends AbstractAction + { + public void actionPerformed(ActionEvent e) + { + JTabbedPane pane = (JTabbedPane) e.getSource(); + pane.requestFocus(); + } + }; + + private static class RequestFocusForVisibleAction extends AbstractAction + { + public void actionPerformed(ActionEvent e) + { + JTabbedPane pane = (JTabbedPane) e.getSource(); + SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) pane.getUI(); + ui.requestMyFocusForVisibleComponent(); + } + }; + + /** + * Selects a tab in the JTabbedPane based on the String of the action + * command. The tab selected is based on the first tab that has a mnemonic + * matching the first character of the action command. + */ + private static class SetSelectedIndexAction extends AbstractAction + { + public void actionPerformed(ActionEvent e) + { + JTabbedPane pane = (JTabbedPane) e.getSource(); + + if (pane != null && (pane.getUI() instanceof SIPCommTabbedPaneUI)) + { + SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) pane.getUI(); + String command = e.getActionCommand(); + + if (command != null && command.length() > 0) + { + int mnemonic = (int) e.getActionCommand().charAt(0); + if (mnemonic >= 'a' && mnemonic <= 'z') + { + mnemonic -= ('a' - 'A'); + } + + Integer index = (Integer) ui.mnemonicToIndexMap + .get(new Integer(mnemonic)); + if (index != null && pane.isEnabledAt(index.intValue())) + { + pane.setSelectedIndex(index.intValue()); + } + } + } + } + }; + + private static class ScrollTabsForwardAction + extends AbstractAction + { + public void actionPerformed(ActionEvent e) + { + JTabbedPane pane = null; + Object src = e.getSource(); + if (src instanceof JTabbedPane) + { + pane = (JTabbedPane) src; + } + else if (src instanceof ScrollableTabButton) + { + pane = (JTabbedPane) ((ScrollableTabButton) src).getParent(); + } + else + { + return; // shouldn't happen + } + SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) pane.getUI(); + + ui.tabScroller.scrollForward(pane.getTabPlacement()); + + } + } + + private static class ScrollTabsBackwardAction + extends AbstractAction + { + public void actionPerformed(ActionEvent e) + { + JTabbedPane pane = null; + Object src = e.getSource(); + if (src instanceof JTabbedPane) + { + pane = (JTabbedPane) src; + } + else if (src instanceof ScrollableTabButton) + { + pane = (JTabbedPane) ((ScrollableTabButton) src).getParent(); + } + else + { + return; // shouldn't happen + } + SIPCommTabbedPaneUI ui = (SIPCommTabbedPaneUI) pane.getUI(); + + ui.tabScroller.scrollBackward(pane.getTabPlacement()); + + } + } + + /** + * This inner class is marked "public" due to a compiler bug. This + * class should be treated as a "protected" inner class. + * Instantiate it only within subclasses of BasicTabbedPaneUI. + */ + private class TabbedPaneScrollLayout + extends TabbedPaneLayout + { + + protected int preferredTabAreaHeight(int tabPlacement, int width) + { + return calculateMaxTabHeight(tabPlacement); + } + + protected int preferredTabAreaWidth(int tabPlacement, int height) + { + return calculateMaxTabWidth(tabPlacement); + } + + public void layoutContainer(Container parent) + { + int tabPlacement = tabPane.getTabPlacement(); + int tabCount = tabPane.getTabCount(); + Insets insets = tabPane.getInsets(); + int selectedIndex = tabPane.getSelectedIndex(); + Component visibleComponent = getVisibleComponent(); + + calculateLayoutInfo(); + + if (selectedIndex < 0) + { + if (visibleComponent != null) + { + // The last tab was removed, so remove the component + setVisibleComponent(null); + } + } + else + { + Component selectedComponent = + tabPane.getComponentAt(selectedIndex); + boolean shouldChangeFocus = false; + + // In order to allow programs to use a single component + // as the display for multiple tabs, we will not change + // the visible compnent if the currently selected tab + // has a null component. This is a bit dicey, as we don't + // explicitly state we support this in the spec, but since + // programs are now depending on this, we're making it work. + // + if (selectedComponent != null) + { + if (selectedComponent != visibleComponent + && visibleComponent != null) + { + if (KeyboardFocusManager.getCurrentKeyboardFocusManager() + .getFocusOwner() != null) + { + shouldChangeFocus = true; + } + } + setVisibleComponent(selectedComponent); + } + int tx, ty, tw, th; // tab area bounds + int cx, cy, cw, ch; // content area bounds + Insets contentInsets = getContentBorderInsets(tabPlacement); + Rectangle bounds = tabPane.getBounds(); + int numChildren = tabPane.getComponentCount(); + + if (numChildren > 0) + { + + // calculate tab area bounds + tw = bounds.width - insets.left - insets.right; + th = + calculateTabAreaHeight(tabPlacement, runCount, + maxTabHeight); + tx = insets.left; + ty = insets.top; + + // calculate content area bounds + cx = tx + contentInsets.left; + cy = ty + th + contentInsets.top; + cw = + bounds.width - insets.left - insets.right + - contentInsets.left - contentInsets.right; + ch = + bounds.height - insets.top - insets.bottom - th + - contentInsets.top - contentInsets.bottom; + + for (int i = 0; i < numChildren; i++) + { + Component child = tabPane.getComponent(i); + + if (child instanceof ScrollableTabViewport) + { + JViewport viewport = (JViewport) child; + Rectangle viewRect = viewport.getViewRect(); + int vw = tw; + int vh = th; + + int totalTabWidth = + rects[tabCount - 1].x + + rects[tabCount - 1].width; + if (totalTabWidth > tw) + { + // Need to allow space for scrollbuttons + vw = Math.max(tw - 36, 36); + ; + if (totalTabWidth - viewRect.x <= vw) + { + // Scrolled to the end, so ensure the + // viewport size is + // such that the scroll offset aligns with a + // tab + vw = totalTabWidth - viewRect.x; + } + } + + child.setBounds(tx, ty, vw, vh); + + } + else if (child instanceof ScrollableTabButton) + { + ScrollableTabButton scrollbutton = + (ScrollableTabButton) child; + Dimension bsize = scrollbutton.getPreferredSize(); + int bx = 0; + int by = 0; + int bw = bsize.width; + int bh = bsize.height; + boolean visible = false; + + int totalTabWidth = + rects[tabCount - 1].x + + rects[tabCount - 1].width; + + if (totalTabWidth > tw) + { + int dir = + scrollbutton.scrollsForward() ? EAST : WEST; + scrollbutton.setDirection(dir); + visible = true; + bx = + dir == EAST ? bounds.width - insets.left + - bsize.width : bounds.width + - insets.left - 2 * bsize.width; + by = + (tabPlacement == TOP ? ty + th + - bsize.height : ty); + } + + child.setVisible(visible); + if (visible) + { + child.setBounds(bx, by, bw, bh); + } + + } + else + { + // All content children... + child.setBounds(cx, cy, cw, ch); + } + } + if (shouldChangeFocus) + { + if (!requestMyFocusForVisibleComponent()) + { + tabPane.requestFocus(); + } + } + } + } + } + + protected void calculateTabRects(int tabPlacement, int tabCount) + { + FontMetrics metrics = getFontMetrics(); + Dimension size = tabPane.getSize(); + Insets insets = tabPane.getInsets(); + Insets tabAreaInsets = getTabAreaInsets(tabPlacement); + int fontHeight = metrics.getHeight(); + int selectedIndex = tabPane.getSelectedIndex(); + int i, j; + + int x = tabAreaInsets.left - 2; + int y = tabAreaInsets.top; + int totalWidth = 0; + int totalHeight = 0; + + // + // Calculate bounds within which a tab run must fit + // + maxTabHeight = calculateMaxTabHeight(tabPlacement); + + runCount = 0; + selectedRun = -1; + + if (tabCount == 0) + return; + + selectedRun = 0; + runCount = 1; + + // Run through tabs and lay them out in a single run + Rectangle rect; + for (i = 0; i < tabCount; i++) + { + rect = rects[i]; + + if (i > 0) + { + rect.x = rects[i - 1].x + rects[i - 1].width - 1; + } + else + { + tabRuns[0] = 0; + maxTabWidth = 0; + totalHeight += maxTabHeight; + rect.x = x; + } + rect.width = calculateTabWidth(tabPlacement, i, metrics); + totalWidth = rect.x + rect.width; + maxTabWidth = Math.max(maxTabWidth, rect.width); + + rect.y = y; + rect.height = maxTabHeight /* - 2 */; + } + + // tabPanel.setSize(totalWidth, totalHeight); + tabScroller.tabPanel.setPreferredSize(new Dimension(totalWidth, + totalHeight)); + } + } + + private class ScrollableTabSupport implements ChangeListener + { + public ScrollableTabViewport viewport; + + public ScrollableTabPanel tabPanel; + + public ScrollableTabButton scrollForwardButton; + + public ScrollableTabButton scrollBackwardButton; + + public int leadingTabIndex; + + private Point tabViewPosition = new Point(0, 0); + + ScrollableTabSupport(int tabPlacement) + { + viewport = new ScrollableTabViewport(); + tabPanel = new ScrollableTabPanel(); + viewport.setView(tabPanel); + viewport.addChangeListener(this); + + scrollForwardButton = createScrollableTabButton(EAST); + scrollBackwardButton = createScrollableTabButton(WEST); + // scrollForwardButton = new ScrollableTabButton(EAST); + // scrollBackwardButton = new ScrollableTabButton(WEST); + } + + public void scrollForward(int tabPlacement) + { + Dimension viewSize = viewport.getViewSize(); + Rectangle viewRect = viewport.getViewRect(); + + if (tabPlacement == TOP || tabPlacement == BOTTOM) + { + if (viewRect.width >= viewSize.width - viewRect.x) + return; // no room left to scroll + } + else + { // tabPlacement == LEFT || tabPlacement == RIGHT + if (viewRect.height >= viewSize.height - viewRect.y) + return; + } + setLeadingTabIndex(tabPlacement, leadingTabIndex + 1); + } + + public void scrollBackward(int tabPlacement) + { + if (leadingTabIndex == 0) + return; // no room left to scroll + + setLeadingTabIndex(tabPlacement, leadingTabIndex - 1); + } + + public void setLeadingTabIndex(int tabPlacement, int index) + { + leadingTabIndex = index; + Dimension viewSize = viewport.getViewSize(); + Rectangle viewRect = viewport.getViewRect(); + + tabViewPosition.x = leadingTabIndex == 0 ? 0 + : rects[leadingTabIndex].x; + + if ((viewSize.width - tabViewPosition.x) < viewRect.width) + { + // We've scrolled to the end, so adjust the viewport size + // to ensure the view position remains aligned on a tab boundary + Dimension extentSize = new Dimension(viewSize.width + - tabViewPosition.x, viewRect.height); + viewport.setExtentSize(extentSize); + } + + viewport.setViewPosition(tabViewPosition); + } + + public void stateChanged(ChangeEvent e) + { + JViewport viewport = (JViewport) e.getSource(); + int tabPlacement = tabPane.getTabPlacement(); + int tabCount = tabPane.getTabCount(); + Rectangle vpRect = viewport.getBounds(); + Dimension viewSize = viewport.getViewSize(); + Rectangle viewRect = viewport.getViewRect(); + + leadingTabIndex = getClosestTab(viewRect.x, viewRect.y); + + // If the tab isn't right aligned, adjust it. + if (leadingTabIndex + 1 < tabCount) + { + + if (rects[leadingTabIndex].x < viewRect.x) + leadingTabIndex++; + } + Insets contentInsets = getContentBorderInsets(tabPlacement); + + tabPane.repaint(vpRect.x, vpRect.y + vpRect.height, vpRect.width, + contentInsets.top); + scrollBackwardButton.setEnabled(viewRect.x > 0); + scrollForwardButton.setEnabled(leadingTabIndex < tabCount - 1 + && viewSize.width - viewRect.x > viewRect.width); + + } + + public String toString() + { + return new String("viewport.viewSize=" + viewport.getViewSize() + + "\n" + "viewport.viewRectangle=" + viewport.getViewRect() + + "\n" + "leadingTabIndex=" + leadingTabIndex + "\n" + + "tabViewPosition=" + tabViewPosition); + } + + } + + private class ScrollableTabViewport + extends JViewport + implements UIResource + { + public ScrollableTabViewport() + { + super(); + setOpaque(false); + setScrollMode(SIMPLE_SCROLL_MODE); + } + } + + private class ScrollableTabPanel + extends TransparentPanel + implements UIResource + { + public ScrollableTabPanel() + { + setLayout(null); + } + + public void paintComponent(Graphics g) + { + super.paintComponent(g); + SIPCommTabbedPaneUI.this.paintTabArea(g, tabPane.getTabPlacement(), + tabPane.getSelectedIndex()); + } + } + + protected class ScrollableTabButton extends BasicArrowButton implements + UIResource, SwingConstants + { + public ScrollableTabButton(int direction) + { + super(direction, UIManager.getColor("TabbedPane.selected"), + UIManager.getColor("TabbedPane.shadow"), UIManager + .getColor("TabbedPane.darkShadow"), UIManager + .getColor("TabbedPane.highlight")); + + } + + public boolean scrollsForward() + { + return direction == EAST || direction == SOUTH; + } + + } + + /** + * This inner class is marked "public" due to a compiler bug. This + * class should be treated as a "protected" inner class. + * Instantiate it only within subclasses of BasicTabbedPaneUI. + */ + public class TabSelectionHandler implements ChangeListener + { + public void stateChanged(ChangeEvent e) + { + JTabbedPane tabPane = (JTabbedPane) e.getSource(); + tabPane.revalidate(); + tabPane.repaint(); + + if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) + { + int index = tabPane.getSelectedIndex(); + + if (index < rects.length && index != -1) + tabScroller.tabPanel.scrollRectToVisible(rects[index]); + } + } + } + + /** + * This inner class is marked "public" due to a compiler bug. This + * class should be treated as a "protected" inner class. + * Instantiate it only within subclasses of BasicTabbedPaneUI. + */ + + /* + * GES 2/3/99: The container listener code was added to support HTML + * rendering of tab titles. + * + * Ideally, we would be able to listen for property changes when a tab is + * added or its text modified. At the moment there are no such events + * because the Beans spec doesn't allow 'indexed' property changes (i.e. tab + * 2's text changed from A to B). + * + * In order to get around this, we listen for tabs to be added or removed by + * listening for the container events. we then queue up a runnable (so the + * component has a chance to complete the add) which checks the tab title of + * the new component to see if it requires HTML rendering. + * + * The Views (one per tab title requiring HTML rendering) are stored in the + * htmlViews Vector, which is only allocated after the first time we run + * into an HTML tab. Note that this vector is kept in step with the number + * of pages, and nulls are added for those pages whose tab title do not + * require HTML rendering. + * + * This makes it easy for the paint and layout code to tell whether to + * invoke the HTML engine without having to check the string during + * time-sensitive operations. + * + * When we have added a way to listen for tab additions and changes to tab + * text, this code should be removed and replaced by something which uses + * that. + */ + + private class ContainerHandler implements ContainerListener + { + public void componentAdded(ContainerEvent e) + { + JTabbedPane tp = (JTabbedPane) e.getContainer(); + Component child = e.getChild(); + if (child instanceof UIResource) + return; + + int index = tp.indexOfComponent(child); + String title = tp.getTitleAt(index); + + boolean isHTML = BasicHTML.isHTMLString(title); + if (isHTML) + { + if (htmlViews == null) + { // Initialize vector + htmlViews = createHTMLVector(); + } + else + { // Vector already exists + View v = BasicHTML.createHTMLView(tp, title); + htmlViews.insertElementAt(v, index); + } + } + else + { // Not HTML + if (htmlViews != null) + { // Add placeholder + htmlViews.insertElementAt(null, index); + } // else nada! + } + } + + public void componentRemoved(ContainerEvent e) + { + JTabbedPane tp = (JTabbedPane) e.getContainer(); + Component child = e.getChild(); + if (child instanceof UIResource) + return; + + // NOTE 4/15/2002 (joutwate): + // This fix is implemented using client properties since there is + // currently no IndexPropertyChangeEvent. Once + // IndexPropertyChangeEvents have been added this code should be + // modified to use it. + Integer indexObj = (Integer) tp + .getClientProperty("__index_to_remove__"); + if (indexObj != null) + { + int index = indexObj.intValue(); + if (htmlViews != null && htmlViews.size() >= index) + { + htmlViews.removeElementAt(index); + } + } + } + } + + private Vector createHTMLVector() + { + Vector htmlViews = new Vector(); + int count = tabPane.getTabCount(); + if (count > 0) { + for (int i = 0; i < count; i++) + { + String title = tabPane.getTitleAt(i); + if (BasicHTML.isHTMLString(title)) + { + htmlViews.addElement(BasicHTML.createHTMLView(tabPane, + title)); + } + else + { + htmlViews.addElement(null); + } + } + } + return htmlViews; + } + + class MyMouseHandler extends MouseHandler + { + public MyMouseHandler() + { + super(); + } + + public void mousePressed(MouseEvent e) + { + if (closeIndexStatus == OVER) + { + closeIndexStatus = PRESSED; + tabScroller.tabPanel.repaint(); + } + else if (maxIndexStatus == OVER) + { + maxIndexStatus = PRESSED; + tabScroller.tabPanel.repaint(); + } + else + { + super.mousePressed(e); + } + } + + public void mouseClicked(MouseEvent e) + { + if (e.getClickCount() > 1 && overTabIndex != -1) + { + ((SIPCommTabbedPane) tabPane).fireDoubleClickTabEvent(e, + overTabIndex); + } + } + + public void mouseReleased(MouseEvent e) + { + updateOverTab(e.getX(), e.getY()); + + if (overTabIndex == -1) { + if (e.isPopupTrigger()) + ((SIPCommTabbedPane) tabPane).firePopupOutsideTabEvent(e); + return; + } + + if (isOneActionButtonEnabled() && e.isPopupTrigger()) + { + super.mousePressed(e); + + closeIndexStatus = INACTIVE; // Prevent undesired action when + maxIndexStatus = INACTIVE; // right-clicking on icons + + actionPopupMenu.show(tabScroller.tabPanel, e.getX(), e.getY()); + return; + } + + if (closeIndexStatus == PRESSED) + { + closeIndexStatus = OVER; + tabScroller.tabPanel.repaint(); + ((SIPCommTabbedPane) tabPane) + .fireCloseTabEvent(e, overTabIndex); + return; + } + + if (maxIndexStatus == PRESSED) + { + maxIndexStatus = OVER; + tabScroller.tabPanel.repaint(); + ((SIPCommTabbedPane) tabPane).fireMaxTabEvent(e, overTabIndex); + return; + } + + } + + public void mouseExited(MouseEvent e) + { + if (!mousePressed) + { + overTabIndex = -1; + tabScroller.tabPanel.repaint(); + } + } + + } + + class MyMouseMotionListener + implements MouseMotionListener + { + + public void mouseMoved(MouseEvent e) + { + if (actionPopupMenu.isVisible()) + return; // No updates when popup is visible + mousePressed = false; + setTabIcons(e.getX(), e.getY()); + } + + public void mouseDragged(MouseEvent e) + { + if (actionPopupMenu.isVisible()) + return; // No updates when popup is visible + mousePressed = true; + setTabIcons(e.getX(), e.getY()); + } + } + + public void tabAddHightlight(int tabIndex) + { + this.highlightedTabs.add(new Integer(tabIndex)); + } + + public void tabRemoveHighlight(int tabIndex) + { + Enumeration highlightedEnum = this.highlightedTabs.elements(); + + while (highlightedEnum.hasMoreElements()) + { + Integer element = (Integer) highlightedEnum.nextElement(); + + if (element.intValue() == tabIndex) + { + this.highlightedTabs.remove(element); + break; + } + } + } + + public boolean isTabHighlighted(int tabIndex) + { + Enumeration highlightedEnum = this.highlightedTabs.elements(); + + while (highlightedEnum.hasMoreElements()) + { + Integer element = (Integer) highlightedEnum.nextElement(); + + if (element.intValue() == tabIndex) + return true; + } + return false; + } + + /** + * We don't want to have a content border. + */ + protected void paintContentBorder( Graphics g, + int tabPlacement, + int selectedIndex) + { + } +} \ No newline at end of file diff --git a/src/net/java/sip/communicator/util/util.manifest.mf b/src/net/java/sip/communicator/util/util.manifest.mf index 830540d..67709da 100644 --- a/src/net/java/sip/communicator/util/util.manifest.mf +++ b/src/net/java/sip/communicator/util/util.manifest.mf @@ -3,23 +3,31 @@ Bundle-Name: SIP Communicator Utility Packages Bundle-Description: A bundle that export packages with utility classes. Bundle-Vendor: sip-communicator.org Bundle-Version: 0.0.1 -Import-Package: org.osgi.framework, +Import-Package: org.xml.sax, org.w3c.dom, - org.xml.sax, - javax.xml.parsers, + org.osgi.framework, org.apache.xml.serialize, - javax.xml.transform, - javax.xml.transform.dom, javax.xml.transform.stream, - javax.naming, - javax.naming.directory, - javax.swing, + javax.xml.transform.dom, + javax.xml.transform, + javax.xml.parsers, javax.swing.text.html, javax.swing.text, + javax.swing.plaf.basic, + javax.swing.plaf, + javax.swing.event, + javax.swing.border, + javax.swing, + javax.naming.directory, + javax.naming, + javax.imageio, net.java.sip.communicator.util.xml, net.java.sip.communicator.util, net.java.sip.communicator.service.resources, - javax.imageio + net.java.sip.communicator.service.keybindings, + net.java.sip.communicator.service.configuration Export-Package: net.java.sip.communicator.util.xml, - net.java.sip.communicator.util, - + net.java.sip.communicator.util.swing.plaf, + net.java.sip.communicator.util.swing.event, + net.java.sip.communicator.util.swing, + net.java.sip.communicator.util -- cgit v1.1