org.colos.ejs.library.control.drawing3d
Class ControlElement3D

java.lang.Object
  extended by org.colos.ejs.library.control.ControlElement
      extended by org.colos.ejs.library.control.drawing3d.ControlElement3D
All Implemented Interfaces:
InteractionListener
Direct Known Subclasses:
ControlAnalyticCurve3D, ControlAnalyticSurface3D, ControlArrow3D, ControlBox3D, ControlCone3D, ControlCylinder3D, ControlDisk3D, ControlEllipsoid3D, ControlGroup3D, ControlImage3D, ControlLight3D, ControlObject3DS, ControlObjectVRML, ControlPanel2D, ControlPlane3D, ControlPoints3D, ControlPolygon3D, ControlSegment3D, ControlSet3D, ControlShape3D, ControlSpring3D, ControlSurface3D, ControlTetrahedron3D, ControlText3D, ControlTile3D, ControlTrail3D, ControlVectorField3D, ControlVectorField3DOld

public abstract class ControlElement3D
extends ControlElement
implements InteractionListener

Abstract superclass for display3d Elements (children of ControlElements3DParent)


Field Summary
static int EL3D_NAME
           
static java.awt.Color NULL_COLOR
           
static int PARENT
           
static double TO_RADIANS
           
 
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
ControlElement3D()
          Constructor and utilities
 
Method Summary
 boolean acceptsChild(ControlElement _child)
          Whether this element can have children of the given type
static Resolution decodeResolution(java.lang.String _value)
           
 void destroy()
          Clears any trace of myself (specially in the group)
 java.lang.String getDefaultValueString(int _index)
           
 Element getElement()
           
 int getFullPositionSpot()
           
 int getFullSizeSpot()
           
 java.lang.String getMenuNameEntry()
           
 java.lang.Object getObject()
          Returns the basic object that the ControlElement wrapps.
abstract  java.lang.String getObjectClassname()
          Returns the expected class of the object that the ControlElement wrapps.
 ControlParentOfElement3D getParent()
           
 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.List<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 interactionPerformed(InteractionEvent _event)
          The method of a registered listener that will be called when an interaction takes place.
 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 setDefaultValue(int _index)
           
 void setParent(ControlParentOfElement3D _dp)
           
 void setValue(int _index, Value _value)
          Sets the value of the registered variables.
 void updatePanel()
           
 
Methods inherited from class org.colos.ejs.library.control.ControlElement
addAction, addAction, addAction, addMenuEntries, editorIsReading, flush, getComponent, getGroup, getObject, getProperty, getSimulation, getValue, getVisual, implementsProperty, indexOf, initialize, invokeActions, invokeActions, isActive, onExit, propertyIndex, propertyIsTypeOf, propertyType, removeAction, removeAction, replaceVisual, reset, setActive, setFieldListValue, setFieldListValues, setGroup, setProperties, setProperty, 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
 

Field Detail

EL3D_NAME

public static final int EL3D_NAME
See Also:
Constant Field Values

PARENT

public static final int PARENT
See Also:
Constant Field Values

NULL_COLOR

public static final java.awt.Color NULL_COLOR

TO_RADIANS

public static final double TO_RADIANS
See Also:
Constant Field Values
Constructor Detail

ControlElement3D

public ControlElement3D()
Constructor and utilities

Method Detail

getObject

public java.lang.Object getObject()
Description copied from class: ControlElement
Returns the basic object that the ControlElement wrapps. Usually a graphic component

Overrides:
getObject in class ControlElement
Returns:
Object

getObjectClassname

public abstract java.lang.String getObjectClassname()
Description copied from class: ControlElement
Returns the expected class of the object that the ControlElement wrapps. Not final because of special needs (see display3d.DrawingPanel3D, f.i.)

Overrides:
getObjectClassname in class ControlElement
Returns:
Object

getElement

public Element getElement()

getPosSpot

public final int[] getPosSpot()

getSizeSpot

public final int[] getSizeSpot()

getFullPositionSpot

public final int getFullPositionSpot()

getFullSizeSpot

public final int getFullSizeSpot()

setParent

public final void setParent(ControlParentOfElement3D _dp)

getParent

public final ControlParentOfElement3D getParent()

destroy

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

Overrides:
destroy in class ControlElement

getMenuNameEntry

public java.lang.String getMenuNameEntry()

acceptsChild

public boolean acceptsChild(ControlElement _child)
Description copied from class: ControlElement
Whether this element can have children of the given type

Overrides:
acceptsChild in class ControlElement
Parameters:
_child - ControlElement
Returns:
boolean

getPropertyList

public java.util.List<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 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

  • 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 ControlElement
    Parameters:
    _property - String
    Returns:
    String

    updatePanel

    public void updatePanel()

    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

    getDefaultValueString

    public java.lang.String getDefaultValueString(int _index)
    Overrides:
    getDefaultValueString 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.

    interactionPerformed

    public void interactionPerformed(InteractionEvent _event)
    Description copied from interface: InteractionListener
    The method of a registered listener that will be called when an interaction takes place. Classes implementing this interface need to register to the interaction source using the addInteractionListener method.

    Specified by:
    interactionPerformed in interface InteractionListener
    Parameters:
    _event - InteractionEvent

    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 ControlElement

    decodeResolution

    public static Resolution decodeResolution(java.lang.String _value)