1 |
/* |
/* |
2 |
* JSampler - a java front-end for LinuxSampler |
* JSampler - a java front-end for LinuxSampler |
3 |
* |
* |
4 |
* Copyright (C) 2005-2006 Grigor Iliev <grigor@grigoriliev.com> |
* Copyright (C) 2005-2007 Grigor Iliev <grigor@grigoriliev.com> |
5 |
* |
* |
6 |
* This file is part of JSampler. |
* This file is part of JSampler. |
7 |
* |
* |
24 |
|
|
25 |
import java.awt.event.ActionEvent; |
import java.awt.event.ActionEvent; |
26 |
import java.awt.event.KeyEvent; |
import java.awt.event.KeyEvent; |
27 |
|
import java.awt.event.MouseAdapter; |
28 |
|
import java.awt.event.MouseEvent; |
29 |
|
|
30 |
import javax.swing.AbstractAction; |
import javax.swing.AbstractAction; |
31 |
import javax.swing.Action; |
import javax.swing.Action; |
63 |
super(dataModel); |
super(dataModel); |
64 |
|
|
65 |
setSelectionMode(ListSelectionModel.SINGLE_SELECTION); |
setSelectionMode(ListSelectionModel.SINGLE_SELECTION); |
66 |
|
setFillsViewportHeight(true); |
67 |
installKeyboardListeners(); |
installKeyboardListeners(); |
68 |
|
|
69 |
|
addMouseListener(new MouseAdapter() { |
70 |
|
public void |
71 |
|
mouseClicked(MouseEvent e) { |
72 |
|
if(e.getButton() != e.BUTTON1) return; |
73 |
|
int r = rowAtPoint(e.getPoint()); |
74 |
|
if(r == -1) { |
75 |
|
clearSelection(); |
76 |
|
return; |
77 |
|
} |
78 |
|
} |
79 |
|
}); |
80 |
} |
} |
81 |
|
|
82 |
private void |
private void |