1 |
/* |
/* |
2 |
* JSampler - a java front-end for LinuxSampler |
* JSampler - a java front-end for LinuxSampler |
3 |
* |
* |
4 |
* Copyright (C) 2005-2007 Grigor Iliev <grigor@grigoriliev.com> |
* Copyright (C) 2005-2008 Grigor Iliev <grigor@grigoriliev.com> |
5 |
* |
* |
6 |
* This file is part of JSampler. |
* This file is part of JSampler. |
7 |
* |
* |
119 |
/** |
/** |
120 |
* Creates a new instance of <code>JSInstrumentsDbTable</code> |
* Creates a new instance of <code>JSInstrumentsDbTable</code> |
121 |
*/ |
*/ |
122 |
public JSInstrumentsDbTable(JSInstrumentsDbTree tree) { |
public |
123 |
|
JSInstrumentsDbTable(JSInstrumentsDbTree tree) { |
124 |
|
this(tree, ""); |
125 |
|
} |
126 |
|
|
127 |
|
/** |
128 |
|
* Creates a new instance of <code>JSInstrumentsDbTable</code> |
129 |
|
* @param columnPrefix Used to create unique property names for storing |
130 |
|
* the column preferences for different tables e.g. for DbInstrumentChooser, |
131 |
|
* InstrumentsDbFrame. |
132 |
|
*/ |
133 |
|
public |
134 |
|
JSInstrumentsDbTable(JSInstrumentsDbTree tree, String columnPrefix) { |
135 |
|
super(columnPrefix); |
136 |
|
|
137 |
instrumentsDbTree = tree; |
instrumentsDbTree = tree; |
138 |
|
|
139 |
/*for(int i = 0; i < getColumnModel().getColumnCount(); i++) { |
/*for(int i = 0; i < getColumnModel().getColumnCount(); i++) { |
436 |
actionPerformed(ActionEvent e) { |
actionPerformed(ActionEvent e) { |
437 |
DbDirectoryTreeNode n = instrumentsDbTree.getSelectedDirectoryNode(); |
DbDirectoryTreeNode n = instrumentsDbTree.getSelectedDirectoryNode(); |
438 |
if(n == null) return; |
if(n == null) return; |
439 |
instrumentsDbTree.refreshDirectoryContent(n.getInfo().getDirectoryPath()); |
final String path = n.getInfo().getDirectoryPath(); |
440 |
|
instrumentsDbTree.refreshDirectoryContent(path); |
441 |
|
CC.scheduleInTaskQueue(new Runnable() { |
442 |
|
public void |
443 |
|
run() { instrumentsDbTree.setSelectedDirectory(path); } |
444 |
|
}); |
445 |
} |
} |
446 |
|
|
447 |
public void |
public void |
640 |
|
|
641 |
LoadInstrumentAction(SamplerChannelModel model) { |
LoadInstrumentAction(SamplerChannelModel model) { |
642 |
String s = "instrumentsdb.actions.loadInstrument.onChannel"; |
String s = "instrumentsdb.actions.loadInstrument.onChannel"; |
643 |
putValue(Action.NAME, i18n.getMenuLabel(s, model.getChannelId())); |
int i = CC.getSamplerModel().getChannelIndex(model) + 1; |
644 |
|
putValue(Action.NAME, i18n.getMenuLabel(s, i)); |
645 |
channelModel = model; |
channelModel = model; |
646 |
} |
} |
647 |
|
|
1043 |
|
|
1044 |
public void |
public void |
1045 |
channelAdded(SamplerChannelListEvent e) { |
channelAdded(SamplerChannelListEvent e) { |
1046 |
|
if(CC.getSamplerModel().getChannelListIsAdjusting()) return; |
1047 |
updateLoadInstrumentMenus(); |
updateLoadInstrumentMenus(); |
1048 |
} |
} |
1049 |
|
|