* Bug #5016 fixed - condestsp could return different results when repeated calls were performed.
+* Bug #6615 fixed - ui(get|put)file did not center the file dialog on the last focused window.
+
* Bug #6689 & #6690 fixed - grand now works with complexes, polynomials, booleans, integers, sparses and strings,
and can take row vectors, matrices and hypermatrices of thoses types.
import javax.swing.border.TitledBorder;
import org.scilab.modules.graphic_export.FileExporter;
+import org.scilab.modules.gui.SwingView;
+import org.scilab.modules.gui.bridge.tab.SwingScilabTab;
import org.scilab.modules.gui.tab.SimpleTab;
import org.scilab.modules.gui.utils.ConfigManager;
import org.scilab.modules.localization.Messages;
public SwingScilabExportFileChooser(Integer figureUID) {
super();
this.figureUID = figureUID;
+ SwingScilabTab tab = (SwingScilabTab) SwingView.getFromId(figureUID);
+ setParentFrame(tab.getParentWindow());
exportCustomFileChooser(figureUID);
}
package org.scilab.modules.gui.bridge.filechooser;
+import java.awt.Component;
+import java.awt.KeyboardFocusManager;
import java.io.File;
import java.util.StringTokenizer;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
+import javax.swing.SwingUtilities;
import org.scilab.modules.gui.filechooser.FileChooserInfos;
import org.scilab.modules.gui.filechooser.SimpleFileChooser;
*/
@Override
public void displayAndWait() {
- JFrame parentFrame;
+ JFrame parentFrame = null;
if (parent == null) {
- parentFrame = new JFrame();
- parentFrame.setIconImage(new ImageIcon(ScilabSwingUtilities.findIcon("scilab", "256x256")).getImage());
+ Component focused = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
+ if (focused != null) {
+ parentFrame = (JFrame) SwingUtilities.getAncestorOfClass(JFrame.class, focused);
+ }
+ if (parentFrame == null) {
+ parentFrame = new JFrame();
+ }
} else {
parentFrame = parent;
}