Hi there,
currently im building an application which is supposed for some sound processing. I'm doing this in java/eclipse with swt/jface. The processing itself need some options/properties for the algorithem inside. At this time, i have a .properties file which holds all options like:
trimLeadingSilence=20
trimtrailingSilence=20
trimhold=5
fftFrameSize=512 ...
I don't want the user to edit these options in a texteditor like notepad++, but within the gui of my app.
Now I think about how to do this. I have 2 "ideas": Create a class for each option set, and manualy code all these boring gui code lines. Like here for just one option ;-)
Spinner spinnerSilenceBack = new Spinner(shell, SWT.BORDER);
spinnerSilenceBack.setMinimum(0);
spinnerSilenceBack.setMaximum(200);
selection = Integer.valueOf(PropertyManager.getPropertyValue("trimming", "trailingSilence"));
spinnerSilenceBack.setSelection(selection);
spinnerSilenceBack.setIncrement(5);
spinnerSilenceBack.setPageIncrement(20);
spinnerSilenceBack.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
int selection = ((Spinner) e.getSource()).getSelection();
int digits = ((Spinner) e.getSource()).getDigits();
int result = (int) (selection / Math.pow(10, digits));
PropertyManager.setPropertyValue("trimming", "trailingSilence", String
.valueOf(result));
}
});
This takes a lot of time due to the fact that there are a lot of different options. So I thought about how I can dynamicly create such gui code, or just dynamicly create these gui windows when starting up the application. At least I would need a config file for the "gui creator" but I don't want to reinvent such a thing-thats why i ask you guys :)