org.opensourcephysics.ejs.control.swing
Class ControlContainer

java.lang.Object
  extended by org.opensourcephysics.ejs.control.ControlElement
      extended by org.opensourcephysics.ejs.control.swing.ControlSwingElement
          extended by org.opensourcephysics.ejs.control.swing.ControlContainer
Direct Known Subclasses:
ControlPanel, ControlSplitPanel, ControlTabbedPanel, ControlWindow

public abstract class ControlContainer
extends ControlSwingElement

A configurable Container


Field Summary
 
Fields inherited from class org.opensourcephysics.ejs.control.swing.ControlSwingElement
ACTION_OFF, ACTION_ON, ACTION_PRESS, BACKGROUND, ENABLED, FONT, FOREGROUND, NAME, PARENT, POSITION, SIZE, TOOLTIP, VISIBLE
 
Fields inherited from class org.opensourcephysics.ejs.control.ControlElement
ACTION, METHOD_FOR_VARIABLE, METHOD_TRIGGER, VARIABLE_CHANGED
 
Constructor Summary
ControlContainer(java.lang.Object _visual)
          Constructor ControlContainer
 
Method Summary
 void add(ControlElement _child)
          adds a child control
 void adjustSize()
           
 java.util.Vector<ControlElement> getChildren()
          Returns the vector of children
 java.awt.Container getContainer()
           
 java.lang.String getPropertyInfo(java.lang.String _property)
          Returns information about a given property.
 void informRadioGroup(ControlRadioButton _source, boolean _state)
           
 void remove(ControlElement _child)
          removes a child control
 ControlElement setProperty(java.lang.String _property, java.lang.String _value)
          Sets a property for this ControlElement.
 
Methods inherited from class org.opensourcephysics.ejs.control.swing.ControlSwingElement
getComponent, 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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ControlContainer

public ControlContainer(java.lang.Object _visual)
Constructor ControlContainer

Parameters:
_visual -
Method Detail

getContainer

public java.awt.Container getContainer()

add

public void add(ControlElement _child)
adds a child control

Parameters:
_child - the child control

adjustSize

public void adjustSize()

getChildren

public java.util.Vector<ControlElement> getChildren()
Returns the vector of children


remove

public void remove(ControlElement _child)
removes a child control

Parameters:
_child - the child control

informRadioGroup

public void informRadioGroup(ControlRadioButton _source,
                             boolean _state)

getPropertyInfo

public java.lang.String getPropertyInfo(java.lang.String _property)
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 class ControlSwingElement

  • setProperty

    public ControlElement setProperty(java.lang.String _property,
                                      java.lang.String _value)
    Description copied from class: ControlElement
    Sets a property for this ControlElement. 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 class ControlElement
    Returns:
    This same element. This is useful to nest more than one call to setProperty
    See Also:
    GroupControl