= Analysis = == Overview == * Bound controls are used to provide a way for data validation on user input. We need to define and create some base classes to serve as a mainframe and some base bound controls. == Task requirements == * Bound controls provide a way for user input. They differ from standard controls in their behavior. * Bound controls should act like a View-Controller and you can consider them a Model-View-Controller pattern. * View is represented by a field, spinner or a drop-down menu plus a sign whether the current data input is valid or not. * The Controller is the part that validates the data and inputs it in the model or rejects it. * As the user inputs data in a bound control it is automatically validated. * If the data is correct it is put in the undo/redo mechanism. * If the data is correct the information in the bound control is sent to the bound data-holder(the control model). * This transition is two-way. * They allow to attach a model and a verification mechanism. * Bound controls are composed of: * a standard control * a notification sign. It shows the verification status. Example - icon: It can be either correct (a green tick) or incorrect (a red cross.) Both the tick and the cross should have an explanation in its tool-tip what is wrong with the input of the user. * a label (optionally). * We have: * !BoundTextField, which contains: * icon - green tick, red cross. * label - what the input is. * text field - for the input itself. * We need: * Some base bound control which eases bound controls creation. * Some Bound controls to use as a start: * Spinner with the minimum and maximum value set and a label to say what it is. * We should: * Design the base classes * Polish the !BoundTextField class and fix what is to be fixed. * Create a class containing a spinner. * it should have predefined min and max value. If the user input < min the min value is to be set. If the user inputs > max the max value is to be set. When inputing data the tool-tip of the spinner should containing a understandable explanation about its correctness and validity. * the spinner bound control should also contain a label, so that the user understands what it is used for. == Task result == The result of this task must be code. == Implementation idea == - Use a JPanel, with other panels for input field(spinner, text field etc.), notification icons and other. = Implementation = == Related == - !BoundTextField class in sophie. == How to demo == * Show working controls. * Try to input invalid data. * Try to input valid data, that must result to expected change. = Log = [[Include(wiki:BASE_BOUND_CONTROLS_R0_LOG)]]