Index: lutinmatrix/src/java/org/codelutin/math/matrix/gui/MatrixPanelEditor.java diff -u lutinmatrix/src/java/org/codelutin/math/matrix/gui/MatrixPanelEditor.java:1.6 lutinmatrix/src/java/org/codelutin/math/matrix/gui/MatrixPanelEditor.java:1.7 --- lutinmatrix/src/java/org/codelutin/math/matrix/gui/MatrixPanelEditor.java:1.6 Mon Jan 23 13:50:06 2006 +++ lutinmatrix/src/java/org/codelutin/math/matrix/gui/MatrixPanelEditor.java Thu Mar 16 12:13:24 2006 @@ -24,9 +24,9 @@ * * @author Benjamin Poussin * - * @version $Revision: 1.6 $ + * @version $Revision: 1.7 $ * - * Mise a jour: $Date: 2006/01/23 13:50:06 $ par : $Author: bpoussin $ + * Mise a jour: $Date: 2006/03/16 12:13:24 $ par : $Author: bpoussin $ */ package org.codelutin.math.matrix.gui; @@ -74,7 +74,7 @@ * @todo changer les 'matrice' en 'matrix', s'il y a des methodes public avec * les nom 'matice' les laisser mais les mettres depreciées */ -class MatriceTableModel extends AbstractTableModel { +class MatrixTableModel extends AbstractTableModel { /** */ private static final long serialVersionUID = 983978774901981167L; @@ -100,11 +100,11 @@ * * @param m Matrice a afficher dans la table */ - public MatriceTableModel(MatrixND m) throws MatrixException { + public MatrixTableModel(MatrixND m) throws MatrixException { this.m = m; if (m.getNbDim() > 2) { throw new MatrixException( - "matrice with more than 2 dimension not supported."); + "matrix with more than 2 dimension not supported."); } } @@ -230,7 +230,7 @@ } } -class MatriceCellRendere extends DefaultTableCellRenderer { +class MatrixCellRendere extends DefaultTableCellRenderer { /** */ private static final long serialVersionUID = 6537813058357761914L; @@ -269,7 +269,7 @@ protected MatrixND m; - protected MatriceTableModel tableModel; + protected MatrixTableModel tableModel; protected JScrollPane editArea; @@ -284,12 +284,12 @@ /** * Construct a new JPanel to edit matrix. * - * @param m the matrice to edit. + * @param m the matrix to edit. * @param dimensionEdit to enabled matrix dimension changes. */ public MatrixPanelEditor(MatrixND m, boolean dimensionEdit) { this(dimensionEdit, DEFAULT_WIDTH, DEFAULT_HEIGHT); - setMatrice(m); + setMatrix(m); } /** @@ -351,7 +351,7 @@ for (int i = 0; i < idim.length; i++) { idim[i] = Integer.parseInt(sdim[i]); } - setMatrice(getFactory().create(idim)); + setMatrix(getFactory().create(idim)); } } }); @@ -390,10 +390,10 @@ // pour les matrices 1D et 2D table = new JTable(); editArea.setViewportView(table); - table.setModel(tableModel = new MatriceTableModel(m)); + table.setModel(tableModel = new MatrixTableModel(m)); if (table.getColumnCount() > 0) { table.getColumnModel().getColumn(0).setCellRenderer( - new MatriceCellRendere()); + new MatrixCellRendere()); } table.registerKeyboardAction(getCopyAction(), "Copy", KeyStroke .getKeyStroke(KeyEvent.VK_C, Event.CTRL_MASK), @@ -411,12 +411,19 @@ repaint(); } - public void setMatrice(MatrixND m) throws MatrixException { + public void setMatrix(MatrixND m) throws MatrixException { initObject(m); this.m = m; } + + /** + * @deprecated use setMatrix + */ + public void setMatrice(MatrixND m) throws MatrixException { + setMatrix(m); + } - public MatrixND getMatrice() { + public MatrixND getMatrix() { if (m == null) { return m; } else if (m.getNbDim() <= 2) { @@ -425,6 +432,12 @@ return MatrixHelper.decodeFromXML(text.getText()); } } + /** + * @deprecated use setMatrix + */ + public MatrixND getMatrice() { + return getMatrix(); + } /** * Enable the matrix to be edited. By default, the matrix is editable. @@ -495,7 +508,7 @@ MatrixND m = MatrixFactory.getInstance().create( new List[] { sem1, sem2 }); - ed.setMatrice(m); + ed.setMatrix(m); // ed.setEnabled(false); } catch (MatrixException e) { e.printStackTrace();