Update UI per new UI Mockups.

git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@6698 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Derek DeMoro
2007-01-16 05:56:47 +00:00
committed by derek
parent 22908987bc
commit fed5dae9d2
12 changed files with 88 additions and 227 deletions

View File

@ -21,16 +21,15 @@ import org.jivesoftware.smack.packet.Presence;
import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smackx.debugger.EnhancedDebuggerWindow;
import org.jivesoftware.smackx.packet.DelayInformation;
import org.jivesoftware.spark.component.VerticalFlowLayout;
import org.jivesoftware.spark.component.panes.CollapsiblePane;
import org.jivesoftware.spark.component.tabbedPane.SparkTabbedPane;
import org.jivesoftware.spark.filetransfer.SparkTransferManager;
import org.jivesoftware.spark.search.SearchManager;
import org.jivesoftware.spark.ui.ChatContainer;
import org.jivesoftware.spark.ui.ChatRoom;
import org.jivesoftware.spark.ui.ChatRoomNotFoundException;
import org.jivesoftware.spark.ui.CommandPanel;
import org.jivesoftware.spark.ui.ContactItem;
import org.jivesoftware.spark.ui.ContactList;
import org.jivesoftware.spark.ui.ChatContainer;
import org.jivesoftware.spark.ui.conferences.Conferences;
import org.jivesoftware.spark.ui.status.StatusBar;
import org.jivesoftware.spark.util.SwingWorker;
@ -40,7 +39,6 @@ import org.jivesoftware.sparkimpl.plugin.transcripts.ChatTranscriptPlugin;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
@ -57,7 +55,6 @@ import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.KeyStroke;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
/**
@ -78,6 +75,7 @@ import javax.swing.UIManager;
public class Workspace extends JPanel implements PacketListener {
private SparkTabbedPane workspacePane;
private StatusBar statusBox;
private CommandPanel commandPanel;
private ContactList contactList;
private Conferences conferences;
@ -90,9 +88,6 @@ public class Workspace extends JPanel implements PacketListener {
public static final String WORKSPACE_PANE = "WORKSPACE_PANE";
private final CollapsiblePane alerts = new CollapsiblePane();
private final JPanel alertPanel = new JPanel();
/**
* Returns the singleton instance of <CODE>Workspace</CODE>,
@ -119,7 +114,7 @@ public class Workspace extends JPanel implements PacketListener {
* Creates the instance of the SupportChatWorkspace.
*/
private Workspace() {
MainWindow mainWindow = SparkManager.getMainWindow();
final MainWindow mainWindow = SparkManager.getMainWindow();
// Add MainWindow listener
mainWindow.addMainWindowListener(new MainWindowListener() {
@ -153,21 +148,14 @@ public class Workspace extends JPanel implements PacketListener {
cardPanel.setOpaque(false);
cardPanel.add(WORKSPACE_PANE, this);
// Setup alert Panel
alertPanel.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false));
alertPanel.setBackground((Color)UIManager.get("List.background"));
alerts.setContentPane(alertPanel);
alerts.getTitlePane().setVisible(false);
alerts.setVisible(false);
statusBox = new StatusBar();
commandPanel = new CommandPanel();
// Build default workspace
this.setLayout(new GridBagLayout());
add(workspacePane, new GridBagConstraints(0, 9, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(2, 4, 4, 4), 0, 0));
add(workspacePane, new GridBagConstraints(0, 9, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 4, 4, 4), 0, 0));
add(statusBox, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 4, 4, 4), 0, 0));
add(alerts, new GridBagConstraints(0, 2, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 4, 4, 4), 0, 0));
add(commandPanel, new GridBagConstraints(0, 5, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 4, 0, 4), 0, 0));
this.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("F12"), "showDebugger");
@ -423,36 +411,6 @@ public class Workspace extends JPanel implements PacketListener {
chatRoom.getChatInputEditor().requestFocusInWindow();
}
public void addAlert(Component comp) {
alertPanel.add(comp);
int comps = alertPanel.getComponentCount();
alerts.setVisible(true);
alerts.getTitlePane().setVisible(true);
alerts.setTitle("Alerts (" + comps + ")");
alertPanel.invalidate();
alertPanel.validate();
alertPanel.repaint();
}
public void removeAlert(Component comp) {
alertPanel.remove(comp);
int comps = alertPanel.getComponentCount();
if (comps == 0) {
alerts.getTitlePane().setVisible(false);
alerts.setVisible(false);
}
else {
alerts.setTitle("Alerts (" + comps + ")");
}
invalidate();
validate();
repaint();
}
/**
* Returns the Workspace TabbedPane. If you wish to add your
@ -482,7 +440,12 @@ public class Workspace extends JPanel implements PacketListener {
return cardPanel;
}
public JPanel getAlertPanel() {
return alertPanel;
/**
* Returns the <code>CommandPanel</code> of this Workspace.
*
* @return the CommandPanel.
*/
public CommandPanel getCommandPanel() {
return commandPanel;
}
}