Nengo.ca

ca.nengo.config.handlers
Class MatrixHandlerBase

java.lang.Object
  extended by ca.nengo.config.handlers.BaseHandler
      extended by ca.nengo.config.handlers.MatrixHandlerBase
All Implemented Interfaces:
ConfigurationHandler
Direct Known Subclasses:
MatrixHandler, VectorHandler

public abstract class MatrixHandlerBase
extends BaseHandler

Base class for ConfigurationHandlers that deal with 2D arrays


Constructor Summary
MatrixHandlerBase(java.lang.Class<?> c)
          Base class for ConfigurationHandlers that deal with 2D arrays
 
Method Summary
abstract  MatrixEditor CreateMatrixEditor(java.lang.Object o, ConfigurationChangeListener configListener)
           
 java.awt.Component getEditor(java.lang.Object o, ConfigurationChangeListener configListener, javax.swing.JComponent parent)
          Returns a JTextField.
 
Methods inherited from class ca.nengo.config.handlers.BaseHandler
canHandle, fromString, getRenderer, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ca.nengo.config.ConfigurationHandler
getDefaultValue
 

Constructor Detail

MatrixHandlerBase

public MatrixHandlerBase(java.lang.Class<?> c)
Base class for ConfigurationHandlers that deal with 2D arrays

Parameters:
c - Class being configured
Method Detail

CreateMatrixEditor

public abstract MatrixEditor CreateMatrixEditor(java.lang.Object o,
                                                ConfigurationChangeListener configListener)
Parameters:
o - Object being configured
configListener - Listener for configuration changes
Returns:
A MatrixEditor object (currently defaults to float[][])

getEditor

public final java.awt.Component getEditor(java.lang.Object o,
                                          ConfigurationChangeListener configListener,
                                          javax.swing.JComponent parent)
Description copied from class: BaseHandler
Returns a JTextField. An object is built from the text using fromString().

Specified by:
getEditor in interface ConfigurationHandler
Overrides:
getEditor in class BaseHandler
Parameters:
o - An object for which canHandle(o.getClass()) == true
configListener - An ActionListener. The returned editor component must 1) add this listener to the part of itself that produces an event when editing is complete, and 2) call setProxy() with an EditorProxy through which the listener can retrieve a new object value when editing is complete
parent - Parent component
Returns:
A UI component (eg JTextField) that allows the user to change the object's value. If null, the calling property editor will attempt to create a default editor, possibly using fromString(...).
See Also:
ConfigurationHandler.getEditor(java.lang.Object, ConfigurationChangeListener, JComponent)

Nengo.ca