branch develop updated (9df54e4 -> 00e09d4)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository nuiton-matrix. See http://git.nuiton.org/nuiton-matrix.git from 9df54e4 gitignore new 00e09d4 refs #3596: Matrix panel viewer is broken in linear mode The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 00e09d48c6c14cdfb0aaa71bf25b5fbef249ef02 Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Mon Dec 8 20:54:04 2014 +0000 refs #3596: Matrix panel viewer is broken in linear mode Summary of changes: .../math/matrix/gui/MatrixTableModelLinear.java | 7 ++++++- .../math/matrix/gui/MatrixPanelEditorTest.java | 24 ++++++++++++++++++---- 2 files changed, 26 insertions(+), 5 deletions(-) -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository nuiton-matrix. See http://git.nuiton.org/nuiton-matrix.git commit 00e09d48c6c14cdfb0aaa71bf25b5fbef249ef02 Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Mon Dec 8 20:54:04 2014 +0000 refs #3596: Matrix panel viewer is broken in linear mode --- .../math/matrix/gui/MatrixTableModelLinear.java | 7 ++++++- .../math/matrix/gui/MatrixPanelEditorTest.java | 24 ++++++++++++++++++---- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixTableModelLinear.java b/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixTableModelLinear.java index 41013ec..38678c0 100644 --- a/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixTableModelLinear.java +++ b/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixTableModelLinear.java @@ -43,6 +43,8 @@ import org.apache.commons.logging.LogFactory; import org.nuiton.math.matrix.MatrixIterator; import org.nuiton.math.matrix.MatrixND; +import cern.colt.Arrays; + /** * MatrixTableModelLinear. * @@ -95,7 +97,10 @@ public class MatrixTableModelLinear extends AbstractTableModel implements Object[] sems = i.getSemanticsCoordinates(); double value = i.getValue(); if (showDefault || value != defaultValue) { - mappingRowSems.add(sems); + // make copy since change in getSemanticsCoordinates() + Object[] sems2 = new Object[sems.length]; + System.arraycopy(sems, 0, sems2, 0, sems.length); + mappingRowSems.add(sems2); } } } diff --git a/nuiton-matrix-gui/src/test/java/org/nuiton/math/matrix/gui/MatrixPanelEditorTest.java b/nuiton-matrix-gui/src/test/java/org/nuiton/math/matrix/gui/MatrixPanelEditorTest.java index d209ded..1b58974 100644 --- a/nuiton-matrix-gui/src/test/java/org/nuiton/math/matrix/gui/MatrixPanelEditorTest.java +++ b/nuiton-matrix-gui/src/test/java/org/nuiton/math/matrix/gui/MatrixPanelEditorTest.java @@ -102,27 +102,35 @@ public class MatrixPanelEditorTest extends AbstractMatrixTest { frame.setLocationRelativeTo(null); frame.setVisible(true); - /*try { - Thread.sleep(60000); + try { + Thread.sleep(000); } catch (InterruptedException e) { e.printStackTrace(); - }*/ + } } @Test public void testModelNDDim2() { MatrixND matrix = getMatrixTest(2); + matrix.setValue(2, 1, 1.1d); + MatrixPanelEditor editor = new MatrixPanelEditor(); editor.setMatrix(matrix); show(editor); + + Assert.assertEquals(1.1d, editor.getTable().getModel().getValueAt(3, 2)); } @Test public void testModelNDDim3() { MatrixND matrix = getMatrixTest(3); + matrix.setValue(1, 2, 3, 4.4d); + MatrixPanelEditor editor = new MatrixPanelEditor(); editor.setMatrix(matrix); show(editor); + + Assert.assertEquals(4.4d, editor.getTable().getModel().getValueAt(8, 4)); } /** @@ -162,13 +170,21 @@ public class MatrixPanelEditorTest extends AbstractMatrixTest { editor.setMatrix(matrix); show(editor); } - + @Test public void testModelLinearDim4() { MatrixND matrix = getMatrixTest(4); + matrix.setValue(0, 0, 1, 3, 5.5d); + MatrixPanelEditor editor = new MatrixPanelEditor(); editor.setLinearModel(true); editor.setMatrix(matrix); show(editor); + + Assert.assertEquals(1999, editor.getTable().getModel().getValueAt(7, 0)); + Assert.assertEquals("Nantes", editor.getTable().getModel().getValueAt(7, 1)); + Assert.assertEquals("Administration", editor.getTable().getModel().getValueAt(7, 2)); + Assert.assertEquals("Jean", editor.getTable().getModel().getValueAt(7, 3)); + Assert.assertEquals(5.5d, editor.getTable().getModel().getValueAt(7, 4)); } } -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
participants (1)
-
nuiton.org scm