org.colos.ejs.library.control.displayejs
Class ControlTrace

java.lang.Object
  extended by org.colos.ejs.library.control.ControlElement
      extended by org.colos.ejs.library.control.swing.ControlDrawable
          extended by org.colos.ejs.library.control.displayejs.ControlDrawable3D
              extended by org.colos.ejs.library.control.displayejs.ControlInteractiveElement
                  extended by org.colos.ejs.library.control.displayejs.ControlTrace
All Implemented Interfaces:
DataCollector, Resetable, NeedsPreUpdate, InteractionListener

public class ControlTrace
extends ControlInteractiveElement
implements NeedsPreUpdate, Resetable, DataCollector

An interactive particle


Field Summary
 
Fields inherited from class org.colos.ejs.library.control.displayejs.ControlInteractiveElement
ACTION_ENTERED, ACTION_EXITED, ACTION_PRESS, IE_ADDED
 
Fields inherited from class org.colos.ejs.library.control.displayejs.ControlDrawable3D
NULL_COLOR
 
Fields inherited from class org.colos.ejs.library.control.swing.ControlDrawable
DRAWABLE_NAME, PARENT
 
Fields inherited from class org.colos.ejs.library.control.ControlElement
ACTION, ACTION_ERROR, ACTION_SUCCESS, METHOD_FOR_VARIABLE, METHOD_TRIGGER, NAME, VARIABLE_CHANGED
 
Constructor Summary
ControlTrace()
           
 
Method Summary
 void addMenuEntries()
          This is a place holder for elements to add menu entries to a simulation
 java.lang.String getDefaultValueString(int _index)
           
 int getFullPositionSpot()
           
 int getFullSizeSpot()
           
 int[] getPosSpot()
           
 java.lang.String getPropertyCommonName(java.lang.String _property)
          This is used by Ejs to obtain an alias for the property name in order to search for this alias in a common file of easily translatable entries used in the tables of properties for an element.
 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.
 int[] getSizeSpot()
           
 Value getValue(int _index)
          Gets the value of any internal variable.
 void initialize()
          initializes the element.
 void onExit()
          perform any clean-up on exit
 Value parseConstant(java.lang.String _propertyType, java.lang.String _value)
          Checks if a value can be considered a valid constant value for a property If not, it returns null, meaning the value can be considered to be a GroupVariable
 void preupdate()
           
 void reset()
          resets the element
 void setDefaultValue(int _index)
           
 ControlElement setProperty(java.lang.String _property, java.lang.String _value)
          Sets a property for this ControlElement.
 void setValue(int _index, Value _value)
          Sets the value of the registered variables.
 
Methods inherited from class org.colos.ejs.library.control.displayejs.ControlInteractiveElement
interactionPerformed
 
Methods inherited from class org.colos.ejs.library.control.displayejs.ControlDrawable3D
decodeResolution
 
Methods inherited from class org.colos.ejs.library.control.swing.ControlDrawable
destroy, getDrawable, getMenuNameEntry, getParent, replaceDrawable, setParent
 
Methods inherited from class org.colos.ejs.library.control.ControlElement
acceptsChild, addAction, addAction, addAction, editorIsReading, flush, getComponent, getGroup, getObject, getObject, getObjectClassname, getProperty, getSimulation, getValue, getVisual, implementsProperty, indexOf, invokeActions, invokeActions, isActive, propertyIndex, propertyIsTypeOf, propertyType, removeAction, removeAction, replaceVisual, setActive, setFieldListValue, setFieldListValues, setGroup, setProperties, setProperty, setPropertyEditor, setVariableEditor, toString, toStringValue, variableChanged, variableChangedDoNotUpdate, variableExtraChanged, variablePropertiesClear, variablesChanged
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ControlTrace

public ControlTrace()
Method Detail

getPosSpot

public final int[] getPosSpot()

getSizeSpot

public final int[] getSizeSpot()

getFullPositionSpot

public final int getFullPositionSpot()

getFullSizeSpot

public final int getFullSizeSpot()

initialize

public void initialize()
Description copied from class: ControlElement
initializes the element. A kind of soft reset()

Overrides:
initialize in class ControlElement

reset

public void reset()
Description copied from class: ControlElement
resets the element

Overrides:
reset in class ControlElement

onExit

public void onExit()
Description copied from class: ControlElement
perform any clean-up on exit

Overrides:
onExit in class ControlElement

preupdate

public void preupdate()
Specified by:
preupdate in interface NeedsPreUpdate

addMenuEntries

public void addMenuEntries()
Description copied from class: ControlElement
This is a place holder for elements to add menu entries to a simulation

Overrides:
addMenuEntries 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.

Overrides:
getPropertyList in class ControlInteractiveElement

getPropertyCommonName

public java.lang.String getPropertyCommonName(java.lang.String _property)
Description copied from class: ControlElement
This is used by Ejs to obtain an alias for the property name in order to search for this alias in a common file of easily translatable entries used in the tables of properties for an element.

Overrides:
getPropertyCommonName in class ControlInteractiveElement
Parameters:
_property - String
Returns:
String

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 keywords PREVIOUS and POSTPROCESS indicate that, when setting several properties at once (using setProperties()) the property must be process before, resp. after, the others

    Overrides:
    getPropertyInfo in class ControlInteractiveElement

  • parseConstant

    public Value parseConstant(java.lang.String _propertyType,
                               java.lang.String _value)
    Description copied from class: ControlElement
    Checks if a value can be considered a valid constant value for a property If not, it returns null, meaning the value can be considered to be a GroupVariable

    Overrides:
    parseConstant in class ControlDrawable3D

    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 EjsControl, 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:
    EjsControl

  • 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 ControlInteractiveElement

    setDefaultValue

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

    getDefaultValueString

    public java.lang.String getDefaultValueString(int _index)
    Overrides:
    getDefaultValueString in class ControlInteractiveElement

    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 ControlInteractiveElement
    Returns:
    Value _value The object holding the value for the variable.