org.opensourcephysics.ejs.control.swing
Class ControlDrawable

java.lang.Object
  extended by org.opensourcephysics.ejs.control.ControlElement
      extended by org.opensourcephysics.ejs.control.swing.ControlDrawable

public abstract class ControlDrawable
extends ControlElement

Abstract superclass for Drawables (children of ControlDrawableParent)


Field Summary
protected  ControlDrawablesParent myParent
           
static int NAME
           
static int PARENT
           
 
Fields inherited from class org.opensourcephysics.ejs.control.ControlElement
ACTION, isUnderEjs, METHOD_FOR_VARIABLE, METHOD_TRIGGER, myGroup, myObject, myPropertiesTable, VARIABLE_CHANGED
 
Constructor Summary
ControlDrawable(java.lang.Object _drawable)
          Constructor and utilities
 
Method Summary
protected abstract  Drawable createDrawable(java.lang.Object drawable)
           
 void destroy()
          Clears any trace of myself (specially in the group)
 Drawable getDrawable()
           
 ControlDrawablesParent getParent()
           
 java.lang.String getPropertyInfo(java.lang.String _property)
          Returns information about a given property.
 java.util.ArrayList<java.lang.String> getPropertyList()
          Returns the list of all properties that can be set for this ControlElement.
 Value getValue(int _index)
          Gets the value of any internal variable.
 void setDefaultValue(int _index)
           
 void setDrawable(Drawable _dr)
           
 void setParent(ControlDrawablesParent _dp)
           
 void setValue(int _index, Value _value)
          Sets the value of the registered variables.
 
Methods inherited from class org.opensourcephysics.ejs.control.ControlElement
addAction, addAction, addAction, getComponent, getGroup, getObject, getProperty, getSimulation, getVisual, implementsProperty, initialize, invokeActions, invokeActions, isActive, parseConstant, propertyIsTypeOf, propertyType, removeAction, removeAction, reset, setActive, setGroup, setProperties, setProperty, toString, variableChanged, variableChangedDoNotUpdate, variablePropertiesClear, variablesChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME

public static final int NAME
See Also:
Constant Field Values

PARENT

public static final int PARENT
See Also:
Constant Field Values

myParent

protected ControlDrawablesParent myParent
Constructor Detail

ControlDrawable

public ControlDrawable(java.lang.Object _drawable)
Constructor and utilities

Parameters:
_drawable -
Method Detail

createDrawable

protected abstract Drawable createDrawable(java.lang.Object drawable)

getDrawable

public final Drawable getDrawable()

setDrawable

public final void setDrawable(Drawable _dr)

setParent

public void setParent(ControlDrawablesParent _dp)

getParent

public final ControlDrawablesParent getParent()

destroy

public void destroy()
Description copied from class: ControlElement
Clears any trace of myself (specially in the group)

Overrides:
destroy in class ControlElement

getPropertyList

public java.util.ArrayList<java.lang.String> getPropertyList()
Description copied from class: ControlElement
Returns the list of all properties that can be set for this ControlElement. Subclasses that add properties should implement this. Order is crucial here: Both for the presentation in an editor (f.i. ViewElement) and for the setValue() method.

Specified by:
getPropertyList in class ControlElement

getPropertyInfo

public java.lang.String getPropertyInfo(java.lang.String _property)
Description copied from class: ControlElement
Returns information about a given property. Subclasses that add properties should implement this. Order in the implementation is irrelevant.
  • The first keyword is ALWAYS the type. If more than one type is accepted, they are separated by | (do NOT use spaces!)
  • The keyword CONSTANT applies to properties that can not be changed using the setValue() methods
  • The keyword VARIABLE_EXPECTED is used when a String could be accepted, but a variable has priority. In this case, a String requires using inverted commas or quotes
  • The keyword NotTrimmed specifies that leading or trailing spaces must be respected when present. This is useful for labels or titles, for instance
  • 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
  • The keywords PREVIOUS and POSTPROCESS indicate that, when setting several properties at once (using setProperties()) the property must be process before, resp. after, the others

    Specified by:
    getPropertyInfo in class ControlElement

  • setValue

    public void setValue(int _index,
                         Value _value)
    Description copied from class: ControlElement
    Sets the value of the registered variables. Subclasses with internal values should extend this Order is crucial here: it must match exactly that of the getPropertyList() method.

    Overrides:
    setValue in class ControlElement

    setDefaultValue

    public void setDefaultValue(int _index)
    Overrides:
    setDefaultValue in class ControlElement

    getValue

    public Value getValue(int _index)
    Description copied from class: ControlElement
    Gets the value of any internal variable. Subclasses with internal values should extend this

    Overrides:
    getValue in class ControlElement
    Returns:
    Value _value The object holding the value for the variable.