|
From: Nick C. <nic...@ve...> - 2003-03-03 14:15:38
|
On Mon, 2003-03-03 at 09:03, Mark R. Diggory wrote:
> No, I think I just mis-understood what setEnabled was for, I thought it
> disabled the widget so that the values couldn't be changed in the event
> there isn't a "setter" for the parameter itself. Now I see that it only
> changes the "capability to edit" the property while the sim is running.
> thanks.
Yeah. setEnabled here has the same semantics as JComponent.setEnabled.
> As an example case, say I have a boolean parameter and I use the Boolean
> PropertyDescriptor to make the presentation into a checkbox for that
> value. Is there any "functionality" in the Boolean
> PropertyDescriptor/CheckBoxWidget that disables the user being able to
> change the state checkbox if there is no "setter" present in the
> SimModel class for that parameter/property?
Ah. I see you what you mean. For properties that can be represented as
Strings a read-only property (no setter) is represented as a label. In
the case of the Boolean property descriptor, if the property is
read-only, the property value will be displayed in a label ("true" or
"false"). For the other PropertyDescriptors we are not so lucky(!) as
they don't have read-only state and can still be changed although there
is no corresponding set method. This is a bug and should be fixed. I'd
prefer just displaying a String representation of the property value in
a label as this is a simple fix. I suppose, though, for things like
arrays and ArrayLists the default String representation isn't really
suitable.
Nick
--
Nick Collier
Social Science Research Computing
University of Chicago
http://repast.sourceforge.net
|