org.colos.ejs.library.control.swing
Class ControlPlottingPanel

java.lang.Object
  extended by org.colos.ejs.library.control.ControlElement
      extended by org.colos.ejs.library.control.swing.ControlSwingElement
          extended by org.colos.ejs.library.control.swing.ControlDrawablesParent
              extended by org.colos.ejs.library.control.swing.ControlPlottingPanel
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, NeedsFinalUpdate, NeedsUpdate, ControlParentOfDrawables, InteractiveMouseHandler

public class ControlPlottingPanel
extends ControlDrawablesParent
implements InteractiveMouseHandler, java.awt.event.ActionListener

A configurable plottingPanel.


Field Summary
 
Fields inherited from class org.colos.ejs.library.control.swing.ControlSwingElement
ACTION_IMMEDIATE, ACTION_OFF, ACTION_ON, ACTION_PRESS, AXIS_DRAGGED_ACTION, BACKGROUND, ENABLED, FONT, FOREGROUND, KEY_ACTION, MENU_NAME, MOUSE_ENTERED_ACTION, MOUSE_EXITED_ACTION, MOUSE_MOVED_ACTION, PARENT, POSITION, PRINT_TARGET, SIZE, SWING_ELEMENT_NAME, TOOLTIP, VISIBLE
 
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
ControlPlottingPanel()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
           
 java.lang.String getDefaultValueString(int _index)
           
 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.
 ControlDrawable getSelectedDrawable()
           
 Value getValue(int _index)
          Gets the value of any internal variable.
 void handleMouseAction(InteractivePanel _panel, java.awt.event.MouseEvent _evt)
           
 void mouseDragged(double _x, double _y)
           
 void mousePressed(double _x, double _y)
           
 void mouseReleased(double _x, double _y)
           
 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 or a primitive constant.
 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.swing.ControlDrawablesParent
acceptsChild, addDrawable, addDrawableAtIndex, addMenuEntries, addToPreupdateList, finalUpdate, getComponent, getDrawingPanel, removeDrawable, removeFromPreupdateList, reset, update
 
Methods inherited from class org.colos.ejs.library.control.swing.ControlSwingElement
changeVisual, getControlWindow, getMenuNameEntry, getTopWindow, getVisual, setControlWindow, toStringValue
 
Methods inherited from class org.colos.ejs.library.control.ControlElement
addAction, addAction, addAction, destroy, editorIsReading, flush, getGroup, getObject, getObject, getObjectClassname, getProperty, getSimulation, getValue, implementsProperty, indexOf, initialize, invokeActions, invokeActions, isActive, onExit, propertyIndex, propertyIsTypeOf, propertyType, removeAction, removeAction, replaceVisual, setActive, setFieldListValue, setFieldListValues, setGroup, setProperties, setProperty, setPropertyEditor, setVariableEditor, toString, variableChanged, variableChangedDoNotUpdate, variableExtraChanged, variablePropertiesClear, variablesChanged
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ControlPlottingPanel

public ControlPlottingPanel()
Method Detail

getPropertyList

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

Overrides:
getPropertyList in class ControlSwingElement

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

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

    Overrides:
    getPropertyInfo in class ControlSwingElement

  • parseConstant

    public Value parseConstant(java.lang.String _propertyType,
                               java.lang.String _value)
    Description copied from class: ControlSwingElement
    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 or a primitive constant. This method implements more cases than really needed for the base class. This is in order to save repetitions in swing subclasses.

    Overrides:
    parseConstant 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 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: ControlSwingElement
    Sets the value of the registered variables. Subclasses with internal values should extend this

    Overrides:
    setValue in class ControlSwingElement

    setDefaultValue

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

    getDefaultValueString

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

    getValue

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

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

    getSelectedDrawable

    public ControlDrawable getSelectedDrawable()
    Overrides:
    getSelectedDrawable in class ControlDrawablesParent

    handleMouseAction

    public void handleMouseAction(InteractivePanel _panel,
                                  java.awt.event.MouseEvent _evt)
    Specified by:
    handleMouseAction in interface InteractiveMouseHandler

    mousePressed

    public void mousePressed(double _x,
                             double _y)

    mouseDragged

    public void mouseDragged(double _x,
                             double _y)

    mouseReleased

    public void mouseReleased(double _x,
                              double _y)

    actionPerformed

    public void actionPerformed(java.awt.event.ActionEvent evt)
    Specified by:
    actionPerformed in interface java.awt.event.ActionListener