Filter editors.
To create a new filter editor, perform the following steps:
public class MyFilterEditor extends JPanel implements FilterEditor { public MyFilterEditor() { super(); // add UI components to panel } public Component getEditorComponent() { // reset UI components and return this return this; } public Filter createFilter() throws FilterEditorException { try { // create instance of MyFilter from values in UI components return new MyFilter(...); } catch (IllegalArgumentException e) { // rethrow instantiation exceptions as FilterEditorExceptions throw new FilterEditorException(e); } } //... }
String toString()
.
public String toString() { return "My filter"; }
/** My filter editor. */ public static final FilterEditor MY_FILTER_EDITOR = new MyFilterEditor();
/** Private array of filter editors. */ private static final FilterEditor[] values = new FilterEditor[] { RANDOM, UNIFORM, MY_FILTER_EDITOR };