Nuiton-matrix-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
April 2011
- 2 participants
- 13 discussions
r357 - in trunk/nuiton-matrix-gui/src/main: java/org/nuiton/math/matrix/gui resources/i18n
by echatellier@users.nuiton.org 29 Apr '11
by echatellier@users.nuiton.org 29 Apr '11
29 Apr '11
Author: echatellier
Date: 2011-04-29 17:07:38 +0200 (Fri, 29 Apr 2011)
New Revision: 357
Url: http://nuiton.org/repositories/revision/nuiton-matrix/357
Log:
#1491: Add new data function on pupop menu (fill identity, fill value)
Modified:
trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixPopupMenu.java
trunk/nuiton-matrix-gui/src/main/resources/i18n/nuiton-matrix-gui_en_GB.properties
trunk/nuiton-matrix-gui/src/main/resources/i18n/nuiton-matrix-gui_fr_FR.properties
Modified: trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixPopupMenu.java
===================================================================
--- trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixPopupMenu.java 2011-04-29 15:06:54 UTC (rev 356)
+++ trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixPopupMenu.java 2011-04-29 15:07:38 UTC (rev 357)
@@ -54,6 +54,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.nuiton.math.matrix.MatrixHelper;
import org.nuiton.math.matrix.MatrixND;
import org.nuiton.util.FileUtil;
@@ -129,10 +130,13 @@
withSemantics = new JCheckBoxMenuItem(
_("nuitonmatrix.menu.option.semantics"), false);
+ JMenu applyDataAction = getApplyDataAction();
+
add(sendToClipBoard);
add(sendToFile);
+ add(withSemantics);
add(new JSeparator());
- add(withSemantics);
+ add(applyDataAction);
}
/**
@@ -140,7 +144,7 @@
*
* @return retourne le menu d'action pour le bloc note
*/
- public JMenu getSendToClipBoard() {
+ protected JMenu getSendToClipBoard() {
if (sendToClipBoard == null) {
sendToClipBoard = new JMenu(_("nuitonmatrix.menu.action"));
JMenuItem sendToClipBoardAllCopy = new JMenuItem(
@@ -176,7 +180,7 @@
*
* @return retourne le menu d'action pour les fichiers CSV
*/
- public JMenu getSendToFile() {
+ protected JMenu getSendToFile() {
if (sendToFile == null) {
sendToFile = new JMenu(_("nuitonmatrix.menu.csv"));
JMenuItem sendToFileAllCopy = new JMenuItem(
@@ -204,7 +208,40 @@
return sendToFile;
}
+
+ /**
+ * Init export to file action.
+ *
+ * @return retourne le menu d'action pour les fichiers CSV
+ */
+ protected JMenu getApplyDataAction() {
+ JMenu getApplyDataAction = new JMenu(_("nuitonmatrix.menu.data"));
+ JMenuItem dataIdentityItem = new JMenuItem(
+ _("nuitonmatrix.menu.data.identity"));
+ JMenuItem dataFillValueItem = new JMenuItem(
+ _("nuitonmatrix.menu.data.fillvalue"));
+ getApplyDataAction.add(dataIdentityItem);
+ getApplyDataAction.add(dataFillValueItem);
+
+ dataIdentityItem.addActionListener(new AbstractAction() {
+ private static final long serialVersionUID = -2263800006423028369L;
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ dataIdentityPerformed();
+ }
+ });
+ dataFillValueItem.addActionListener(new AbstractAction() {
+ private static final long serialVersionUID = -2263800006423028369L;
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ dataFillValuePerformed();
+ }
+ });
+
+ return getApplyDataAction;
+ }
+
/**
* Init export to file writer.
*
@@ -706,4 +743,31 @@
}
}
}
+
+ /**
+ * Fill editor matrix with identity matrix.
+ */
+ protected void dataIdentityPerformed() {
+ MatrixHelper.convertToId(getMatrix());
+ matrixEditor.fireEvent();
+ matrixEditor.repaint();
+ }
+
+ /**
+ * Ask user for new value to fill into matrix.
+ */
+ protected void dataFillValuePerformed() {
+ String stringValue = JOptionPane.showInputDialog(matrixEditor, _("nuitonmatrix.menu.data.fillvalue.ask"));
+ if (stringValue != null) {
+ try {
+ double value = Double.parseDouble(stringValue);
+ MatrixHelper.fill(getMatrix(), value);
+ matrixEditor.fireEvent();
+ matrixEditor.repaint();
+ }
+ catch (NumberFormatException ex) {
+ // skip exception
+ }
+ }
+ }
}
Modified: trunk/nuiton-matrix-gui/src/main/resources/i18n/nuiton-matrix-gui_en_GB.properties
===================================================================
--- trunk/nuiton-matrix-gui/src/main/resources/i18n/nuiton-matrix-gui_en_GB.properties 2011-04-29 15:06:54 UTC (rev 356)
+++ trunk/nuiton-matrix-gui/src/main/resources/i18n/nuiton-matrix-gui_en_GB.properties 2011-04-29 15:07:38 UTC (rev 357)
@@ -21,6 +21,10 @@
nuitonmatrix.menu.csv.export.selection=Export selection
nuitonmatrix.menu.csv.import.file=Import from file
nuitonmatrix.menu.csv.import.position=Import at current position
+nuitonmatrix.menu.data=Data
+nuitonmatrix.menu.data.fillvalue=Fill value
+nuitonmatrix.menu.data.fillvalue.ask=Enter new value to fill into matrix \:
+nuitonmatrix.menu.data.identity=Convert to identity
nuitonmatrix.menu.option.semantics=Export/Copy with semantics
nuitonmatrix.viewer.dimnameindex=Dimension %d
nuitonmatrix.viewer.graphcomborender.bar=Verticals bar rendering
Modified: trunk/nuiton-matrix-gui/src/main/resources/i18n/nuiton-matrix-gui_fr_FR.properties
===================================================================
--- trunk/nuiton-matrix-gui/src/main/resources/i18n/nuiton-matrix-gui_fr_FR.properties 2011-04-29 15:06:54 UTC (rev 356)
+++ trunk/nuiton-matrix-gui/src/main/resources/i18n/nuiton-matrix-gui_fr_FR.properties 2011-04-29 15:07:38 UTC (rev 357)
@@ -21,6 +21,10 @@
nuitonmatrix.menu.csv.export.selection=Exporter la s\u00E9lection
nuitonmatrix.menu.csv.import.file=Importer depuis un fichier
nuitonmatrix.menu.csv.import.position=Importer \u00E0 la position courante
+nuitonmatrix.menu.data=Donn\u00E9es
+nuitonmatrix.menu.data.fillvalue=Remplir avec une valeur
+nuitonmatrix.menu.data.fillvalue.ask=Entrez la valeur avec laquelle remplir la matrice \:
+nuitonmatrix.menu.data.identity=Convertir en matrice identit\u00E9
nuitonmatrix.menu.option.semantics=Exporter/Copier avec la s\u00E9mantique
nuitonmatrix.viewer.dimnameindex=Dimension %d
nuitonmatrix.viewer.graphcomborender.bar=Rendu en barres verticales
1
0
r356 - trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui
by echatellier@users.nuiton.org 29 Apr '11
by echatellier@users.nuiton.org 29 Apr '11
29 Apr '11
Author: echatellier
Date: 2011-04-29 17:06:54 +0200 (Fri, 29 Apr 2011)
New Revision: 356
Url: http://nuiton.org/repositories/revision/nuiton-matrix/356
Log:
Regression : en vrai property change cela ne fonctionne pas, doit faire certaines chose des que l'instance change
Modified:
trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixPanelEditor.jaxx
Modified: trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixPanelEditor.jaxx
===================================================================
--- trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixPanelEditor.jaxx 2011-04-22 07:51:03 UTC (rev 355)
+++ trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixPanelEditor.jaxx 2011-04-29 15:06:54 UTC (rev 356)
@@ -30,9 +30,6 @@
<MatrixPanelEditorHandler id="handler" />
- <!-- Matrix to display -->
- <MatrixND id="matrix" javaBean='null' />
-
<!-- if true, use linear representation of matrix. -->
<Boolean id='linearModel' javaBean='false'/>
@@ -46,6 +43,8 @@
<Boolean id="displayOptions" javaBean='false' />
<script><![CDATA[
+protected MatrixND matrix;
+
public MatrixPanelEditor(boolean dimensionEdit, int width, int height) {
this.dimensionEdit = dimensionEdit;
setPreferredSize(new java.awt.Dimension(width, height));
@@ -60,18 +59,33 @@
matrix = m;
}
+@Override
+public void setMatrix(MatrixND matrix) {
+ this.matrix = matrix;
+ getHandler().initEditor(this);
+}
+
+@Override
+public MatrixND getMatrix() {
+ return matrix;
+}
+
protected void $afterCompleteSetup() {
getHandler().initEditor(this);
+ /* ne fonctionne, pas doit être fait des que l'instance change, même si les
+ deux matrices sont égales
addPropertyChangeListener(PROPERTY_MATRIX, new java.beans.PropertyChangeListener() {
public void propertyChange(java.beans.PropertyChangeEvent evt) {
getHandler().initEditor(MatrixPanelEditor.this);
}
- });
+ });*/
}
+
@Override
protected void fireEvent() {
getHandler().fireEvent(this);
}
+
public void addMatrixPanelListener(MatrixPanelListener l) {
getHandler().addMatrixPanelListener(l);
}
1
0
r355 - trunk/nuiton-matrix-gui/src/test/java/org/nuiton/math/matrix/gui
by echatellier@users.nuiton.org 22 Apr '11
by echatellier@users.nuiton.org 22 Apr '11
22 Apr '11
Author: echatellier
Date: 2011-04-22 09:51:03 +0200 (Fri, 22 Apr 2011)
New Revision: 355
Url: http://nuiton.org/repositories/revision/nuiton-matrix/355
Log:
Remove timer
Modified:
trunk/nuiton-matrix-gui/src/test/java/org/nuiton/math/matrix/gui/MatrixPanelEditorTest.java
Modified: trunk/nuiton-matrix-gui/src/test/java/org/nuiton/math/matrix/gui/MatrixPanelEditorTest.java
===================================================================
--- trunk/nuiton-matrix-gui/src/test/java/org/nuiton/math/matrix/gui/MatrixPanelEditorTest.java 2011-04-14 09:30:03 UTC (rev 354)
+++ trunk/nuiton-matrix-gui/src/test/java/org/nuiton/math/matrix/gui/MatrixPanelEditorTest.java 2011-04-22 07:51:03 UTC (rev 355)
@@ -111,6 +111,14 @@
}
@Test
+ public void testModelNDDim2() {
+ MatrixND matrix = getMatrixTest(2);
+ MatrixPanelEditor editor = new MatrixPanelEditor();
+ editor.setMatrix(matrix);
+ show(editor);
+ }
+
+ @Test
public void testModelNDDim3() {
MatrixND matrix = getMatrixTest(3);
MatrixPanelEditor editor = new MatrixPanelEditor();
@@ -125,8 +133,17 @@
editor.setMatrix(matrix);
show(editor);
}
-
+
@Test
+ public void testModelLinearNDDim2() {
+ MatrixND matrix = getMatrixTest(2);
+ MatrixPanelEditor editor = new MatrixPanelEditor();
+ editor.setLinearModel(true);
+ editor.setMatrix(matrix);
+ show(editor);
+ }
+
+ @Test
public void testModelLinearDim3() {
MatrixND matrix = getMatrixTest(3);
MatrixPanelEditor editor = new MatrixPanelEditor();
1
0
r354 - trunk/nuiton-matrix-gui/src/test/java/org/nuiton/math/matrix/gui
by echatellier@users.nuiton.org 14 Apr '11
by echatellier@users.nuiton.org 14 Apr '11
14 Apr '11
Author: echatellier
Date: 2011-04-14 11:30:03 +0200 (Thu, 14 Apr 2011)
New Revision: 354
Url: http://nuiton.org/repositories/revision/nuiton-matrix/354
Log:
Remove time wait
Modified:
trunk/nuiton-matrix-gui/src/test/java/org/nuiton/math/matrix/gui/MatrixPanelEditorTest.java
Modified: trunk/nuiton-matrix-gui/src/test/java/org/nuiton/math/matrix/gui/MatrixPanelEditorTest.java
===================================================================
--- trunk/nuiton-matrix-gui/src/test/java/org/nuiton/math/matrix/gui/MatrixPanelEditorTest.java 2011-04-13 15:59:26 UTC (rev 353)
+++ trunk/nuiton-matrix-gui/src/test/java/org/nuiton/math/matrix/gui/MatrixPanelEditorTest.java 2011-04-14 09:30:03 UTC (rev 354)
@@ -103,11 +103,11 @@
frame.setLocationRelativeTo(null);
frame.setVisible(true);
- try {
+ /*try {
Thread.sleep(60000);
} catch (InterruptedException e) {
e.printStackTrace();
- }
+ }*/
}
@Test
1
0
r353 - in trunk/nuiton-matrix-gui/src: main/java/org/nuiton/math/matrix/gui main/java/org/nuiton/math/matrix/viewer/renderer main/resources/i18n test/java/org/nuiton/math/matrix/gui test/java/org/nuiton/math/matrix/viewer
by echatellier@users.nuiton.org 13 Apr '11
by echatellier@users.nuiton.org 13 Apr '11
13 Apr '11
Author: echatellier
Date: 2011-04-13 17:59:26 +0200 (Wed, 13 Apr 2011)
New Revision: 353
Url: http://nuiton.org/repositories/revision/nuiton-matrix/353
Log:
Evolution #1150: Add new toolbar on matrix panel to perform some operation on matrix
Added:
trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixPanelEditorHandler.java
trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixTableModelOption.java
trunk/nuiton-matrix-gui/src/test/java/org/nuiton/math/matrix/gui/MatrixPanelEditorTest.java
Removed:
trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/renderer/MatrixInfoTableModel.java
trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/renderer/MatrixInfoTableRenderer.java
Modified:
trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixPanelEditor.jaxx
trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixTableModel.java
trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixTableModelLinear.java
trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixTableModelND.java
trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/renderer/MatrixPanelRenderer.java
trunk/nuiton-matrix-gui/src/main/resources/i18n/nuiton-matrix-gui_en_GB.properties
trunk/nuiton-matrix-gui/src/main/resources/i18n/nuiton-matrix-gui_fr_FR.properties
trunk/nuiton-matrix-gui/src/test/java/org/nuiton/math/matrix/gui/MatrixPanelListenerTest.java
trunk/nuiton-matrix-gui/src/test/java/org/nuiton/math/matrix/viewer/MatrixViewerPanelTest.java
Modified: trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixPanelEditor.jaxx
===================================================================
--- trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixPanelEditor.jaxx 2011-04-13 15:50:50 UTC (rev 352)
+++ trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixPanelEditor.jaxx 2011-04-13 15:59:26 UTC (rev 353)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2004 - 2010 CodeLutin
+ Copyright (C) 2004 - 2011 CodeLutin, Chatellier Eric
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -24,8 +24,15 @@
-->
<MatrixEditor layout='{new BorderLayout()}'>
- <MatrixTableModel id='tableModel' javaBean='null'/>
+ <import>
+ org.nuiton.math.matrix.MatrixND
+ </import>
+ <MatrixPanelEditorHandler id="handler" />
+
+ <!-- Matrix to display -->
+ <MatrixND id="matrix" javaBean='null' />
+
<!-- if true, use linear representation of matrix. -->
<Boolean id='linearModel' javaBean='false'/>
@@ -35,132 +42,68 @@
<!-- Boolean to autorize matrix dimension changes. -->
<Boolean id='dimensionEdit' javaBean='false'/>
- <script><![CDATA[
-import java.awt.BorderLayout;
-import java.awt.Dimension;
-import java.awt.Event;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
-import java.util.Collection;
-import java.util.HashSet;
+ <!-- Display option bar -->
+ <Boolean id="displayOptions" javaBean='false' />
-import org.nuiton.math.matrix.MatrixFactory;
-import org.nuiton.math.matrix.MatrixND;
-
-private final static int DEFAULT_WIDTH = 150;
-
-private final static int DEFAULT_HEIGHT = 150;
-
-protected Collection<MatrixPanelListener> matrixPanelListeners = new HashSet<MatrixPanelListener>();
-
-protected MatrixPopupMenu popupMenu = null;
-
-protected MatrixND matrix = null;
-
-initObject();
-
-public MatrixPanelEditor(MatrixND m, boolean dimensionEdit) {
- this(dimensionEdit, DEFAULT_WIDTH, DEFAULT_HEIGHT);
- matrix = m;
-}
-
+ <script><![CDATA[
public MatrixPanelEditor(boolean dimensionEdit, int width, int height) {
this.dimensionEdit = dimensionEdit;
- setPreferredSize(new Dimension(width, height));
+ setPreferredSize(new java.awt.Dimension(width, height));
}
public MatrixPanelEditor(boolean dimensionEdit) {
- this(dimensionEdit, DEFAULT_WIDTH, DEFAULT_HEIGHT);
+ this(dimensionEdit, 150, 150);
}
-public void setMatrix(MatrixND m){
- this.matrix = m;
- initObject();
+public MatrixPanelEditor(MatrixND m, boolean dimensionEdit) {
+ this(dimensionEdit);
+ matrix = m;
}
-public MatrixND getMatrix() {
- return matrix;
+protected void $afterCompleteSetup() {
+ getHandler().initEditor(this);
+ addPropertyChangeListener(PROPERTY_MATRIX, new java.beans.PropertyChangeListener() {
+ public void propertyChange(java.beans.PropertyChangeEvent evt) {
+ getHandler().initEditor(MatrixPanelEditor.this);
+ }
+ });
}
-
-protected MatrixFactory getFactory() {
- return MatrixFactory.getInstance();
+@Override
+protected void fireEvent() {
+ getHandler().fireEvent(this);
}
-
public void addMatrixPanelListener(MatrixPanelListener l) {
- matrixPanelListeners.add(l);
+ getHandler().addMatrixPanelListener(l);
}
public void removeMatrixPanelListener(MatrixPanelListener l) {
- matrixPanelListeners.remove(l);
+ getHandler().removeMatrixPanelListener(l);
}
-
-protected void initObject() {
- if (getMatrix() == null) {
- editArea.setViewportView(null);
- }
- else {
- popupMenu = new MatrixPopupMenu(this);
- table = new JTable() {
- public void processMouseEvent(MouseEvent event) {
- if (event.isPopupTrigger()) {
- popupMenu.show(event.getComponent(), event.getX(), event.getY());
- }
- super.processMouseEvent(event);
- }
- };
-
- table.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_C, Event.CTRL_MASK),"copy");
- table.getActionMap().put("copy",popupMenu.getSendToClipBoardSelectionCopyAction());
- table.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_V, Event.CTRL_MASK),"paste");
- table.getActionMap().put("paste",popupMenu.getSendToClipBoardCurrentPasteAction());
- if (isLinearModel()) {
- setTableModel(new MatrixTableModelLinear(getMatrix(), isLinearModelShowDefault()));
- }
- else {
- setTableModel(new MatrixTableModelND(getMatrix()));
- }
-
- getTableModel().addTableModelListener(new TableModelListener() {
- @Override
- public void tableChanged(TableModelEvent e) {
- fireEvent();
- }
- });
-
- table.setModel(getTableModel());
- table.setDefaultRenderer(String.class, tableModel.getMatrixCellRenderer());
- table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
- table.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
- editArea.setViewportView(table);
- }
- repaint();
-}
-
-protected void btnAction() {
- String dim;
- dim = JOptionPane.showInputDialog(null, _("nuitonmatrix.create.matrix.message"), _("nuitonmatrix.create.matrix.title"), JOptionPane.DEFAULT_OPTION);
-
- if (dim != null) {
- String[] sdim = dim.split(";");
- int[] idim = new int[sdim.length];
- for (int i = 0; i < idim.length; i++) {
- idim[i] = Integer.parseInt(sdim[i]);
- }
- setMatrix(getFactory().create(idim));
- }
-}
-
-protected void fireEvent() {
- MatrixPanelEvent e = new MatrixPanelEvent(this);
- for (MatrixPanelListener matrixPanelListener : matrixPanelListeners) {
- matrixPanelListener.matrixChanged(e);
- }
-}
]]>
</script>
+ <Table visible="{isDisplayOptions()}" constraints='BorderLayout.NORTH'>
+ <row>
+ <cell anchor="center" weightx='1.0'>
+ <JLabel id="matrixNameLabel" />
+ </cell>
+ <cell>
+ <JCheckBox id="sumOptionCheckBox" text="nuitonmatrix.gui.sumOption"
+ onActionPerformed="getHandler().initEditor(this);" />
+ </cell>
+ <cell>
+ <JCheckBox id="meanOptionCheckBox" text="nuitonmatrix.gui.meanOption"
+ onActionPerformed="getHandler().initEditor(this);" />
+ </cell>
+ <cell>
+ <JCheckBox id="transposeOptionCheckBox" text="nuitonmatrix.gui.transposeOption"
+ onActionPerformed="getHandler().initEditor(this);" />
+ </cell>
+ </row>
+ </Table>
<JScrollPane id='editArea' constraints='BorderLayout.CENTER'>
- <JTable id='table' autoResizeMode='{JTable.AUTO_RESIZE_OFF}' cellSelectionEnabled='{true}' selectionMode='{ListSelectionModel.SINGLE_INTERVAL_SELECTION}'/>
+ <JTable id='table' /><!-- only to compile, not used after init :( autoResizeMode='{JTable.AUTO_RESIZE_OFF}'
+ cellSelectionEnabled='{true}' selectionMode='{ListSelectionModel.SINGLE_INTERVAL_SELECTION}'/> -->
</JScrollPane>
- <JButton id='buttonEdit' text='nuitonmatrix.create.matrix.button' visible='{isDimensionEdit()}'
- onActionPerformed='btnAction()' constraints='BorderLayout.SOUTH'/>
+ <JButton id="buttonEdit" text='nuitonmatrix.create.matrix.button' visible='{isDimensionEdit()}'
+ onActionPerformed='getHandler().modifyMatrixDimension(this)' constraints='BorderLayout.SOUTH'/>
</MatrixEditor>
Added: trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixPanelEditorHandler.java
===================================================================
--- trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixPanelEditorHandler.java (rev 0)
+++ trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixPanelEditorHandler.java 2011-04-13 15:59:26 UTC (rev 353)
@@ -0,0 +1,156 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package org.nuiton.math.matrix.gui;
+
+import static org.nuiton.i18n.I18n._;
+
+import java.awt.Event;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
+import java.util.Collection;
+import java.util.HashSet;
+
+import javax.swing.JOptionPane;
+import javax.swing.JTable;
+import javax.swing.KeyStroke;
+import javax.swing.ListSelectionModel;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+
+import org.nuiton.math.matrix.MatrixFactory;
+import org.nuiton.math.matrix.MatrixND;
+
+/**
+ * Handler for matrix panel editor.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class MatrixPanelEditorHandler {
+
+ protected Collection<MatrixPanelListener> matrixPanelListeners = new HashSet<MatrixPanelListener>();
+
+ protected MatrixPopupMenu popupMenu = null;
+
+ public void addMatrixPanelListener(MatrixPanelListener l) {
+ matrixPanelListeners.add(l);
+ }
+
+ public void removeMatrixPanelListener(MatrixPanelListener l) {
+ matrixPanelListeners.remove(l);
+ }
+
+ protected void fireEvent(MatrixPanelEditor matrixPanelEditor) {
+ MatrixPanelEvent event = new MatrixPanelEvent(matrixPanelEditor);
+ for (MatrixPanelListener matrixPanelListener : matrixPanelListeners) {
+ matrixPanelListener.matrixChanged(event);
+ }
+ }
+
+ /**
+ * Init panel with current panel matrix.
+ *
+ * @param matrixPanelEditor panel to init
+ */
+ protected void initEditor(final MatrixPanelEditor matrixPanelEditor) {
+
+ MatrixND matrix = matrixPanelEditor.getMatrix();
+
+ JTable matrixTable = null;
+ if (matrix != null) {
+ popupMenu = new MatrixPopupMenu(matrixPanelEditor);
+ matrixTable = new JTable() {
+ public void processMouseEvent(MouseEvent event) {
+ if (event.isPopupTrigger()) {
+ popupMenu.show(event.getComponent(), event.getX(), event.getY());
+ }
+ super.processMouseEvent(event);
+ }
+ };
+
+ matrixTable.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_C, Event.CTRL_MASK), "copy");
+ matrixTable.getActionMap().put("copy", popupMenu.getSendToClipBoardSelectionCopyAction());
+ matrixTable.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_V, Event.CTRL_MASK), "paste");
+ matrixTable.getActionMap().put("paste", popupMenu.getSendToClipBoardCurrentPasteAction());
+
+ MatrixTableModel matrixTableModel = null;
+ if (matrixPanelEditor.isLinearModel()) {
+ matrixTableModel = new MatrixTableModelLinear(matrix, matrixPanelEditor.isLinearModelShowDefault());
+ }
+ else {
+ matrixTableModel = new MatrixTableModelND(matrix);
+ }
+
+ // unique gestion des options par modele interposé
+ if (matrixPanelEditor.isDisplayOptions()) {
+ matrixTableModel = new MatrixTableModelOption(matrixTableModel,
+ matrixPanelEditor.getSumOptionCheckBox().isSelected(),
+ matrixPanelEditor.getMeanOptionCheckBox().isSelected(),
+ matrixPanelEditor.getTransposeOptionCheckBox().isSelected());
+
+ }
+
+ matrixTableModel.addTableModelListener(new TableModelListener() {
+ @Override
+ public void tableChanged(TableModelEvent e) {
+ matrixPanelEditor.fireEvent();
+ }
+ });
+
+ matrixTable.setModel(matrixTableModel);
+ matrixTable.setDefaultRenderer(String.class, matrixTableModel.getMatrixCellRenderer());
+ matrixTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
+ matrixTable.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
+ matrixPanelEditor.table = matrixTable;
+ }
+ matrixPanelEditor.getEditArea().setViewportView(matrixTable);
+ matrixPanelEditor.repaint();
+ }
+
+ /**
+ * Modify matrix dimensions
+ *
+ * @param matrixPanelEditor matrix panel editor
+ */
+ public void modifyMatrixDimension(MatrixPanelEditor matrixPanelEditor) {
+ String dim = JOptionPane.showInputDialog(matrixPanelEditor,
+ _("nuitonmatrix.create.matrix.message"),
+ _("nuitonmatrix.create.matrix.title"));
+
+ if (dim != null && dim.indexOf(';') != -1) {
+ String[] sdim = dim.split(";");
+ int[] idim = new int[sdim.length];
+ for (int i = 0; i < idim.length; i++) {
+ idim[i] = Integer.parseInt(sdim[i]);
+ }
+ MatrixND newMatrix = MatrixFactory.getInstance().create(idim);
+ matrixPanelEditor.setMatrix(newMatrix);
+ }
+ }
+}
Property changes on: trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixPanelEditorHandler.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixTableModel.java
===================================================================
--- trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixTableModel.java 2011-04-13 15:50:50 UTC (rev 352)
+++ trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixTableModel.java 2011-04-13 15:59:26 UTC (rev 353)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2004 - 2010 CodeLutin
+ * Copyright (C) 2004 - 2011 CodeLutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
@@ -25,13 +25,14 @@
package org.nuiton.math.matrix.gui;
+import javax.swing.JTable;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableModel;
import org.nuiton.math.matrix.MatrixND;
/**
- * MatrixTableModel.
+ * {@link TableModel} that can display matrix in a {@link JTable}.
*
* Created: 22 mars 2006 12:53:22
*
@@ -40,15 +41,26 @@
*
* Last update: $Date$
* by : $Author$
- *
- * TODO Javadoc ?
*/
public interface MatrixTableModel extends TableModel {
void setMatrix(MatrixND m);
+
+ MatrixND getMatrix();
- void setEnabled(boolean enabled);
-
TableCellRenderer getMatrixCellRenderer();
+ /**
+ * Get how many additional rows table model need to renderer matrix.
+ *
+ * @return additional rows
+ */
+ int getAdditionalRows();
+
+ /**
+ * Get how many additional columns table model need to renderer matrix.
+ *
+ * @return additional columns
+ */
+ int getAdditionalColumns();
}
Modified: trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixTableModelLinear.java
===================================================================
--- trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixTableModelLinear.java 2011-04-13 15:50:50 UTC (rev 352)
+++ trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixTableModelLinear.java 2011-04-13 15:59:26 UTC (rev 353)
@@ -66,7 +66,6 @@
/** Logger for this class. */
private static Log log = LogFactory.getLog(MatrixTableModelLinear.class);
- protected boolean enabled = true;
protected MatrixND m = null;
protected boolean showDefault = false;
protected double defaultValue = 0;
@@ -78,7 +77,15 @@
setMatrix(m);
}
+ /*
+ * @see org.nuiton.math.matrix.gui.MatrixTableModel#getMatrix()
+ */
@Override
+ public MatrixND getMatrix() {
+ return m;
+ }
+
+ @Override
public void setMatrix(MatrixND m) {
this.m = m;
computeMapping();
@@ -97,21 +104,6 @@
}
/**
- * @return Returns the enabled.
- */
- public boolean isEnabled() {
- return this.enabled;
- }
-
- /**
- * @param enabled The enabled to set.
- */
- @Override
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-
- /**
* @return Returns the showDefault.
*/
public boolean isShowDefault() {
@@ -178,7 +170,7 @@
*/
@Override
public boolean isCellEditable(int rowIndex, int columnIndex) {
- return isEnabled() && columnIndex == m.getDimCount();
+ return columnIndex == m.getDimCount();
}
/*
@@ -282,4 +274,19 @@
}
}
+ /*
+ * @see org.nuiton.math.matrix.gui.MatrixTableModel#getAdditionalRows()
+ */
+ @Override
+ public int getAdditionalRows() {
+ return 0;
+ }
+
+ /*
+ * @see org.nuiton.math.matrix.gui.MatrixTableModel#getAdditionalColumns()
+ */
+ @Override
+ public int getAdditionalColumns() {
+ return m.getDimCount();
+ }
}
Modified: trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixTableModelND.java
===================================================================
--- trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixTableModelND.java 2011-04-13 15:50:50 UTC (rev 352)
+++ trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixTableModelND.java 2011-04-13 15:59:26 UTC (rev 353)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2004 - 2010 CodeLutin
+ * Copyright (C) 2004 - 2011 CodeLutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
@@ -72,9 +72,6 @@
protected int[] multRowCol = null;
- /** par defaut, la matrice est editable. */
- protected boolean enabled = true;
-
protected TableCellRenderer renderer = null;
/**
@@ -106,7 +103,15 @@
setMatrix(m);
}
+ /*
+ * @see org.nuiton.math.matrix.gui.MatrixTableModel#getMatrix()
+ */
@Override
+ public MatrixND getMatrix() {
+ return m;
+ }
+
+ @Override
public void setMatrix(MatrixND m) {
this.m = m;
addRow = m.getDimCount() / 2;
@@ -303,15 +308,10 @@
} else if (m.getDimCount() == 1 && row < 1) {
return false;
}
- return enabled;
+ return true;
}
@Override
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-
- @Override
public Class<?> getColumnClass(int column) {
return String.class;
}
@@ -376,4 +376,20 @@
}
}
+ /*
+ * @see org.nuiton.math.matrix.gui.MatrixTableModel#getAdditionalRows()
+ */
+ @Override
+ public int getAdditionalRows() {
+ return addRow;
+ }
+
+ /*
+ * @see org.nuiton.math.matrix.gui.MatrixTableModel#getAdditionalColumns()
+ */
+ @Override
+ public int getAdditionalColumns() {
+ return addCol;
+ }
+
}
Added: trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixTableModelOption.java
===================================================================
--- trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixTableModelOption.java (rev 0)
+++ trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixTableModelOption.java 2011-04-13 15:59:26 UTC (rev 353)
@@ -0,0 +1,414 @@
+/*
+ * #%L
+ * NuitonMatrix
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package org.nuiton.math.matrix.gui;
+
+import static org.nuiton.i18n.I18n._;
+
+import javax.swing.event.TableModelListener;
+import javax.swing.table.TableCellRenderer;
+
+import org.nuiton.math.matrix.MatrixND;
+
+/**
+ * Model that take a delegate model to add additional lines during
+ * rendering (such as row sum, column sum, row mean, column mean...)
+ *
+ * Created: 21 mars 2006 19:01:27
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class MatrixTableModelOption implements MatrixTableModel {
+
+ protected MatrixTableModel delegate;
+
+ protected boolean sumOption;
+
+ protected boolean meanOption;
+
+ protected boolean transposeOption;
+
+ public MatrixTableModelOption(MatrixTableModel delegate) {
+ this(delegate, false, false, false);
+ }
+
+ public MatrixTableModelOption(MatrixTableModel delegate, boolean sumOption,
+ boolean meanOption, boolean transposeOption) {
+ this.delegate = delegate;
+ this.sumOption = sumOption;
+ this.meanOption = meanOption;
+ this.transposeOption = transposeOption;
+ }
+
+ public boolean isSumOption() {
+ return sumOption;
+ }
+
+ public void setSumOption(boolean sumOption) {
+ this.sumOption = sumOption;
+ }
+
+ public boolean isMeanOption() {
+ return meanOption;
+ }
+
+ public void setMeanOption(boolean meanOption) {
+ this.meanOption = meanOption;
+ }
+
+ public boolean isTransposeOption() {
+ return transposeOption;
+ }
+
+ public void setTransposeOption(boolean transposeOption) {
+ this.transposeOption = transposeOption;
+ }
+
+ /*
+ * @see javax.swing.table.TableModel#getRowCount()
+ */
+ @Override
+ public int getRowCount() {
+ int result = -1;
+ if (transposeOption) {
+ result = delegate.getColumnCount();
+ }
+ else {
+ result = delegate.getRowCount();
+ }
+ if (sumOption) {
+ result++;
+ }
+ if (meanOption) {
+ result++;
+ }
+ return result;
+ }
+
+ /*
+ * @see javax.swing.table.TableModel#getColumnCount()
+ */
+ @Override
+ public int getColumnCount() {
+ int result = -1;
+ if (transposeOption) {
+ result = delegate.getRowCount();
+ }
+ else {
+ result = delegate.getColumnCount();
+ }
+ if (sumOption) {
+ result++;
+ }
+ if (meanOption) {
+ result++;
+ }
+ return result;
+ }
+
+ /*
+ * @see javax.swing.table.TableModel#getColumnName(int)
+ */
+ @Override
+ public String getColumnName(int columnIndex) {
+ String result = null;
+ if (sumOption && columnIndex == delegate.getColumnCount() + 0) {
+ result = null; //_("matrix.gui.model.sum");
+ }
+ else if (meanOption && columnIndex == delegate.getColumnCount() + 1) {
+ result = null; //_("matrix.gui.model.mean");
+ }
+ else {
+ result = delegate.getColumnName(columnIndex);
+ }
+ return result;
+ }
+
+ /*
+ * @see javax.swing.table.TableModel#getColumnClass(int)
+ */
+ @Override
+ public Class<?> getColumnClass(int columnIndex) {
+ return delegate.getColumnClass(columnIndex);
+ }
+
+ /*
+ * @see javax.swing.table.TableModel#isCellEditable(int, int)
+ */
+ @Override
+ public boolean isCellEditable(int rowIndex, int columnIndex) {
+ return delegate.isCellEditable(rowIndex, columnIndex);
+ }
+
+ /*
+ * @see javax.swing.table.TableModel#getValueAt(int, int)
+ */
+ @Override
+ public Object getValueAt(int rowIndex, int columnIndex) {
+ int rowCount = delegate.getRowCount();
+ int columnCount = delegate.getColumnCount();
+
+ Object result = null;
+ if (transposeOption) {
+ result = getValueAtTranposable(columnIndex, rowIndex, rowCount, columnCount);
+ }
+ else {
+ result = getValueAtTranposable(rowIndex, columnIndex, rowCount, columnCount);
+ }
+ return result;
+ }
+
+ /**
+ * Get value qui fonctionne aussi en transposée.
+ *
+ * Le principe est que des que les bornes sur modele delegé sont dépassées
+ * on réalise des opération (mean/sum).
+ *
+ * Actuellement le code n'est vraiment pas evident.
+ *
+ * @param rowIndex rowIndex
+ * @param columnIndex columnIndex
+ * @param rowCount rowCount
+ * @param columnCount columnCount
+ * @return object at rowIndex/columnCount
+ */
+ protected Object getValueAtTranposable(int rowIndex, int columnIndex, int rowCount, int columnCount) {
+ Object result = null;
+ // operation sur la derniere ligne
+ if (rowIndex >= rowCount) {
+ // une seule operation
+ if (columnIndex == 0) {
+ if (rowIndex == rowCount + 1) {
+ result = _("matrix.gui.model.mean");
+ }
+ else {
+ if (sumOption) {
+ result = _("matrix.gui.model.sum");
+ }
+ else {
+ result = _("matrix.gui.model.mean");
+ }
+ }
+ }
+ // deux operation (forcement mean) (cas somme des sommes)
+ else if (columnIndex == columnCount + 1) {
+ if (rowIndex == rowCount + 1) { // pas de sens
+ result = delegate.getMatrix().meanAll();
+ }
+ }
+ // une seule operation (cas somme des sommes)
+ else if (columnIndex == columnCount) {
+ if (rowIndex == rowCount) { // pas de sens
+ if (sumOption) {
+ result = delegate.getMatrix().sumAll();
+ }
+ else {
+ result = delegate.getMatrix().sumAll();
+ }
+ }
+ }
+ // deux operation (forcement mean)
+ else if (rowIndex == rowCount + 1) {
+ result = getComputedValueForColumn(columnIndex, true); // mean
+ }
+ // une seule operation
+ else {
+ if (sumOption) {
+ result = getComputedValueForColumn(columnIndex, false); // sum
+ }
+ else {
+ // sum
+ result = getComputedValueForColumn(columnIndex, true); // mean
+ }
+ }
+ }
+
+ // operation sur la derniere colonne
+ else if (columnIndex >= columnCount) {
+ // une seule operation
+ if (rowIndex == 0) {
+ if (columnIndex == columnCount + 1) {
+ result = _("matrix.gui.model.mean");
+ }
+ else {
+ if (sumOption) {
+ result = _("matrix.gui.model.sum");
+ }
+ else {
+ result = _("matrix.gui.model.mean");
+ }
+ }
+ }
+ // cas sommes de somme deja gérée
+ // par le premier if mais il faut quand meme les conditions
+ // pour qu'il ne passe pas dans le else final
+ else if (rowIndex == rowCount + 1) {}
+ else if (rowIndex == rowCount) {}
+ // deux operation (forcement mean)
+ else if (columnIndex == columnCount + 1) {
+ result = getComputedValueForRow(rowIndex, true); // mean
+ }
+ // une seule operation
+ else {
+ if (sumOption) {
+ result = getComputedValueForRow(rowIndex, false); // sum
+ }
+ else {
+ // sum
+ result = getComputedValueForRow(rowIndex, true); // mean
+ }
+ }
+ }
+
+ else {
+ // reste du tableau
+ result = delegate.getValueAt(rowIndex, columnIndex);
+ }
+ return result;
+ }
+
+ /**
+ * Compute sum for delegate model row index.
+ *
+ * @param delegateRowIndex delegate model row index
+ * @return sum for row
+ */
+ protected Double getComputedValueForRow(int delegateRowIndex, boolean mean) {
+ double sum = 0.0;
+ double count = 0;
+ for (int col = delegate.getAdditionalColumns() ; col < delegate.getColumnCount() ; col++) {
+ sum += (Double)delegate.getValueAt(delegateRowIndex, col);
+ count++;
+ }
+ double result = sum;
+ if (mean) {
+ result = sum / count;
+ }
+ return result;
+ }
+
+ /**
+ * Compute sum for delegate model column index.
+ *
+ * @param delegateColumnIndex delegate model column index
+ * @return sum for column
+ */
+ protected Double getComputedValueForColumn(int delegateColumnIndex, boolean mean) {
+ double sum = 0.0;
+ double count = 0;
+ for (int row = delegate.getAdditionalRows() ; row < delegate.getRowCount() ; row++) {
+ sum += (Double)delegate.getValueAt(row, delegateColumnIndex);
+ count++;
+ }
+ double result = sum;
+ if (mean) {
+ result = sum / count;
+ }
+ return result;
+ }
+
+ /*
+ * @see javax.swing.table.TableModel#setValueAt(java.lang.Object, int, int)
+ */
+ @Override
+ public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
+ if (transposeOption) {
+ delegate.setValueAt(aValue, rowIndex, columnIndex);
+ } else {
+ delegate.setValueAt(aValue, columnIndex, rowIndex);
+ }
+ }
+
+ /*
+ * @see javax.swing.table.TableModel#addTableModelListener(javax.swing.event.TableModelListener)
+ */
+ @Override
+ public void addTableModelListener(TableModelListener l) {
+ delegate.addTableModelListener(l);
+ }
+
+ /*
+ * @see javax.swing.table.TableModel#removeTableModelListener(javax.swing.event.TableModelListener)
+ */
+ @Override
+ public void removeTableModelListener(TableModelListener l) {
+ delegate.removeTableModelListener(l);
+ }
+
+ /*
+ * @see org.nuiton.math.matrix.gui.MatrixTableModel#setMatrix(org.nuiton.math.matrix.MatrixND)
+ */
+ @Override
+ public void setMatrix(MatrixND m) {
+ delegate.setMatrix(m);
+ }
+
+ @Override
+ public MatrixND getMatrix() {
+ return delegate.getMatrix();
+ }
+
+ /*
+ * @see org.nuiton.math.matrix.gui.MatrixTableModel#getMatrixCellRenderer()
+ */
+ @Override
+ public TableCellRenderer getMatrixCellRenderer() {
+ return delegate.getMatrixCellRenderer();
+ }
+
+ /*
+ * @see org.nuiton.math.matrix.gui.MatrixTableModel#getAdditionalRows()
+ */
+ @Override
+ public int getAdditionalRows() {
+ int result = 0;
+ if (sumOption) {
+ result++;
+ }
+ if (meanOption) {
+ result++;
+ }
+ return result;
+ }
+
+ /*
+ * @see org.nuiton.math.matrix.gui.MatrixTableModel#getAdditionalColumns()
+ */
+ @Override
+ public int getAdditionalColumns() {
+ int result = 0;
+ if (sumOption) {
+ result++;
+ }
+ if (meanOption) {
+ result++;
+ }
+ return result;
+ }
+}
Property changes on: trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/gui/MatrixTableModelOption.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Deleted: trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/renderer/MatrixInfoTableModel.java
===================================================================
--- trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/renderer/MatrixInfoTableModel.java 2011-04-13 15:50:50 UTC (rev 352)
+++ trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/renderer/MatrixInfoTableModel.java 2011-04-13 15:59:26 UTC (rev 353)
@@ -1,104 +0,0 @@
-/*
- * #%L
- *
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2002 - 2010 CodeLutin, Chatellier Eric
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-package org.nuiton.math.matrix.viewer.renderer;
-
-import org.nuiton.math.matrix.MatrixND;
-import org.nuiton.math.matrix.MatrixException;
-import javax.swing.table.AbstractTableModel;
-
-/**
- * Matrix info table model.
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update : $Date$
- * By : $Author$
- */
-public class MatrixInfoTableModel extends AbstractTableModel {
-
- /** serialVersionUID. */
- private static final long serialVersionUID = 2632133167225155487L;
-
- protected MatrixND matrix;
-
- public MatrixInfoTableModel(MatrixND mat) {
- if (mat.getDimCount() > 2) {
- throw new MatrixException(
- "matrice with more than 2 dimension not supported.");
- }
- this.matrix = mat;
- }
-
- /**
- * @return Le nombre de lignes de la table.
- */
- public int getRowCount() {
- if (matrix == null || matrix.getDimCount() < 1) {
- return 0;
- } else {
- return matrix.getDim(0);
- }
- }
-
- /**
- * @return Le nombre de colonnes de la table.
- */
- public int getColumnCount() {
- if (matrix == null || matrix.getDimCount() < 1) {
- return 0;
- } else {
- return matrix.getDim(1) + 1;
- }
- }
-
- /**
- * @param row La ligne
- * @param column La colonnes
- * @return L'Object correspondant dans la matrice.
- */
- public Object getValueAt(int row, int column) {
- if (column == 0) {
- Object obj = matrix.getSemantic(0).get(row);
- return obj;
- } else {
- if (matrix.getDimCount() == 1) {
- return String.valueOf(matrix.getValue(column - 1));
- } else {
- return String.valueOf(matrix.getValue(row, column - 1));
- }
- }
- }
-
- public String getColumnName(int column) {
- if (column == 0) {
- return matrix.getDimensionName(0) + "\\"
- + matrix.getDimensionName(1);
- } else {
- return "" + matrix.getSemantic(1).get(column - 1);
- }
- }
-
-}// MatrixInfoTableModel
Deleted: trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/renderer/MatrixInfoTableRenderer.java
===================================================================
--- trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/renderer/MatrixInfoTableRenderer.java 2011-04-13 15:50:50 UTC (rev 352)
+++ trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/renderer/MatrixInfoTableRenderer.java 2011-04-13 15:59:26 UTC (rev 353)
@@ -1,142 +0,0 @@
-/*
- * #%L
- *
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2010 Codelutin, Chatellier Eric
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-package org.nuiton.math.matrix.viewer.renderer;
-
-import static org.nuiton.i18n.I18n._;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-
-import javax.swing.Icon;
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.math.matrix.MatrixND;
-import org.nuiton.math.matrix.viewer.MatrixRenderer;
-import org.nuiton.util.FileUtil;
-import org.nuiton.util.Resource;
-
-/**
- * Matrix info table renderer.
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update : $Date$
- * By : $Author$
- */
-public class MatrixInfoTableRenderer implements MatrixRenderer, ActionListener {
-
- /** Class logger. */
- private static Log log = LogFactory.getLog(MatrixInfoTableRenderer.class);
-
- protected MatrixND matrix;
-
- /*
- * @see org.nuiton.math.matrix.viewer.MatrixRenderer#getPanel(org.nuiton.math.matrix.MatrixND)
- */
- @Override
- public Component getComponent(MatrixND matrix) {
- this.matrix = matrix;
-
- JPanel panel = new JPanel(new BorderLayout());
-
- // label matrix name
- JLabel nameLabel = new JLabel(_(matrix.getName()));
- nameLabel.setHorizontalAlignment(JLabel.CENTER);
- panel.add(nameLabel, BorderLayout.NORTH);
-
- // data table
- JTable table = new JTable();
- table.setModel(new MatrixInfoTableModel(matrix));
- panel.add(new JScrollPane(table), BorderLayout.CENTER);
-
- // export button
- JButton exportButton = new JButton(_("nuitonmatrix.viewer.renderer.exportascsv"));
- exportButton.addActionListener(this);
- exportButton.setActionCommand("exportascsv");
- exportButton.setEnabled(this.matrix != null);
- panel.add(exportButton, BorderLayout.SOUTH);
- return panel;
- }
-
- /*
- * @see org.nuiton.math.matrix.viewer.MatrixRenderer#getIcon()
- */
- @Override
- public Icon getIcon() {
- return Resource.getIcon("/icons/table.png");
- }
-
- /*
- * @see org.nuiton.math.matrix.viewer.MatrixRenderer#getName()
- */
- @Override
- public String getName() {
- return _("nuitonmatrix.viewer.renderer.data");
- }
-
- /*
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- */
- @Override
- public void actionPerformed(ActionEvent e) {
-
- if ("exportascsv".equals(e.getActionCommand())) {
- FileWriter writer = null;
- try {
- File file = FileUtil.getFile(".+\\.csv", "CSV file");
- if (file != null) {
-
- // add csv extension
- if (!file.getName().endsWith(".csv")) {
- file = new File(file.getAbsolutePath() + ".csv");
- }
-
- writer = new FileWriter(file);
- matrix.exportCSV(writer, true);
- }
- } catch (IOException eee) {
- log.error(":104:Error during export" + eee);
- }
- finally {
- IOUtils.closeQuietly(writer);
- }
- }
- }
-
-}
Modified: trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/renderer/MatrixPanelRenderer.java
===================================================================
--- trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/renderer/MatrixPanelRenderer.java 2011-04-13 15:50:50 UTC (rev 352)
+++ trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/renderer/MatrixPanelRenderer.java 2011-04-13 15:59:26 UTC (rev 353)
@@ -27,13 +27,25 @@
import static org.nuiton.i18n.I18n._;
+import java.awt.BorderLayout;
import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
import javax.swing.Icon;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.nuiton.math.matrix.MatrixND;
import org.nuiton.math.matrix.gui.MatrixPanelEditor;
import org.nuiton.math.matrix.viewer.MatrixRenderer;
+import org.nuiton.util.FileUtil;
import org.nuiton.util.Resource;
/**
@@ -45,16 +57,57 @@
* Last update : $Date$
* By : $Author$
*/
-public class MatrixPanelRenderer implements MatrixRenderer {
+public class MatrixPanelRenderer implements ActionListener, MatrixRenderer {
+ /** Class logger. */
+ private static Log log = LogFactory.getLog(MatrixPanelRenderer.class);
+
+ /** Renderer main component. */
+ protected JPanel panel;
+
+ /** Matrix editor. */
+ protected MatrixPanelEditor editor;
+
+ /** Export button. */
+ protected JButton exportButton;
+
+ /** Current matrix. */
+ protected MatrixND matrix;
+
+ public MatrixPanelRenderer() {
+
+ panel = new JPanel(new BorderLayout());
+
+ // main component
+ editor = new MatrixPanelEditor();
+ panel.add(editor, BorderLayout.CENTER);
+
+ // export button
+ exportButton = new JButton(_("nuitonmatrix.viewer.renderer.exportascsv"));
+ exportButton.addActionListener(this);
+ exportButton.setActionCommand("exportascsv");
+ exportButton.setEnabled(false);
+ panel.add(exportButton, BorderLayout.SOUTH);
+ }
+
+ /**
+ * Get editor instance to allow configuration.
+ *
+ * @return internal editor reference
+ */
+ public MatrixPanelEditor getEditor() {
+ return editor;
+ }
+
/*
* @see org.nuiton.math.matrix.viewer.MatrixRenderer#getPanel(org.nuiton.math.matrix.MatrixND)
*/
@Override
public Component getComponent(MatrixND matrix) {
+ this.matrix = matrix;
+ editor.setMatrix(matrix);
+ exportButton.setEnabled(matrix != null);
- MatrixPanelEditor panel = new MatrixPanelEditor();
- panel.setMatrix(matrix);
return panel;
}
@@ -73,6 +126,36 @@
public String getName() {
return _("nuitonmatrix.viewer.renderer.panel");
}
+
+ /*
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ @Override
+ public void actionPerformed(ActionEvent e) {
-
+ if ("exportascsv".equals(e.getActionCommand())) {
+ FileWriter writer = null;
+ try {
+ File file = FileUtil.getFile(".+\\.csv", "CSV file");
+ if (file != null) {
+
+ // add csv extension
+ if (!file.getName().endsWith(".csv")) {
+ file = new File(file.getAbsolutePath() + ".csv");
+ }
+
+ writer = new FileWriter(file);
+ matrix.exportCSV(writer, true);
+ }
+ } catch (IOException eee) {
+ if (log.isErrorEnabled()) {
+ log.error("Error during export", eee);
+ }
+ }
+ finally {
+ IOUtils.closeQuietly(writer);
+ }
+ }
+ }
+
}
Modified: trunk/nuiton-matrix-gui/src/main/resources/i18n/nuiton-matrix-gui_en_GB.properties
===================================================================
--- trunk/nuiton-matrix-gui/src/main/resources/i18n/nuiton-matrix-gui_en_GB.properties 2011-04-13 15:50:50 UTC (rev 352)
+++ trunk/nuiton-matrix-gui/src/main/resources/i18n/nuiton-matrix-gui_en_GB.properties 2011-04-13 15:59:26 UTC (rev 353)
@@ -1,3 +1,5 @@
+matrix.gui.model.mean=Mean
+matrix.gui.model.sum=Sum
nuitonmatrix.create.matrix.button=New matrix
nuitonmatrix.create.matrix.message=Matrix size (separate by ';')
nuitonmatrix.create.matrix.title=New matrix
@@ -6,6 +8,9 @@
nuitonmatrix.error.clipboard.write=Cannot write clipboard
nuitonmatrix.error.file.read=Cannot read file
nuitonmatrix.error.file.write=Cannot write file
+nuitonmatrix.gui.meanOption=Mean
+nuitonmatrix.gui.sumOption=Sum
+nuitonmatrix.gui.transposeOption=Transpose
nuitonmatrix.menu.action=Copy/Paste
nuitonmatrix.menu.action.copy=Copy
nuitonmatrix.menu.action.copy.selection=Copy selection
@@ -28,7 +33,6 @@
nuitonmatrix.viewer.graphcomborender.surface.stacked=Stacked area rendering
nuitonmatrix.viewer.matrix.more.2d=Matrix dimensions count over 2 \!\nChoose less elements or apply sum operator.
nuitonmatrix.viewer.renderer.chart=Chart
-nuitonmatrix.viewer.renderer.data=Data
nuitonmatrix.viewer.renderer.exportascsv=Export as CSV
nuitonmatrix.viewer.renderer.panel=Matrix
nuitonmatrix.viewer.sum=Sum
Modified: trunk/nuiton-matrix-gui/src/main/resources/i18n/nuiton-matrix-gui_fr_FR.properties
===================================================================
--- trunk/nuiton-matrix-gui/src/main/resources/i18n/nuiton-matrix-gui_fr_FR.properties 2011-04-13 15:50:50 UTC (rev 352)
+++ trunk/nuiton-matrix-gui/src/main/resources/i18n/nuiton-matrix-gui_fr_FR.properties 2011-04-13 15:59:26 UTC (rev 353)
@@ -1,3 +1,5 @@
+matrix.gui.model.mean=Moyenne
+matrix.gui.model.sum=Somme
nuitonmatrix.create.matrix.button=Cr\u00E9er une matrice
nuitonmatrix.create.matrix.message=Dimensions de la matrice (s\u00E9par\u00E9es par ';')
nuitonmatrix.create.matrix.title=Cr\u00E9er une matrice
@@ -6,6 +8,9 @@
nuitonmatrix.error.clipboard.write=Impossible d'\u00E9crire dans le bloc note
nuitonmatrix.error.file.read=Impossible de lire le fichier
nuitonmatrix.error.file.write=Impossible d'\u00E9crire dans le fichier
+nuitonmatrix.gui.meanOption=Moyenne
+nuitonmatrix.gui.sumOption=Somme
+nuitonmatrix.gui.transposeOption=Transpos\u00E9e
nuitonmatrix.menu.action=Copier/Coller
nuitonmatrix.menu.action.copy=Copier
nuitonmatrix.menu.action.copy.selection=Copier la s\u00E9lection
@@ -28,7 +33,6 @@
nuitonmatrix.viewer.graphcomborender.surface.stacked=Rendu en aires empil\u00E9es
nuitonmatrix.viewer.matrix.more.2d=Matrice de plus de 2 dimensions \!\nS\u00E9lectionnez moins d'\u00E9l\u00E9ments ou utilisez l'op\u00E9rateur somme.
nuitonmatrix.viewer.renderer.chart=Graphique
-nuitonmatrix.viewer.renderer.data=Donn\u00E9es
nuitonmatrix.viewer.renderer.exportascsv=Exporter en CSV
nuitonmatrix.viewer.renderer.panel=Matrice
nuitonmatrix.viewer.sum=Somme
Added: trunk/nuiton-matrix-gui/src/test/java/org/nuiton/math/matrix/gui/MatrixPanelEditorTest.java
===================================================================
--- trunk/nuiton-matrix-gui/src/test/java/org/nuiton/math/matrix/gui/MatrixPanelEditorTest.java (rev 0)
+++ trunk/nuiton-matrix-gui/src/test/java/org/nuiton/math/matrix/gui/MatrixPanelEditorTest.java 2011-04-13 15:59:26 UTC (rev 353)
@@ -0,0 +1,147 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package org.nuiton.math.matrix.gui;
+
+import java.awt.Component;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.JFrame;
+
+import org.junit.Test;
+import org.nuiton.math.matrix.MatrixFactory;
+import org.nuiton.math.matrix.MatrixHelper;
+import org.nuiton.math.matrix.MatrixND;
+
+/**
+ * Test to diplay matrix in MatrixPanelEditor using differents model.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class MatrixPanelEditorTest {
+
+ protected MatrixND getMatrixTest(int dimCount) {
+ List<?>[] dims = new List<?>[dimCount];
+
+ List<Integer> years = new ArrayList<Integer>();
+ years.add(1999);
+ years.add(2000);
+ years.add(2001);
+ years.add(2002);
+ years.add(2003);
+ years.add(2004);
+ years.add(2005);
+ dims[0] = years;
+
+ if (dimCount >= 2) {
+ List<String> cities = new ArrayList<String>();
+ cities.add("Nantes");
+ cities.add("Paris");
+ cities.add("Lyon");
+ cities.add("Lille");
+ cities.add("Toulouse");
+ cities.add("Marseille");
+ dims[1] = cities;
+ }
+
+ if (dimCount >= 3) {
+ List<String> sectors = new ArrayList<String>();
+ sectors.add("Informatique");
+ sectors.add("Administration");
+ sectors.add("Livraison");
+ sectors.add("Achat");
+ dims[2] = sectors;
+ }
+
+ if (dimCount >= 4) {
+ List<String> persons = new ArrayList<String>();
+ persons.add("Bob");
+ persons.add("Joe");
+ persons.add("Louis");
+ persons.add("Jean");
+ dims[3] = persons;
+ }
+
+ MatrixND matrix = MatrixFactory.getInstance().create(dims);
+ matrix.setName("test matrix");
+ MatrixHelper.fill(matrix, Math.random()*10000);
+
+ return matrix;
+ }
+
+ protected void show(Component comp) {
+ JFrame frame = new JFrame();
+ frame.add(comp);
+ frame.pack();
+ frame.setLocationRelativeTo(null);
+ frame.setVisible(true);
+
+ try {
+ Thread.sleep(60000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Test
+ public void testModelNDDim3() {
+ MatrixND matrix = getMatrixTest(3);
+ MatrixPanelEditor editor = new MatrixPanelEditor();
+ editor.setMatrix(matrix);
+ show(editor);
+ }
+
+ @Test
+ public void testModelNDDim4() {
+ MatrixND matrix = getMatrixTest(4);
+ MatrixPanelEditor editor = new MatrixPanelEditor();
+ editor.setMatrix(matrix);
+ show(editor);
+ }
+
+ @Test
+ public void testModelLinearDim3() {
+ MatrixND matrix = getMatrixTest(3);
+ MatrixPanelEditor editor = new MatrixPanelEditor();
+ editor.setLinearModel(true);
+ editor.setLinearModelShowDefault(true);
+ editor.setMatrix(matrix);
+ show(editor);
+ }
+
+ @Test
+ public void testModelLinearDim4() {
+ MatrixND matrix = getMatrixTest(4);
+ MatrixPanelEditor editor = new MatrixPanelEditor();
+ editor.setLinearModel(true);
+ editor.setMatrix(matrix);
+ show(editor);
+ }
+}
Property changes on: trunk/nuiton-matrix-gui/src/test/java/org/nuiton/math/matrix/gui/MatrixPanelEditorTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/nuiton-matrix-gui/src/test/java/org/nuiton/math/matrix/gui/MatrixPanelListenerTest.java
===================================================================
--- trunk/nuiton-matrix-gui/src/test/java/org/nuiton/math/matrix/gui/MatrixPanelListenerTest.java 2011-04-13 15:50:50 UTC (rev 352)
+++ trunk/nuiton-matrix-gui/src/test/java/org/nuiton/math/matrix/gui/MatrixPanelListenerTest.java 2011-04-13 15:59:26 UTC (rev 353)
@@ -33,7 +33,7 @@
import org.junit.Test;
/**
- * A test to verify that {@link MatrixPanelListener} is trully a JavaBeans
+ * A test to verify that {@link MatrixPanelListener} is truly a JavaBeans
* listener implementation in editors.
*
* @author chemit
@@ -44,7 +44,7 @@
public static final String MATRIX_PANEL_LISTENER_NAME = "matrixPanel";
/**
- * Test if editors are trully JavaBeans listeners implementations
+ * Test if editors are truly JavaBeans listeners implementations
* @throws Exception
*/
@Test
Modified: trunk/nuiton-matrix-gui/src/test/java/org/nuiton/math/matrix/viewer/MatrixViewerPanelTest.java
===================================================================
--- trunk/nuiton-matrix-gui/src/test/java/org/nuiton/math/matrix/viewer/MatrixViewerPanelTest.java 2011-04-13 15:50:50 UTC (rev 352)
+++ trunk/nuiton-matrix-gui/src/test/java/org/nuiton/math/matrix/viewer/MatrixViewerPanelTest.java 2011-04-13 15:59:26 UTC (rev 353)
@@ -37,7 +37,6 @@
import org.nuiton.math.matrix.MatrixND;
import org.nuiton.math.matrix.MatrixProvider;
import org.nuiton.math.matrix.viewer.renderer.MatrixChartRenderer;
-import org.nuiton.math.matrix.viewer.renderer.MatrixInfoTableRenderer;
import org.nuiton.math.matrix.viewer.renderer.MatrixPanelRenderer;
import org.nuiton.util.Resource;
@@ -83,7 +82,8 @@
else {
matrix = MatrixFactory.getInstance().create("test matrix", new List<?>[]{years, cities}, new String[]{"Years", "Cities"});
MatrixHelper.fill(matrix, Math.random()*10000);
- matrix.setValue(0, 0, Math.random()*10000);
+ matrix.setValue(1, 0, Math.random()*10000);
+ matrix.setValue(0, 4, Math.random()*10000);
}
return matrix;
}
@@ -98,9 +98,10 @@
MatrixViewerPanel panel = new MatrixViewerPanel();
MatrixND testMatrix = getTestMatrix(false);
panel.setMatrix(testMatrix);
- panel.addMatrixRenderer(new MatrixInfoTableRenderer());
panel.addMatrixRenderer(new MatrixChartRenderer());
- panel.addMatrixRenderer(new MatrixPanelRenderer());
+ MatrixPanelRenderer panelRenderer = new MatrixPanelRenderer();
+ panelRenderer.getEditor().setDisplayOptions(true);
+ panel.addMatrixRenderer(panelRenderer);
frame.add(panel);
frame.pack();
@@ -123,7 +124,7 @@
MatrixViewerPanel panel = new MatrixViewerPanel();
MatrixND testMatrix = getTestMatrix(true);
- panel.addMatrixRenderer(new MatrixInfoTableRenderer());
+ panel.addMatrixRenderer(new MatrixPanelRenderer());
panel.addMatrixRenderer(new MatrixChartRenderer());
panel.addMatrixDimentionAction(new MatrixDimensionAction() {
@Override
1
0
r352 - trunk/nuiton-matrix/src/main/java/org/nuiton/math/matrix
by echatellier@users.nuiton.org 13 Apr '11
by echatellier@users.nuiton.org 13 Apr '11
13 Apr '11
Author: echatellier
Date: 2011-04-13 17:50:50 +0200 (Wed, 13 Apr 2011)
New Revision: 352
Url: http://nuiton.org/repositories/revision/nuiton-matrix/352
Log:
Anomalie #1458: Can't use List<Integer> as semantics
Modified:
trunk/nuiton-matrix/src/main/java/org/nuiton/math/matrix/MatrixHelper.java
Modified: trunk/nuiton-matrix/src/main/java/org/nuiton/math/matrix/MatrixHelper.java
===================================================================
--- trunk/nuiton-matrix/src/main/java/org/nuiton/math/matrix/MatrixHelper.java 2011-04-13 08:39:28 UTC (rev 351)
+++ trunk/nuiton-matrix/src/main/java/org/nuiton/math/matrix/MatrixHelper.java 2011-04-13 15:50:50 UTC (rev 352)
@@ -32,8 +32,6 @@
import java.util.NoSuchElementException;
import java.util.Stack;
-import org.apache.commons.lang.ArrayUtils;
-
/**
* Contains usefull methods to get information on matrix.
*
@@ -191,7 +189,7 @@
for (int i = 0; i < result.length; i++) {
result[i] = semantics[i].get(coordinates[i]);
if (result[i] == null) {
- result[i] = Integer.valueOf(coordinates[i]);
+ result[i] = MatrixDimensionIndex.valueOf(coordinates[i]);
}
}
return result;
@@ -204,7 +202,7 @@
*
* @param semantics la semantique à utiliser pour la conversion
* @param coordinates les coordonnées sémantique
- * @return les coordonnées en entier. Si la sémantique est représentéé par un
+ * @return les coordonnées en entier. Si la sémantique est représentée par un
* Integer alors la valeur de l'integer est utilisé pour la
* conversion.
*/
@@ -233,8 +231,9 @@
*/
public static int indexOf(List<?>[] semantics, int dim, Object o)
throws NoSuchElementException {
- if (o instanceof Integer) {
- return ((Integer) o).intValue();
+ // see {#dimensionToSemantics()} to known why
+ if (o instanceof MatrixDimensionIndex) {
+ return ((MatrixDimensionIndex) o).intValue();
}
int result = -1;
if ((0 <= dim) && (dim < semantics.length)) {
@@ -373,3 +372,53 @@
}
} // MatrixHelper
+
+/**
+ * This class must stay private and can't be used outside nuiton matrix
+ * to prevent semantic type collision.
+ *
+ * This class is a copy of JDK's Integer with only necessary stuff.
+ */
+class MatrixDimensionIndex {
+ protected int value;
+
+ private MatrixDimensionIndex(int value) {
+ this.value = value;
+ }
+
+ /**
+ * See {@code Integer#IntegerCache} for details about that.
+ */
+ private static class MatrixDimensionIndexCache {
+ static final int high;
+ static final MatrixDimensionIndex cache[];
+
+ static {
+ final int low = 0;
+
+ // high value may be configured by property
+ high = 127;
+
+ cache = new MatrixDimensionIndex[(high - low) + 1];
+ int j = low;
+ for(int k = 0; k < cache.length; k++) {
+ cache[k] = new MatrixDimensionIndex(j++);
+ }
+ }
+
+ private MatrixDimensionIndexCache() {}
+ }
+
+ public static MatrixDimensionIndex valueOf(int i) {
+ if(i >= 0 && i <= MatrixDimensionIndexCache.high) {
+ return MatrixDimensionIndexCache.cache[i + 128];
+ }
+ else {
+ return new MatrixDimensionIndex(i);
+ }
+ }
+
+ public int intValue() {
+ return value;
+ }
+}
\ No newline at end of file
1
0
Author: echatellier
Date: 2011-04-13 10:39:28 +0200 (Wed, 13 Apr 2011)
New Revision: 351
Url: http://nuiton.org/repositories/revision/nuiton-matrix/351
Log:
Evolution #1455: Update to jaxx 2.4
Evolution #1456: Update to nuiton-util 2.1.1
Evolution #1457: Update nuiton-i18n 2.3.2
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-04-11 08:46:21 UTC (rev 350)
+++ trunk/pom.xml 2011-04-13 08:39:28 UTC (rev 351)
@@ -50,14 +50,10 @@
<artifactId>javahelp</artifactId>
</exclusion>
<exclusion>
- <groupId>com.opensymphony</groupId>
- <artifactId>xwork</artifactId>
+ <groupId>org.swinglabs</groupId>
+ <artifactId>swingx-core</artifactId>
</exclusion>
<exclusion>
- <groupId>opensymphony</groupId>
- <artifactId>ognl</artifactId>
- </exclusion>
- <exclusion>
<groupId>commons-jxpath</groupId>
<artifactId>commons-jxpath</artifactId>
</exclusion>
@@ -96,9 +92,9 @@
<projectId>nuiton-matrix</projectId>
- <jaxxVersion>2.2.5</jaxxVersion>
- <nuitonUtilsVersion>2.0</nuitonUtilsVersion>
- <nuitonI18nVersion>2.2</nuitonI18nVersion>
+ <jaxxVersion>2.4</jaxxVersion>
+ <nuitonUtilsVersion>2.1.1</nuitonUtilsVersion>
+ <nuitonI18nVersion>2.3.2</nuitonI18nVersion>
</properties>
1
0
Author: tchemit
Date: 2011-04-11 10:46:21 +0200 (Mon, 11 Apr 2011)
New Revision: 350
Url: http://nuiton.org/repositories/revision/nuiton-matrix/350
Log:
Update mavenpom4redmineAndCentral to 2.5.3.
Modified:
branches/nuiton-matrix-2.1.x/pom.xml
Modified: branches/nuiton-matrix-2.1.x/pom.xml
===================================================================
--- branches/nuiton-matrix-2.1.x/pom.xml 2011-04-11 08:46:18 UTC (rev 349)
+++ branches/nuiton-matrix-2.1.x/pom.xml 2011-04-11 08:46:21 UTC (rev 350)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmineAndCentral</artifactId>
- <version>2.5.2</version>
+ <version>2.5.3</version>
</parent>
<artifactId>nuiton-matrix</artifactId>
1
0
Author: tchemit
Date: 2011-04-11 10:46:18 +0200 (Mon, 11 Apr 2011)
New Revision: 349
Url: http://nuiton.org/repositories/revision/nuiton-matrix/349
Log:
Update mavenpom4redmineAndCentral to 2.5.3.
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-04-08 14:03:40 UTC (rev 348)
+++ trunk/pom.xml 2011-04-11 08:46:18 UTC (rev 349)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmineAndCentral</artifactId>
- <version>2.5.2</version>
+ <version>2.5.3</version>
</parent>
<artifactId>matrix</artifactId>
1
0
r348 - in trunk/nuiton-matrix-gui/src/main: java/org/nuiton/math/matrix/viewer java/org/nuiton/math/matrix/viewer/renderer resources/i18n
by echatellier@users.nuiton.org 08 Apr '11
by echatellier@users.nuiton.org 08 Apr '11
08 Apr '11
Author: echatellier
Date: 2011-04-08 16:03:40 +0200 (Fri, 08 Apr 2011)
New Revision: 348
Url: http://nuiton.org/repositories/revision/nuiton-matrix/348
Log:
#1448: Update MatrixFilter to support dimension filter
Modified:
trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/MatrixDimensionPanel.java
trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/MatrixFilter.java
trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/MatrixViewerPanel.java
trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/renderer/MatrixInfoTableRenderer.java
trunk/nuiton-matrix-gui/src/main/resources/i18n/nuiton-matrix-gui_en_GB.properties
trunk/nuiton-matrix-gui/src/main/resources/i18n/nuiton-matrix-gui_fr_FR.properties
Modified: trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/MatrixDimensionPanel.java
===================================================================
--- trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/MatrixDimensionPanel.java 2011-04-08 13:10:03 UTC (rev 347)
+++ trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/MatrixDimensionPanel.java 2011-04-08 14:03:40 UTC (rev 348)
@@ -27,6 +27,8 @@
import static org.nuiton.i18n.I18n._;
+import org.apache.commons.lang.StringUtils;
+
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
@@ -103,8 +105,8 @@
repaint();
}
- public MatrixND getModifiedMatrix() {
- MatrixND reducedMatrix = createAndReduce(matrix);
+ public MatrixND getModifiedMatrix(List<MatrixFilter> matrixFilters) {
+ MatrixND reducedMatrix = createAndReduce(matrix, matrixFilters);
return reducedMatrix;
}
@@ -141,6 +143,9 @@
* tous les boutons (methode setSelected surchargée).
*/
protected ButtonGroup buttonGroup = new ButtonGroup() {
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 8214289174634749701L;
+
@Override
public void setSelected(ButtonModel m, boolean b) {
if (b) {
@@ -245,7 +250,14 @@
if (matrix != null) {
int index = 0;
for (List<?> semantic : matrix.getSemantics()) {
- SubDimensionPanel dimPanel = new SubDimensionPanel(index, _(matrix.getDimensionName(index)), semantic);
+
+ // compute dimension name
+ String dimensionName = _(matrix.getDimensionName(index));
+ if (StringUtils.isBlank(dimensionName)) {
+ dimensionName = _("nuitonmatrix.viewer.dimnameindex", index);
+ }
+
+ SubDimensionPanel dimPanel = new SubDimensionPanel(index, dimensionName, semantic);
add(dimPanel);
subPanelList.add(dimPanel);
index++;
@@ -275,10 +287,18 @@
}
}
- protected MatrixND createAndReduce(MatrixND matrix) {
+ /**
+ * Reduit, somme et filtre la matrice sur les dimensions selectionnés,
+ * les boutons d'action selections et les filtres enregistrés.
+ *
+ * @param matrix initial matrix to reduce
+ * @param matrixFilters matrix filter to apply
+ * @return filtred, reduced and sommed matrix
+ */
+ protected MatrixND createAndReduce(MatrixND matrix, List<MatrixFilter> matrixFilters) {
if (log.isDebugEnabled()) {
- log.debug("matrice avant submatrice : " + matrix);
+ log.debug("Matrice before submatrix : " + matrix);
}
// la matrice doit être reduite avant tout et en une seule
@@ -304,7 +324,7 @@
matrix = matrix.getSubMatrix(dimIndices);
if (log.isDebugEnabled()) {
- log.debug("matrice apres submatrice : " + matrix);
+ log.debug("Matrix after submatrix : " + matrix);
}
// Effectue la somme si l'utilisateur a selectionné l'option somme
@@ -322,49 +342,22 @@
// c une somme partielle
String name = matrix.getDimensionName(i) + " " + _("nuitonmatrix.viewer.sum");
- /* FIXME echatellier somme par autre interval que -1
- //si c une somme pour les annees, on change l'intitule
- if (item instanceof InfoItemDate){
- name = _ ("isisfish.common.year");
- }*/
-
matrix.setDimensionName(i, name);
}
- /* FIXME echatellier somme par autre interval que -1
- // #1905 : modifie les semantiques de type Date pour que lorsque
- // c'est par exemple une somme par année
- // les semantique se nomment
- // janvier 0, janvier 1...
- // plutot que
- // janvier 0, fevrier 0...
- Object sem = matrix.getSemantics(i);
- if (sem instanceof List) {
- List<Object> semList = (List<Object>)sem;
- List<Object> newList = new ArrayList<Object>();
- for (int index = 0 ; index < semList.size(); ++index) {
- Object semObject = semList.get(index);
- if (semObject instanceof Date) {
- Date semDate = (Date)semObject;
- Date newDate = new Date(semDate.getDate() * item.getSumStep());
- newList.add(newDate);
- }
- else {
- newList.add(semObject);
- }
- }
- matrix.setSemantics(i, newList);
+ // apply main filter after reduction
+ for (MatrixFilter matrixFilter : matrixFilters) {
+ matrix = matrixFilter.filterDimension(matrix, i, subDimPanel.getSumStep());
}
- // end semantics modification */
}
if (log.isDebugEnabled()) {
- log.debug("matrice apres sum de la dim " + i + ": " + matrix);
+ log.debug("Matrix after sum on dim " + i + ": " + matrix);
}
}
if (log.isDebugEnabled()) {
- log.debug("Matrice avant le reduce: " + matrix);
+ log.debug("Matrix febore reduce: " + matrix);
}
// arrive ici on a une matrice qui a des tailles de dimension 1
@@ -374,6 +367,11 @@
// reduction de la matrice
MatrixND result = matrix.reduce(2);
+ // apply main filter after reduction
+ for (MatrixFilter matrixFilter : matrixFilters) {
+ result = matrixFilter.filter(result);
+ }
+
return result;
}
}
Modified: trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/MatrixFilter.java
===================================================================
--- trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/MatrixFilter.java 2011-04-08 13:10:03 UTC (rev 347)
+++ trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/MatrixFilter.java 2011-04-08 14:03:40 UTC (rev 348)
@@ -41,8 +41,22 @@
/**
* Filter input matrix.
*
+ * Called after submatrix creation on selected dimension and applied sum action.
+ *
+ * This method can be considerer as "main filter".
+ *
* @param matrix matrix to filter
* @return filtered matrix
*/
public MatrixND filter(MatrixND matrix);
+
+ /**
+ * Apply filter on matrix after dimension summing.
+ *
+ * @param matrix matrix to filter
+ * @param dim dimension concerned by summing
+ * @param sumStep sumStep summing
+ * @return filtered matrix
+ */
+ public MatrixND filterDimension(MatrixND matrix, int dim, int sumStep);
}
Modified: trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/MatrixViewerPanel.java
===================================================================
--- trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/MatrixViewerPanel.java 2011-04-08 13:10:03 UTC (rev 347)
+++ trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/MatrixViewerPanel.java 2011-04-08 14:03:40 UTC (rev 348)
@@ -300,10 +300,8 @@
String actionCommand = e.getActionCommand();
if ("render".equals(actionCommand)) {
- // get matrix to display
- MatrixND matrix = dimensionPanel.getModifiedMatrix();
- // filter matrix
- matrix = getFilteredMatrix(matrix);
+ // get matrix to display filtered
+ MatrixND matrix = dimensionPanel.getModifiedMatrix(matrixFilters);
// matrice superieur a 2 dimensions non geree!!
if (matrix.getDimCount() > 2) {
Modified: trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/renderer/MatrixInfoTableRenderer.java
===================================================================
--- trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/renderer/MatrixInfoTableRenderer.java 2011-04-08 13:10:03 UTC (rev 347)
+++ trunk/nuiton-matrix-gui/src/main/java/org/nuiton/math/matrix/viewer/renderer/MatrixInfoTableRenderer.java 2011-04-08 14:03:40 UTC (rev 348)
@@ -27,14 +27,27 @@
import static org.nuiton.i18n.I18n._;
+import java.awt.BorderLayout;
import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
import javax.swing.Icon;
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.nuiton.math.matrix.MatrixND;
import org.nuiton.math.matrix.viewer.MatrixRenderer;
+import org.nuiton.util.FileUtil;
import org.nuiton.util.Resource;
/**
@@ -46,17 +59,39 @@
* Last update : $Date$
* By : $Author$
*/
-public class MatrixInfoTableRenderer implements MatrixRenderer {
+public class MatrixInfoTableRenderer implements MatrixRenderer, ActionListener {
+ /** Class logger. */
+ private static Log log = LogFactory.getLog(MatrixInfoTableRenderer.class);
+
+ protected MatrixND matrix;
+
/*
* @see org.nuiton.math.matrix.viewer.MatrixRenderer#getPanel(org.nuiton.math.matrix.MatrixND)
*/
@Override
public Component getComponent(MatrixND matrix) {
+ this.matrix = matrix;
+ JPanel panel = new JPanel(new BorderLayout());
+
+ // label matrix name
+ JLabel nameLabel = new JLabel(_(matrix.getName()));
+ nameLabel.setHorizontalAlignment(JLabel.CENTER);
+ panel.add(nameLabel, BorderLayout.NORTH);
+
+ // data table
JTable table = new JTable();
table.setModel(new MatrixInfoTableModel(matrix));
- return new JScrollPane(table);
+ panel.add(new JScrollPane(table), BorderLayout.CENTER);
+
+ // export button
+ JButton exportButton = new JButton(_("nuitonmatrix.viewer.renderer.exportascsv"));
+ exportButton.addActionListener(this);
+ exportButton.setActionCommand("exportascsv");
+ exportButton.setEnabled(this.matrix != null);
+ panel.add(exportButton, BorderLayout.SOUTH);
+ return panel;
}
/*
@@ -75,5 +110,33 @@
return _("nuitonmatrix.viewer.renderer.data");
}
-
+ /*
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ @Override
+ public void actionPerformed(ActionEvent e) {
+
+ if ("exportascsv".equals(e.getActionCommand())) {
+ FileWriter writer = null;
+ try {
+ File file = FileUtil.getFile(".+\\.csv", "CSV file");
+ if (file != null) {
+
+ // add csv extension
+ if (!file.getName().endsWith(".csv")) {
+ file = new File(file.getAbsolutePath() + ".csv");
+ }
+
+ writer = new FileWriter(file);
+ matrix.exportCSV(writer, true);
+ }
+ } catch (IOException eee) {
+ log.error(":104:Error during export" + eee);
+ }
+ finally {
+ IOUtils.closeQuietly(writer);
+ }
+ }
+ }
+
}
Modified: trunk/nuiton-matrix-gui/src/main/resources/i18n/nuiton-matrix-gui_en_GB.properties
===================================================================
--- trunk/nuiton-matrix-gui/src/main/resources/i18n/nuiton-matrix-gui_en_GB.properties 2011-04-08 13:10:03 UTC (rev 347)
+++ trunk/nuiton-matrix-gui/src/main/resources/i18n/nuiton-matrix-gui_en_GB.properties 2011-04-08 14:03:40 UTC (rev 348)
@@ -17,6 +17,7 @@
nuitonmatrix.menu.csv.import.file=Import from file
nuitonmatrix.menu.csv.import.position=Import at current position
nuitonmatrix.menu.option.semantics=Export/Copy with semantics
+nuitonmatrix.viewer.dimnameindex=Dimension %d
nuitonmatrix.viewer.graphcomborender.bar=Verticals bar rendering
nuitonmatrix.viewer.graphcomborender.bar.3d=3D verticals bars rendering
nuitonmatrix.viewer.graphcomborender.bar.stacked=Stacked verticals bars rendering
@@ -28,5 +29,6 @@
nuitonmatrix.viewer.matrix.more.2d=Matrix dimensions count over 2 \!\nChoose less elements or apply sum operator.
nuitonmatrix.viewer.renderer.chart=Chart
nuitonmatrix.viewer.renderer.data=Data
+nuitonmatrix.viewer.renderer.exportascsv=Export as CSV
nuitonmatrix.viewer.renderer.panel=Matrix
nuitonmatrix.viewer.sum=Sum
Modified: trunk/nuiton-matrix-gui/src/main/resources/i18n/nuiton-matrix-gui_fr_FR.properties
===================================================================
--- trunk/nuiton-matrix-gui/src/main/resources/i18n/nuiton-matrix-gui_fr_FR.properties 2011-04-08 13:10:03 UTC (rev 347)
+++ trunk/nuiton-matrix-gui/src/main/resources/i18n/nuiton-matrix-gui_fr_FR.properties 2011-04-08 14:03:40 UTC (rev 348)
@@ -17,6 +17,7 @@
nuitonmatrix.menu.csv.import.file=Importer depuis un fichier
nuitonmatrix.menu.csv.import.position=Importer \u00E0 la position courante
nuitonmatrix.menu.option.semantics=Exporter/Copier avec la s\u00E9mantique
+nuitonmatrix.viewer.dimnameindex=Dimension %d
nuitonmatrix.viewer.graphcomborender.bar=Rendu en barres verticales
nuitonmatrix.viewer.graphcomborender.bar.3d=Rendu en barres verticales 3D
nuitonmatrix.viewer.graphcomborender.bar.stacked=Rendu en barres verticales empil\u00E9es
@@ -28,5 +29,6 @@
nuitonmatrix.viewer.matrix.more.2d=Matrice de plus de 2 dimensions \!\nS\u00E9lectionnez moins d'\u00E9l\u00E9ments ou utilisez l'op\u00E9rateur somme.
nuitonmatrix.viewer.renderer.chart=Graphique
nuitonmatrix.viewer.renderer.data=Donn\u00E9es
+nuitonmatrix.viewer.renderer.exportascsv=Exporter en CSV
nuitonmatrix.viewer.renderer.panel=Matrice
nuitonmatrix.viewer.sum=Somme
1
0