RePast
v. 2.0

uchicago.src.reflector
Class BooleanPropertyDescriptor

java.lang.Object
  |
  +--uchicago.src.reflector.PropertyDescriptor
        |
        +--uchicago.src.reflector.BooleanPropertyDescriptor

public class BooleanPropertyDescriptor
extends PropertyDescriptor

Descriptor for a model's boolean properties/parameters. Using a BooleanPropertyDescriptor allows a boolean property to be represented as a on/off checkbox in the properties panel.

A BooleanPropertyDescriptor is typically setup in a model's constructor as follows:

 BooleanPropertyDescriptor bd1 = new BooleanPropertyDescriptor("RecordData",
     false);
 descriptors.put("RecordData", bd1);
 

This property descriptor describes the RecordData property/parameter of some model, and thus assumes that the model contains a setRecordData and a getRecordData or a isRecordData method. A BooleanPropertyDescriptor's constructor takes a the name of the boolean property, and the default state of that property, in this case false. The BooleanPropertyDescriptor is then placed in the hashtable "descriptors" (an ivar of the SimModelImpl class). When the model parameters are displayed in gui mode, the RecordData will then be displayed as a check box.


Constructor Summary
BooleanPropertyDescriptor(String name, boolean isSelected)
          Creates a BooleanPropertyDescriptor for the specified property, and the specified selection state.
 
Method Summary
 PropertyWidget getWidget()
          Gets the widget associated with this property.
 
Methods inherited from class uchicago.src.reflector.PropertyDescriptor
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BooleanPropertyDescriptor

public BooleanPropertyDescriptor(String name,
                                 boolean isSelected)
Creates a BooleanPropertyDescriptor for the specified property, and the specified selection state.

Parameters:
name - the name of the property
isSelected - whether the checkbox representing the boolean property should be selected or not by default.
Method Detail

getWidget

public PropertyWidget getWidget()
Gets the widget associated with this property. In this case a JCheckBox.

Specified by:
getWidget in class PropertyDescriptor

RePast
v. 2.0

Bug reports and feature requests to RePast