Link samples table to GUI events

This commit is contained in:
2018-09-11 16:53:50 +02:00
parent 0cf9904929
commit 5e7540620b
3 changed files with 51 additions and 16 deletions

View File

@@ -87,15 +87,18 @@ public class MainPanel extends Panel {
@Override
public void valueChanged(ListSelectionEvent e) {
try {
String add = String.valueOf(tableSamples.getModel().getValueAt(tableSamples.getSelectedRow(), 3));
if (!add.trim().isEmpty()) {
String cur = Controller.getInstance().getCurrentSelection();
if (cur != null) {
cur = cur.substring(0, 2);
}
if (!add.equals(cur)) {
Puck puck = Controller.getInstance().getPuck(add);
Controller.getInstance().selectPuck(puck);
int selection = tableSamples.getSelectedRow();
if (selection>=0){
String add = String.valueOf(tableSamples.getModel().getValueAt(selection, 3));
if (!add.trim().isEmpty()) {
String cur = Controller.getInstance().getCurrentSelection();
if (cur != null) {
cur = cur.substring(0, 2);
}
if (!add.equals(cur)) {
Puck puck = Controller.getInstance().getPuck(add);
Controller.getInstance().selectPuck(puck);
}
}
}
} catch (Exception ex) {