Updating look and feel.

git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@6718 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Derek DeMoro
2007-01-18 06:15:36 +00:00
committed by derek
parent d4c9e78fb5
commit 646e18c807
5 changed files with 39 additions and 28 deletions

View File

@ -49,6 +49,7 @@ import java.util.List;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JComponent;
@ -72,6 +73,8 @@ import javax.swing.text.Document;
public abstract class ChatRoom extends BackgroundPanel implements ActionListener, PacketListener, DocumentListener, ConnectionListener {
private final JPanel chatPanel;
private final JSplitPane splitPane;
private JSplitPane verticalSplit;
private final JLabel notificationLabel;
private final TranscriptWindow transcriptWindow;
private final ChatAreaSendField chatAreaButton;
@ -88,8 +91,6 @@ public abstract class ChatRoom extends BackgroundPanel implements ActionListener
private List closingListeners = new ArrayList();
private JSplitPane verticalSplit;
private ChatRoomTransferHandler transferHandler;
private final List packetIDList;
@ -205,7 +206,7 @@ public abstract class ChatRoom extends BackgroundPanel implements ActionListener
getTranscriptWindow().setTransferHandler(transferHandler);
getChatInputEditor().setTransferHandler(transferHandler);
add(toolbar, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
add(toolbar, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 0, 5), 0, 0));
// Add Connection Listener
SparkManager.getConnection().addConnectionListener(this);
@ -215,16 +216,18 @@ public abstract class ChatRoom extends BackgroundPanel implements ActionListener
private void init() {
setLayout(new GridBagLayout());
add(splitPane, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
splitPane.setOneTouchExpandable(false);
verticalSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
verticalSplit.setOneTouchExpandable(false);
// Remove Default Beveled Borders
splitPane.setBorder(null);
splitPane.setOneTouchExpandable(false);
// Add Vertical Split Pane
verticalSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
add(verticalSplit, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
verticalSplit.setBorder(null);
splitPane.setLeftComponent(verticalSplit);
verticalSplit.setOneTouchExpandable(false);
verticalSplit.setTopComponent(splitPane);
textScroller.setAutoscrolls(true);
@ -238,7 +241,11 @@ public abstract class ChatRoom extends BackgroundPanel implements ActionListener
chatWindowPanel.setOpaque(false);
// Layout Components
chatPanel.add(chatWindowPanel, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
chatPanel.add(chatWindowPanel, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 5, 0, 5), 0, 0));
// Add Chat Panel to Split Pane
splitPane.setLeftComponent(chatPanel);
// Add edit buttons to Chat Room
editorBar.setOpaque(false);
@ -250,11 +257,13 @@ public abstract class ChatRoom extends BackgroundPanel implements ActionListener
bottomPanel.setOpaque(false);
splitPane.setOpaque(false);
bottomPanel.setLayout(new GridBagLayout());
bottomPanel.add(chatAreaButton, new GridBagConstraints(0, 1, 5, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 15));
bottomPanel.add(editorBar, new GridBagConstraints(0, 0, 5, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
bottomPanel.add(chatAreaButton, new GridBagConstraints(0, 1, 5, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 5, 5, 5), 0, 15));
bottomPanel.add(editorBar, new GridBagConstraints(0, 0, 5, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 0, 5), 0, 0));
// Set bottom panel border
bottomPanel.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(197, 213, 230)));
verticalSplit.setOpaque(false);
verticalSplit.setTopComponent(chatPanel);
verticalSplit.setBottomComponent(bottomPanel);
verticalSplit.setResizeWeight(1.0);
verticalSplit.setDividerSize(2);
@ -938,6 +947,7 @@ public abstract class ChatRoom extends BackgroundPanel implements ActionListener
return verticalSplit;
}
/**
* Implementation of this method should return the last time this chat room
* sent or recieved a message.