[Lutinmatrix-commits] r128 - lutinmatrix/trunk/src/main/java/org/codelutin/math/matrix/gui
Author: sletellier Date: 2009-03-20 13:46:40 +0000 (Fri, 20 Mar 2009) New Revision: 128 Modified: lutinmatrix/trunk/src/main/java/org/codelutin/math/matrix/gui/MatrixPanelEditor.java Log: Bug visible matrix fixed Modified: lutinmatrix/trunk/src/main/java/org/codelutin/math/matrix/gui/MatrixPanelEditor.java =================================================================== --- lutinmatrix/trunk/src/main/java/org/codelutin/math/matrix/gui/MatrixPanelEditor.java 2009-03-16 17:59:20 UTC (rev 127) +++ lutinmatrix/trunk/src/main/java/org/codelutin/math/matrix/gui/MatrixPanelEditor.java 2009-03-20 13:46:40 UTC (rev 128) @@ -51,11 +51,11 @@ /** * JPanel contenant une JTable pour afficher une Matrice a une ou deux * dimension. - * + * * TODO: Une methode permettant de retourne la sous matrice de la selection que * la matrice soit reprensentée en lineaire ou non. (avoir un mapping cellule de * table vers element de matrice - * + * * Created: 29 oct. 2004 * * @author Benjamin Poussin <poussin@codelutin.com> @@ -94,12 +94,15 @@ /** Boolean to autorize table editing. */ protected boolean enabled = true; + /** Boolean to show matrix. */ + protected boolean visible = true; + /** Boolean to autorize matrice dimension changes. */ protected boolean dimensionEdit; /** * Construct a new JPanel to edit matrix. - * + * * @param m the matrix to edit. * @param dimensionEdit to enabled matrix dimension changes. */ @@ -110,7 +113,7 @@ /** * Construct a new JPanel to edit matrix. - * + * * @param dimensionEdit to enabled matrix dimension changes. * @param width width prefered for the component * @param height height prefered for the component @@ -123,7 +126,7 @@ /** * Construct a new JPanel to edit matrix. - * + * * @param dimensionEdit to enabled matrix dimension changes. */ public MatrixPanelEditor(boolean dimensionEdit) { @@ -217,7 +220,7 @@ /** * Get the value of dimensionEdit. - * + * * @return value of dimensionEdit. */ public boolean isDimensionEdit() { @@ -226,7 +229,7 @@ /** * Set the value of dimensionEdit. - * + * * @param v Value to assign to dimensionEdit. */ public void setDimensionEdit(boolean v) { @@ -273,6 +276,7 @@ // editArea.setColumnHeaderView(null); // } setEnabled(enabled); + setVisible(visible); repaint(); } @@ -360,6 +364,20 @@ return enabled; } + /** + * Set the matrix visible. By default, the matrix is visible. + */ + public void setVisible(boolean visible) { + if (table != null){ + table.setVisible(visible); + } + super.setVisible(visible); + this.visible = visible; + } + + public boolean isVisible() { + return visible; + } /* * @see javax.swing.event.TableModelListener#tableChanged(javax.swing.event.TableModelEvent) */
participants (1)
-
sletellier@users.labs.libre-entreprise.org