Class ControlContainer
- Direct Known Subclasses:
ControlPanel
,ControlSplitPanel
,ControlTabbedPanel
,ControlWindow
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Vector<ControlElement>
protected Vector<ControlElement>
Fields inherited from class org.opensourcephysics.ejs.control.swing.ControlSwingElement
ACTION_OFF, ACTION_ON, ACTION_PRESS, BACKGROUND, ENABLED, FONT, FOREGROUND, myVisual, NAME, PARENT, POSITION, SIZE, TOOLTIP, VISIBLE
Fields inherited from class org.opensourcephysics.ejs.control.ControlElement
ACTION, isUnderEjs, METHOD_FOR_VARIABLE, METHOD_TRIGGER, myGroup, myObject, myPropertiesTable, VARIABLE_CHANGED
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(ControlElement _child) adds a child controlvoid
Returns the vector of childrengetPropertyInfo
(String _property) Returns information about a given property.void
informRadioGroup
(ControlRadioButton _source, boolean _state) void
remove
(ControlElement _child) removes a child controlsetProperty
(String _property, String _value) Sets a property for thisControlElement
.Methods inherited from class org.opensourcephysics.ejs.control.swing.ControlSwingElement
createVisual, getComponent, getIcon, getPropertyList, getValue, getVisual, parseConstant, setDefaultValue, setValue
Methods inherited from class org.opensourcephysics.ejs.control.ControlElement
addAction, addAction, addAction, destroy, getGroup, getObject, getProperty, getSimulation, implementsProperty, initialize, invokeActions, invokeActions, isActive, propertyIsTypeOf, propertyType, removeAction, removeAction, reset, setActive, setGroup, setProperties, toString, variableChanged, variableChangedDoNotUpdate, variablePropertiesClear, variablesChanged
-
Field Details
-
radioButtons
-
children
-
-
Constructor Details
-
ControlContainer
Constructor ControlContainer- Parameters:
_visual
-
-
-
Method Details
-
getContainer
-
add
adds a child control- Parameters:
_child
- the child control
-
adjustSize
public void adjustSize() -
getChildren
Returns the vector of children -
remove
removes a child control- Parameters:
_child
- the child control
-
informRadioGroup
-
getPropertyInfo
Description copied from class:ControlSwingElement
Returns information about a given property. Subclasses that add properties should extend this table.- The first keyword is ALWAYS the type.
- The keyword CONSTANT applies to properties that can not be changed using the setValue() methods
- The keyword BASIC is used by Ejs to group properties to the left hand side of the property editor
- The keyword HIDDEN is used by Ejs so that it does not display an entry in the editor field
- Overrides:
getPropertyInfo
in classControlSwingElement
-
setProperty
Description copied from class:ControlElement
Sets a property for thisControlElement
. Implementing classes are responsible of deciding (by declaring them in the getPropertyList() method) what properties turn into visual changes, or different behaviour, of the ControlElement.However, every propery is accepted, even if it is not meaningful for a particular implementation of this interface. This can serve as a repository of information for future use.
Implementing classes should make sure that the following requirements are met:
- Properties can be set in any order. The final result should not depend on the order. Exceptions must be explicitly documented.
- Any property can be modified. If so, the old value, and whatever meaning it had, is superseded by the new one. If the new one is null, the old one is simply removed and setDefaultValue(index) is called in case a precise default value should be used.
- When the element is part of a GroupControl, final users should not use this setProperty method directly, but go through the corresponding method of the group.
- Overrides:
setProperty
in classControlElement
- Returns:
- This same element. This is useful to nest more than one call to
setProperty
- See Also:
-