From: Joe E. <jo...@em...> - 2005-03-02 20:06:19
|
Jeff Weber wrote: >The way I have handled this in the past was to >subclass ParamModel to handle the high to low range. >How much effort would it take to modify ParamModel to >handle this situation and make subclassing >unnecessary? > > I haven't looked at the code, but I can't imagine that it's that tough. A few lines of code, perhaps? >Apparently >the CheckBoxWidget is hard wired to send only values >of 0 for "off" or 1 for "on". But the Drive setting on >the V-Amp is turned off by any values in the range >0-63 and on by any values in the range 64-127. Both a >0 and a 1 will turn it off. > Again, I haven't looked at the widgets, yet, but my assumption was that the widgets (in order to be suitably generic) would have constructors for odd behavior like this. For example: CheckboxWidget ( int offVal, int onVal) and that the default constructor would just look like: CheckboxWidget() { this( 0, 1 ); } If the widgets do *not* have this kind of flexibility, I can go add it to them. I'm almost done with my overhaul of DevicesConfig and the transformation of the device selection dialog to use a JTree. - Joe |