All Packages Class Hierarchy This Package Previous Next Index
Class benno.awt.MatrixEditor
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----benno.awt.MatrixEditor
- public class MatrixEditor
- extends Panel
- implements ActionListener, TextListener
This class provides an AWT component to edit a matrix.
A benno.linalg.Matrix object must be supplied - it will be the
entries of this matrix which will be modified.
Note that if the entries of the matrix are changed by something other than
a specific instance of this class, for example by other code or by another
instance of this class, then the text-boxes will not be updated to reflect
this change.
- Version:
- $Revision: 1.3 $
- Author:
- Ben Clifford
-
MatrixEditor(Matrix)
- constructs a matrix editor to edit the supplied Matrix.
-
actionPerformed(ActionEvent)
- this passes on actionPerformed events (from the entry text boxes) to
the current ActionListener.
-
addActionListener(ActionListener)
- this adds (up to a total of one) an action listener.
-
addTextListener(TextListener)
- this adds (up to a total of one) a text listener.
-
getMatrix()
- returns the matrix that we are editing (not a copy).
-
textValueChanged(TextEvent)
- this implements the TextListener interface.
MatrixEditor
public MatrixEditor(Matrix constructor_matrix)
- constructs a matrix editor to edit the supplied Matrix.
- Parameters:
- constructor_matrix - the matrix to be edited.
getMatrix
public Matrix getMatrix()
- returns the matrix that we are editing (not a copy).
- Returns:
- the matrix (as supplied in the constructor)
textValueChanged
public void textValueChanged(TextEvent e)
- this implements the TextListener interface. During construction, the
instance of MatrixEditor is set as a TextListener for all of the
TextFields that hold the matrix entries. When a TextEvent is
received, the matrix is immediately updated to the new value.
This function does not handle exceptions thrown when the contents
of the modified text field cannot be parsed as a double; instead, the
exception just passes up the hierarchy.
- Parameters:
- e - the text event object
addTextListener
public void addTextListener(TextListener l) throws TooManyListenersException
- this adds (up to a total of one) a text listener. see notes for
action_listener.
- Throws: TooManyListenersException
- if an attempt is made to
add more than one TextListener.
actionPerformed
public void actionPerformed(ActionEvent e)
- this passes on actionPerformed events (from the entry text boxes) to
the current ActionListener. see notes for action_listener.
addActionListener
public void addActionListener(ActionListener l) throws TooManyListenersException
- this adds (up to a total of one) an action listener. see notes for
action_listener.
- Throws: TooManyListenersException
- if an attempt is made to
add more than one ActionListener.
All Packages Class Hierarchy This Package Previous Next Index