Gui icons: fix browsevar, filebrowser, and missing icon 88/5688/6
Clément DAVID [Tue, 20 Dec 2011 08:05:34 +0000 (09:05 +0100)]
Change-Id: I199bb8ab4cabb45726e0f2f6ba995412f3dd5fa9

45 files changed:
scilab/modules/gui/Makefile.am
scilab/modules/gui/Makefile.in
scilab/modules/gui/images/icons/16x16/actions/edit-select-all.png [new file with mode: 0644]
scilab/modules/gui/images/icons/16x16/status/error.png [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/CallScilabBridge.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/colorchooser/SwingScilabColorChooser.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/filechooser/ExportOptionWindow.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/filechooser/SwingScilabFileChooser.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/fontchooser/SwingScilabFontChooser.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/messagebox/SwingScilabMessageBox.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/tab/SwingScilabTab.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/tree/ScilabTreeCellRenderer.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/waitbar/SwingScilabWaitBar.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/window/SwingScilabWindow.java
scilab/modules/gui/src/java/org/scilab/modules/gui/events/ZoomRubberBox.java
scilab/modules/gui/src/java/org/scilab/modules/gui/utils/HelpSearchField.java
scilab/modules/gui/src/java/org/scilab/modules/gui/utils/ScilabAboutBox.java
scilab/modules/gui/src/java/org/scilab/modules/gui/utils/ScilabSwingUtilities.java
scilab/modules/scinotes/src/java/org/scilab/modules/scinotes/SciNotes.java
scilab/modules/scinotes/src/java/org/scilab/modules/scinotes/SearchManager.java
scilab/modules/scinotes/src/java/org/scilab/modules/scinotes/actions/ConfigTabulationsAction.java
scilab/modules/scinotes/src/java/org/scilab/modules/scinotes/actions/FindAction.java
scilab/modules/scinotes/src/java/org/scilab/modules/scinotes/actions/IncrementalSearchAction.java
scilab/modules/scinotes/src/java/org/scilab/modules/scinotes/actions/OpenSourceFileOnKeywordAction.java
scilab/modules/scinotes/src/java/org/scilab/modules/scinotes/actions/RestoreOpenedFilesAction.java
scilab/modules/scinotes/src/java/org/scilab/modules/scinotes/actions/SearchWordInFilesAction.java
scilab/modules/scinotes/src/java/org/scilab/modules/scinotes/actions/SetAnchorAction.java
scilab/modules/scinotes/src/java/org/scilab/modules/scinotes/actions/SetColorsAction.java
scilab/modules/scinotes/src/java/org/scilab/modules/scinotes/utils/SearchFile.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/BrowseVar.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/filebrowser/FileUtils.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/filebrowser/ScilabFileBrowserHistory.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/filebrowser/ScilabFileSelectorFilter.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/variableeditor/actions/CreateNewVariableAction.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/variableeditor/actions/CreateVariableFromSelectionAction.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/variableeditor/actions/DuplicateVariableAction.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/variableeditor/actions/InsertColumnAction.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/variableeditor/actions/InsertRowAction.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/variableeditor/actions/RemoveColumnAction.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/variableeditor/actions/RemoveRowAction.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/variableeditor/actions/SetPrecisionLongAction.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/variableeditor/actions/SetPrecisionLongeAction.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/variableeditor/actions/SetPrecisionShortAction.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/variableeditor/actions/SetPrecisionShorteAction.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/variableeditor/actions/SizeColumnsToFitAction.java

index 515f563..23a1f03 100644 (file)
@@ -313,6 +313,7 @@ images/icons/16x16/actions/edit-find.png \
 images/icons/16x16/actions/edit-find-replace.png \
 images/icons/16x16/actions/edit-paste.png \
 images/icons/16x16/actions/edit-redo.png \
+images/icons/16x16/actions/edit-select-all.png \
 images/icons/16x16/actions/edit-undo.png \
 images/icons/16x16/actions/execute-all.png \
 images/icons/16x16/actions/filter.png \
@@ -362,6 +363,7 @@ images/icons/16x16/places/folder.png \
 images/icons/16x16/places/folder-saved-search.png \
 images/icons/16x16/places/scilab-folder.png \
 images/icons/16x16/places/user-home.png \
+images/icons/16x16/status/error.png \
 images/icons/16x16/status/folder-open.png \
 images/icons/16x16/status/line-found.png \
 images/icons/16x16/status/scilab-folder-open.png \
index 457024e..ce3ff85 100644 (file)
@@ -876,6 +876,7 @@ images/icons/16x16/actions/edit-find.png \
 images/icons/16x16/actions/edit-find-replace.png \
 images/icons/16x16/actions/edit-paste.png \
 images/icons/16x16/actions/edit-redo.png \
+images/icons/16x16/actions/edit-select-all.png \
 images/icons/16x16/actions/edit-undo.png \
 images/icons/16x16/actions/execute-all.png \
 images/icons/16x16/actions/filter.png \
@@ -925,6 +926,7 @@ images/icons/16x16/places/folder.png \
 images/icons/16x16/places/folder-saved-search.png \
 images/icons/16x16/places/scilab-folder.png \
 images/icons/16x16/places/user-home.png \
+images/icons/16x16/status/error.png \
 images/icons/16x16/status/folder-open.png \
 images/icons/16x16/status/line-found.png \
 images/icons/16x16/status/scilab-folder-open.png \
diff --git a/scilab/modules/gui/images/icons/16x16/actions/edit-select-all.png b/scilab/modules/gui/images/icons/16x16/actions/edit-select-all.png
new file mode 100644 (file)
index 0000000..f4b0b19
Binary files /dev/null and b/scilab/modules/gui/images/icons/16x16/actions/edit-select-all.png differ
diff --git a/scilab/modules/gui/images/icons/16x16/status/error.png b/scilab/modules/gui/images/icons/16x16/status/error.png
new file mode 100644 (file)
index 0000000..3bbbb4a
Binary files /dev/null and b/scilab/modules/gui/images/icons/16x16/status/error.png differ
index fe0ca50..46bf965 100644 (file)
@@ -108,6 +108,7 @@ import org.scilab.modules.gui.utils.PrinterHelper;
 import org.scilab.modules.gui.utils.ScilabAboutBox;
 import org.scilab.modules.gui.utils.ScilabPrint;
 import org.scilab.modules.gui.utils.ScilabRelief;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.gui.utils.Size;
 import org.scilab.modules.gui.utils.ToolBarBuilder;
 import org.scilab.modules.gui.utils.UIElementMapper;
@@ -601,8 +602,7 @@ public class CallScilabBridge {
         graphicTab.addMenuBar(menuBar);
         graphicTab.addToolBar(toolBar);
         graphicTab.addInfoBar(infoBar);
-        ((SwingScilabTab) graphicTab.getAsSimpleTab()).setWindowIcon(new ImageIcon(System.getenv("SCI")
-                                                                                   + "/modules/gui/images/icons/graphic-window.png").getImage());
+        ((SwingScilabTab) graphicTab.getAsSimpleTab()).setWindowIcon(new ImageIcon(ScilabSwingUtilities.findIcon("graphic-window")).getImage());
         newWindow.addTab(graphicTab);
 
         // link the tab and canvas with their figure
index 3880859..77f5754 100644 (file)
@@ -55,7 +55,7 @@ public class SwingScilabColorChooser extends JDialog implements SimpleColorChoos
          */
         public SwingScilabColorChooser(Color color) {
                 super(new JFrame(), "Color Chooser", true);
-                ((JFrame) getParent()).setIconImage(new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/scilab.png").getImage());
+        ((JFrame) getParent()).setIconImage(new ImageIcon(ScilabSwingUtilities.findIcon("scilab")).getImage());
 
                 getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
 
index 820189e..ab2e515 100644 (file)
@@ -35,6 +35,7 @@ import org.scilab.modules.graphic_export.FileExporter;
 import org.scilab.modules.gui.messagebox.ScilabModalDialog;
 import org.scilab.modules.gui.messagebox.ScilabModalDialog.IconType;
 import org.scilab.modules.gui.tab.Tab;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 
 /**
  * Window in which we can configure option for the selected format
@@ -71,7 +72,7 @@ public class ExportOptionWindow extends JDialog implements ActionListener {
         parentWindow = (Window) SwingUtilities.getAncestorOfClass(Window.class, (JComponent) tab.getAsSimpleTab());
         optionDialog = new JDialog(parentWindow);
         optionDialog.setTitle("Option for " + exportData.getExportExtension().toUpperCase() + " format");
-        optionDialog.setIconImage(new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/scilab.png").getImage());
+        optionDialog.setIconImage(new ImageIcon(ScilabSwingUtilities.findIcon("scilab")).getImage());
         //Center the frame
         optionDialog.setLocationRelativeTo(parentWindow);
     }
index d1c3a2f..c2160f5 100644 (file)
@@ -25,6 +25,7 @@ import org.scilab.modules.gui.filechooser.FileChooserInfos;
 import org.scilab.modules.gui.filechooser.SimpleFileChooser;
 import org.scilab.modules.gui.utils.ConfigManager;
 import org.scilab.modules.gui.utils.SciFileFilter;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.localization.Messages;
 
 /**
@@ -128,7 +129,7 @@ public class SwingScilabFileChooser extends JFileChooser implements SimpleFileCh
        @Override
     public void displayAndWait() {
                JFrame parentFrame = new JFrame();
-               parentFrame.setIconImage(new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/scilab.png").getImage());
+        parentFrame.setIconImage(new ImageIcon(ScilabSwingUtilities.findIcon("scilab")).getImage());
                int returnValue = 0;
                if (maskSize > 0) {
                         setFileFilter(getChoosableFileFilters()[maskSize]);
index b498e16..cd21962 100644 (file)
@@ -105,7 +105,7 @@ public class SwingScilabFontChooser extends JDialog implements SimpleFontChooser
         public SwingScilabFontChooser(JFrame owner, Font font, boolean calledFromScinotes) {
                 super(owner, Messages.gettext("Font Chooser"), true);
                 this.calledFromScinotes = calledFromScinotes;
-                ((JFrame) getParent()).setIconImage(new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/scilab.png").getImage());
+        ((JFrame) getParent()).setIconImage(new ImageIcon(ScilabSwingUtilities.findIcon("scilab")).getImage());
 
                 getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
 
index 49afd71..61212ab 100644 (file)
@@ -100,13 +100,14 @@ public class SwingScilabMessageBox extends JDialog implements SimpleMessageBox,
     /**
      * Icons
      */
-    private final Icon scilabIcon = new ImageIcon(SCIDIR + "/modules/gui/images/icons/scilab.png");
-    private final Icon passwdIcon = new ImageIcon(SCIDIR + "/modules/gui/images/icons/emblem-readonly.png");
-    private final Icon hourglassIcon = new ImageIcon(SCIDIR + "/modules/gui/images/icons/process-working.png");
+    private final Icon scilabIcon = new ImageIcon(ScilabSwingUtilities.findIcon("scilab"));
+    private final Icon passwdIcon = new ImageIcon(ScilabSwingUtilities.findIcon("emblem-readonly"));
+    private final Icon hourglassIcon = new ImageIcon(ScilabSwingUtilities.findIcon("process-working"));
 
     private int elementId;
 
-    private Icon messageIcon; //= new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/scilab.png");
+    private Icon messageIcon; // = new
+                              // ImageIcon(ScilabSwingUtilities.findIcon("scilab"));
 
     private int scilabDialogType = X_MESSAGE_TYPE;
 
index 118d679..1e0b934 100644 (file)
@@ -74,6 +74,7 @@ import org.scilab.modules.gui.utils.BarUpdater;
 import org.scilab.modules.gui.utils.Position;
 import org.scilab.modules.gui.utils.SciClosingAction;
 import org.scilab.modules.gui.utils.SciUndockingAction;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.gui.utils.Size;
 
 /**
@@ -86,7 +87,7 @@ import org.scilab.modules.gui.utils.Size;
  */
 public class SwingScilabTab extends View implements SimpleTab, FocusListener {
 
-    private static final Image SCILAB_ICON = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/scilab.png").getImage();
+    private static final Image SCILAB_ICON = new ImageIcon(ScilabSwingUtilities.findIcon("scilab")).getImage();
 
     private static final long serialVersionUID = 1L;
 
index a112665..4ad9bfb 100644 (file)
@@ -21,6 +21,8 @@ import javax.swing.ImageIcon;
 import javax.swing.JTree;
 import javax.swing.tree.DefaultTreeCellRenderer;
 
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
+
 /**
  * Class define the Scilab tree renderer
  * @author Sylvestre Koumar
@@ -34,20 +36,17 @@ public class ScilabTreeCellRenderer extends DefaultTreeCellRenderer {
      * Images
      */
     public static Toolkit toolkit = Toolkit.getDefaultToolkit();
-    public static Image plus = toolkit.getImage(System.getenv("SCI") + "/modules/gui/images/icons/list-add.png");
-    public static Image minus = toolkit.getImage(System.getenv("SCI") + "/modules/gui/images/icons/list-remove.png");
-    public static Image scilab = toolkit.getImage(System.getenv("SCI") + "/modules/gui/images/icons/scilab.png");
-    public static Image puff = toolkit.getImage(System.getenv("SCI") + "/modules/gui/images/icons/puff.png");
+    public static Image plus = toolkit.getImage(ScilabSwingUtilities.findIcon("list-add"));
+    public static Image minus = toolkit.getImage(ScilabSwingUtilities.findIcon("list-remove"));
+    public static Image scilab = toolkit.getImage(ScilabSwingUtilities.findIcon("scilab"));
 
     public static Image myNewPlus = plus.getScaledInstance(IMAGE_SIZE, IMAGE_SIZE, Image.SCALE_DEFAULT);
     public static Image myNewMinus = minus.getScaledInstance(IMAGE_SIZE, IMAGE_SIZE, Image.SCALE_DEFAULT);
     public static Image myNewScilab = scilab.getScaledInstance(IMAGE_SIZE, IMAGE_SIZE, Image.SCALE_DEFAULT);
-    public static Image myNewPuff = puff.getScaledInstance(IMAGE_SIZE, IMAGE_SIZE, Image.SCALE_DEFAULT);
 
     public static Icon iconPlus = new ImageIcon(myNewPlus);
     public static Icon iconMinus = new ImageIcon(myNewMinus);        
     public static Icon iconScilab = new ImageIcon(myNewScilab);
-    public static Icon iconPuff = new ImageIcon(myNewPuff);
 
     public static Image defaut = toolkit.getImage("");
     public static Image myNewDefaut = defaut.getScaledInstance(IMAGE_SIZE, IMAGE_SIZE, Image.SCALE_DEFAULT);
index a4fed7e..b09e682 100644 (file)
@@ -21,6 +21,7 @@ import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.JProgressBar;
 
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.gui.waitbar.SimpleWaitBar;
 
 /**
@@ -42,7 +43,7 @@ public class SwingScilabWaitBar extends JFrame implements SimpleWaitBar {
        
        private final JLabel messageLabel;
 
-       private final ImageIcon scilabIcon = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/scilab.png");
+    private final ImageIcon scilabIcon = new ImageIcon(ScilabSwingUtilities.findIcon("scilab"));
        
        /**
         * Default constructor
index c5a48fe..e09987f 100644 (file)
@@ -111,7 +111,7 @@ public class SwingScilabWindow extends JFrame implements SimpleWindow {
         // TODO : Only for testing : Must be removed
         this.setDims(new Size(DEFAULTWIDTH, DEFAULTHEIGHT));
         this.setTitle("Scilab");
-        setIconImage(new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/scilab.png").getImage());
+        setIconImage(new ImageIcon(ScilabSwingUtilities.findIcon("scilab")).getImage());
 
         /* defining the Layout */
         super.setLayout(new java.awt.BorderLayout());
index 2b9bb7e..caab723 100644 (file)
@@ -31,7 +31,7 @@ import org.scilab.modules.renderer.figureDrawing.DrawableFigureGL;
  */
 public class ZoomRubberBox extends ClickRubberBox implements FocusListener {
 
-       private static final String ICON_PATH = System.getenv("SCI") + "/modules/gui/images/icons/zoom-area-cursor.png";
+    private static final String ICON_PATH = ScilabSwingUtilities.findIcon("zoom-area-cursor");
        private static final String CURSOR_ICON_NAME = "zoom-area";
        
        private DrawableFigureGL zoomedFigure;
index 1292edf..c363872 100644 (file)
@@ -52,8 +52,8 @@ public class HelpSearchField extends JPanel implements FocusListener, KeyListene
     private static final String TAB = "tab";
     private static final String F3 = "f3";
     private static final ImageIcon CLOSEICON = new ImageIcon(SCI + "/modules/gui/images/icons/close-tab.png");
-    private static final ImageIcon TOPICON = new ImageIcon(SCI + "/modules/gui/images/icons/16x16/actions/go-top.png");
-    private static final ImageIcon BOTICON = new ImageIcon(SCI + "/modules/gui/images/icons/16x16/actions/go-bottom.png");
+    private static final ImageIcon TOPICON = new ImageIcon(ScilabSwingUtilities.findIcon("go-top"));
+    private static final ImageIcon BOTICON = new ImageIcon(ScilabSwingUtilities.findIcon("go-bottom"));
     private static final int BUTTONSIZE = 28;
 
     private String text;
index f8e3aab..ae22cb1 100644 (file)
@@ -34,7 +34,7 @@ import org.scilab.modules.localization.Messages;
 
 public class ScilabAboutBox {
 
-        private static Icon scilabIcon = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/scilab.png");
+    private static Icon scilabIcon = new ImageIcon(ScilabSwingUtilities.findIcon("scilab"));
         private static Image imageForIcon = ((ImageIcon) scilabIcon).getImage();
         /**
          * Constructor
index 4044a86..1d43958 100644 (file)
@@ -249,6 +249,7 @@ public final class ScilabSwingUtilities {
         final String fallback = lookupFallbackIcon(icon);
         if (fallback == null) {
             System.err.println("Unable to found icon: " + icon + '[' + size + ']');
+            return System.getenv("SCI") + "/modules/gui/images/icons/16x16/status/error.png";
         }
         return fallback;
     }
index 5b54d2e..e9ae6ae 100644 (file)
@@ -71,6 +71,7 @@ import org.scilab.modules.gui.utils.ClosingOperationsManager;
 import org.scilab.modules.gui.utils.ConfigManager;
 import org.scilab.modules.gui.utils.Position;
 import org.scilab.modules.gui.utils.SciFileFilter;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.gui.utils.Size;
 import org.scilab.modules.gui.utils.WindowsConfigurationManager;
 import org.scilab.modules.gui.window.ScilabWindow;
@@ -223,7 +224,7 @@ public class SciNotes extends SwingScilabTab implements Tab {
 
     public void setParentWindow() {
         this.parentWindow = ScilabWindow.createWindow();
-        setWindowIcon(new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/32x32/apps/accessories-text-editor.png").getImage());
+        setWindowIcon(new ImageIcon(ScilabSwingUtilities.findIcon("accessories-text-editor", "32x32")).getImage());
         SwingScilabWindow window = (SwingScilabWindow) parentWindow.getAsSimpleWindow();
         Position pos = ConfigSciNotesManager.getMainWindowPosition();
         window.setLocation(pos.getX(), pos.getY());
@@ -585,7 +586,7 @@ public class SciNotes extends SwingScilabTab implements Tab {
             if (getTabPane().getTabCount() != 1 || getTextPane(0).getName() != null) {
                 openFile(null, 0, null);
             }
-            setWindowIcon(new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/32x32/apps/accessories-text-editor.png").getImage());
+            setWindowIcon(new ImageIcon(ScilabSwingUtilities.findIcon("accessories-text-editor", "32x32")).getImage());
             WindowsConfigurationManager.restorationFinished(this);
 
             return;
@@ -607,7 +608,7 @@ public class SciNotes extends SwingScilabTab implements Tab {
                         }
                     }
 
-                    setWindowIcon(new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/32x32/apps/accessories-text-editor.png").getImage());
+                setWindowIcon(new ImageIcon(ScilabSwingUtilities.findIcon("accessories-text-editor", "32x32")).getImage());
 
                     if (navigator != null) {
                         navigator.updateTree();
index fed3564..65bafd6 100644 (file)
@@ -32,6 +32,7 @@ import javax.swing.text.BadLocationException;
 import javax.swing.text.Document;
 import javax.swing.tree.DefaultMutableTreeNode;
 
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.scinotes.utils.SciNotesMessages;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
@@ -43,10 +44,10 @@ import org.w3c.dom.NodeList;
  */
 public class SearchManager {
 
-    private static final ImageIcon FILEIMAGE = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/search/file.png");
-    private static final ImageIcon SCILABFILEIMAGE = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/search/scilab-file.png");
-    private static final ImageIcon FOLDERIMAGE = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/search/folder.png");
-    private static final ImageIcon LINEICON = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/search/line-found.png");
+    private static final ImageIcon FILEIMAGE = new ImageIcon(ScilabSwingUtilities.findIcon("stock_search"));
+    private static final ImageIcon SCILABFILEIMAGE = new ImageIcon(ScilabSwingUtilities.findIcon("scilab_search"));
+    private static final ImageIcon FOLDERIMAGE = new ImageIcon(ScilabSwingUtilities.findIcon("folder-saved-search"));
+    private static final ImageIcon LINEICON = new ImageIcon(ScilabSwingUtilities.findIcon("line-found"));
 
     /**
      * FIND AND REPLACE START
index cace80b..2557b95 100644 (file)
@@ -40,6 +40,7 @@ import javax.swing.SpinnerNumberModel;
 
 import org.scilab.modules.commons.ScilabConstants;
 import org.scilab.modules.gui.menuitem.MenuItem;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.scinotes.IndentManager;
 import org.scilab.modules.scinotes.SciNotes;
 import org.scilab.modules.scinotes.ScilabDocument;
@@ -123,7 +124,7 @@ public class ConfigTabulationsAction extends DefaultAction {
         TabManager.Tabulation tabProps = ConfigSciNotesManager.getDefaultTabulation();
 
         mainFrame = new JFrame();
-        mainFrame.setIconImage(new ImageIcon(SCI + "/modules/gui/images/icons/scilab.png").getImage());
+        mainFrame.setIconImage(new ImageIcon(ScilabSwingUtilities.findIcon("scilab")).getImage());
         mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         mainFrame.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE , 0), ESCAPE);
         mainFrame.getRootPane().getActionMap().put(ESCAPE, new AbstractAction() {
index 112e244..5c4d008 100644 (file)
@@ -63,6 +63,7 @@ import javax.swing.text.Highlighter;
 import org.scilab.modules.gui.bridge.textbox.SwingScilabTextBox;
 import org.scilab.modules.gui.menuitem.MenuItem;
 import org.scilab.modules.gui.pushbutton.PushButton;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.scinotes.SciNotes;
 import org.scilab.modules.scinotes.ScilabDocument;
 import org.scilab.modules.scinotes.SearchManager;
@@ -291,7 +292,7 @@ public final class FindAction extends DefaultAction implements WindowFocusListen
                 }
             });
 
-        frame.setIconImage(new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/scilab.png").getImage());
+        frame.setIconImage(new ImageIcon(ScilabSwingUtilities.findIcon("scilab")).getImage());
         frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
         frame.setTitle(SciNotesMessages.FIND_REPLACE);
         frame.setResizable(false);
index 511d63f..55534a5 100644 (file)
@@ -40,6 +40,7 @@ import javax.swing.KeyStroke;
 import org.scilab.modules.commons.ScilabConstants;
 import org.scilab.modules.gui.menuitem.MenuItem;
 import org.scilab.modules.gui.pushbutton.PushButton;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.scinotes.SciNotes;
 import org.scilab.modules.scinotes.ScilabDocument;
 import org.scilab.modules.scinotes.ScilabEditorPane;
@@ -55,8 +56,8 @@ public final class IncrementalSearchAction extends DefaultAction {
     private static final String SCI = ScilabConstants.SCI.getPath();
     private static final String TAB = "tab";
     private static final ImageIcon CLOSEICON = new ImageIcon(SCI + "/modules/gui/images/icons/close-tab.png");
-    private static final ImageIcon TOPICON = new ImageIcon(SCI + "/modules/gui/images/icons/16x16/actions/go-top.png");
-    private static final ImageIcon BOTICON = new ImageIcon(SCI + "/modules/gui/images/icons/16x16/actions/go-bottom.png");
+    private static final ImageIcon TOPICON = new ImageIcon(ScilabSwingUtilities.findIcon("go-top"));
+    private static final ImageIcon BOTICON = new ImageIcon(ScilabSwingUtilities.findIcon("go-bottom"));
     private static final int BUTTONSIZE = 28;
 
     private static Map<SciNotes, SearchField> fields = new HashMap<SciNotes, SearchField>();
index b723a39..00924db 100644 (file)
@@ -38,6 +38,7 @@ import javax.swing.text.JTextComponent;
 
 import org.scilab.modules.action_binding.InterpreterManagement;
 import org.scilab.modules.gui.menuitem.MenuItem;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.scinotes.KeywordEvent;
 import org.scilab.modules.scinotes.SciNotes;
 import org.scilab.modules.scinotes.ScilabDocument;
@@ -164,7 +165,7 @@ public class OpenSourceFileOnKeywordAction extends DefaultAction {
 
         mainFrame = new JFrame();
         mainFrame.setAlwaysOnTop(true);
-        mainFrame.setIconImage(new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/scilab.png").getImage());
+        mainFrame.setIconImage(new ImageIcon(ScilabSwingUtilities.findIcon("scilab")).getImage());
         mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 
         windowAlreadyExist = true;
index 611ddbb..fc07a9d 100644 (file)
@@ -58,6 +58,7 @@ import javax.swing.tree.TreeNode;
 import javax.swing.tree.TreePath;
 
 import org.scilab.modules.gui.checkboxmenuitem.CheckBoxMenuItem;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.scinotes.SciNotes;
 import org.scilab.modules.scinotes.ScilabEditorPane;
 import org.scilab.modules.scinotes.utils.ConfigSciNotesManager;
@@ -72,7 +73,7 @@ public class RestoreOpenedFilesAction extends DefaultCheckAction {
 
     private static final int GAP = 10;
     private static final String ESCAPE = "ESCAPE";
-    private static final Icon SCILAB_ICON = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/scilab.png");
+    private static final Icon SCILAB_ICON = new ImageIcon(ScilabSwingUtilities.findIcon("scilab"));
     private static List<File> selectedFiles;
 
     /**
index a50891b..157d8e1 100644 (file)
@@ -56,6 +56,7 @@ import org.scilab.modules.gui.bridge.filechooser.SwingScilabFileChooser;
 import org.scilab.modules.gui.bridge.window.SwingScilabWindow;
 import org.scilab.modules.gui.filechooser.ScilabFileChooser;
 import org.scilab.modules.gui.menuitem.MenuItem;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.scinotes.SciNotes;
 import org.scilab.modules.scinotes.utils.ConfigSciNotesManager;
 import org.scilab.modules.scinotes.utils.SciNotesMessages;
@@ -225,7 +226,7 @@ public class SearchWordInFilesAction extends DefaultAction implements WindowFocu
                 }
             });
         mainFrame.setTitle(SciNotesMessages.SEARCHINFILES);
-        mainFrame.setIconImage(new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/32x32/apps/system-search.png").getImage());
+        mainFrame.setIconImage(new ImageIcon(ScilabSwingUtilities.findIcon("system-search", "32x32")).getImage());
 
         getEditor().getSwingParentWindow().addWindowFocusListener(this);
         mainFrame.addWindowFocusListener(this);
index 6e6a695..248c6e7 100644 (file)
@@ -31,6 +31,7 @@ import javax.swing.KeyStroke;
 import javax.swing.text.Element;
 
 import org.scilab.modules.gui.menuitem.MenuItem;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.scinotes.SciNotes;
 import org.scilab.modules.scinotes.ScilabDocument;
 import org.scilab.modules.scinotes.ScilabEditorPane;
@@ -85,7 +86,7 @@ public class SetAnchorAction extends DefaultAction {
 
         dialog = new JDialog();
         dialog.setModalityType(ModalityType.APPLICATION_MODAL);
-        dialog.setIconImage(new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/scilab.png").getImage());
+        dialog.setIconImage(new ImageIcon(ScilabSwingUtilities.findIcon("scilab")).getImage());
         JLabel label = new JLabel(SciNotesMessages.ANCHOR_NAME);
 
         cancelButton = new JButton(SciNotesMessages.CANCEL);
index 628cbd7..1af2c81 100644 (file)
@@ -52,6 +52,7 @@ import javax.swing.text.DefaultCaret;
 import org.scilab.modules.gui.bridge.colorchooser.SwingScilabColorChooser;
 import org.scilab.modules.gui.bridge.window.SwingScilabWindow;
 import org.scilab.modules.gui.menuitem.MenuItem;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.scinotes.KeywordAdaptater;
 import org.scilab.modules.scinotes.KeywordEvent;
 import org.scilab.modules.scinotes.SciNotes;
@@ -153,7 +154,7 @@ public final class SetColorsAction extends DefaultAction {
 
         /* Main frame = Window */
         dialog = new JDialog((SwingScilabWindow) SwingUtilities.getAncestorOfClass(SwingScilabWindow.class, getEditor().getTabPane()), true);
-        dialog.setIconImage(new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/scilab.png").getImage());
+        dialog.setIconImage(new ImageIcon(ScilabSwingUtilities.findIcon("scilab")).getImage());
         dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
         dialog.setTitle(SciNotesMessages.SET_COLORS);
 
index 7072389..22f6a2a 100644 (file)
@@ -62,6 +62,7 @@ import org.scilab.modules.gui.textbox.ScilabTextBox;
 import org.scilab.modules.gui.textbox.TextBox;
 import org.scilab.modules.gui.toolbar.ToolBar;
 import org.scilab.modules.gui.utils.ClosingOperationsManager;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.gui.utils.WindowsConfigurationManager;
 import org.scilab.modules.gui.window.ScilabWindow;
 import org.scilab.modules.gui.window.Window;
@@ -310,7 +311,7 @@ public class SearchFile extends SwingScilabTab implements Tab {
      */
     private void initTab() {
         final TextBox infobar = ScilabTextBox.createTextBox();
-        setWindowIcon(new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/32x32/apps/system-search.png").getImage());
+        setWindowIcon(new ImageIcon(ScilabSwingUtilities.findIcon("system-search", "32x32")).getImage());
         updateUI();
 
         CallBack callback = new CallBack(null) {
index c3c1528..696e24e 100644 (file)
@@ -14,6 +14,7 @@ package org.scilab.modules.ui_data;
 
 import javax.swing.ImageIcon;
 
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.localization.Messages;
 import org.scilab.modules.types.ScilabTypeEnumDescription;
 import org.scilab.modules.ui_data.variablebrowser.ScilabVariableBrowser;
@@ -44,22 +45,20 @@ public class BrowseVar {
                                                             Messages.gettext("Type int value")
     };
 
-    private static final String ICON_PATH = System.getenv("SCI") + "/modules/ui_data/images/icons/";
-
-    private static final ImageIcon NO_ICON = new ImageIcon(ICON_PATH + "noicon.png");
-    private static final ImageIcon DOUBLE_ICON = new ImageIcon(ICON_PATH + "double.png");
-    private static final ImageIcon POLYNOMIAL_ICON = new ImageIcon(ICON_PATH + "polynomial.png");
-    private static final ImageIcon BOOLEAN_ICON = new ImageIcon(ICON_PATH + "boolean.png");
-    private static final ImageIcon SPARSE_ICON = new ImageIcon(ICON_PATH + "sparse.png");
-    private static final ImageIcon INT_ICON = new ImageIcon(ICON_PATH + "int.png");
-    private static final ImageIcon HANDLE_ICON = new ImageIcon(ICON_PATH + "handle.png");
-    private static final ImageIcon STRING_ICON = new ImageIcon(ICON_PATH + "string.png");
-    private static final ImageIcon FUNCTION_ICON = new ImageIcon(ICON_PATH + "function.png");
-    private static final ImageIcon LIST_ICON = new ImageIcon(ICON_PATH + "list.png");
-    private static final ImageIcon TLIST_ICON = new ImageIcon(ICON_PATH + "tlist.png");
-    private static final ImageIcon MLIST_ICON = new ImageIcon(ICON_PATH + "mlist.png");
-    private static final ImageIcon USER_ICON = new ImageIcon(ICON_PATH + "user.png");
-    private static final ImageIcon FPTR_ICON = new ImageIcon(ICON_PATH + "fptr.png");
+    private static final ImageIcon NO_ICON = new ImageIcon(ScilabSwingUtilities.findIcon("noicon"));
+    private static final ImageIcon DOUBLE_ICON = new ImageIcon(ScilabSwingUtilities.findIcon("double"));
+    private static final ImageIcon POLYNOMIAL_ICON = new ImageIcon(ScilabSwingUtilities.findIcon("polynomial"));
+    private static final ImageIcon BOOLEAN_ICON = new ImageIcon(ScilabSwingUtilities.findIcon("boolean"));
+    private static final ImageIcon SPARSE_ICON = new ImageIcon(ScilabSwingUtilities.findIcon("sparse"));
+    private static final ImageIcon INT_ICON = new ImageIcon(ScilabSwingUtilities.findIcon("int"));
+    private static final ImageIcon HANDLE_ICON = new ImageIcon(ScilabSwingUtilities.findIcon("handle"));
+    private static final ImageIcon STRING_ICON = new ImageIcon(ScilabSwingUtilities.findIcon("string"));
+    private static final ImageIcon FUNCTION_ICON = new ImageIcon(ScilabSwingUtilities.findIcon("function"));
+    private static final ImageIcon LIST_ICON = new ImageIcon(ScilabSwingUtilities.findIcon("list"));
+    private static final ImageIcon TLIST_ICON = new ImageIcon(ScilabSwingUtilities.findIcon("tlist"));
+    private static final ImageIcon MLIST_ICON = new ImageIcon(ScilabSwingUtilities.findIcon("mlist"));
+    private static final ImageIcon USER_ICON = new ImageIcon(ScilabSwingUtilities.findIcon("user"));
+    private static final ImageIcon FPTR_ICON = new ImageIcon(ScilabSwingUtilities.findIcon("fptr"));
 
     /**
      * Default private constructor for utility class
index 88fdcbf..e6c3580 100644 (file)
@@ -22,28 +22,30 @@ import java.util.Map;
 import javax.swing.Icon;
 import javax.swing.ImageIcon;
 
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
+
 /**
  * Few file tools
  * @author Calixte DENIZET
  */
 public final class FileUtils {
 
-    private static final Icon SCILABICON = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/filebrowser/icon_scilab.png");
-    private static final Icon PDFICON = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/filebrowser/application-pdf.png");
-    private static final Icon BINARYICON = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/filebrowser/binary.png");
-    private static final Icon IMAGEICON = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/filebrowser/image-x-generic.png");
-    private static final Icon TEXTICON = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/filebrowser/text-x-generic.png");
-    private static final Icon HTMLICON = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/filebrowser/text-html.png");
-    private static final Icon XMLICON = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/filebrowser/text-xml.png");
-    private static final Icon CSVICON = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/filebrowser/text-csv.png");
-    private static final Icon DIRICON = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/filebrowser/folder.png");
-    private static final Icon OPENDIRICON = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/filebrowser/folder-open.png");
-    private static final Icon READONLYICON = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/filebrowser/emblem-readonly.png");
-    private static final Icon CLOSEDUSERHOMEICON = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/filebrowser/user-home.png");
-    private static final Icon OPENUSERHOMEICON = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/filebrowser/open-user-home.png");
-    private static final Icon UPICON = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/filebrowser/dynamic-blue-up.png");
-    private static final Icon SCIICON = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/filebrowser/scilab-folder.png");
-    private static final Icon OPENSCIICON = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/filebrowser/open-scilab-folder.png");
+    private static final Icon SCILABICON = new ImageIcon(ScilabSwingUtilities.findIcon("scilab"));
+    private static final Icon PDFICON = new ImageIcon(ScilabSwingUtilities.findIcon("application-pdf"));
+    private static final Icon BINARYICON = new ImageIcon(ScilabSwingUtilities.findIcon("binary"));
+    private static final Icon IMAGEICON = new ImageIcon(ScilabSwingUtilities.findIcon("image-x-generic"));
+    private static final Icon TEXTICON = new ImageIcon(ScilabSwingUtilities.findIcon("text-x-generic"));
+    private static final Icon HTMLICON = new ImageIcon(ScilabSwingUtilities.findIcon("text-html"));
+    private static final Icon XMLICON = new ImageIcon(ScilabSwingUtilities.findIcon("text-xml"));
+    private static final Icon CSVICON = new ImageIcon(ScilabSwingUtilities.findIcon("text-csv"));
+    private static final Icon DIRICON = new ImageIcon(ScilabSwingUtilities.findIcon("folder"));
+    private static final Icon OPENDIRICON = new ImageIcon(ScilabSwingUtilities.findIcon("folder-open"));
+    private static final Icon READONLYICON = new ImageIcon(ScilabSwingUtilities.findIcon("emblem-readonly"));
+    private static final Icon CLOSEDUSERHOMEICON = new ImageIcon(ScilabSwingUtilities.findIcon("user-home"));
+    private static final Icon OPENUSERHOMEICON = new ImageIcon(ScilabSwingUtilities.findIcon("user-home-open"));
+    private static final Icon UPICON = new ImageIcon(ScilabSwingUtilities.findIcon("dynamic-blue-up"));
+    private static final Icon SCIICON = new ImageIcon(ScilabSwingUtilities.findIcon("scilab-folder"));
+    private static final Icon OPENSCIICON = new ImageIcon(ScilabSwingUtilities.findIcon("scilab-folder-open"));
 
     private static final int CHARTOREAD = 128;
 
index ed0cdc2..492c2fa 100644 (file)
@@ -29,6 +29,7 @@ import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.events.callback.CallBack;
 import org.scilab.modules.gui.pushbutton.PushButton;
 import org.scilab.modules.gui.pushbutton.ScilabPushButton;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 
 /**
  * The File Browser history
@@ -36,8 +37,8 @@ import org.scilab.modules.gui.pushbutton.ScilabPushButton;
  */
 public class ScilabFileBrowserHistory {
 
-    private static final String PREVIOUSICON = System.getenv("SCI") + "/modules/gui/images/icons/16x16/filebrowser/go-previous.png";
-    private static final String NEXTICON = System.getenv("SCI") + "/modules/gui/images/icons/16x16/filebrowser/go-next.png";
+    private static final String PREVIOUSICON = ScilabSwingUtilities.findIcon("go-previous");
+    private static final String NEXTICON = ScilabSwingUtilities.findIcon("go-next");
 
     private final SwingScilabTreeTable stt;
     private final List<String> history = new ArrayList<String>();
index 37457de..fbecf81 100644 (file)
@@ -39,6 +39,7 @@ import javax.swing.text.DefaultEditorKit;
 
 import org.scilab.modules.core.Scilab;
 import org.scilab.modules.gui.events.callback.CallBack;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.ui_data.utils.UiDataMessages;
 
 /**
@@ -49,7 +50,7 @@ public class ScilabFileSelectorFilter extends JPanel {
 
     private static boolean isWindows = Scilab.isWindowsPlateform();
     private static final int GAP = 3;
-    private static final Icon VALIDATE = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/filebrowser/filter.png");
+    private static final Icon VALIDATE = new ImageIcon(ScilabSwingUtilities.findIcon("filter"));
 
     private MyJTextField textfield;
     private final SwingScilabTreeTable stt;
index bf3685e..31b4807 100644 (file)
@@ -39,6 +39,7 @@ import org.scilab.modules.gui.menuitem.MenuItem;
 import org.scilab.modules.gui.menuitem.ScilabMenuItem;
 import org.scilab.modules.gui.pushbutton.PushButton;
 import org.scilab.modules.gui.pushbutton.ScilabPushButton;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.ui_data.UI_data;
 import org.scilab.modules.ui_data.datatable.SwingEditvarTableModel;
 import org.scilab.modules.ui_data.utils.UiDataMessages;
@@ -117,7 +118,7 @@ public final class CreateNewVariableAction extends CallBack {
         final Object[] ret = new Object[]{ "", new Integer(0), new Integer(0), "" };
         dialog.setModalityType(ModalityType.APPLICATION_MODAL);
         dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
-        dialog.setIconImage(new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/32x32/apps/rrze_table.png").getImage());
+        dialog.setIconImage(new ImageIcon(ScilabSwingUtilities.findIcon("rrze_table", "32x32")).getImage());
 
         JPanel panel = new JPanel(new GridBagLayout());
         GridBagConstraints gbc = new GridBagConstraints();
@@ -250,7 +251,7 @@ public final class CreateNewVariableAction extends CallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new CreateNewVariableAction(editor, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/actions/variable-new.png");
+        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("variable-new"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index 031d543..b5064c3 100644 (file)
@@ -39,6 +39,7 @@ import org.scilab.modules.gui.menuitem.MenuItem;
 import org.scilab.modules.gui.menuitem.ScilabMenuItem;
 import org.scilab.modules.gui.pushbutton.PushButton;
 import org.scilab.modules.gui.pushbutton.ScilabPushButton;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.ui_data.UI_data;
 import org.scilab.modules.ui_data.datatable.SwingEditvarTableModel;
 import org.scilab.modules.ui_data.utils.UiDataMessages;
@@ -100,7 +101,7 @@ public final class CreateVariableFromSelectionAction extends CallBack {
         final String[] ret = new String[]{ "" };
         dialog.setModalityType(ModalityType.APPLICATION_MODAL);
         dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
-        dialog.setIconImage(new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/32x32/apps/rrze_table.png").getImage());
+        dialog.setIconImage(new ImageIcon(ScilabSwingUtilities.findIcon("rrze_table")).getImage());
 
         JPanel panel = new JPanel(new GridBagLayout());
         GridBagConstraints gbc = new GridBagConstraints();
@@ -188,7 +189,7 @@ public final class CreateVariableFromSelectionAction extends CallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new CreateVariableFromSelectionAction(editor, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/actions/variable-from-selection.png");
+        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("variable-from-selection"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index f7e6c73..d925f6f 100644 (file)
@@ -36,6 +36,7 @@ import org.scilab.modules.gui.bridge.menuitem.SwingScilabMenuItem;
 import org.scilab.modules.gui.events.callback.CallBack;
 import org.scilab.modules.gui.menuitem.MenuItem;
 import org.scilab.modules.gui.menuitem.ScilabMenuItem;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.ui_data.UI_data;
 import org.scilab.modules.ui_data.datatable.SwingEditvarTableModel;
 import org.scilab.modules.ui_data.utils.UiDataMessages;
@@ -90,7 +91,7 @@ public final class DuplicateVariableAction extends CallBack {
         final String[] ret = new String[]{ "" };
         dialog.setModalityType(ModalityType.APPLICATION_MODAL);
         dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
-        dialog.setIconImage(new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/32x32/apps/rrze_table.png").getImage());
+        dialog.setIconImage(new ImageIcon(ScilabSwingUtilities.findIcon("rrze_table")).getImage());
 
         JPanel panel = new JPanel(new GridBagLayout());
         GridBagConstraints gbc = new GridBagConstraints();
index 8195d6a..b6dacae 100644 (file)
@@ -20,6 +20,7 @@ import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.events.callback.CallBack;
 import org.scilab.modules.gui.pushbutton.PushButton;
 import org.scilab.modules.gui.pushbutton.ScilabPushButton;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.ui_data.datatable.SwingEditvarTableModel;
 import org.scilab.modules.ui_data.variableeditor.TableVariableEditor;
 
@@ -66,7 +67,7 @@ public final class InsertColumnAction extends CallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new InsertColumnAction(table, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/actions/short.png");
+        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("short"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index 451e734..fcae136 100644 (file)
@@ -20,6 +20,7 @@ import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.events.callback.CallBack;
 import org.scilab.modules.gui.pushbutton.PushButton;
 import org.scilab.modules.gui.pushbutton.ScilabPushButton;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.ui_data.datatable.SwingEditvarTableModel;
 import org.scilab.modules.ui_data.variableeditor.TableVariableEditor;
 
@@ -62,7 +63,7 @@ public final class InsertRowAction extends CallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new InsertRowAction(table, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/actions/short.png");
+        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("short"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index 955b23f..10af33a 100644 (file)
@@ -20,6 +20,7 @@ import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.events.callback.CallBack;
 import org.scilab.modules.gui.pushbutton.PushButton;
 import org.scilab.modules.gui.pushbutton.ScilabPushButton;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.ui_data.datatable.SwingEditvarTableModel;
 import org.scilab.modules.ui_data.variableeditor.TableVariableEditor;
 
@@ -65,7 +66,7 @@ public final class RemoveColumnAction extends CallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new RemoveColumnAction(table, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/actions/short.png");
+        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("short"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index b4f2fcc..d166ce7 100644 (file)
@@ -20,6 +20,7 @@ import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.events.callback.CallBack;
 import org.scilab.modules.gui.pushbutton.PushButton;
 import org.scilab.modules.gui.pushbutton.ScilabPushButton;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.ui_data.datatable.SwingEditvarTableModel;
 import org.scilab.modules.ui_data.variableeditor.TableVariableEditor;
 
@@ -65,7 +66,7 @@ public final class RemoveRowAction extends CallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new RemoveRowAction(table, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/actions/short.png");
+        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("short"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index 650e8f5..21a2cb3 100644 (file)
@@ -21,6 +21,7 @@ import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.events.callback.CallBack;
 import org.scilab.modules.gui.pushbutton.PushButton;
 import org.scilab.modules.gui.pushbutton.ScilabPushButton;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.ui_data.variableeditor.SwingScilabVariableEditor;
 import org.scilab.modules.ui_data.variableeditor.renderers.ScilabComplexRenderer;
 
@@ -75,7 +76,7 @@ public final class SetPrecisionLongAction extends CallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new SetPrecisionLongAction(editor, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/actions/long.png");
+        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("long"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index dcdb8e9..9f2c543 100644 (file)
@@ -21,6 +21,7 @@ import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.events.callback.CallBack;
 import org.scilab.modules.gui.pushbutton.PushButton;
 import org.scilab.modules.gui.pushbutton.ScilabPushButton;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.ui_data.variableeditor.SwingScilabVariableEditor;
 import org.scilab.modules.ui_data.variableeditor.renderers.ScilabComplexRenderer;
 
@@ -75,7 +76,7 @@ public final class SetPrecisionLongeAction extends CallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new SetPrecisionLongeAction(editor, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/actions/longe.png");
+        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("longe"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index 3a6a95d..17cd51f 100644 (file)
@@ -21,6 +21,7 @@ import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.events.callback.CallBack;
 import org.scilab.modules.gui.pushbutton.PushButton;
 import org.scilab.modules.gui.pushbutton.ScilabPushButton;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.ui_data.variableeditor.SwingScilabVariableEditor;
 import org.scilab.modules.ui_data.variableeditor.renderers.ScilabComplexRenderer;
 
@@ -73,7 +74,7 @@ public final class SetPrecisionShortAction extends CallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new SetPrecisionShortAction(editor, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/actions/short.png");
+        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("short"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index a1bae12..6af2b06 100644 (file)
@@ -21,6 +21,7 @@ import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.events.callback.CallBack;
 import org.scilab.modules.gui.pushbutton.PushButton;
 import org.scilab.modules.gui.pushbutton.ScilabPushButton;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.ui_data.variableeditor.SwingScilabVariableEditor;
 import org.scilab.modules.ui_data.variableeditor.renderers.ScilabComplexRenderer;
 
@@ -75,7 +76,7 @@ public final class SetPrecisionShorteAction extends CallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new SetPrecisionShorteAction(editor, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/actions/shorte.png");
+        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("shorte"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index fb4ddf6..f84ee54 100644 (file)
@@ -23,6 +23,7 @@ import org.scilab.modules.gui.menuitem.MenuItem;
 import org.scilab.modules.gui.menuitem.ScilabMenuItem;
 import org.scilab.modules.gui.pushbutton.PushButton;
 import org.scilab.modules.gui.pushbutton.ScilabPushButton;
+import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.ui_data.variableeditor.SwingScilabVariableEditor;
 import org.scilab.modules.ui_data.variableeditor.TableVariableEditor;
 
@@ -75,7 +76,7 @@ public final class SizeColumnsToFitAction extends CallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new SizeColumnsToFitAction(editor, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(System.getenv("SCI") + "/modules/gui/images/icons/16x16/actions/SizeColumnsToFit.png");
+        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("SizeColumnsToFit"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;