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 |
* |
* |
197 |
return stringListEditor; |
return stringListEditor; |
198 |
} |
} |
199 |
} else if(p.hasPossibilities()) { |
} else if(p.hasPossibilities()) { |
200 |
return new DefaultCellEditor(new JComboBox(p.getPossibilities())); |
JComboBox cb = new JComboBox(p.getPossibilities()); |
201 |
|
cb.setSelectedItem(null); |
202 |
|
return new DefaultCellEditor(cb); |
203 |
} else if(p.getType() == ParameterType.INT) { |
} else if(p.getType() == ParameterType.INT) { |
204 |
Integer i = p.hasRangeMin() ? p.getRangeMin().intValue() : null; |
Integer i = p.hasRangeMin() ? p.getRangeMin().intValue() : null; |
205 |
integerEditor.setMinimum(i); |
integerEditor.setMinimum(i); |
221 |
return null; |
return null; |
222 |
} |
} |
223 |
|
|
224 |
|
/** Gets the parameters that are shown in the table. */ |
225 |
|
public Parameter[] |
226 |
|
getParameters() { return parameters; } |
227 |
|
|
228 |
/** |
/** |
229 |
* Sets the parameters to be shown in the table. |
* Sets the parameters to be shown in the table. |
230 |
* @param parameters The parameters to be shown in the table. |
* @param parameters The parameters to be shown in the table. |
379 |
} |
} |
380 |
} |
} |
381 |
|
|
382 |
/*class StringListCellEditor extends AbstractCellEditor implements TableCellEditor { |
class StringListCellEditor extends AbstractCellEditor implements TableCellEditor { |
383 |
private final JButton editor = new JButton(); |
private final JButton editor = new JButton(); |
384 |
private final JPopupMenu menu = new JPopupMenu(); |
private final JPopupMenu menu = new JPopupMenu(); |
385 |
private final Vector<JCheckBoxMenuItem> menuItems = new Vector<JCheckBoxMenuItem>(); |
private final Vector<JCheckBoxMenuItem> menuItems = new Vector<JCheckBoxMenuItem>(); |
388 |
editor.setBorderPainted(false); |
editor.setBorderPainted(false); |
389 |
editor.setContentAreaFilled(false); |
editor.setContentAreaFilled(false); |
390 |
editor.setFocusPainted(false); |
editor.setFocusPainted(false); |
391 |
|
editor.setMargin(new java.awt.Insets(0, 0, 0, 0)); |
392 |
editor.setFont(editor.getFont().deriveFont(java.awt.Font.PLAIN)); |
editor.setFont(editor.getFont().deriveFont(java.awt.Font.PLAIN)); |
393 |
|
|
394 |
editor.addActionListener(new ActionListener() { |
editor.addActionListener(new ActionListener() { |
456 |
JCheckBoxMenuItem item = new JCheckBoxMenuItem(s); |
JCheckBoxMenuItem item = new JCheckBoxMenuItem(s); |
457 |
setListener(item); |
setListener(item); |
458 |
|
|
459 |
for(String s2 : vals) if(s2.equals(s)) item.setSelected(true); |
for(String s2 : vals) { |
460 |
|
if(s2.equals(s)) item.setSelected(true); |
461 |
|
} |
462 |
|
|
463 |
menu.add(item); |
menu.add(item); |
464 |
menuItems.add(item); |
menuItems.add(item); |
476 |
} |
} |
477 |
}); |
}); |
478 |
} |
} |
479 |
}*/ |
} |
480 |
|
|
481 |
private static JComboBox comboBox = new JComboBox(); |
/*private static JComboBox comboBox = new JComboBox(); |
482 |
class StringListCellEditor extends DefaultCellEditor { |
class StringListCellEditor extends DefaultCellEditor { |
483 |
StringListCellEditor() { |
StringListCellEditor() { |
484 |
super(comboBox); |
super(comboBox); |
506 |
for(String s : slp.getPossibilities()[0]) comboBox.addItem(s); |
for(String s : slp.getPossibilities()[0]) comboBox.addItem(s); |
507 |
return comboBox; |
return comboBox; |
508 |
} |
} |
509 |
} |
}*/ |
510 |
|
|
511 |
class StringListCellRenderer extends DefaultTableCellRenderer { |
class StringListCellRenderer extends DefaultTableCellRenderer { |
512 |
private final StringBuffer sb = new StringBuffer(); |
private final StringBuffer sb = new StringBuffer(); |