|
From: <de...@us...> - 2012-06-04 22:42:56
|
Revision: 7270
http://fudaa.svn.sourceforge.net/fudaa/?rev=7270&view=rev
Author: deniger
Date: 2012-06-04 22:42:49 +0000 (Mon, 04 Jun 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostRubarFmtModel.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostRubarLoader.java
trunk/soft/fudaa-prepro/ui/src/main/resources/org/fudaa/fudaa/tr/common/tr_en.fr_txt
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostRubarFmtModel.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostRubarFmtModel.java 2012-06-04 22:42:19 UTC (rev 7269)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostRubarFmtModel.java 2012-06-04 22:42:49 UTC (rev 7270)
@@ -8,8 +8,6 @@
import com.memoire.bu.BuResource;
import org.fudaa.ctulu.CtuluLib;
-import org.fudaa.ctulu.CtuluLibArray;
-import org.fudaa.ctulu.CtuluLibFile;
import org.fudaa.ctulu.fileformat.FileFormat;
/**
@@ -39,7 +37,9 @@
@Override
public Class getColumnClass(final int _columnIndex) {
- if (_columnIndex == 0) { return Boolean.class; }
+ if (_columnIndex == 0) {
+ return Boolean.class;
+ }
return String.class;
}
@@ -50,7 +50,9 @@
@Override
public String getColumnName(final int _column) {
- if (_column == 0) { return CtuluLib.getS("Charg\xE9"); }
+ if (_column == 0) {
+ return CtuluLib.getS("Charg\xE9");
+ }
return BuResource.BU.getString("Fichier");
}
@@ -61,7 +63,9 @@
@Override
public Object getValueAt(final int _rowIndex, final int _columnIndex) {
- if (_columnIndex == 0) { return Boolean.valueOf(fileToLoad_[_rowIndex]); }
+ if (_columnIndex == 0) {
+ return Boolean.valueOf(fileToLoad_[_rowIndex]);
+ }
final FileFormat fileFormat = fmtToLoad_[_rowIndex];
final String[] ext = fileFormat.getExtensions();
final File file = (File) fmtLoadable_.get(fileFormat);
@@ -94,4 +98,19 @@
fileToLoad_[_rowIndex] = ((Boolean) _value).booleanValue();
}
}
+
+ void unselectAll() {
+ for (int i = fileToLoad_.length - 1; i >= 0; i--) {
+ fileToLoad_[i] = false;
+ }
+ fireTableRowsUpdated(0, getRowCount() - 1);
+ }
+
+ void selectAll() {
+ for (int i = fileToLoad_.length - 1; i >= 0; i--) {
+ fileToLoad_[i] = true;
+ }
+ fireTableRowsUpdated(0, getRowCount() - 1);
+
+ }
}
\ No newline at end of file
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostRubarLoader.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostRubarLoader.java 2012-06-04 22:42:19 UTC (rev 7269)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostRubarLoader.java 2012-06-04 22:42:49 UTC (rev 7270)
@@ -98,6 +98,12 @@
import com.memoire.bu.BuScrollPane;
import com.memoire.fu.Fu;
import com.memoire.fu.FuLog;
+import java.awt.BorderLayout;
+import java.awt.FlowLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import javax.swing.JButton;
+import javax.swing.JPanel;
/**
* @author Fred Deniger
@@ -920,10 +926,32 @@
lb.setHorizontalTextPosition(SwingConstants.CENTER);
pn.add(lb, BuBorderLayout.NORTH);
final JTable tb = new JTable();
- tb.setModel(new TrPostRubarFmtModel(fmtToLoad_, fileToLoad_, fmtLoadable_));
+ final TrPostRubarFmtModel trPostRubarFmtModel = new TrPostRubarFmtModel(fmtToLoad_, fileToLoad_, fmtLoadable_);
+ tb.setModel(trPostRubarFmtModel);
final BuScrollPane sc = new BuScrollPane(tb);
sc.setColumnHeaderView(null);
pn.add(sc, BuBorderLayout.CENTER);
+ JPanel pnButtons = new JPanel(new FlowLayout(FlowLayout.CENTER));
+ JButton btSelectAll = new JButton(TrLib.getString("Tout s\xE9lectionner"));
+ JButton btUnSelectAll = new JButton(TrLib.getString("Tout d\xE9s\xE9lectionner"));
+ pnButtons.add(btSelectAll);
+ pnButtons.add(btUnSelectAll);
+ btSelectAll.addActionListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ trPostRubarFmtModel.selectAll();
+ }
+ });
+ btUnSelectAll.addActionListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ trPostRubarFmtModel.unselectAll();
+ }
+ });
+ pn.add(pnButtons, BorderLayout.SOUTH);
+
if (CtuluDialogPanel.isOkResponse(pn.afficheModale(_f.getParentComponent()))) {
if (_inter == null) {
final CtuluTaskDelegate task = _f.createTask(TrResource.getS("Charger"));
@@ -985,12 +1013,10 @@
fmtToLoad_ = new FileFormat[fileLoadable.size()];
fileToLoad_ = new boolean[fileLoadable.size()];
+
fileLoadable.toArray(fmtToLoad_);
- if (selectedFile != null) {
- final int idx = CtuluLibArray.findObject(fmtToLoad_, selectedFile);
- if (idx >= 0) {
- fileToLoad_[idx] = true;
- }
+ for (int i = 0; i < fileToLoad_.length; i++) {
+ fileToLoad_[i] = true;
}
}
Modified: trunk/soft/fudaa-prepro/ui/src/main/resources/org/fudaa/fudaa/tr/common/tr_en.fr_txt
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/resources/org/fudaa/fudaa/tr/common/tr_en.fr_txt 2012-06-04 22:42:19 UTC (rev 7269)
+++ trunk/soft/fudaa-prepro/ui/src/main/resources/org/fudaa/fudaa/tr/common/tr_en.fr_txt 2012-06-04 22:42:49 UTC (rev 7270)
@@ -1207,4 +1207,6 @@
Fichier r\xE9sultat=Result file
Chemin complet=Absolute path
Variable\: {0}\n Point interpol\xE9\: {1}=Variable\: {0}\n Interpolated point \: {1}
-Pas de valeurs \xE0 \xE9diter pour un ouvrage unique=No data to edit when only one structure is defined
\ No newline at end of file
+Pas de valeurs \xE0 \xE9diter pour un ouvrage unique=No data to edit when only one structure is defined
+Tout s\xE9lectionner=Select All
+Tout d\xE9s\xE9lectionner=Unselect All
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|