//this.setLayout(new GridLayout(1, 2));
this.setLayout(new FlowLayout(FlowLayout.LEADING));
envModel = new VoiceEnvelopeModel(voice, models[0].getParameterDescriptor().getId());
envelope = new RatesEnvelope(envModel);
makeModelAndTable(category, models, title);
RowHeaderedAndSectionedTablePanel etp;
final Integer[] ids = new Integer[models.length];
for (int i = 0,j = models.length; i < j; i++)
ids[i] = models[i].getParameterDescriptor().getId();
Action ra = new AbstractAction() {
public void actionPerformed(ActionEvent e) {
new ZDBModifyThread("Refresh Envelope") {
public void run() {
try {
voice.getPreset().refreshVoiceParameters(voice.getVoiceNumber(), ids);
} catch (NoSuchContextException e1) {
e1.printStackTrace();
} catch (PresetEmptyException e1) {
e1.printStackTrace();
} catch (NoSuchPresetException e1) {
e1.printStackTrace();
} catch (NoSuchVoiceException e1) {
e1.printStackTrace();
} catch (ParameterValueOutOfRangeException e1) {
e1.printStackTrace();
} catch (IllegalParameterIdException e1) {
e1.printStackTrace();
}
}
}.start();
}
};
ra.putValue("tip", "Refresh " + title);
etp = new RowHeaderedAndSectionedTablePanel().init(envTable, "SHOW " + title, UIColors.getTableBorder(), ra);
etp.getHideButton().setAction(toggleAction);
etp.getHideButton().setToolTipText("Toggle Envelope Mode");
FuzzyLineBorder flb = new FuzzyLineBorder(UIColors.getTableBorder(),UIColors.getTableBorderWidth(), true);
flb.setFadingIn(!flb.isFadingIn());
envelope.setBorder(new TitledBorder(flb, title, TitledBorder.LEFT, TitledBorder.ABOVE_TOP));
//env.setBorder(new TitledBorder(UIColors.makeFuzzyBorder(UIColors.getTableBorder(), RowHeaderedAndSectionedTablePanel.getBorderWidth()), title, TitledBorder.LEFT, TitledBorder.ABOVE_TOP));
envelope.setPreferredSize(new Dimension((int) (etp.getPreferredSize().getWidth() * 0.7), (int) (etp.getPreferredSize().getHeight() * 1.2)));
add(etp);
add(envelope);
return this;