mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-12-01 12:27:58 +00:00
Memory work.
git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@9254 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
@ -99,6 +99,8 @@ public abstract class ChatRoom extends BackgroundPanel implements ActionListener
|
|||||||
private List<Message> transcript;
|
private List<Message> transcript;
|
||||||
private List<FileDropListener> fileDropListeners;
|
private List<FileDropListener> fileDropListeners;
|
||||||
|
|
||||||
|
private MouseAdapter transcriptWindowMouseListener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the base layout and base background color.
|
* Initializes the base layout and base background color.
|
||||||
*/
|
*/
|
||||||
@ -116,17 +118,19 @@ public abstract class ChatRoom extends BackgroundPanel implements ActionListener
|
|||||||
editorBar = new JPanel(new FlowLayout(FlowLayout.LEFT, 1, 1));
|
editorBar = new JPanel(new FlowLayout(FlowLayout.LEFT, 1, 1));
|
||||||
fileDropListeners = new ArrayList<FileDropListener>();
|
fileDropListeners = new ArrayList<FileDropListener>();
|
||||||
|
|
||||||
transcriptWindow.addMouseListener(new MouseAdapter() {
|
transcriptWindowMouseListener = new MouseAdapter() {
|
||||||
public void mouseClicked(MouseEvent e) {
|
public void mouseClicked(MouseEvent e) {
|
||||||
getChatInputEditor().requestFocus();
|
getChatInputEditor().requestFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void mouseReleased(MouseEvent e) {
|
public void mouseReleased(MouseEvent e) {
|
||||||
if (transcriptWindow.getSelectedText() == null) {
|
if (transcriptWindow.getSelectedText() == null) {
|
||||||
getChatInputEditor().requestFocus();
|
getChatInputEditor().requestFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
|
||||||
|
transcriptWindow.addMouseListener(transcriptWindowMouseListener);
|
||||||
|
|
||||||
chatAreaButton = new ChatAreaSendField(SparkRes.getString(SparkRes.SEND)) {
|
chatAreaButton = new ChatAreaSendField(SparkRes.getString(SparkRes.SEND)) {
|
||||||
public Dimension getPreferredSize() {
|
public Dimension getPreferredSize() {
|
||||||
@ -145,16 +149,6 @@ public abstract class ChatRoom extends BackgroundPanel implements ActionListener
|
|||||||
|
|
||||||
textScroller = new JScrollPane(transcriptWindow);
|
textScroller = new JScrollPane(transcriptWindow);
|
||||||
|
|
||||||
textScroller.getVerticalScrollBar().addMouseListener(new MouseAdapter() {
|
|
||||||
public void mousePressed(MouseEvent e) {
|
|
||||||
mousePressed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void mouseReleased(MouseEvent e) {
|
|
||||||
mousePressed = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
textScroller.setBackground(transcriptWindow.getBackground());
|
textScroller.setBackground(transcriptWindow.getBackground());
|
||||||
textScroller.getViewport().setBackground(Color.white);
|
textScroller.getViewport().setBackground(Color.white);
|
||||||
transcriptWindow.setBackground(Color.white);
|
transcriptWindow.setBackground(Color.white);
|
||||||
@ -614,6 +608,8 @@ public abstract class ChatRoom extends BackgroundPanel implements ActionListener
|
|||||||
fireClosingListeners();
|
fireClosingListeners();
|
||||||
|
|
||||||
getTranscriptWindow().removeContextMenuListener(this);
|
getTranscriptWindow().removeContextMenuListener(this);
|
||||||
|
getTranscriptWindow().removeMouseListener(transcriptWindowMouseListener);
|
||||||
|
|
||||||
|
|
||||||
// Remove Connection Listener
|
// Remove Connection Listener
|
||||||
SparkManager.getConnection().removeConnectionListener(this);
|
SparkManager.getConnection().removeConnectionListener(this);
|
||||||
|
|||||||
Reference in New Issue
Block a user