add icon property in figure and uicontrol handle and some other stuff 13/13713/4
Antoine ELIAS [Tue, 11 Feb 2014 20:46:32 +0000 (21:46 +0100)]
Change-Id: I83d91b147316a85b316f4526572f3b42c10dd05b

101 files changed:
scilab/modules/commons/Makefile.am
scilab/modules/commons/Makefile.in
scilab/modules/commons/src/c/commons.vcxproj
scilab/modules/commons/src/c/commons.vcxproj.filters
scilab/modules/commons/src/java/org/scilab/modules/commons/gui/FindIconHelper.java [new file with mode: 0644]
scilab/modules/commons/src/jni/FindIconHelper.cpp [new file with mode: 0644]
scilab/modules/commons/src/jni/FindIconHelper.hxx [new file with mode: 0644]
scilab/modules/commons/src/jni/FindIconHelper.xml [new file with mode: 0644]
scilab/modules/fileio/fileio.vcxproj
scilab/modules/fileio/fileio.vcxproj.filters
scilab/modules/fileio/includes/fullpath.h [moved from scilab/modules/fileio/src/c/fullpath.h with 86% similarity]
scilab/modules/graph/src/java/org/scilab/modules/graph/actions/base/DefaultAction.java
scilab/modules/graphic_objects/src/c/graphic_objects.vcxproj
scilab/modules/graphic_objects/src/c/graphic_objects.vcxproj.filters
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/figure/Figure.java
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/uicontrol/Uicontrol.java
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/xmlloader/GOBuilder.java
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/xmlloader/XmlLoader.java
scilab/modules/graphics/Gui_Import.def
scilab/modules/graphics/src/c/getHandleProperty/GetHashTable.c
scilab/modules/graphics/src/c/getHandleProperty/SetHashTable.c
scilab/modules/graphics/src/c/getHandleProperty/getHandleProperty.h
scilab/modules/graphics/src/c/getHandleProperty/setHandleProperty.h
scilab/modules/gui/Makefile.am
scilab/modules/gui/Makefile.in
scilab/modules/gui/includes/GetUicontrol.h [new file with mode: 0644]
scilab/modules/gui/includes/SetUicontrol.h [new file with mode: 0644]
scilab/modules/gui/sci_gateway/c/sci_uicontrol.c
scilab/modules/gui/src/c/CreateUIControl.c [deleted file]
scilab/modules/gui/src/c/gui.vcxproj
scilab/modules/gui/src/c/gui.vcxproj.filters
scilab/modules/gui/src/cpp/CreateUIControl.cpp [new file with mode: 0644]
scilab/modules/gui/src/cpp/CreateUIControl.h [moved from scilab/modules/gui/src/c/CreateUIControl.h with 100% similarity]
scilab/modules/gui/src/cpp/GetUicontrolIcon.cpp [new file with mode: 0644]
scilab/modules/gui/src/cpp/SetUicontrolIcon.cpp [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/SwingView.java
scilab/modules/gui/src/java/org/scilab/modules/gui/SwingViewMenu.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/filechooser/ExportOptionWindow.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/fontchooser/SwingScilabFontChooser.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/label/SwingScilabLabel.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/messagebox/SwingScilabMessageBox.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/pushbutton/SwingScilabPushButton.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/tab/SwingScilabCommonPanel.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/tab/SwingScilabDockablePanel.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/plotbrowser/actions/RefreshAction.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/gui/src/java/org/scilab/modules/gui/utils/ToolBarBuilder.java
scilab/modules/helptools/src/java/org/scilab/modules/helptools/JavaHelpDocbookTagConverter.java
scilab/modules/history_browser/src/java/org/scilab/modules/history_browser/actions/CopyAction.java
scilab/modules/history_browser/src/java/org/scilab/modules/history_browser/actions/CutAction.java
scilab/modules/history_browser/src/java/org/scilab/modules/history_browser/actions/DeleteAction.java
scilab/modules/history_browser/src/java/org/scilab/modules/history_browser/actions/HelpAction.java
scilab/modules/history_browser/src/java/org/scilab/modules/history_browser/actions/PrefsAction.java
scilab/modules/scinotes/src/java/org/scilab/modules/scinotes/SearchManager.java
scilab/modules/scinotes/src/java/org/scilab/modules/scinotes/actions/DefaultAction.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/ui_data/src/java/org/scilab/modules/ui_data/BrowseVar.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/actions/DefaultAction.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/actions/HelpAction.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/actions/ScilabVarFilteringButtonAction.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/filebrowser/SwingScilabTreeTable.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/variablebrowser/actions/DeleteAction.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/variablebrowser/actions/ModifyAction.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/variablebrowser/actions/RefreshAction.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/variableeditor/actions/CopyAction.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/CutAction.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/PasteAction.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/variableeditor/actions/PlotAction.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/variableeditor/actions/RedoAction.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/variableeditor/actions/RefreshAction.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
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/variableeditor/actions/UndoAction.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/Xcos.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/actions/dialog/DebugLevelDialog.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/actions/dialog/SetContextDialog.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/actions/dialog/SetupDialog.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/modelica/ModelicaController.java

index 067df04..82180be 100644 (file)
@@ -24,6 +24,8 @@ libscicommons_la_etc_DATA = \
        etc/commons.quit \
        etc/commons.start
 
+COMMONS_JNI_SOURCES = src/jni/FindIconHelper.cpp
+
 COMMONS_C_SOURCES =  src/jni/ScilabCommons_wrap.c \
                     src/jni/CommonFileUtils_wrap.c \
                     src/c/fileutils.c
@@ -63,6 +65,8 @@ INCLUDE_FLAGS = $(libscicommons_la_CPPFLAGS)
 SWIG_WRAPPERS = src/jni/ScilabCommons.i \
                 src/jni/CommonFileUtils.i
 
+GIWS_WRAPPERS = src/jni/FindIconHelper.giws.xml
+
 BUILT_SOURCES=
 if SWIG
 BUILT_SOURCES+=swig
index 821c69c..571870b 100644 (file)
@@ -182,17 +182,19 @@ am__v_lt_1 =
 libscicommons_la_LIBADD =
 am__libscicommons_la_SOURCES_DIST = src/jni/ScilabCommons_wrap.c \
        src/jni/CommonFileUtils_wrap.c src/c/fileutils.c \
-       src/fortran/empty.f src/jni/GiwsException.cpp
+       src/fortran/empty.f src/jni/FindIconHelper.cpp \
+       src/jni/GiwsException.cpp
 am__dirstamp = $(am__leading_dot)dirstamp
 am__objects_1 = src/jni/libscicommons_la-ScilabCommons_wrap.lo \
        src/jni/libscicommons_la-CommonFileUtils_wrap.lo \
        src/c/libscicommons_la-fileutils.lo
 am__objects_2 = src/fortran/empty.lo
-@NEED_JAVA_TRUE@am__objects_3 =  \
+am__objects_3 = src/jni/libscicommons_la-FindIconHelper.lo
+@NEED_JAVA_TRUE@am__objects_4 =  \
 @NEED_JAVA_TRUE@       src/jni/libscicommons_la-GiwsException.lo
-am__objects_4 = $(am__objects_3)
+am__objects_5 = $(am__objects_4)
 am_libscicommons_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
-       $(am__objects_4)
+       $(am__objects_3) $(am__objects_5)
 libscicommons_la_OBJECTS = $(am_libscicommons_la_OBJECTS)
 @GUI_TRUE@am_libscicommons_la_rpath = -rpath $(pkglibdir)
 AM_V_P = $(am__v_P_@AM_V@)
@@ -578,6 +580,7 @@ libscicommons_la_etc_DATA = \
        etc/commons.quit \
        etc/commons.start
 
+COMMONS_JNI_SOURCES = src/jni/FindIconHelper.cpp
 COMMONS_C_SOURCES = src/jni/ScilabCommons_wrap.c \
                     src/jni/CommonFileUtils_wrap.c \
                     src/c/fileutils.c
@@ -603,6 +606,7 @@ INCLUDE_FLAGS = $(libscicommons_la_CPPFLAGS)
 SWIG_WRAPPERS = src/jni/ScilabCommons.i \
                 src/jni/CommonFileUtils.i
 
+GIWS_WRAPPERS = src/jni/FindIconHelper.giws.xml
 BUILT_SOURCES = $(am__append_3) $(am__append_4)
 
 #### commons : gateway declaration ####
@@ -782,6 +786,8 @@ src/fortran/$(DEPDIR)/$(am__dirstamp):
        @: > src/fortran/$(DEPDIR)/$(am__dirstamp)
 src/fortran/empty.lo: src/fortran/$(am__dirstamp) \
        src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/jni/libscicommons_la-FindIconHelper.lo: src/jni/$(am__dirstamp) \
+       src/jni/$(DEPDIR)/$(am__dirstamp)
 src/jni/libscicommons_la-GiwsException.lo: src/jni/$(am__dirstamp) \
        src/jni/$(DEPDIR)/$(am__dirstamp)
 
@@ -802,6 +808,7 @@ distclean-compile:
 
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscicommons_la-fileutils.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/jni/$(DEPDIR)/libscicommons_la-CommonFileUtils_wrap.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/jni/$(DEPDIR)/libscicommons_la-FindIconHelper.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/jni/$(DEPDIR)/libscicommons_la-GiwsException.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/jni/$(DEPDIR)/libscicommons_la-ScilabCommons_wrap.Plo@am__quote@
 
@@ -874,6 +881,13 @@ src/c/libscicommons_la-fileutils.lo: src/c/fileutils.c
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
 
+src/jni/libscicommons_la-FindIconHelper.lo: src/jni/FindIconHelper.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicommons_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/jni/libscicommons_la-FindIconHelper.lo -MD -MP -MF src/jni/$(DEPDIR)/libscicommons_la-FindIconHelper.Tpo -c -o src/jni/libscicommons_la-FindIconHelper.lo `test -f 'src/jni/FindIconHelper.cpp' || echo '$(srcdir)/'`src/jni/FindIconHelper.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/jni/$(DEPDIR)/libscicommons_la-FindIconHelper.Tpo src/jni/$(DEPDIR)/libscicommons_la-FindIconHelper.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='src/jni/FindIconHelper.cpp' object='src/jni/libscicommons_la-FindIconHelper.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicommons_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/jni/libscicommons_la-FindIconHelper.lo `test -f 'src/jni/FindIconHelper.cpp' || echo '$(srcdir)/'`src/jni/FindIconHelper.cpp
+
 src/jni/libscicommons_la-GiwsException.lo: src/jni/GiwsException.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicommons_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/jni/libscicommons_la-GiwsException.lo -MD -MP -MF src/jni/$(DEPDIR)/libscicommons_la-GiwsException.Tpo -c -o src/jni/libscicommons_la-GiwsException.lo `test -f 'src/jni/GiwsException.cpp' || echo '$(srcdir)/'`src/jni/GiwsException.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/jni/$(DEPDIR)/libscicommons_la-GiwsException.Tpo src/jni/$(DEPDIR)/libscicommons_la-GiwsException.Plo
index c42a2eb..30b836e 100644 (file)
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="..\jni\CommonFileUtils_wrap.c" />
+    <ClCompile Include="..\jni\FindIconHelper.cpp" />
     <ClCompile Include="..\jni\GiwsException.cpp" />
     <ClCompile Include="DllmainCommons.c" />
     <ClCompile Include="..\jni\ScilabCommons_wrap.c" />
   <ItemGroup>
     <ClInclude Include="..\..\includes\dynlib_commons.h" />
     <ClInclude Include="..\..\includes\fileutils.h" />
+    <ClInclude Include="..\jni\FindIconHelper.hxx" />
     <ClInclude Include="..\jni\GiwsException.hxx" />
   </ItemGroup>
   <ItemGroup>
index 9b00b9a..fef01a2 100644 (file)
@@ -38,6 +38,9 @@
     <ClCompile Include="..\jni\GiwsException.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\jni\FindIconHelper.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\includes\dynlib_commons.h">
@@ -49,6 +52,9 @@
     <ClInclude Include="..\jni\GiwsException.hxx">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\jni\FindIconHelper.hxx">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="core_import.def">
diff --git a/scilab/modules/commons/src/java/org/scilab/modules/commons/gui/FindIconHelper.java b/scilab/modules/commons/src/java/org/scilab/modules/commons/gui/FindIconHelper.java
new file mode 100644 (file)
index 0000000..75782e9
--- /dev/null
@@ -0,0 +1,262 @@
+package org.scilab.modules.commons.gui;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.TreeSet;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.scilab.modules.commons.OS;
+
+public final class FindIconHelper {
+    /**
+     * Look for the icon associated with the name.
+     *
+     * @param icon
+     *            the name to look for
+     * @return the image icon path
+     */
+    public static String findIcon(final String icon) {
+        return findIcon(icon, "16x16");
+    }
+
+    /**
+     * Look for the icon associated with the name for a specific module.
+     *
+     * @param name
+     *            the name to look for
+     * @param size
+     *            the size to look for
+     * @return the loaded image icon
+     */
+    public static String findIcon(final String icon, final String size) {
+        if (icon == null || icon.isEmpty()) {
+            return null;
+        }
+
+        final String filename = findIconHelper(icon, size, "Tango");
+        if (filename != null) {
+            if (LOG.isLoggable(Level.FINER)) {
+                LOG.finer(icon + '[' + size + ']' + " i " + filename);
+            }
+            return filename;
+        }
+
+        final String fallback = lookupFallbackIcon(icon);
+        if (fallback == null) {
+            LOG.warning("Unable to found icon: " + icon + '[' + size + ']');
+            return System.getenv("SCI") + "/modules/gui/images/icons/16x16/status/error.png";
+        }
+
+        if (LOG.isLoggable(Level.FINER)) {
+            LOG.finer(icon + '[' + size + ']' + " f " + fallback);
+        }
+        return fallback;
+    }
+
+    private static String findIconHelper(final String icon, final String size, final String theme) {
+        try {
+            final String filename = lookupIcon(icon, size, theme);
+            if (filename != null) {
+                return filename;
+            }
+        } catch (IOException e) {
+        }
+
+        /*
+         * always look for hicolor and then empty theme in case of invalid
+         * theme.
+         */
+        if (!theme.isEmpty() && theme != HICOLOR) {
+            return findIconHelper(icon, size, HICOLOR);
+        } else if (!theme.isEmpty()) {
+            return findIconHelper(icon, size, "");
+        } else {
+            return null;
+        }
+    }
+
+    private static final Logger LOG = Logger.getLogger(FindIconHelper.class.getName());
+
+    private static final String SCI = System.getenv("SCI");
+    private static final String SEP = System.getProperty("file.separator");
+    private static final String DOT = ".";
+    private static final String HICOLOR = "hicolor";
+    private static final List<String> ICONS_EXTENSIONS = Arrays.asList("png", "svg", "xpm");
+    private static final HashMap<File, TreeSet<String>> THEME_SUBDIR_CACHE = new HashMap<File, TreeSet<String>>();
+
+    private static final FileFilter DIR_FILTER;
+    private static final List<String> THEME_BASENAME;
+    static {
+        DIR_FILTER = new FileFilter() {
+            @Override
+            public boolean accept(File pathname) {
+                return pathname.isDirectory();
+            }
+        };
+        THEME_BASENAME = new ArrayList<String>();
+
+        /*
+         * Linux specific path
+         */
+        switch (OS.get()) {
+            case UNIX:
+                THEME_BASENAME.add("~/.icons");
+                THEME_BASENAME.add("/usr/share/icons");
+                THEME_BASENAME.add("/usr/share/pixmaps");
+
+                THEME_BASENAME.add(SCI + "/../icons");
+                break;
+
+            case MAC:
+                THEME_BASENAME.add(SCI + "/../icons");
+                break;
+
+            default:
+                break;
+        }
+
+        /*
+         * Scilab embedded icons
+         */
+
+        final ArrayList<File> dirs = new ArrayList<File>();
+
+        // Append SCI/desktop and SCI/modules/xxx to the dirs
+        dirs.add(new File(SCI + SEP + "desktop"));
+        dirs.addAll(Arrays.asList(new File(SCI + SEP + "modules").listFiles(DIR_FILTER)));
+        for (File m : dirs) {
+            final File icons = new File(m, "images" + SEP + "icons");
+            final boolean iconsIsDir = icons.isDirectory();
+
+            // add dirs/images/icons/ to the base name
+            if (iconsIsDir) {
+                THEME_BASENAME.add(icons.getAbsolutePath());
+            }
+
+            // add dirs/images/icons/*/* to the base name
+            if (iconsIsDir) {
+                for (File s : icons.listFiles(DIR_FILTER)) {
+                    for (File category : s.listFiles(DIR_FILTER)) {
+                        THEME_BASENAME.add(category.getAbsolutePath());
+                    }
+                }
+            }
+        }
+    }
+
+    private static String lookupIcon(final String iconname, final String size, final String theme) throws IOException {
+        for (String directory : THEME_BASENAME) {
+            final File themeDir = new File(directory + SEP + theme);
+            if (!themeDir.exists() || !themeDir.isDirectory()) {
+                continue;
+            }
+
+            /*
+             * FIXME: implement an index.theme reader, for now we are parsing
+             * the file path to get the information
+             */
+
+            /*
+             * Create the theme subdirs
+             */
+            final int themeDirLen = themeDir.getCanonicalPath().length();
+            final TreeSet<String> themeSubdirs = findThemeSubdir(themeDir, themeDirLen);
+
+            /*
+             * Create a theme subdirs for a specific size
+             */
+            final TreeSet<String> sizedSubDirs = findSizedSubdirs(size, themeSubdirs);
+
+            /*
+             * Look for the icon
+             */
+            for (final String s : sizedSubDirs) {
+                for (String extension : ICONS_EXTENSIONS) {
+                    final File f = new File(themeDir, s + SEP + iconname + DOT + extension);
+
+                    if (f.exists()) {
+                        return f.getCanonicalPath();
+                    }
+                }
+            }
+        }
+
+        return null;
+    }
+
+    private static TreeSet<String> findSizedSubdirs(final String size, final TreeSet<String> themeSubdirs) {
+        final TreeSet<String> sizedSubDirs = new TreeSet<String>();
+        for (String subdir : themeSubdirs) {
+            if (subdir.startsWith(size)) {
+                sizedSubDirs.add(subdir);
+            }
+        }
+        return sizedSubDirs;
+    }
+
+    private static TreeSet<String> findThemeSubdir(final File themeDir, final int themeDirLen) throws IOException {
+        final TreeSet<String> cache = THEME_SUBDIR_CACHE.get(themeDir);
+        if (cache != null) {
+            return cache;
+        }
+
+        final TreeSet<String> themeSubdirs = new TreeSet<String>();
+
+        final LinkedList<File> dirs = new LinkedList<File>(Arrays.asList(themeDir.listFiles(DIR_FILTER)));
+        while (!dirs.isEmpty()) {
+            final File d = dirs.poll();
+
+            final List<File> sub = Arrays.asList(d.listFiles(DIR_FILTER));
+            if (sub.isEmpty()) {
+                final String s = d.getCanonicalPath();
+
+                themeSubdirs.add(s.substring(themeDirLen + 1));
+            } else {
+                dirs.addAll(sub);
+            }
+        }
+
+        THEME_SUBDIR_CACHE.put(themeDir, themeSubdirs);
+        return themeSubdirs;
+    }
+
+    public static String findImage(final String image) {
+        for (String directory : THEME_BASENAME) {
+            final File f = new File(directory + SEP + image);
+            if (f.exists()) {
+                return f.getAbsolutePath();
+            }
+        }
+
+        return findIcon(image);
+    }
+
+    private static String lookupFallbackIcon(final String icon) {
+        for (String directory : THEME_BASENAME) {
+            for (String extension : ICONS_EXTENSIONS) {
+                final File f = new File(directory + SEP + icon + DOT + extension);
+                if (f.exists()) {
+                    return f.getAbsolutePath();
+                }
+            }
+        }
+
+        return null;
+    }
+
+    public static void addThemePath(String path) {
+        if (THEME_BASENAME.contains(path)) {
+            return;
+        }
+
+        THEME_BASENAME.add(path);
+    }
+
+}
diff --git a/scilab/modules/commons/src/jni/FindIconHelper.cpp b/scilab/modules/commons/src/jni/FindIconHelper.cpp
new file mode 100644 (file)
index 0000000..b032b8c
--- /dev/null
@@ -0,0 +1,177 @@
+#include "FindIconHelper.hxx"
+/* Generated by GIWS (version 2.0.2) with command:
+giws --disable-return-size-array --output-dir . --throws-exception-on-error --description-file FindIconHelper.xml
+*/
+/*
+
+This is generated code.
+
+This software is a computer program whose purpose is to hide the complexity
+of accessing Java objects/methods from C++ code.
+
+This software is governed by the CeCILL-B license under French law and
+abiding by the rules of distribution of free software.  You can  use,
+modify and/ or redistribute the software under the terms of the CeCILL-B
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info".
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability.
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or
+data to be ensured and,  more generally, to use and operate it in the
+same conditions as regards security.
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL-B license and that you accept its terms.
+*/
+
+namespace org_scilab_modules_commons_gui {
+
+                // Static declarations (if any)
+                
+// Returns the current env
+
+JNIEnv * FindIconHelper::getCurrentEnv() {
+JNIEnv * curEnv = NULL;
+jint res=this->jvm->AttachCurrentThread(reinterpret_cast<void **>(&curEnv), NULL);
+if (res != JNI_OK) {
+throw GiwsException::JniException(getCurrentEnv());
+}
+return curEnv;
+}
+// Destructor
+
+FindIconHelper::~FindIconHelper() {
+JNIEnv * curEnv = NULL;
+this->jvm->AttachCurrentThread(reinterpret_cast<void **>(&curEnv), NULL);
+curEnv->DeleteGlobalRef(this->instance);
+curEnv->DeleteGlobalRef(this->instanceClass);
+}
+// Constructors
+FindIconHelper::FindIconHelper(JavaVM * jvm_) {
+jmethodID constructObject = NULL ;
+jobject localInstance ;
+jclass localClass ;
+
+const std::string construct="<init>";
+const std::string param="()V";
+jvm=jvm_;
+
+JNIEnv * curEnv = getCurrentEnv();
+
+localClass = curEnv->FindClass( this->className().c_str() ) ;
+if (localClass == NULL) {
+  throw GiwsException::JniClassNotFoundException(curEnv, this->className());
+}
+
+this->instanceClass = static_cast<jclass>(curEnv->NewGlobalRef(localClass));
+
+/* localClass is not needed anymore */
+curEnv->DeleteLocalRef(localClass);
+
+if (this->instanceClass == NULL) {
+throw GiwsException::JniObjectCreationException(curEnv, this->className());
+}
+
+
+constructObject = curEnv->GetMethodID( this->instanceClass, construct.c_str() , param.c_str() ) ;
+if(constructObject == NULL){
+throw GiwsException::JniObjectCreationException(curEnv, this->className());
+}
+
+localInstance = curEnv->NewObject( this->instanceClass, constructObject ) ;
+if(localInstance == NULL){
+throw GiwsException::JniObjectCreationException(curEnv, this->className());
+}
+this->instance = curEnv->NewGlobalRef(localInstance) ;
+if(this->instance == NULL){
+throw GiwsException::JniObjectCreationException(curEnv, this->className());
+}
+/* localInstance not needed anymore */
+curEnv->DeleteLocalRef(localInstance);
+
+                /* Methods ID set to NULL */
+voidaddThemePathjstringjava_lang_StringID=NULL;
+
+
+}
+
+FindIconHelper::FindIconHelper(JavaVM * jvm_, jobject JObj) {
+        jvm=jvm_;
+
+        JNIEnv * curEnv = getCurrentEnv();
+
+jclass localClass = curEnv->GetObjectClass(JObj);
+        this->instanceClass = static_cast<jclass>(curEnv->NewGlobalRef(localClass));
+        curEnv->DeleteLocalRef(localClass);
+
+        if (this->instanceClass == NULL) {
+throw GiwsException::JniObjectCreationException(curEnv, this->className());
+        }
+
+        this->instance = curEnv->NewGlobalRef(JObj) ;
+        if(this->instance == NULL){
+throw GiwsException::JniObjectCreationException(curEnv, this->className());
+        }
+        /* Methods ID set to NULL */
+        voidaddThemePathjstringjava_lang_StringID=NULL;
+
+
+}
+
+// Generic methods
+
+void FindIconHelper::synchronize() {
+if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+throw GiwsException::JniMonitorException(getCurrentEnv(), "FindIconHelper");
+}
+}
+
+void FindIconHelper::endSynchronize() {
+if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+throw GiwsException::JniMonitorException(getCurrentEnv(), "FindIconHelper");
+}
+}
+// Method(s)
+
+void FindIconHelper::addThemePath (JavaVM * jvm_, char const* path){
+
+JNIEnv * curEnv = NULL;
+jvm_->AttachCurrentThread(reinterpret_cast<void **>(&curEnv), NULL);
+jclass cls = initClass(curEnv);
+if ( cls == NULL) {
+throw GiwsException::JniCallMethodException(curEnv);
+}
+
+static jmethodID voidaddThemePathjstringjava_lang_StringID = curEnv->GetStaticMethodID(cls, "addThemePath", "(Ljava/lang/String;)V" ) ;
+if (voidaddThemePathjstringjava_lang_StringID == NULL) {
+throw GiwsException::JniMethodNotFoundException(curEnv, "addThemePath");
+}
+
+jstring path_ = curEnv->NewStringUTF( path );
+if (path != NULL && path_ == NULL)
+{
+throw GiwsException::JniBadAllocException(curEnv);
+}
+
+
+                         curEnv->CallStaticVoidMethod(cls, voidaddThemePathjstringjava_lang_StringID ,path_);
+                        curEnv->DeleteLocalRef(path_);
+if (curEnv->ExceptionCheck()) {
+throw GiwsException::JniCallMethodException(curEnv);
+}
+}
+
+}
diff --git a/scilab/modules/commons/src/jni/FindIconHelper.hxx b/scilab/modules/commons/src/jni/FindIconHelper.hxx
new file mode 100644 (file)
index 0000000..58d6c30
--- /dev/null
@@ -0,0 +1,178 @@
+/* Generated by GIWS (version 2.0.2) with command:
+giws --disable-return-size-array --output-dir . --throws-exception-on-error --description-file FindIconHelper.xml
+*/
+/*
+
+This is generated code.
+
+This software is a computer program whose purpose is to hide the complexity
+of accessing Java objects/methods from C++ code.
+
+This software is governed by the CeCILL-B license under French law and
+abiding by the rules of distribution of free software.  You can  use,
+modify and/ or redistribute the software under the terms of the CeCILL-B
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info".
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability.
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or
+data to be ensured and,  more generally, to use and operate it in the
+same conditions as regards security.
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL-B license and that you accept its terms.
+*/
+
+
+#ifndef __ORG_SCILAB_MODULES_COMMONS_GUI_FINDICONHELPER__
+#define __ORG_SCILAB_MODULES_COMMONS_GUI_FINDICONHELPER__
+#include <iostream>
+#include <string>
+#include <string.h>
+#include <stdlib.h>
+#include <jni.h>
+
+#include "GiwsException.hxx"
+
+        #if defined(_MSC_VER) /* Defined anyway with Visual */
+            #include <Windows.h>
+        #else
+            typedef signed char byte;
+        #endif
+
+
+#ifndef GIWSEXPORT
+# if defined(_MSC_VER) || defined(__WIN32__) || defined(__CYGWIN__)
+#   if defined(STATIC_LINKED)
+#     define GIWSEXPORT
+#   else
+#     define GIWSEXPORT __declspec(dllexport)
+#   endif
+# else
+#   if __GNUC__ >= 4
+#     define GIWSEXPORT __attribute__ ((visibility ("default")))
+#   else
+#     define GIWSEXPORT
+#   endif
+# endif
+#endif
+
+namespace org_scilab_modules_commons_gui {
+class GIWSEXPORT FindIconHelper {
+
+private:
+JavaVM * jvm;
+
+protected:
+jmethodID voidaddThemePathjstringjava_lang_StringID; // cache method id
+
+
+
+jobject instance;
+jclass instanceClass; // cache class
+
+                       
+// Caching (if any)
+
+
+/**
+* Get the environment matching to the current thread.
+*/
+virtual JNIEnv * getCurrentEnv();
+
+public:
+// Constructor
+/**
+* Create a wrapping of the object from a JNIEnv.
+* It will call the default constructor
+* @param JEnv_ the Java Env
+*/
+FindIconHelper(JavaVM * jvm_);
+
+/**
+* Create a wrapping of an already existing object from a JNIEnv.
+* The object must have already been instantiated
+* @param JEnv_ the Java Env
+* @param JObj the object
+*/
+FindIconHelper(JavaVM * jvm_, jobject JObj);
+
+
+/** 
+* This is a fake constructor to avoid the constructor
+* chaining when dealing with extended giws classes 
+*/
+#ifdef FAKEGIWSDATATYPE
+FindIconHelper(fakeGiwsDataType::fakeGiwsDataType /* unused */) {}
+#endif
+
+// Destructor
+~FindIconHelper();
+
+// Generic method
+// Synchronization methods
+/**
+* Enter monitor associated with the object.
+* Equivalent of creating a "synchronized(obj)" scope in Java.
+*/
+void synchronize();
+
+/**
+* Exit monitor associated with the object.
+* Equivalent of ending a "synchronized(obj)" scope.
+*/
+void endSynchronize();
+
+// Methods
+static void addThemePath(JavaVM * jvm_, char const* path);
+
+
+                        /**
+                        * Get class name to use for static methods
+                        * @return class name to use for static methods
+                        */
+                        
+                static const std::string className()
+                {
+                return "org/scilab/modules/commons/gui/FindIconHelper";
+                }
+                
+
+                        /**
+                        * Get class to use for static methods
+                        * @return class to use for static methods
+                        */
+                        
+                static jclass initClass(JNIEnv * curEnv)
+                {
+                    static jclass cls = 0;
+
+                    if (cls == 0)
+                    {
+                        jclass _cls = curEnv->FindClass(className().c_str());
+                        if (_cls)
+                        {
+                            cls = static_cast<jclass>(curEnv->NewGlobalRef(_cls));
+                        }
+                    }
+
+                    return cls;
+                 }
+                
+};
+
+
+}
+#endif
diff --git a/scilab/modules/commons/src/jni/FindIconHelper.xml b/scilab/modules/commons/src/jni/FindIconHelper.xml
new file mode 100644 (file)
index 0000000..a894fa0
--- /dev/null
@@ -0,0 +1,19 @@
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2014 - Scilab Enterprises - Antoine ELIAS
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+
+<package name="org.scilab.modules.commons.gui">
+    <object name="FindIconHelper">
+        <method name="addThemePath" returnType="void" modifier="static">
+            <parameter name="path" type="String"/>
+        </method>
+    </object>
+</package>
index 853da7c..940b55b 100644 (file)
@@ -314,6 +314,7 @@ lib /DEF:"$(ProjectDir)Console_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platfor
     <ClInclude Include="includes\createtempfilename.h" />
     <ClInclude Include="includes\deleteafile.h" />
     <ClInclude Include="includes\diary.h" />
+    <ClInclude Include="includes\fullpath.h" />
     <ClInclude Include="includes\getshortpathname.h" />
     <ClInclude Include="includes\mgetl.h" />
     <ClInclude Include="includes\readline.h" />
@@ -333,7 +334,6 @@ lib /DEF:"$(ProjectDir)Console_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platfor
     <ClInclude Include="includes\findfiles.h" />
     <ClInclude Include="src\c\fprintfMat.h" />
     <ClInclude Include="src\c\fscanfMat.h" />
-    <ClInclude Include="src\c\fullpath.h" />
     <ClInclude Include="src\c\getdrives.h" />
     <ClInclude Include="includes\getfiledesc.h" />
     <ClInclude Include="includes\getfileinfo.h" />
index 513f973..26ccdf2 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup>
     <Filter Include="Source Files">
     <ClInclude Include="src\c\fscanfMat.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="src\c\fullpath.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="src\c\getdrives.h">
       <Filter>Header Files</Filter>
     </ClInclude>
     <ClInclude Include="src\c\convert_tools.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="includes\fullpath.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="src\c\fileio.rc">
       <Filter>localization</Filter>
     </None>
   </ItemGroup>
-</Project>
+</Project>
\ No newline at end of file
similarity index 86%
rename from scilab/modules/fileio/src/c/fullpath.h
rename to scilab/modules/fileio/includes/fullpath.h
index b31c759..887c8bc 100644 (file)
@@ -13,6 +13,8 @@
 #ifndef __FULLPATH_H__
 #define __FULLPATH_H__
 
+#include "dynlib_fileio.h"
+
 /**
 * Creates an absolute or full path name for the specified relative path name.
 * @param[out] absPath Pointer to a buffer containing the absolute or full path name, or NULL.
@@ -21,7 +23,7 @@
 * @return returns a pointer to a buffer containing the absolute path name (absPath).
 */
 
-char * get_full_path(char * _FullPath, const char * _Path, size_t _SizeInBytes);
+FILEIO_IMPEXP char * get_full_path(char * _FullPath, const char * _Path, size_t _SizeInBytes);
 
 /**
 * Creates an absolute or full path name for the specified relative path name.
@@ -31,7 +33,7 @@ char * get_full_path(char * _FullPath, const char * _Path, size_t _SizeInBytes);
 * @return returns a pointer to a buffer containing the absolute path name (absPath).
 * "localized" on windows (Wide char)
 */
-wchar_t * get_full_pathW(wchar_t * _wcFullPath, const wchar_t * _wcPath, size_t _SizeInBytes);
+FILEIO_IMPEXP wchar_t * get_full_pathW(wchar_t * _wcFullPath, const wchar_t * _wcPath, size_t _SizeInBytes);
 
 #endif
 /*--------------------------------------------------------------------------*/
index 7d8d602..a574278 100644 (file)
@@ -23,6 +23,7 @@ import javax.swing.Action;
 import javax.swing.ImageIcon;
 import javax.swing.KeyStroke;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.graph.ScilabGraph;
 import org.scilab.modules.gui.bridge.checkboxmenuitem.SwingScilabCheckBoxMenuItem;
 import org.scilab.modules.gui.bridge.menuitem.SwingScilabMenuItem;
@@ -34,7 +35,6 @@ 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 com.mxgraph.swing.mxGraphComponent;
 
@@ -85,7 +85,7 @@ public abstract class DefaultAction extends CommonCallBack {
              */
             String iconName = (String) getClass().getField("SMALL_ICON").get(null);
             if (iconName != null && !iconName.isEmpty()) {
-                icon = new ImageIcon(ScilabSwingUtilities.findIcon(iconName));
+                icon = new ImageIcon(FindIconHelper.findIcon(iconName));
             }
 
             mnemonic = getClass().getField("MNEMONIC_KEY").getInt(null);
index dbc62a2..eef2d56 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
index 85e26de..ae53de2 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup>
     <Filter Include="Source Files">
index bb328a6..ad0a5b8 100644 (file)
@@ -45,6 +45,7 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TOOLBAR_VISIBLE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TOOLBAR__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_VIEWPORT__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_ICON__;
 
 import java.util.Arrays;
 
@@ -62,7 +63,7 @@ public class Figure extends GraphicObject {
         INFOMESSAGE, COLORMAP, COLORMAPSIZE, BACKGROUND, ROTATIONTYPE,
         RESIZEFCN, CLOSEREQUESTFCN, RESIZE, TOOLBAR, TOOLBAR_VISIBLE,
         MENUBAR, MENUBAR_VISIBLE, INFOBAR_VISIBLE, DOCKABLE, LAYOUT, LAYOUT_SET,
-        GRIDOPT_GRID, GRIDOPT_PADDING, BORDEROPT_PADDING, DEFAULT_AXES
+        GRIDOPT_GRID, GRIDOPT_PADDING, BORDEROPT_PADDING, DEFAULT_AXES, ICON
     };
 
     /** Specifies whether rotation applies to a single subwindow or to all the figure's subwindows */
@@ -406,6 +407,8 @@ public class Figure extends GraphicObject {
     /** default axes management */
     private Boolean defaultAxes;
 
+    private String icon = "";
+
     /** Constructor */
     public Figure() {
         super();
@@ -530,6 +533,8 @@ public class Figure extends GraphicObject {
                 return FigureProperty.BORDEROPT_PADDING;
             case __GO_DEFAULT_AXES__ :
                 return FigureProperty.DEFAULT_AXES;
+            case __GO_UI_ICON__ :
+                return FigureProperty.ICON;
             default :
                 return super.getPropertyFromName(propertyName);
         }
@@ -607,6 +612,8 @@ public class Figure extends GraphicObject {
             return getBorderOptPadding();
         } else if (property == FigureProperty.DEFAULT_AXES) {
             return hasDefaultAxes();
+        } else if (property == FigureProperty.ICON) {
+            return getIcon();
         } else {
             return super.getProperty(property);
         }
@@ -659,6 +666,8 @@ public class Figure extends GraphicObject {
                     return setBorderOptPadding((Integer[]) value);
                 case DEFAULT_AXES:
                     return setDefaultAxes((Boolean) value);
+                case ICON:
+                    return setIcon((String) value);
                 default:
                     break;
             }
@@ -1406,6 +1415,20 @@ public class Figure extends GraphicObject {
     }
 
 
+    public String getIcon() {
+        return icon;
+    }
+
+    public UpdateStatus setIcon(String icon) {
+        if (this.icon.equals(icon)) {
+            return UpdateStatus.NoChange;
+        }
+
+        this.icon = icon;
+        return UpdateStatus.Success;
+    }
+
+
     /**
      * @return Type as String
      */
index 29bac97..9930b71 100644 (file)
@@ -53,6 +53,7 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_PUSHBUTTON__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_RADIOBUTTON__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_RELIEF__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_SCROLLABLE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_SLIDERSTEP__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_SLIDER__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_STRING_COLNB__;
@@ -69,9 +70,7 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_VALUE_SIZE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_VALUE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_VERTICALALIGNMENT__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_TITLE_POSITION__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_TITLE_SCROLL__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_SCROLLABLE__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_ICON__;
 
 import java.awt.Font;
 import java.util.Arrays;
@@ -305,6 +304,7 @@ public class Uicontrol extends GraphicObject {
     private String[] tooltipString = {""};
     private String units = "pixels";
     private Double[] value;
+    private Boolean scrollable = false;
     private LayoutType layout = LayoutType.NONE;
     private Double[] margins = new Double[] {0.0, 0.0, 0.0, 0.0};
     private Integer[] gridbagGrid = new Integer[] { -1, -1, 1, 1};
@@ -313,6 +313,7 @@ public class Uicontrol extends GraphicObject {
     private AnchorType gridbagAnchor = AnchorType.CENTER;
     private Integer[] gridbagPadding = new Integer[] {0, 0};
     private BorderLayoutType borderPosition = BorderLayoutType.CENTER;
+    private String icon = "";
 
     /** layout options */
     private Integer[] gridOptGrid = new Integer[] {0, 0};
@@ -329,8 +330,6 @@ public class Uicontrol extends GraphicObject {
     private Boolean titleScroll = false;
     private TitlePositionType titlePosition = TitlePositionType.TOP;
 
-    /** Scrollable */
-    private Boolean scrollable = false;
 
     /**
      * All uicontrol properties
@@ -380,7 +379,8 @@ public class Uicontrol extends GraphicObject {
         GROUPNAME,
         TITLE_POSITION,
         TITLE_SCROLL,
-        SCROLLABLE
+        SCROLLABLE,
+        ICON
     };
 
     /**
@@ -605,6 +605,8 @@ public class Uicontrol extends GraphicObject {
                 return UicontrolProperty.TITLE_SCROLL;
             case __GO_UI_SCROLLABLE__:
                 return UicontrolProperty.SCROLLABLE;
+            case __GO_UI_ICON__:
+                return UicontrolProperty.ICON;
             default :
                 return super.getPropertyFromName(propertyName);
         }
@@ -702,6 +704,8 @@ public class Uicontrol extends GraphicObject {
             return getTitleScroll();
         } else if (property == UicontrolProperty.SCROLLABLE) {
             return getScrollable();
+        } else if (property == UicontrolProperty.ICON) {
+            return getIcon();
         } else {
             return super.getProperty(property);
         }
@@ -796,6 +800,8 @@ public class Uicontrol extends GraphicObject {
                 return setTitleScroll((Boolean) value);
             case SCROLLABLE:
                 return setScrollable((Boolean) value);
+            case ICON:
+                return setIcon((String) value);
             default:
                 return super.setProperty(property, value);
         }
@@ -1464,6 +1470,19 @@ public class Uicontrol extends GraphicObject {
         }
     }
 
+    public UpdateStatus setIcon(String icon) {
+        if (this.icon.equals(icon)) {
+            return UpdateStatus.NoChange;
+        }
+
+        this.icon = icon;
+        return UpdateStatus.Success;
+    }
+
+    public String getIcon() {
+        return icon;
+    }
+
     public void accept(Visitor visitor) {
     }
 }
index 0168548..e1b1f0a 100644 (file)
@@ -1,7 +1,7 @@
 package org.scilab.modules.graphic_objects.xmlloader;
 
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_DOCKABLE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_BORDER_OPT_PADDING__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_DOCKABLE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_GRID_OPT_GRID__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_GRID_OPT_PADDING__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_INFOBAR_VISIBLE__;
@@ -18,8 +18,10 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TITLE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TOOLBAR_VISIBLE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TYPE__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_BACKGROUNDCOLOR__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_BORDER_POSITION__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_CHECKBOX__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_ENABLE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FONTANGLE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FONTNAME__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FONTSIZE__;
@@ -37,6 +39,7 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_STYLE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_TITLE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_SCROLLABLE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_GRIDBAG_ANCHOR__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_GRIDBAG_FILL__;
@@ -44,6 +47,7 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_GRIDBAG_PADDING__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_GRIDBAG_WEIGHT__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_HORIZONTALALIGNMENT__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_ICON__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_MAX__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_PUSHBUTTON__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_SCROLLABLE__;
@@ -51,11 +55,9 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_TAB__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_TEXT__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_VISIBLE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_SCROLLABLE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_ENABLE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_BACKGROUNDCOLOR__;
 
 import java.awt.Color;
+import java.io.File;
 import java.lang.reflect.Field;
 import java.util.Map;
 
@@ -140,9 +142,15 @@ public class GOBuilder {
             item = "name:border"; //default layout is border
         }
 
-
         setLayoutProperty(controller, fig, item);
 
+
+        //icon
+        item = attributes.getValue("icon");
+        if (item != null) {
+            controller.setProperty(fig, __GO_UI_ICON__, item);
+        }
+
         // visible
         XmlTools.setPropAsBoolean(fig, __GO_VISIBLE__, attributes.getValue("visible"));
 
@@ -339,11 +347,21 @@ public class GOBuilder {
                     break;
                 }
                 case __GO_UI_PUSHBUTTON__: {
+
+                    //string
                     String[] text = new String[1];
                     text[0] = attributes.getValue("text");
                     if (text[0] != null) {
                         controller.setProperty(uic, __GO_UI_STRING__, text);
                     }
+
+
+                    //icon
+                    item = attributes.getValue("icon");
+                    if (item != null) {
+                        controller.setProperty(uic, __GO_UI_ICON__, item);
+                    }
+
                     break;
                 }
                 case __GO_UI_TEXT__:
@@ -358,6 +376,12 @@ public class GOBuilder {
                     if (columns != null) {
                         controller.setProperty(uic, __GO_UI_MAX__, Double.parseDouble(columns));
                     }
+
+                    //icon
+                    item = attributes.getValue("icon");
+                    if (item != null) {
+                        controller.setProperty(uic, __GO_UI_ICON__, item);
+                    }
                     break;
             }
 
index 9777e9f..40e6924 100644 (file)
@@ -27,7 +27,6 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_TABLE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_TAB__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_TEXT__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_VISIBLE__;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -44,6 +43,7 @@ import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
 
 import org.scilab.modules.graphic_objects.graphicController.GraphicController;
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.xml.sax.Attributes;
 import org.xml.sax.Locator;
 import org.xml.sax.SAXException;
@@ -156,6 +156,12 @@ public class XmlLoader extends DefaultHandler {
     public int parse(String filename) throws SAXException {
         this.filename = filename;
         File f = new File(filename);
+        //add filename filepath in ScilabSwingUtilities paths
+        String absoluteFilePath = f.getAbsolutePath();
+        String path = absoluteFilePath.substring(0,
+                      absoluteFilePath.lastIndexOf(File.separator));
+        FindIconHelper.addThemePath(path);
+
         FileInputStream in = null;
         try {
             in = new FileInputStream(f);
index 9ff1511..090cbf0 100644 (file)
@@ -68,3 +68,5 @@ SetUimenuLabel
 SetUiobjectEnable
 GetConsoleUseDeprecatedLF
 SetConsoleUseDeprecatedLF
+GetUicontrolIcon
+SetUicontrolIcon
index f24d68b..227ad6b 100755 (executable)
@@ -246,7 +246,8 @@ static getHashTableCouple propertyGetTable[] =
     {"groupname", get_groupname_property},
     {"title_position", get_title_position_property},
     {"title_scroll", get_title_scroll_property},
-    {"scrollable", get_scrollable_property}
+    {"scrollable", get_scrollable_property},
+    {"icon", GetUicontrolIcon}
 };
 
 /*--------------------------------------------------------------------------*/
index 765b362..7ce8950 100755 (executable)
@@ -248,7 +248,8 @@ static setHashTableCouple propertySetTable[] =
     {"title_position", set_title_position_property},
     {"title_scroll", set_title_scroll_property},
     {"default_axes", set_default_axes_property},
-    {"scrollable", set_scrollable_property}
+    {"scrollable", set_scrollable_property},
+    {"icon", SetUicontrolIcon}
 };
 
 /*--------------------------------------------------------------------------*/
index fce32d5..3158dca 100755 (executable)
@@ -44,6 +44,7 @@
 #include "GetUimenuChecked.h"
 #include "GetConsoleShowHiddenHandles.h"
 #include "GetUicontrolTooltipString.h"
+#include "GetUicontrol.h"
 
 int get_figures_id_property(void* _pvCtx, int iObjUID);
 int get_visible_property(void* _pvCtx, int iObjUID);
@@ -218,5 +219,6 @@ int get_groupname_property(void* _pvCtx, int iObjUID);
 int get_title_position_property(void* _pvCtx, int iObjUID);
 int get_title_scroll_property(void* _pvCtx, int iObjUID);
 int get_scrollable_property(void* _pvCtx, int iObjUID);
+int get_icon_property(void* _pvCtx, int iObjUID);
 
 #endif /* _GET_HANDLE_PROPERTY_H_ */
index 4e2b9ed..e6daad5 100755 (executable)
@@ -48,6 +48,7 @@
 #include "SetUimenuChecked.h"
 #include "SetConsoleShowHiddenHandles.h"
 #include "SetUicontrolTooltipString.h"
+#include "SetUicontrol.h"
 
 
 int set_color_map_property(void* _pvCtx, int iObj, void* _pvData, int valueType, int nbRow, int nbCol);
index a72fc44..27b40fe 100755 (executable)
@@ -53,7 +53,6 @@ src/c/getMainWindowTitle.c \
 src/c/InitializeGUI.c \
 src/c/setMainWindowTitle.c \
 src/c/addmenu.c \
-src/c/CreateUIControl.c \
 src/c/CreateUimenu.c \
 src/c/checkColorRange.c \
 src/c/messageboxoptions.c \
@@ -63,6 +62,7 @@ src/jni/ScilabTermination_wrap.c
 GUI_CXX_SOURCES = \
 src/cpp/InitUIMenu.cpp \
 src/jni/CallScilabBridge.cpp \
+src/cpp/CreateUIControl.cpp \
 src/jni/Jxclick.cpp \
 src/jni/SwingView.cpp \
 src/cpp/CallJxclick.cpp \
@@ -119,6 +119,8 @@ src/cpp/SetUicontrolVerticalAlignment.cpp \
 src/cpp/GetUicontrolVerticalAlignment.cpp \
 src/cpp/SetUicontrolSliderStep.cpp \
 src/cpp/GetUicontrolSliderStep.cpp \
+src/cpp/SetUicontrolIcon.cpp \
+src/cpp/GetUicontrolIcon.cpp \
 src/cpp/SetConsoleShowHiddenHandles.cpp \
 src/cpp/GetConsoleShowHiddenHandles.cpp \
 src/cpp/UnitsConversion.cpp \
index 2a1fd94..e9dbb70 100644 (file)
@@ -182,7 +182,6 @@ am__objects_1 = src/c/libscigui_algo_la-buildMainWindowTitle.lo \
        src/c/libscigui_algo_la-InitializeGUI.lo \
        src/c/libscigui_algo_la-setMainWindowTitle.lo \
        src/c/libscigui_algo_la-addmenu.lo \
-       src/c/libscigui_algo_la-CreateUIControl.lo \
        src/c/libscigui_algo_la-CreateUimenu.lo \
        src/c/libscigui_algo_la-checkColorRange.lo \
        src/c/libscigui_algo_la-messageboxoptions.lo \
@@ -190,6 +189,7 @@ am__objects_1 = src/c/libscigui_algo_la-buildMainWindowTitle.lo \
        src/jni/libscigui_algo_la-ScilabTermination_wrap.lo
 am__objects_2 = src/cpp/libscigui_algo_la-InitUIMenu.lo \
        src/jni/libscigui_algo_la-CallScilabBridge.lo \
+       src/cpp/libscigui_algo_la-CreateUIControl.lo \
        src/jni/libscigui_algo_la-Jxclick.lo \
        src/jni/libscigui_algo_la-SwingView.lo \
        src/cpp/libscigui_algo_la-CallJxclick.lo \
@@ -246,6 +246,8 @@ am__objects_2 = src/cpp/libscigui_algo_la-InitUIMenu.lo \
        src/cpp/libscigui_algo_la-GetUicontrolVerticalAlignment.lo \
        src/cpp/libscigui_algo_la-SetUicontrolSliderStep.lo \
        src/cpp/libscigui_algo_la-GetUicontrolSliderStep.lo \
+       src/cpp/libscigui_algo_la-SetUicontrolIcon.lo \
+       src/cpp/libscigui_algo_la-GetUicontrolIcon.lo \
        src/cpp/libscigui_algo_la-SetConsoleShowHiddenHandles.lo \
        src/cpp/libscigui_algo_la-GetConsoleShowHiddenHandles.lo \
        src/cpp/libscigui_algo_la-UnitsConversion.lo \
@@ -726,7 +728,6 @@ src/c/getMainWindowTitle.c \
 src/c/InitializeGUI.c \
 src/c/setMainWindowTitle.c \
 src/c/addmenu.c \
-src/c/CreateUIControl.c \
 src/c/CreateUimenu.c \
 src/c/checkColorRange.c \
 src/c/messageboxoptions.c \
@@ -736,6 +737,7 @@ src/jni/ScilabTermination_wrap.c
 GUI_CXX_SOURCES = \
 src/cpp/InitUIMenu.cpp \
 src/jni/CallScilabBridge.cpp \
+src/cpp/CreateUIControl.cpp \
 src/jni/Jxclick.cpp \
 src/jni/SwingView.cpp \
 src/cpp/CallJxclick.cpp \
@@ -792,6 +794,8 @@ src/cpp/SetUicontrolVerticalAlignment.cpp \
 src/cpp/GetUicontrolVerticalAlignment.cpp \
 src/cpp/SetUicontrolSliderStep.cpp \
 src/cpp/GetUicontrolSliderStep.cpp \
+src/cpp/SetUicontrolIcon.cpp \
+src/cpp/GetUicontrolIcon.cpp \
 src/cpp/SetConsoleShowHiddenHandles.cpp \
 src/cpp/GetConsoleShowHiddenHandles.cpp \
 src/cpp/UnitsConversion.cpp \
@@ -1241,8 +1245,6 @@ src/c/libscigui_algo_la-setMainWindowTitle.lo: src/c/$(am__dirstamp) \
        src/c/$(DEPDIR)/$(am__dirstamp)
 src/c/libscigui_algo_la-addmenu.lo: src/c/$(am__dirstamp) \
        src/c/$(DEPDIR)/$(am__dirstamp)
-src/c/libscigui_algo_la-CreateUIControl.lo: src/c/$(am__dirstamp) \
-       src/c/$(DEPDIR)/$(am__dirstamp)
 src/c/libscigui_algo_la-CreateUimenu.lo: src/c/$(am__dirstamp) \
        src/c/$(DEPDIR)/$(am__dirstamp)
 src/c/libscigui_algo_la-checkColorRange.lo: src/c/$(am__dirstamp) \
@@ -1269,6 +1271,8 @@ src/cpp/libscigui_algo_la-InitUIMenu.lo: src/cpp/$(am__dirstamp) \
        src/cpp/$(DEPDIR)/$(am__dirstamp)
 src/jni/libscigui_algo_la-CallScilabBridge.lo:  \
        src/jni/$(am__dirstamp) src/jni/$(DEPDIR)/$(am__dirstamp)
+src/cpp/libscigui_algo_la-CreateUIControl.lo: src/cpp/$(am__dirstamp) \
+       src/cpp/$(DEPDIR)/$(am__dirstamp)
 src/jni/libscigui_algo_la-Jxclick.lo: src/jni/$(am__dirstamp) \
        src/jni/$(DEPDIR)/$(am__dirstamp)
 src/jni/libscigui_algo_la-SwingView.lo: src/jni/$(am__dirstamp) \
@@ -1381,6 +1385,10 @@ src/cpp/libscigui_algo_la-SetUicontrolSliderStep.lo:  \
        src/cpp/$(am__dirstamp) src/cpp/$(DEPDIR)/$(am__dirstamp)
 src/cpp/libscigui_algo_la-GetUicontrolSliderStep.lo:  \
        src/cpp/$(am__dirstamp) src/cpp/$(DEPDIR)/$(am__dirstamp)
+src/cpp/libscigui_algo_la-SetUicontrolIcon.lo:  \
+       src/cpp/$(am__dirstamp) src/cpp/$(DEPDIR)/$(am__dirstamp)
+src/cpp/libscigui_algo_la-GetUicontrolIcon.lo:  \
+       src/cpp/$(am__dirstamp) src/cpp/$(DEPDIR)/$(am__dirstamp)
 src/cpp/libscigui_algo_la-SetConsoleShowHiddenHandles.lo:  \
        src/cpp/$(am__dirstamp) src/cpp/$(DEPDIR)/$(am__dirstamp)
 src/cpp/libscigui_algo_la-GetConsoleShowHiddenHandles.lo:  \
@@ -1672,7 +1680,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscigui_la-sci_uiputfile.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscigui_la-sci_usecanvas.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscigui_la-sci_useeditor.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscigui_algo_la-CreateUIControl.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscigui_algo_la-CreateUimenu.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscigui_algo_la-InitializeGUI.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscigui_algo_la-ScilabTermination.Plo@am__quote@
@@ -1691,6 +1698,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscigui_algo_la-CallJxgetmouse.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscigui_algo_la-CallMessageBox.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscigui_algo_la-ContextMenu.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscigui_algo_la-CreateUIControl.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscigui_algo_la-GetConsoleShowHiddenHandles.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscigui_algo_la-GetScreenProperty.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscigui_algo_la-GetUicontrolBackgroundColor.Plo@am__quote@
@@ -1700,6 +1708,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscigui_algo_la-GetUicontrolFontUnits.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscigui_algo_la-GetUicontrolFontWeight.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscigui_algo_la-GetUicontrolHorizontalAlignment.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscigui_algo_la-GetUicontrolIcon.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscigui_algo_la-GetUicontrolListboxTop.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscigui_algo_la-GetUicontrolMax.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscigui_algo_la-GetUicontrolMin.Plo@am__quote@
@@ -1725,6 +1734,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscigui_algo_la-SetUicontrolFontUnits.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscigui_algo_la-SetUicontrolFontWeight.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscigui_algo_la-SetUicontrolHorizontalAlignment.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscigui_algo_la-SetUicontrolIcon.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscigui_algo_la-SetUicontrolListboxTop.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscigui_algo_la-SetUicontrolMax.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscigui_algo_la-SetUicontrolMin.Plo@am__quote@
@@ -1822,13 +1832,6 @@ src/c/libscigui_algo_la-addmenu.lo: src/c/addmenu.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigui_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscigui_algo_la-addmenu.lo `test -f 'src/c/addmenu.c' || echo '$(srcdir)/'`src/c/addmenu.c
 
-src/c/libscigui_algo_la-CreateUIControl.lo: src/c/CreateUIControl.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigui_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscigui_algo_la-CreateUIControl.lo -MD -MP -MF src/c/$(DEPDIR)/libscigui_algo_la-CreateUIControl.Tpo -c -o src/c/libscigui_algo_la-CreateUIControl.lo `test -f 'src/c/CreateUIControl.c' || echo '$(srcdir)/'`src/c/CreateUIControl.c
-@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscigui_algo_la-CreateUIControl.Tpo src/c/$(DEPDIR)/libscigui_algo_la-CreateUIControl.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/c/CreateUIControl.c' object='src/c/libscigui_algo_la-CreateUIControl.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigui_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscigui_algo_la-CreateUIControl.lo `test -f 'src/c/CreateUIControl.c' || echo '$(srcdir)/'`src/c/CreateUIControl.c
-
 src/c/libscigui_algo_la-CreateUimenu.lo: src/c/CreateUimenu.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigui_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscigui_algo_la-CreateUimenu.lo -MD -MP -MF src/c/$(DEPDIR)/libscigui_algo_la-CreateUimenu.Tpo -c -o src/c/libscigui_algo_la-CreateUimenu.lo `test -f 'src/c/CreateUimenu.c' || echo '$(srcdir)/'`src/c/CreateUimenu.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscigui_algo_la-CreateUimenu.Tpo src/c/$(DEPDIR)/libscigui_algo_la-CreateUimenu.Plo
@@ -2084,6 +2087,13 @@ src/jni/libscigui_algo_la-CallScilabBridge.lo: src/jni/CallScilabBridge.cpp
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigui_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/jni/libscigui_algo_la-CallScilabBridge.lo `test -f 'src/jni/CallScilabBridge.cpp' || echo '$(srcdir)/'`src/jni/CallScilabBridge.cpp
 
+src/cpp/libscigui_algo_la-CreateUIControl.lo: src/cpp/CreateUIControl.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigui_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/libscigui_algo_la-CreateUIControl.lo -MD -MP -MF src/cpp/$(DEPDIR)/libscigui_algo_la-CreateUIControl.Tpo -c -o src/cpp/libscigui_algo_la-CreateUIControl.lo `test -f 'src/cpp/CreateUIControl.cpp' || echo '$(srcdir)/'`src/cpp/CreateUIControl.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/cpp/$(DEPDIR)/libscigui_algo_la-CreateUIControl.Tpo src/cpp/$(DEPDIR)/libscigui_algo_la-CreateUIControl.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='src/cpp/CreateUIControl.cpp' object='src/cpp/libscigui_algo_la-CreateUIControl.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigui_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/libscigui_algo_la-CreateUIControl.lo `test -f 'src/cpp/CreateUIControl.cpp' || echo '$(srcdir)/'`src/cpp/CreateUIControl.cpp
+
 src/jni/libscigui_algo_la-Jxclick.lo: src/jni/Jxclick.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigui_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/jni/libscigui_algo_la-Jxclick.lo -MD -MP -MF src/jni/$(DEPDIR)/libscigui_algo_la-Jxclick.Tpo -c -o src/jni/libscigui_algo_la-Jxclick.lo `test -f 'src/jni/Jxclick.cpp' || echo '$(srcdir)/'`src/jni/Jxclick.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/jni/$(DEPDIR)/libscigui_algo_la-Jxclick.Tpo src/jni/$(DEPDIR)/libscigui_algo_la-Jxclick.Plo
@@ -2476,6 +2486,20 @@ src/cpp/libscigui_algo_la-GetUicontrolSliderStep.lo: src/cpp/GetUicontrolSliderS
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigui_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/libscigui_algo_la-GetUicontrolSliderStep.lo `test -f 'src/cpp/GetUicontrolSliderStep.cpp' || echo '$(srcdir)/'`src/cpp/GetUicontrolSliderStep.cpp
 
+src/cpp/libscigui_algo_la-SetUicontrolIcon.lo: src/cpp/SetUicontrolIcon.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigui_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/libscigui_algo_la-SetUicontrolIcon.lo -MD -MP -MF src/cpp/$(DEPDIR)/libscigui_algo_la-SetUicontrolIcon.Tpo -c -o src/cpp/libscigui_algo_la-SetUicontrolIcon.lo `test -f 'src/cpp/SetUicontrolIcon.cpp' || echo '$(srcdir)/'`src/cpp/SetUicontrolIcon.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/cpp/$(DEPDIR)/libscigui_algo_la-SetUicontrolIcon.Tpo src/cpp/$(DEPDIR)/libscigui_algo_la-SetUicontrolIcon.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='src/cpp/SetUicontrolIcon.cpp' object='src/cpp/libscigui_algo_la-SetUicontrolIcon.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigui_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/libscigui_algo_la-SetUicontrolIcon.lo `test -f 'src/cpp/SetUicontrolIcon.cpp' || echo '$(srcdir)/'`src/cpp/SetUicontrolIcon.cpp
+
+src/cpp/libscigui_algo_la-GetUicontrolIcon.lo: src/cpp/GetUicontrolIcon.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigui_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/libscigui_algo_la-GetUicontrolIcon.lo -MD -MP -MF src/cpp/$(DEPDIR)/libscigui_algo_la-GetUicontrolIcon.Tpo -c -o src/cpp/libscigui_algo_la-GetUicontrolIcon.lo `test -f 'src/cpp/GetUicontrolIcon.cpp' || echo '$(srcdir)/'`src/cpp/GetUicontrolIcon.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/cpp/$(DEPDIR)/libscigui_algo_la-GetUicontrolIcon.Tpo src/cpp/$(DEPDIR)/libscigui_algo_la-GetUicontrolIcon.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='src/cpp/GetUicontrolIcon.cpp' object='src/cpp/libscigui_algo_la-GetUicontrolIcon.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigui_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/libscigui_algo_la-GetUicontrolIcon.lo `test -f 'src/cpp/GetUicontrolIcon.cpp' || echo '$(srcdir)/'`src/cpp/GetUicontrolIcon.cpp
+
 src/cpp/libscigui_algo_la-SetConsoleShowHiddenHandles.lo: src/cpp/SetConsoleShowHiddenHandles.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigui_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/libscigui_algo_la-SetConsoleShowHiddenHandles.lo -MD -MP -MF src/cpp/$(DEPDIR)/libscigui_algo_la-SetConsoleShowHiddenHandles.Tpo -c -o src/cpp/libscigui_algo_la-SetConsoleShowHiddenHandles.lo `test -f 'src/cpp/SetConsoleShowHiddenHandles.cpp' || echo '$(srcdir)/'`src/cpp/SetConsoleShowHiddenHandles.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/cpp/$(DEPDIR)/libscigui_algo_la-SetConsoleShowHiddenHandles.Tpo src/cpp/$(DEPDIR)/libscigui_algo_la-SetConsoleShowHiddenHandles.Plo
diff --git a/scilab/modules/gui/includes/GetUicontrol.h b/scilab/modules/gui/includes/GetUicontrol.h
new file mode 100644 (file)
index 0000000..876f4a5
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2014 - Scilab Enterprises - Antoine ELIAS
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#ifndef __GET_UICONTROL_H__
+#define __GET_UICONTROL_H__
+
+#include "BOOL.h"
+#include "returnProperty.h"
+#include "dynlib_gui.h"
+#include "setHandleProperty.h"
+#include "Scierror.h"
+#include "sciprint.h"
+#include "localization.h"
+#include "SetPropertyStatus.h"
+#include "sci_types.h"
+#include "setGraphicObjectProperty.h"
+#include "getGraphicObjectProperty.h"
+#include "graphicObjectProperties.h"
+
+GUI_IMPEXP int GetUicontrolIcon(void* _pvCtx, int iObjUID);
+
+#endif /* __GET_UICONTROL_H__ */
diff --git a/scilab/modules/gui/includes/SetUicontrol.h b/scilab/modules/gui/includes/SetUicontrol.h
new file mode 100644 (file)
index 0000000..68e7248
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2014 - Scilab Enterprises - Antoine ELIAS
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#ifndef __SET_UICONTROL_H__
+#define __SET_UICONTROL_H__
+
+#include "BOOL.h"
+#include "returnProperty.h"
+#include "dynlib_gui.h"
+#include "setHandleProperty.h"
+#include "Scierror.h"
+#include "sciprint.h"
+#include "localization.h"
+#include "SetPropertyStatus.h"
+#include "sci_types.h"
+#include "setGraphicObjectProperty.h"
+#include "getGraphicObjectProperty.h"
+#include "graphicObjectProperties.h"
+
+GUI_IMPEXP int SetUicontrolIcon(void* _pvCtx, int iObjUID, void* _pvData, int valueType, int nbRow, int nbCol);
+
+#endif /* __SET_UICONTROL_H__ */
index 887bc18..61c96b0 100644 (file)
@@ -74,7 +74,8 @@ static const char* propertiesNames[] =
     "groupname",
     "title_position",
     "title_scroll",
-    "scrollable"
+    "scrollable",
+    "icon"
 };
 
 /*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/gui/src/c/CreateUIControl.c b/scilab/modules/gui/src/c/CreateUIControl.c
deleted file mode 100644 (file)
index 1da9c2e..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2007 - INRIA - Vincent COUVERT
- * Copyright (C) 2010 - DIGITEO - Vincent COUVERT
- * Create Java object matching Scilab uicontrol
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
- *
- */
-
-#include <string.h>
-#include "CreateUIControl.h"
-#include "BuildObjects.h"
-#include "DestroyObjects.h" /* sciStandardDestroyOperations */
-
-#include "createGraphicObject.h"
-#include "graphicObjectProperties.h"
-#include "setGraphicObjectProperty.h"
-
-/**CreateUIControl
- * This function creates Uicontrol structure.
- * @param char style[]: the type of the uicontrol object
- * @return  : created object UID if ok , NULL if not
- */
-int CreateUIControl(char *style)
-{
-    int iObjUID = 0;
-    if (style == NULL || strcmp(style, "pushbutton") == 0)
-    {
-        iObjUID = createGraphicObject(__GO_UI_PUSHBUTTON__);
-    }
-    else if (strcmp(style, "checkbox") == 0)
-    {
-        iObjUID = createGraphicObject(__GO_UI_CHECKBOX__);
-    }
-    else if (strcmp(style, "edit") == 0)
-    {
-        iObjUID = createGraphicObject(__GO_UI_EDIT__);
-    }
-    else if (strcmp(style, "frame") == 0)
-    {
-        iObjUID = createGraphicObject(__GO_UI_FRAME__);
-    }
-    else if (strcmp(style, "listbox") == 0)
-    {
-        iObjUID = createGraphicObject(__GO_UI_LISTBOX__);
-    }
-    else if (strcmp(style, "image") == 0)
-    {
-        iObjUID = createGraphicObject(__GO_UI_IMAGE__);
-    }
-    else if (strcmp(style, "popupmenu") == 0)
-    {
-        iObjUID = createGraphicObject(__GO_UI_POPUPMENU__);
-    }
-    else if (strcmp(style, "radiobutton") == 0)
-    {
-        iObjUID = createGraphicObject(__GO_UI_RADIOBUTTON__);
-    }
-    else if (strcmp(style, "slider") == 0)
-    {
-        iObjUID = createGraphicObject(__GO_UI_SLIDER__);
-    }
-    else if (strcmp(style, "table") == 0)
-    {
-        iObjUID = createGraphicObject(__GO_UI_TABLE__);
-    }
-    else if (strcmp(style, "text") == 0)
-    {
-        iObjUID = createGraphicObject(__GO_UI_TEXT__);
-    }
-    else if (strcmp(style, "tab") == 0)
-    {
-        iObjUID = createGraphicObject(__GO_UI_TAB__);
-    }
-    else if (strcmp(style, "layer") == 0)
-    {
-        iObjUID = createGraphicObject(__GO_UI_LAYER__);
-    }
-
-    return iObjUID;
-}
-/*----------------------------------------------------------------------------*/
-
index 9ed07ec..9ad6b1c 100755 (executable)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
@@ -84,7 +84,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>.;../jni;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../includes;../../../core/includes;../../../fileio/includes;../../../graphics/includes;../../../graphic_export/includes;../../../graphics/src/c/getHandleProperty;../../../renderer/src/cpp;../../../renderer/src/jni;../../../localization/includes;../../../jvm/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../../libs/intl;;../../../string/includes;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../renderer/includes;../cpp;../../../api_scilab/includes;../../../commons/src/jni;../../../graphic_objects/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../jni;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../includes;../../../core/includes;../../../fileio/includes;../../../graphics/includes;../../../graphic_export/includes;../../../graphics/src/c/getHandleProperty;../../../renderer/src/cpp;../../../renderer/src/jni;../../../localization/includes;../../../jvm/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../../libs/intl;../../../string/includes;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../renderer/includes;../cpp;../../../api_scilab/includes;../../../commons/src/jni;../../../graphic_objects/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;GUI_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>.;../jni;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../includes;../../../core/includes;../../../fileio/includes;../../../graphics/includes;../../../graphic_export/includes;../../../graphics/src/c/getHandleProperty;../../../renderer/src/cpp;../../../renderer/src/jni;../../../localization/includes;../../../jvm/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../../libs/intl;;../../../string/includes;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../renderer/includes;../cpp;../../../api_scilab/includes;../../../commons/src/jni;../../../graphic_objects/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../jni;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../includes;../../../core/includes;../../../fileio/includes;../../../graphics/includes;../../../graphic_export/includes;../../../graphics/src/c/getHandleProperty;../../../renderer/src/cpp;../../../renderer/src/jni;../../../localization/includes;../../../jvm/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../../libs/intl;../../../string/includes;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../renderer/includes;../cpp;../../../api_scilab/includes;../../../commons/src/jni;../../../graphic_objects/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;GUI_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
     <ClCompile>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>.;../jni;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../includes;../../../core/includes;../../../fileio/includes;../../../graphics/includes;../../../graphic_export/includes;../../../graphics/src/c/getHandleProperty;../../../renderer/src/cpp;../../../renderer/src/jni;../../../localization/includes;../../../jvm/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../../libs/intl;;../../../string/includes;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../renderer/includes;../cpp;../../../api_scilab/includes;../../../commons/src/jni;../../../graphic_objects/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../jni;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../includes;../../../core/includes;../../../fileio/includes;../../../graphics/includes;../../../graphic_export/includes;../../../graphics/src/c/getHandleProperty;../../../renderer/src/cpp;../../../renderer/src/jni;../../../localization/includes;../../../jvm/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../../libs/intl;../../../string/includes;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../renderer/includes;../cpp;../../../api_scilab/includes;../../../commons/src/jni;../../../graphic_objects/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;GUI_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
     <ClCompile>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>.;../jni;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../includes;../../../core/includes;../../../fileio/includes;../../../graphics/includes;../../../graphic_export/includes;../../../graphics/src/c/getHandleProperty;../../../renderer/src/cpp;../../../renderer/src/jni;../../../localization/includes;../../../jvm/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../../libs/intl;;../../../string/includes;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../renderer/includes;../cpp;../../../api_scilab/includes;../../../commons/src/jni;../../../graphic_objects/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../jni;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../includes;../../../core/includes;../../../fileio/includes;../../../graphics/includes;../../../graphic_export/includes;../../../graphics/src/c/getHandleProperty;../../../renderer/src/cpp;../../../renderer/src/jni;../../../localization/includes;../../../jvm/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../../libs/intl;../../../string/includes;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../renderer/includes;../cpp;../../../api_scilab/includes;../../../commons/src/jni;../../../graphic_objects/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;GUI_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
     <ClCompile Include="..\..\sci_gateway\cpp\sci_openged.cpp" />
     <ClCompile Include="..\..\sci_gateway\cpp\sci_datatipcreate.cpp" />
     <ClCompile Include="..\..\sci_gateway\cpp\sci_datatipremove.cpp" />
+    <ClCompile Include="..\cpp\CreateUIControl.cpp" />
     <ClCompile Include="..\cpp\GetConsoleShowHiddenHandles.cpp" />
+    <ClCompile Include="..\cpp\GetUicontrolIcon.cpp" />
     <ClCompile Include="..\cpp\GetUicontrolTooltipString.cpp" />
     <ClCompile Include="..\cpp\SetConsoleShowHiddenHandles.cpp" />
+    <ClCompile Include="..\cpp\SetUicontrolIcon.cpp" />
     <ClCompile Include="..\jni\DatatipCreate.cpp" />
     <ClCompile Include="..\jni\DatatipSetStyle.cpp" />
     <ClCompile Include="..\jni\DatatipDelete.cpp" />
     <ClCompile Include="..\jni\CallScilabBridge.cpp" />
     <ClCompile Include="checkColorRange.c" />
     <ClCompile Include="..\cpp\ContextMenu.cpp" />
-    <ClCompile Include="CreateUIControl.c" />
     <ClCompile Include="CreateUimenu.c" />
     <ClCompile Include="..\cpp\displaytree.cpp" />
     <ClCompile Include="DllmainGUI.c" />
     <ClInclude Include="..\..\includes\exportUserInterface.hxx" />
     <ClInclude Include="..\..\includes\GetConsoleShowHiddenHandles.h" />
     <ClInclude Include="..\..\includes\GetScreenProperty.h" />
+    <ClInclude Include="..\..\includes\GetUicontrol.h" />
+    <ClInclude Include="..\..\includes\SetUicontrol.h" />
     <ClInclude Include="..\..\includes\GetUicontrolBackgroundColor.h" />
     <ClInclude Include="..\..\includes\GetUicontrolFontAngle.h" />
     <ClInclude Include="..\..\includes\GetUicontrolFontName.h" />
     <ClInclude Include="..\..\includes\SetUiobjectForegroundColor.h" />
     <ClInclude Include="..\..\includes\TerminateGui.h" />
     <ClInclude Include="..\..\includes\Widget.h" />
+    <ClInclude Include="..\cpp\CreateUIControl.h" />
     <ClInclude Include="..\jni\DatatipCreate.hxx" />
     <ClInclude Include="..\jni\DatatipSetStyle.hxx" />
     <ClInclude Include="..\jni\DatatipDelete.hxx" />
     <ClInclude Include="..\jni\SwingView.hxx" />
     <ClInclude Include="buildMainWindowTitle.h" />
     <ClInclude Include="checkColorRange.h" />
-    <ClInclude Include="CreateUIControl.h" />
     <ClInclude Include="CreateUimenu.h" />
     <ClInclude Include="getMainWindowTitle.h" />
     <ClInclude Include="iconifyMainWindow.h" />
index 8b0f1c7..37e1455 100755 (executable)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup>
     <Filter Include="Source Files">
@@ -62,9 +62,6 @@
     <ClCompile Include="..\cpp\ContextMenu.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="CreateUIControl.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="CreateUimenu.c">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="..\..\sci_gateway\c\sci_figure.c">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\cpp\GetUicontrolIcon.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\cpp\SetUicontrolIcon.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\cpp\CreateUIControl.cpp">
+      <Filter>Header Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <None Include="core_import.def">
     <ClInclude Include="checkColorRange.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="CreateUIControl.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="CreateUimenu.h">
       <Filter>Header Files</Filter>
     </ClInclude>
     <ClInclude Include="..\jni\DatatipOrientation.hxx">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\includes\SetUicontrol.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\includes\GetUicontrol.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\cpp\CreateUIControl.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/scilab/modules/gui/src/cpp/CreateUIControl.cpp b/scilab/modules/gui/src/cpp/CreateUIControl.cpp
new file mode 100644 (file)
index 0000000..8019545
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2007 - INRIA - Vincent COUVERT
+ * Copyright (C) 2010 - DIGITEO - Vincent COUVERT
+ * Create Java object matching Scilab uicontrol
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+extern "C"
+{
+#include <string.h>
+#include "CreateUIControl.h"
+#include "BuildObjects.h"
+#include "DestroyObjects.h" /* sciStandardDestroyOperations */
+
+#include "createGraphicObject.h"
+#include "graphicObjectProperties.h"
+#include "setGraphicObjectProperty.h"
+}
+
+#include <map>
+#include <string>
+
+static bool init = false;
+static std::map<std::string, int> styleMap;
+
+void initStyleMap()
+{
+    styleMap["pushbutton"] = __GO_UI_PUSHBUTTON__;
+    styleMap["checkbox"] = __GO_UI_CHECKBOX__;
+    styleMap["edit"] = __GO_UI_EDIT__;
+    styleMap["frame"] = __GO_UI_FRAME__;
+    styleMap["listbox"] = __GO_UI_LISTBOX__;
+    styleMap["image"] = __GO_UI_IMAGE__;
+    styleMap["popupmenu"] = __GO_UI_POPUPMENU__;
+    styleMap["radiobutton"] = __GO_UI_RADIOBUTTON__;
+    styleMap["slider"] = __GO_UI_SLIDER__;
+    styleMap["table"] = __GO_UI_TABLE__;
+    styleMap["text"] = __GO_UI_TEXT__;
+    styleMap["tab"] = __GO_UI_TAB__;
+    styleMap["layer"] = __GO_UI_LAYER__;
+    init = true;
+}
+
+/**CreateUIControl
+ * This function creates Uicontrol structure.
+ * @param char style[]: the type of the uicontrol object
+ * @return  : created object UID if ok , NULL if not
+ */
+int CreateUIControl(char *style)
+{
+
+    if (init == false)
+    {
+        initStyleMap();
+    }
+
+    if (style == NULL)
+    {
+        return createGraphicObject(styleMap["pushbutton"]);
+    }
+
+    return createGraphicObject(styleMap[style]);
+}
+/*----------------------------------------------------------------------------*/
+
diff --git a/scilab/modules/gui/src/cpp/GetUicontrolIcon.cpp b/scilab/modules/gui/src/cpp/GetUicontrolIcon.cpp
new file mode 100644 (file)
index 0000000..e3113ef
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2014 - Scilab Enterprises - Antoine ELIAS
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+extern "C"
+{
+#include <string.h>
+
+#include "GetUicontrol.h"
+}
+
+/*------------------------------------------------------------------------*/
+int GetUicontrolIcon(void* _pvCtx, int iObjUID)
+{
+    char* psticon = NULL;
+    getGraphicObjectProperty(iObjUID, __GO_UI_ICON__, jni_string, (void **)&psticon);
+    if (psticon == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "icon");
+        return -1;
+    }
+
+    return sciReturnString(_pvCtx, psticon);
+}
+/*------------------------------------------------------------------------*/
diff --git a/scilab/modules/gui/src/cpp/SetUicontrolIcon.cpp b/scilab/modules/gui/src/cpp/SetUicontrolIcon.cpp
new file mode 100644 (file)
index 0000000..07cf43b
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2014 - Scilab Enterprises - Antoine ELIAS
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include "FindIconHelper.hxx"
+
+extern "C" {
+#include "SetUicontrol.h"
+#include "expandPathVariable.h"
+#include "getScilabJavaVM.h"
+#include "scicurdir.h"
+#include "MALLOC.h"
+#include "fullpath.h"
+}
+/*------------------------------------------------------------------------*/
+int SetUicontrolIcon(void* _pvCtx, int iObjUID, void* _pvData, int valueType, int nbRow, int nbCol)
+{
+    char* expandedpath = NULL;
+    char absolutepath[4096];
+
+    if (valueType != sci_strings)
+    {
+        Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "icon");
+        return SET_PROPERTY_ERROR;
+    }
+
+    //get file path
+    expandedpath = expandPathVariable((char*)_pvData);
+    get_full_path(absolutepath, expandedpath, 4096);
+
+    //it is a absolute path, put it only in model
+    if (strcmp(expandedpath, absolutepath))
+    {
+        int iErr = 0;
+        char* pwd = scigetcwd(&iErr);
+
+        //add it to FindIconHelper java class
+        org_scilab_modules_commons_gui::FindIconHelper::addThemePath(getScilabJavaVM(), pwd);
+    }
+
+    strcpy(absolutepath, expandedpath);
+    FREE(expandedpath);
+
+    if (setGraphicObjectProperty(iObjUID, __GO_UI_ICON__, absolutepath, jni_string, 1) == FALSE)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "icon");
+        return SET_PROPERTY_ERROR;
+    }
+
+    return SET_PROPERTY_SUCCEED;
+}
+/*------------------------------------------------------------------------*/
index 7bd3c20..2712d1d 100644 (file)
@@ -366,7 +366,7 @@ public final class SwingView implements GraphicView {
                 edit.setId(id);
                 setDefaultProperties(edit, id);
                 return edit;
-            case Figure:
+            case Figure: {
                 Figure figure = (Figure) GraphicController.getController().getObjectFromId(id);
                 String figureTitle = figure.getName();
                 Integer figureId = figure.getId();
@@ -429,11 +429,18 @@ public final class SwingView implements GraphicView {
                 }
                 tab.update(__GO_SIZE__, GraphicController.getController().getProperty(id, __GO_SIZE__));
                 tab.update(__GO_POSITION__, GraphicController.getController().getProperty(id, __GO_POSITION__));
+
+                String icon = (String)GraphicController.getController().getProperty(id, __GO_UI_ICON__);
+                if (icon != null && icon.equals("") == false) {
+                    tab.update(__GO_UI_ICON__, icon);
+                }
+
                 // TODO set other default properties
 
                 window.setVisible(figure.getVisible());
                 window.pack();
                 return tab;
+            }
             case Axes:
                 SwingScilabAxes axes = new SwingScilabAxes();
                 return axes;
@@ -479,11 +486,17 @@ public final class SwingView implements GraphicView {
                 progressbar.setIndeterminateMode(true);
                 progressbar.setId(id);
                 return progressbar;
-            case PushButton:
+            case PushButton: {
                 SwingScilabPushButton pushButton = new SwingScilabPushButton();
                 pushButton.setId(id);
                 setDefaultProperties(pushButton, id);
+                String icon = (String)GraphicController.getController().getProperty(id, __GO_UI_ICON__);
+                if (icon != null && icon.equals("") == false) {
+                    pushButton.update(__GO_UI_ICON__, icon);
+                }
+
                 return pushButton;
+            }
             case RadioButton:
                 SwingScilabRadioButton radioButton = new SwingScilabRadioButton();
                 radioButton.setId(id);
@@ -506,11 +519,16 @@ public final class SwingView implements GraphicView {
                 table.setId(id);
                 setDefaultProperties(table, id);
                 return table;
-            case Text:
+            case Text: {
                 SwingScilabLabel text = new SwingScilabLabel();
                 text.setId(id);
                 setDefaultProperties(text, id);
+                String icon = (String)GraphicController.getController().getProperty(id, __GO_UI_ICON__);
+                if (icon != null && icon.equals("") == false) {
+                    text.update(__GO_UI_ICON__, icon);
+                }
                 return text;
+            }
             case Uimenu:
                 throw new UnsupportedOperationException();
             case UiParentMenu: /* SwingView internal type */
index 7a11099..9675fe4 100644 (file)
@@ -27,13 +27,13 @@ import java.awt.Color;
 
 import javax.swing.ImageIcon;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.commons.gui.ScilabKeyStroke;
 import org.scilab.modules.graphic_objects.graphicController.GraphicController;
 import org.scilab.modules.gui.bridge.checkboxmenuitem.SwingScilabCheckBoxMenuItem;
 import org.scilab.modules.gui.bridge.menu.SwingScilabMenu;
 import org.scilab.modules.gui.bridge.menuitem.SwingScilabMenuItem;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
-import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.gui.widget.Widget;
 
 /**
@@ -86,7 +86,7 @@ public final class SwingViewMenu {
                 break;
             case __GO_UI_ICON__ :
                 if (!((String) value).equals("")) {
-                    ((SwingScilabMenuItem) uimenu).setIcon(new ImageIcon(ScilabSwingUtilities.findIcon((String) value, "16x16")));
+                    ((SwingScilabMenuItem) uimenu).setIcon(new ImageIcon(FindIconHelper.findIcon((String) value, "16x16")));
                 }
                 break;
             case __GO_UI_LABEL__ :
index 745b14d..7270603 100644 (file)
@@ -30,12 +30,12 @@ import javax.swing.JPanel;
 import javax.swing.JRadioButton;
 import javax.swing.SwingUtilities;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.graphic_export.ExportParams;
 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.SimpleTab;
-import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.localization.Messages;
 
 /**
@@ -73,7 +73,7 @@ public class ExportOptionWindow implements ActionListener {
         parentWindow = (Window) SwingUtilities.getAncestorOfClass(Window.class, (JComponent) tab);
         optionDialog = new JDialog(parentWindow);
         optionDialog.setTitle(String.format(Messages.gettext("Option for %s format"), exportData.getExportExtension().toUpperCase()));
-        optionDialog.setIconImage(new ImageIcon(ScilabSwingUtilities.findIcon("scilab")).getImage());
+        optionDialog.setIconImage(new ImageIcon(FindIconHelper.findIcon("scilab")).getImage());
     }
 
     /**
index 3225161..e2e7d49 100644 (file)
@@ -46,6 +46,7 @@ import javax.swing.event.ChangeListener;
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.gui.fontchooser.SimpleFontChooser;
 import org.scilab.modules.gui.utils.ScilabFontUtils;
 import org.scilab.modules.gui.utils.ScilabSwingUtilities;
@@ -72,9 +73,9 @@ public class SwingScilabFontChooser extends JDialog implements SimpleFontChooser
 
     private final JList fontSizeList;
     private final String[] availableFontSizes = {"8", "10", "11", "12",
-                                                 "13", "14", "16", "18", "20",
-                                                 "24", "30", "36", "40",
-                                                 "48", "60", "72"
+                           "13", "14", "16", "18", "20",
+                           "24", "30", "36", "40",
+                           "48", "60", "72"
                                                 };
 
     private final boolean calledFromScinotes;
@@ -106,7 +107,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(ScilabSwingUtilities.findIcon("scilab", "256x256")).getImage());
+        ((JFrame) getParent()).setIconImage(new ImageIcon(FindIconHelper.findIcon("scilab", "256x256")).getImage());
 
         getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
 
index 5dd7838..3a17efd 100644 (file)
  */
 package org.scilab.modules.gui.bridge.label;
 
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_ICON__;
 
 import java.awt.Color;
 import java.awt.Dimension;
 import java.awt.Font;
 import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
 
+import javax.imageio.ImageIO;
 import javax.swing.BorderFactory;
+import javax.swing.ImageIcon;
 import javax.swing.JComponent;
 import javax.swing.JEditorPane;
 import javax.swing.JLabel;
@@ -35,9 +40,8 @@ import javax.swing.event.HyperlinkListener;
 import javax.swing.text.html.HTMLDocument;
 import javax.swing.text.html.StyleSheet;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.console.utils.ScilabSpecialTextUtilities;
-import org.scilab.modules.graphic_objects.graphicController.GraphicController;
-import org.scilab.modules.graphic_objects.uicontrol.frame.border.FrameBorderType;
 import org.scilab.modules.gui.SwingViewObject;
 import org.scilab.modules.gui.SwingViewWidget;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
@@ -484,7 +488,28 @@ public class SwingScilabLabel extends JScrollPane implements SwingViewObject, Si
      * @param value property value
      */
     public void update(int property, Object value) {
-        SwingViewWidget.update(this, property, value);
+        switch (property) {
+            case __GO_UI_ICON__ : {
+                if (isJLabel) {
+                    File file = new File((String)value);
+                    if (file.exists() == false) {
+                        String filename = FindIconHelper.findImage((String)value);
+                        file = new File(filename);
+                    }
+
+                    try {
+                        BufferedImage icon = ImageIO.read(file);
+                        ((JLabel) label).setIcon(new ImageIcon(icon));
+                    } catch (IOException e) {
+                    }
+                } else {
+                    //Icon in JEditorPane ?
+                }
+            }
+            default : {
+                SwingViewWidget.update(this, property, value);
+            }
+        }
     }
 
     public void resetBackground() {
index e12f161..627230b 100644 (file)
@@ -59,6 +59,7 @@ import javax.swing.event.HyperlinkListener;
 import javax.swing.text.html.HTMLEditorKit;
 import javax.swing.text.html.StyleSheet;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.gui.console.ScilabConsole;
 import org.scilab.modules.gui.messagebox.SimpleMessageBox;
 import org.scilab.modules.gui.tab.SimpleTab;
@@ -98,9 +99,9 @@ public class SwingScilabMessageBox extends JDialog implements SimpleMessageBox,
     /**
      * Icons
      */
-    private final Icon scilabIcon = new ImageIcon(ScilabSwingUtilities.findIcon("scilab", "48x48"));
-    private final Icon passwdIcon = new ImageIcon(ScilabSwingUtilities.findIcon("emblem-readonly", "48x48"));
-    private final Icon hourglassIcon = new ImageIcon(ScilabSwingUtilities.findIcon("process-working"));
+    private final Icon scilabIcon = new ImageIcon(FindIconHelper.findIcon("scilab", "48x48"));
+    private final Icon passwdIcon = new ImageIcon(FindIconHelper.findIcon("emblem-readonly", "48x48"));
+    private final Icon hourglassIcon = new ImageIcon(FindIconHelper.findIcon("process-working"));
 
     private int elementId;
 
index 597711b..b9b8cd3 100644 (file)
 
 package org.scilab.modules.gui.bridge.pushbutton;
 
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_ICON__;
+
 import java.awt.Color;
 import java.awt.Font;
+import java.awt.image.BufferedImage;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
+import java.io.File;
+import java.io.IOException;
 
+import javax.imageio.ImageIO;
 import javax.swing.Icon;
 import javax.swing.ImageIcon;
 import javax.swing.JButton;
 import javax.swing.UIManager;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.console.utils.ScilabSpecialTextUtilities;
 import org.scilab.modules.graphic_objects.console.Console;
 import org.scilab.modules.gui.SwingViewObject;
@@ -305,7 +312,24 @@ public class SwingScilabPushButton extends JButton implements SwingViewObject, S
      * @param value property value
      */
     public void update(int property, Object value) {
-        SwingViewWidget.update(this, property, value);
+        switch (property) {
+            case __GO_UI_ICON__ : {
+                File file = new File((String)value);
+                if (file.exists() == false) {
+                    String filename = FindIconHelper.findImage((String)value);
+                    file = new File(filename);
+                }
+
+                try {
+                    BufferedImage icon = ImageIO.read(file);
+                    setIcon(new ImageIcon(icon));
+                } catch (IOException e) {
+                }
+            }
+            default : {
+                SwingViewWidget.update(this, property, value);
+            }
+        }
     }
 
     public void setBackground(Color color) {
index 291b422..3a27e05 100644 (file)
@@ -35,6 +35,7 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UICHILDMENU__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UIMENU__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UIPARENTMENU__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_ICON__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_VISIBLE__;
 
 import java.awt.BorderLayout;
@@ -43,9 +44,15 @@ import java.awt.Dimension;
 import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
 import java.awt.GridLayout;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
 
+import javax.imageio.ImageIO;
+import javax.swing.ImageIcon;
 import javax.swing.JLayeredPane;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.graphic_objects.figure.Figure;
 import org.scilab.modules.graphic_objects.figure.Figure.BarType;
 import org.scilab.modules.graphic_objects.graphicController.GraphicController;
@@ -237,6 +244,19 @@ public class SwingScilabCommonPanel {
                 component.getWidgetPane().setLayout(new BorderLayout(padding[0], padding[1]));
                 component.getWidgetPane().setLayout(new BorderLayout());
             }
+            case __GO_UI_ICON__ : {
+                File file = new File((String)value);
+                if (file.exists() == false) {
+                    String filename = FindIconHelper.findImage((String)value);
+                    file = new File(filename);
+                }
+
+                try {
+                    BufferedImage icon = ImageIO.read(file);
+                    component.getParentWindow().setIconImage(new ImageIcon(icon).getImage());
+                } catch (IOException e) {
+                }
+            }
         }
     }
 
index f30bcab..f6ffb0b 100644 (file)
@@ -58,6 +58,7 @@ import org.flexdock.view.Titlebar;
 import org.flexdock.view.View;
 import org.scilab.modules.action_binding.InterpreterManagement;
 import org.scilab.modules.commons.ScilabConstants;
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.graphic_objects.figure.Figure;
 import org.scilab.modules.graphic_objects.graphicController.GraphicController;
 import org.scilab.modules.gui.SwingViewObject;
@@ -75,7 +76,6 @@ import org.scilab.modules.gui.bridge.popupmenu.SwingScilabPopupMenu;
 import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.bridge.radiobutton.SwingScilabRadioButton;
 import org.scilab.modules.gui.bridge.slider.SwingScilabScroll;
-import org.scilab.modules.gui.bridge.toolbar.SwingScilabToolBar;
 import org.scilab.modules.gui.bridge.tree.SwingScilabTree;
 import org.scilab.modules.gui.bridge.uidisplaytree.SwingScilabUiDisplayTree;
 import org.scilab.modules.gui.bridge.uiimage.SwingScilabUiImage;
@@ -113,7 +113,6 @@ import org.scilab.modules.gui.utils.Position;
 import org.scilab.modules.gui.utils.SciClosingAction;
 import org.scilab.modules.gui.utils.SciHelpOnComponentAction;
 import org.scilab.modules.gui.utils.SciUndockingAction;
-import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.gui.utils.Size;
 
 /**
@@ -129,7 +128,7 @@ public class SwingScilabDockablePanel extends View implements SimpleTab, FocusLi
 
 
 
-    private static final Image SCILAB_ICON = new ImageIcon(ScilabSwingUtilities.findIcon("scilab", "256x256")).getImage();
+    private static final Image SCILAB_ICON = new ImageIcon(FindIconHelper.findIcon("scilab", "256x256")).getImage();
 
     private static final long serialVersionUID = 1L;
 
@@ -416,7 +415,7 @@ public class SwingScilabDockablePanel extends View implements SimpleTab, FocusLi
      * @param iconName window icon associated with this tab
      */
     public void setWindowIcon(String iconName) {
-        setWindowIcon(new ImageIcon(ScilabSwingUtilities.findIcon(iconName, "256x256")).getImage());
+        setWindowIcon(new ImageIcon(FindIconHelper.findIcon(iconName, "256x256")).getImage());
     }
 
     /**
index 1a4af3f..b15c706 100644 (file)
@@ -21,7 +21,7 @@ import javax.swing.ImageIcon;
 import javax.swing.JTree;
 import javax.swing.tree.DefaultTreeCellRenderer;
 
-import org.scilab.modules.gui.utils.ScilabSwingUtilities;
+import org.scilab.modules.commons.gui.FindIconHelper;
 
 /**
  * Class define the Scilab tree renderer
@@ -36,9 +36,9 @@ public class ScilabTreeCellRenderer extends DefaultTreeCellRenderer {
      * Images
      */
     public static Toolkit toolkit = Toolkit.getDefaultToolkit();
-    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 plus = toolkit.getImage(FindIconHelper.findIcon("list-add"));
+    public static Image minus = toolkit.getImage(FindIconHelper.findIcon("list-remove"));
+    public static Image scilab = toolkit.getImage(FindIconHelper.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);
index 33a9844..b7ebd8e 100644 (file)
@@ -27,9 +27,9 @@ import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.JProgressBar;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.gui.SwingViewObject;
 import org.scilab.modules.gui.console.ScilabConsole;
-import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.gui.waitbar.SimpleWaitBar;
 
 /**
@@ -51,7 +51,7 @@ public class SwingScilabWaitBar extends JFrame implements SwingViewObject, Simpl
 
     private final JLabel messageLabel;
 
-    private final ImageIcon scilabIcon = new ImageIcon(ScilabSwingUtilities.findIcon("scilab"));
+    private final ImageIcon scilabIcon = new ImageIcon(FindIconHelper.findIcon("scilab"));
 
     /**
      * Default constructor
index 9054dc0..69f970c 100644 (file)
@@ -39,6 +39,7 @@ import javax.swing.WindowConstants;
 
 import org.flexdock.docking.DockingPort;
 import org.scilab.modules.action_binding.InterpreterManagement;
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.commons.gui.ScilabKeyStroke;
 import org.scilab.modules.gui.bridge.menubar.SwingScilabMenuBar;
 import org.scilab.modules.gui.bridge.tab.SwingScilabDockablePanel;
@@ -53,7 +54,6 @@ import org.scilab.modules.gui.textbox.TextBox;
 import org.scilab.modules.gui.toolbar.SimpleToolBar;
 import org.scilab.modules.gui.toolbar.ToolBar;
 import org.scilab.modules.gui.utils.Position;
-import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.gui.utils.Size;
 import org.scilab.modules.gui.window.SimpleWindow;
 
@@ -106,7 +106,7 @@ public abstract 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(ScilabSwingUtilities.findIcon("scilab", "256x256")).getImage());
+        setIconImage(new ImageIcon(FindIconHelper.findIcon("scilab", "256x256")).getImage());
 
         /* defining the Layout */
         super.setLayout(new java.awt.BorderLayout());
@@ -192,7 +192,7 @@ public abstract class SwingScilabWindow extends JFrame implements SimpleWindow {
             OSXAdapter.setAboutHandler(this, getClass().getMethod("macosxAbout", (Class[]) null));
             OSXAdapter.setQuitHandler(this, getClass().getMethod("macosxQuit", (Class[]) null));
             OSXAdapter.setPreferencesHandler(this, getClass().getMethod("macosxPreferences", (Class[]) null));
-            OSXAdapter.setDockIcon(new ImageIcon(ScilabSwingUtilities.findIcon("puffin", "256x256")));
+            OSXAdapter.setDockIcon(new ImageIcon(FindIconHelper.findIcon("puffin", "256x256")));
         } catch (java.lang.NoSuchMethodException e) {
             System.err.println("OSXAdapter could not find the method: " + e.getLocalizedMessage());
         }
index c739383..20b2151 100644 (file)
@@ -14,6 +14,7 @@ package org.scilab.modules.gui.plotbrowser.actions;
 
 import javax.swing.ImageIcon;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
 import org.scilab.modules.gui.plotbrowser.PlotBrowser;
@@ -21,7 +22,6 @@ import org.scilab.modules.gui.plotbrowser.StartPlotBrowser;
 import org.scilab.modules.gui.plotbrowser.SwingPlotBrowser;
 import org.scilab.modules.gui.pushbutton.PushButton;
 import org.scilab.modules.gui.pushbutton.ScilabPushButton;
-import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 
 /**
  * Refresh action class
@@ -57,7 +57,7 @@ public final class RefreshAction extends CommonCallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new RefreshAction(title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("view-refresh"));
+        ImageIcon imageIcon = new ImageIcon(FindIconHelper.findIcon("view-refresh"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index 1f9a0c6..5836f55 100644 (file)
@@ -42,6 +42,7 @@ import javax.swing.text.Document;
 import javax.swing.text.JTextComponent;
 
 import org.scilab.modules.commons.ScilabConstants;
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.commons.gui.ScilabKeyStroke;
 
 /**
@@ -56,8 +57,8 @@ public class HelpSearchField extends JPanel implements FocusListener, KeyListene
     private static final String F3 = "F3";
     private static final String KEY = "help-search-field";
     private static final ImageIcon CLOSEICON = new ImageIcon(SCI + "/modules/gui/images/icons/close-tab.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 ImageIcon TOPICON = new ImageIcon(FindIconHelper.findIcon("go-top"));
+    private static final ImageIcon BOTICON = new ImageIcon(FindIconHelper.findIcon("go-bottom"));
     private static final int BUTTONSIZE = 28;
 
     private String text;
index 74670b2..9a085f2 100644 (file)
@@ -28,6 +28,7 @@ import javax.swing.JFrame;
 import javax.swing.JScrollPane;
 import javax.swing.JToggleButton;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.gui.console.ScilabConsole;
 import org.scilab.modules.localization.Messages;
 
@@ -40,7 +41,7 @@ public class ScilabAboutBox {
 
     public static final String SCIDIR = System.getenv("SCI");
     public static final String IMAGEPATH = SCIDIR + "/modules/gui/images/icons/aboutscilab.png";
-    private static Icon scilabIcon = new ImageIcon(ScilabSwingUtilities.findIcon("scilab", "256x256"));
+    private static Icon scilabIcon = new ImageIcon(FindIconHelper.findIcon("scilab", "256x256"));
     private static Image imageForIcon = ((ImageIcon) scilabIcon).getImage();
 
     /**
index 96457b9..01039e3 100644 (file)
@@ -221,231 +221,6 @@ public final class ScilabSwingUtilities {
      */
 
     /**
-     * Look for the icon associated with the name.
-     *
-     * @param icon
-     *            the name to look for
-     * @return the image icon path
-     */
-    public static String findIcon(final String icon) {
-        return findIcon(icon, "16x16");
-    }
-
-    /**
-     * Look for the icon associated with the name for a specific module.
-     *
-     * @param name
-     *            the name to look for
-     * @param size
-     *            the size to look for
-     * @return the loaded image icon
-     */
-    public static String findIcon(final String icon, final String size) {
-        if (icon == null || icon.isEmpty()) {
-            return null;
-        }
-
-        final String filename = findIconHelper(icon, size, "Tango");
-        if (filename != null) {
-            if (LOG.isLoggable(Level.FINER)) {
-                LOG.finer(icon + '[' + size + ']' + " i " + filename);
-            }
-            return filename;
-        }
-
-        final String fallback = lookupFallbackIcon(icon);
-        if (fallback == null) {
-            LOG.warning("Unable to found icon: " + icon + '[' + size + ']');
-            return System.getenv("SCI") + "/modules/gui/images/icons/16x16/status/error.png";
-        }
-
-        if (LOG.isLoggable(Level.FINER)) {
-            LOG.finer(icon + '[' + size + ']' + " f " + fallback);
-        }
-        return fallback;
-    }
-
-    private static String findIconHelper(final String icon, final String size, final String theme) {
-        try {
-            final String filename = lookupIcon(icon, size, theme);
-            if (filename != null) {
-                return filename;
-            }
-        } catch (IOException e) {
-        }
-
-        /*
-         * always look for hicolor and then empty theme in case of invalid
-         * theme.
-         */
-        if (!theme.isEmpty() && theme != HICOLOR) {
-            return findIconHelper(icon, size, HICOLOR);
-        } else if (!theme.isEmpty()) {
-            return findIconHelper(icon, size, "");
-        } else {
-            return null;
-        }
-    }
-
-    private static final Logger LOG = Logger.getLogger(ScilabSwingUtilities.class.getName());
-
-    private static final String SCI = System.getenv("SCI");
-    private static final String SEP = System.getProperty("file.separator");
-    private static final String DOT = ".";
-    private static final String HICOLOR = "hicolor";
-    private static final List<String> ICONS_EXTENSIONS = Arrays.asList("png", "svg", "xpm");
-    private static final HashMap<File, TreeSet<String>> THEME_SUBDIR_CACHE = new HashMap<File, TreeSet<String>>();
-
-    private static final FileFilter DIR_FILTER;
-    private static final List<String> THEME_BASENAME;
-    static {
-        DIR_FILTER = new FileFilter() {
-            @Override
-            public boolean accept(File pathname) {
-                return pathname.isDirectory();
-            }
-        };
-        THEME_BASENAME = new ArrayList<String>();
-
-        /*
-         * Linux specific path
-         */
-        switch (OS.get()) {
-            case UNIX:
-                THEME_BASENAME.add("~/.icons");
-                THEME_BASENAME.add("/usr/share/icons");
-                THEME_BASENAME.add("/usr/share/pixmaps");
-
-                THEME_BASENAME.add(SCI + "/../icons");
-                break;
-
-            case MAC:
-                THEME_BASENAME.add(SCI + "/../icons");
-                break;
-
-            default:
-                break;
-        }
-
-        /*
-         * Scilab embedded icons
-         */
-
-        final ArrayList<File> dirs = new ArrayList<File>();
-
-        // Append SCI/desktop and SCI/modules/xxx to the dirs
-        dirs.add(new File(SCI + SEP + "desktop"));
-        dirs.addAll(Arrays.asList(new File(SCI + SEP + "modules").listFiles(DIR_FILTER)));
-        for (File m : dirs) {
-            final File icons = new File(m, "images" + SEP + "icons");
-            final boolean iconsIsDir = icons.isDirectory();
-
-            // add dirs/images/icons/ to the base name
-            if (iconsIsDir) {
-                THEME_BASENAME.add(icons.getAbsolutePath());
-            }
-
-            // add dirs/images/icons/*/* to the base name
-            if (iconsIsDir) {
-                for (File s : icons.listFiles(DIR_FILTER)) {
-                    for (File category : s.listFiles(DIR_FILTER)) {
-                        THEME_BASENAME.add(category.getAbsolutePath());
-                    }
-                }
-            }
-        }
-    }
-
-    private static String lookupIcon(final String iconname, final String size, final String theme) throws IOException {
-        for (String directory : THEME_BASENAME) {
-            final File themeDir = new File(directory + SEP + theme);
-            if (!themeDir.exists() || !themeDir.isDirectory()) {
-                continue;
-            }
-
-            /*
-             * FIXME: implement an index.theme reader, for now we are parsing
-             * the file path to get the information
-             */
-
-            /*
-             * Create the theme subdirs
-             */
-            final int themeDirLen = themeDir.getCanonicalPath().length();
-            final TreeSet<String> themeSubdirs = findThemeSubdir(themeDir, themeDirLen);
-
-            /*
-             * Create a theme subdirs for a specific size
-             */
-            final TreeSet<String> sizedSubDirs = findSizedSubdirs(size, themeSubdirs);
-
-            /*
-             * Look for the icon
-             */
-            for (final String s : sizedSubDirs) {
-                for (String extension : ICONS_EXTENSIONS) {
-                    final File f = new File(themeDir, s + SEP + iconname + DOT + extension);
-
-                    if (f.exists()) {
-                        return f.getCanonicalPath();
-                    }
-                }
-            }
-        }
-
-        return null;
-    }
-
-    private static TreeSet<String> findSizedSubdirs(final String size, final TreeSet<String> themeSubdirs) {
-        final TreeSet<String> sizedSubDirs = new TreeSet<String>();
-        for (String subdir : themeSubdirs) {
-            if (subdir.startsWith(size)) {
-                sizedSubDirs.add(subdir);
-            }
-        }
-        return sizedSubDirs;
-    }
-
-    private static TreeSet<String> findThemeSubdir(final File themeDir, final int themeDirLen) throws IOException {
-        final TreeSet<String> cache = THEME_SUBDIR_CACHE.get(themeDir);
-        if (cache != null) {
-            return cache;
-        }
-
-        final TreeSet<String> themeSubdirs = new TreeSet<String>();
-
-        final LinkedList<File> dirs = new LinkedList<File>(Arrays.asList(themeDir.listFiles(DIR_FILTER)));
-        while (!dirs.isEmpty()) {
-            final File d = dirs.poll();
-
-            final List<File> sub = Arrays.asList(d.listFiles(DIR_FILTER));
-            if (sub.isEmpty()) {
-                final String s = d.getCanonicalPath();
-
-                themeSubdirs.add(s.substring(themeDirLen + 1));
-            } else {
-                dirs.addAll(sub);
-            }
-        }
-
-        THEME_SUBDIR_CACHE.put(themeDir, themeSubdirs);
-        return themeSubdirs;
-    }
-
-    private static String lookupFallbackIcon(final String icon) {
-        for (String directory : THEME_BASENAME) {
-            for (String extension : ICONS_EXTENSIONS) {
-                final File f = new File(directory + SEP + icon + DOT + extension);
-                if (f.exists()) {
-                    return f.getAbsolutePath();
-                }
-            }
-        }
-
-        return null;
-    }
-
-    /**
      * Add an action to close the window when the ESCAPE key is hit.
      * @param window the window where to add the action, it must be an instance of
      * JFrame or JWindow or JDialog
index 81a4254..63c0da6 100644 (file)
@@ -27,12 +27,11 @@ import javax.swing.JButton;
 import javax.swing.JToggleButton;
 import javax.xml.parsers.ParserConfigurationException;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.commons.xml.ScilabDocumentBuilderFactory;
 import org.scilab.modules.graphic_objects.graphicObject.CallBack;
 import org.scilab.modules.gui.bridge.toolbar.SwingScilabToolBar;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
-import org.scilab.modules.gui.pushbutton.PushButton;
-import org.scilab.modules.gui.pushbutton.ScilabPushButton;
 import org.scilab.modules.gui.toolbar.ScilabToolBar;
 import org.scilab.modules.gui.toolbar.ToolBar;
 import org.scilab.modules.localization.Messages;
@@ -225,7 +224,7 @@ public final class ToolBarBuilder {
                         for (int i = 0; i < buttonAttributes.getLength(); i++) {
                             if (buttonAttributes.item(i).getNodeName().equals(ICON)) {
                                 // Icon file
-                                pushButton.setIcon(new ImageIcon(ScilabSwingUtilities.findIcon(buttonAttributes.item(i).getNodeValue())));
+                                pushButton.setIcon(new ImageIcon(FindIconHelper.findIcon(buttonAttributes.item(i).getNodeValue())));
                             } else if (buttonAttributes.item(i).getNodeName().equals(ENABLED)) {
                                 // Enable are disable the button
                                 pushButton.setEnabled(buttonAttributes.item(i).getNodeValue().equals(TRUE));
index e1c15a7..9708257 100644 (file)
@@ -19,11 +19,11 @@ import java.io.OutputStreamWriter;
 import java.nio.charset.Charset;
 import java.util.Iterator;
 
-import org.xml.sax.SAXException;
 import org.scilab.modules.commons.ScilabCommonsUtils;
 import org.scilab.modules.commons.ScilabConstants;
-import org.scilab.modules.gui.utils.ScilabSwingUtilities;
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.helptools.image.ImageConverter;
+import org.xml.sax.SAXException;
 
 /**
  * Class to convert DocBook to JavaHelp
@@ -64,13 +64,13 @@ public class JavaHelpDocbookTagConverter extends HTMLDocbookTagConverter {
     public void install() {
         super.install();
 
-        ScilabCommonsUtils.copyFile(new File(ScilabSwingUtilities.findIcon("media-playback-start")), new File(outImages + "/ScilabExecute.png"));
-        ScilabCommonsUtils.copyFile(new File(ScilabSwingUtilities.findIcon("accessories-text-editor")), new File(outImages + "/ScilabEdit.png"));
-        ScilabCommonsUtils.copyFile(new File(ScilabSwingUtilities.findIcon("dialog-information")), new File(outImages + "/ScilabNote.png"));
-        ScilabCommonsUtils.copyFile(new File(ScilabSwingUtilities.findIcon("dialog-warning")), new File(outImages + "/ScilabWarning.png"));
-        ScilabCommonsUtils.copyFile(new File(ScilabSwingUtilities.findIcon("dialog-warning")), new File(outImages + "/ScilabCaution.png"));
-        ScilabCommonsUtils.copyFile(new File(ScilabSwingUtilities.findIcon("dialog-information")), new File(outImages + "/ScilabTip.png"));
-        ScilabCommonsUtils.copyFile(new File(ScilabSwingUtilities.findIcon("emblem-important")), new File(outImages + "/ScilabImportant.png"));
+        ScilabCommonsUtils.copyFile(new File(FindIconHelper.findIcon("media-playback-start")), new File(outImages + "/ScilabExecute.png"));
+        ScilabCommonsUtils.copyFile(new File(FindIconHelper.findIcon("accessories-text-editor")), new File(outImages + "/ScilabEdit.png"));
+        ScilabCommonsUtils.copyFile(new File(FindIconHelper.findIcon("dialog-information")), new File(outImages + "/ScilabNote.png"));
+        ScilabCommonsUtils.copyFile(new File(FindIconHelper.findIcon("dialog-warning")), new File(outImages + "/ScilabWarning.png"));
+        ScilabCommonsUtils.copyFile(new File(FindIconHelper.findIcon("dialog-warning")), new File(outImages + "/ScilabCaution.png"));
+        ScilabCommonsUtils.copyFile(new File(FindIconHelper.findIcon("dialog-information")), new File(outImages + "/ScilabTip.png"));
+        ScilabCommonsUtils.copyFile(new File(FindIconHelper.findIcon("emblem-important")), new File(outImages + "/ScilabImportant.png"));
         if (!isToolbox) {
             ScilabCommonsUtils.copyFile(new File(SCI + "/modules/helptools/data/pages/error.html"), new File(outName + "/ScilabErrorPage.html"));
             File homepage = new File(SCI + "/modules/helptools/data/pages/homepage-" + language + ".html");
index eff97e6..3ad9fb7 100644 (file)
@@ -18,6 +18,7 @@ import java.lang.reflect.InvocationTargetException;
 
 import javax.swing.ImageIcon;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.commons.gui.ScilabKeyStroke;
 import org.scilab.modules.gui.bridge.menuitem.SwingScilabMenuItem;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
@@ -25,7 +26,6 @@ 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.history_browser.CommandHistory;
 import org.scilab.modules.history_browser.CommandHistoryMessages;
 
@@ -38,7 +38,7 @@ public final class CopyAction extends CommonCallBack {
     private static final long serialVersionUID = 1L;
 
     private static final String LABEL = CommandHistoryMessages.COPY;
-    private static final String ICON = ScilabSwingUtilities.findIcon("edit-copy");
+    private static final String ICON = FindIconHelper.findIcon("edit-copy");
     private static final char MNEMONIC = 'C';
 
     private static final String KEY = "OSSCKEY C";
index e01d5c4..4899d5d 100644 (file)
@@ -16,6 +16,7 @@ import java.lang.reflect.InvocationTargetException;
 
 import javax.swing.ImageIcon;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.commons.gui.ScilabKeyStroke;
 import org.scilab.modules.gui.bridge.menuitem.SwingScilabMenuItem;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
@@ -23,7 +24,6 @@ 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.history_browser.CommandHistory;
 import org.scilab.modules.history_browser.CommandHistoryMessages;
 
@@ -36,7 +36,7 @@ public final class CutAction extends CommonCallBack {
     private static final long serialVersionUID = 1L;
 
     private static final String LABEL = CommandHistoryMessages.CUT;
-    private static final String ICON = ScilabSwingUtilities.findIcon("edit-cut");
+    private static final String ICON = FindIconHelper.findIcon("edit-cut");
     private static final char MNEMONIC = 'U';
 
     private static final String KEY = "OSSCKEY X";
index 7ebf896..853793c 100644 (file)
@@ -20,13 +20,13 @@ import javax.swing.tree.DefaultMutableTreeNode;
 import javax.swing.tree.MutableTreeNode;
 import javax.swing.tree.TreePath;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.gui.bridge.menuitem.SwingScilabMenuItem;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
 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.history_browser.CommandHistory;
 import org.scilab.modules.history_browser.CommandHistoryMessages;
 import org.scilab.modules.history_manager.HistoryManagement;
@@ -40,7 +40,7 @@ public final class DeleteAction extends CommonCallBack {
     private static final long serialVersionUID = 1L;
 
     private static final String LABEL = CommandHistoryMessages.DELETE;
-    private static final String ICON = ScilabSwingUtilities.findIcon("edit-delete");
+    private static final String ICON = FindIconHelper.findIcon("edit-delete");
     private static final char MNEMONIC = 'D';
 
     private static final String KEY = "DELETE";
index 4475cea..3575674 100644 (file)
@@ -16,6 +16,7 @@ import java.lang.reflect.InvocationTargetException;
 
 import javax.swing.ImageIcon;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.gui.bridge.CallScilabBridge;
 import org.scilab.modules.gui.bridge.menuitem.SwingScilabMenuItem;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
@@ -23,7 +24,6 @@ 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.history_browser.CommandHistoryMessages;
 
 /**
@@ -35,7 +35,7 @@ public final class HelpAction extends CommonCallBack {
     private static final long serialVersionUID = 1L;
 
     private static final String LABEL = CommandHistoryMessages.SCILAB_HELP;
-    private static final String ICON = ScilabSwingUtilities.findIcon("help-browser");
+    private static final String ICON = FindIconHelper.findIcon("help-browser");
     private static final char MNEMONIC = 'S';
 
     /**
index d84160e..3164c32 100644 (file)
@@ -17,13 +17,13 @@ import java.lang.reflect.InvocationTargetException;
 import javax.swing.ImageIcon;
 
 import org.scilab.modules.commons.ScilabGeneralPrefs;
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.gui.bridge.menuitem.SwingScilabMenuItem;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
 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.history_browser.CommandHistoryMessages;
 
 /**
@@ -35,7 +35,7 @@ public final class PrefsAction extends CommonCallBack {
     private static final long serialVersionUID = 1L;
 
     private static final String LABEL = CommandHistoryMessages.SCILAB_PREFS;
-    private static final String ICON = ScilabSwingUtilities.findIcon("preferences-system");
+    private static final String ICON = FindIconHelper.findIcon("preferences-system");
     private static final char MNEMONIC = 'P';
 
     /**
index 4fbd612..a5af5cf 100644 (file)
@@ -32,8 +32,8 @@ import javax.swing.text.BadLocationException;
 import javax.swing.text.Document;
 import javax.swing.tree.DefaultMutableTreeNode;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.commons.xml.ScilabXMLUtilities;
-import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.scinotes.utils.SciNotesMessages;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
@@ -45,10 +45,10 @@ import org.w3c.dom.NodeList;
  */
 public class SearchManager {
 
-    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"));
+    private static final ImageIcon FILEIMAGE = new ImageIcon(FindIconHelper.findIcon("stock_search"));
+    private static final ImageIcon SCILABFILEIMAGE = new ImageIcon(FindIconHelper.findIcon("scilab_search"));
+    private static final ImageIcon FOLDERIMAGE = new ImageIcon(FindIconHelper.findIcon("folder-saved-search"));
+    private static final ImageIcon LINEICON = new ImageIcon(FindIconHelper.findIcon("line-found"));
 
     /**
      * FIND AND REPLACE START
index 35928e9..9bf7335 100644 (file)
@@ -19,6 +19,7 @@ import javax.swing.ImageIcon;
 import javax.swing.JOptionPane;
 import javax.swing.KeyStroke;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.gui.bridge.menuitem.SwingScilabMenuItem;
 import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
@@ -26,7 +27,6 @@ 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.scinotes.SciNotes;
 import org.scilab.modules.scinotes.utils.SciNotesMessages;
 
@@ -82,7 +82,7 @@ public class DefaultAction extends CommonCallBack {
         if (icon == null) {
             button.setText(title);
         } else {
-            ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(new ImageIcon(ScilabSwingUtilities.findIcon(icon)));
+            ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(new ImageIcon(FindIconHelper.findIcon(icon)));
         }
         return button;
     }
index 1d40c20..d66d715 100644 (file)
@@ -61,10 +61,10 @@ import javax.swing.text.Document;
 import javax.swing.text.Element;
 import javax.swing.text.Highlighter;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 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;
@@ -293,7 +293,7 @@ public final class FindAction extends DefaultAction implements WindowFocusListen
             }
         });
 
-        frame.setIconImage(new ImageIcon(ScilabSwingUtilities.findIcon("scilab")).getImage());
+        frame.setIconImage(new ImageIcon(FindIconHelper.findIcon("scilab")).getImage());
         frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
         frame.setTitle(SciNotesMessages.FIND_REPLACE);
         frame.setResizable(false);
index dea937b..50b1b49 100644 (file)
@@ -38,9 +38,9 @@ import javax.swing.JTextField;
 import javax.swing.KeyStroke;
 
 import org.scilab.modules.commons.ScilabConstants;
+import org.scilab.modules.commons.gui.FindIconHelper;
 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;
@@ -56,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(ScilabSwingUtilities.findIcon("go-top"));
-    private static final ImageIcon BOTICON = new ImageIcon(ScilabSwingUtilities.findIcon("go-bottom"));
+    private static final ImageIcon TOPICON = new ImageIcon(FindIconHelper.findIcon("go-top"));
+    private static final ImageIcon BOTICON = new ImageIcon(FindIconHelper.findIcon("go-bottom"));
     private static final int BUTTONSIZE = 28;
 
     private static Map<SciNotes, SearchField> fields = new HashMap<SciNotes, SearchField>();
index b1306b1..51d6f9b 100644 (file)
@@ -37,8 +37,8 @@ import javax.swing.text.BadLocationException;
 import javax.swing.text.JTextComponent;
 
 import org.scilab.modules.action_binding.InterpreterManagement;
+import org.scilab.modules.commons.gui.FindIconHelper;
 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;
@@ -165,7 +165,7 @@ public class OpenSourceFileOnKeywordAction extends DefaultAction {
 
         mainFrame = new JFrame();
         mainFrame.setAlwaysOnTop(true);
-        mainFrame.setIconImage(new ImageIcon(ScilabSwingUtilities.findIcon("scilab")).getImage());
+        mainFrame.setIconImage(new ImageIcon(FindIconHelper.findIcon("scilab")).getImage());
         mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 
         windowAlreadyExist = true;
index 6f62986..40a9d87 100644 (file)
@@ -57,8 +57,8 @@ import javax.swing.tree.TreeModel;
 import javax.swing.tree.TreeNode;
 import javax.swing.tree.TreePath;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 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;
@@ -74,7 +74,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(ScilabSwingUtilities.findIcon("scilab"));
+    private static final Icon SCILAB_ICON = new ImageIcon(FindIconHelper.findIcon("scilab"));
     private static List<File> selectedFiles;
 
     /**
index 92bd7a7..5f08564 100644 (file)
@@ -52,11 +52,11 @@ import javax.swing.event.PopupMenuEvent;
 import javax.swing.event.PopupMenuListener;
 
 import org.scilab.modules.commons.ScilabConstants;
+import org.scilab.modules.commons.gui.FindIconHelper;
 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;
@@ -227,7 +227,7 @@ public class SearchWordInFilesAction extends DefaultAction implements WindowFocu
             }
         });
         mainFrame.setTitle(SciNotesMessages.SEARCHINFILES);
-        mainFrame.setIconImage(new ImageIcon(ScilabSwingUtilities.findIcon("system-search", "32x32")).getImage());
+        mainFrame.setIconImage(new ImageIcon(FindIconHelper.findIcon("system-search", "32x32")).getImage());
 
         getEditor().getSwingParentWindow().addWindowFocusListener(this);
         mainFrame.addWindowFocusListener(this);
index 2485ffe..c86d833 100644 (file)
@@ -30,8 +30,8 @@ import javax.swing.JTextField;
 import javax.swing.KeyStroke;
 import javax.swing.text.Element;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 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;
@@ -86,7 +86,7 @@ public class SetAnchorAction extends DefaultAction {
 
         dialog = new JDialog();
         dialog.setModalityType(ModalityType.APPLICATION_MODAL);
-        dialog.setIconImage(new ImageIcon(ScilabSwingUtilities.findIcon("scilab")).getImage());
+        dialog.setIconImage(new ImageIcon(FindIconHelper.findIcon("scilab")).getImage());
         JLabel label = new JLabel(SciNotesMessages.ANCHOR_NAME);
 
         cancelButton = new JButton(SciNotesMessages.CANCEL);
index b86e307..ce569e4 100644 (file)
@@ -15,7 +15,7 @@ package org.scilab.modules.ui_data;
 import javax.swing.ImageIcon;
 import javax.swing.JLabel;
 
-import org.scilab.modules.gui.utils.ScilabSwingUtilities;
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.localization.Messages;
 import org.scilab.modules.types.ScilabTypeEnum;
 import org.scilab.modules.types.ScilabTypeEnumDescription;
@@ -53,20 +53,20 @@ public class BrowseVar {
 
     public static final int[] COLUMNSALIGNMENT = new int[] { -1, JLabel.LEFT, JLabel.RIGHT, JLabel.RIGHT, JLabel.RIGHT, JLabel.RIGHT, JLabel.RIGHT, JLabel.RIGHT};
 
-    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"));
+    private static final ImageIcon NO_ICON = new ImageIcon(FindIconHelper.findIcon("noicon"));
+    private static final ImageIcon DOUBLE_ICON = new ImageIcon(FindIconHelper.findIcon("double"));
+    private static final ImageIcon POLYNOMIAL_ICON = new ImageIcon(FindIconHelper.findIcon("polynomial"));
+    private static final ImageIcon BOOLEAN_ICON = new ImageIcon(FindIconHelper.findIcon("boolean"));
+    private static final ImageIcon SPARSE_ICON = new ImageIcon(FindIconHelper.findIcon("sparse"));
+    private static final ImageIcon INT_ICON = new ImageIcon(FindIconHelper.findIcon("int"));
+    private static final ImageIcon HANDLE_ICON = new ImageIcon(FindIconHelper.findIcon("handle"));
+    private static final ImageIcon STRING_ICON = new ImageIcon(FindIconHelper.findIcon("string"));
+    private static final ImageIcon FUNCTION_ICON = new ImageIcon(FindIconHelper.findIcon("function"));
+    private static final ImageIcon LIST_ICON = new ImageIcon(FindIconHelper.findIcon("list"));
+    private static final ImageIcon TLIST_ICON = new ImageIcon(FindIconHelper.findIcon("tlist"));
+    private static final ImageIcon MLIST_ICON = new ImageIcon(FindIconHelper.findIcon("mlist"));
+    private static final ImageIcon USER_ICON = new ImageIcon(FindIconHelper.findIcon("user"));
+    private static final ImageIcon FPTR_ICON = new ImageIcon(FindIconHelper.findIcon("fptr"));
 
     /**
      * Default private constructor for utility class
index 8b8dcbb..195ed40 100644 (file)
@@ -19,6 +19,7 @@ import javax.swing.Action;
 import javax.swing.ImageIcon;
 import javax.swing.KeyStroke;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.graphic_objects.graphicObject.CallBack;
 import org.scilab.modules.gui.bridge.checkboxmenuitem.SwingScilabCheckBoxMenuItem;
 import org.scilab.modules.gui.bridge.menuitem.SwingScilabMenuItem;
@@ -30,7 +31,6 @@ 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;
 
 /**
  * Default action for a BrowseVar
@@ -77,7 +77,7 @@ public abstract class DefaultAction extends CommonCallBack {
              */
             final String iconName = (String) getClass().getField("SMALL_ICON").get(null);
             if (iconName != null && !iconName.isEmpty()) {
-                icon = new ImageIcon(ScilabSwingUtilities.findIcon(iconName));
+                icon = new ImageIcon(FindIconHelper.findIcon(iconName));
             }
 
             mnemonic = getClass().getField("MNEMONIC_KEY").getInt(null);
index 92f8854..f907d2f 100644 (file)
@@ -16,6 +16,7 @@ import javax.swing.ImageIcon;
 
 import org.scilab.modules.action_binding.highlevel.ScilabInterpreterManagement;
 import org.scilab.modules.action_binding.highlevel.ScilabInterpreterManagement.InterpreterException;
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.gui.bridge.menuitem.SwingScilabMenuItem;
 import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
@@ -23,7 +24,6 @@ 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;
 
 /**
  * Launch Scilab help class
@@ -32,7 +32,7 @@ import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 @SuppressWarnings(value = { "serial" })
 public final class HelpAction extends CommonCallBack {
 
-    private static ImageIcon icon = new ImageIcon(ScilabSwingUtilities.findIcon("help-browser"));
+    private static ImageIcon icon = new ImageIcon(FindIconHelper.findIcon("help-browser"));
 
     /**
      * Constructor
index c0d1282..19125e2 100644 (file)
@@ -14,11 +14,11 @@ package org.scilab.modules.ui_data.actions;
 
 import javax.swing.ImageIcon;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
 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.utils.UiDataMessages;
 import org.scilab.modules.ui_data.variablebrowser.ScilabVariableBrowser;
 
@@ -54,7 +54,7 @@ public class ScilabVarFilteringButtonAction extends CommonCallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new ScilabVarFilteringButtonAction(title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("edit-clear"));
+        ImageIcon imageIcon = new ImageIcon(FindIconHelper.findIcon("edit-clear"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index 53d112d..a0da0ef 100644 (file)
@@ -22,7 +22,7 @@ import java.util.Map;
 import javax.swing.Icon;
 import javax.swing.ImageIcon;
 
-import org.scilab.modules.gui.utils.ScilabSwingUtilities;
+import org.scilab.modules.commons.gui.FindIconHelper;
 
 /**
  * Few file tools
@@ -31,22 +31,22 @@ import org.scilab.modules.gui.utils.ScilabSwingUtilities;
  */
 public final class FileUtils {
 
-    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 Icon SCILABICON = new ImageIcon(FindIconHelper.findIcon("scilab"));
+    private static final Icon PDFICON = new ImageIcon(FindIconHelper.findIcon("application-pdf"));
+    private static final Icon BINARYICON = new ImageIcon(FindIconHelper.findIcon("binary"));
+    private static final Icon IMAGEICON = new ImageIcon(FindIconHelper.findIcon("image-x-generic"));
+    private static final Icon TEXTICON = new ImageIcon(FindIconHelper.findIcon("text-x-generic"));
+    private static final Icon HTMLICON = new ImageIcon(FindIconHelper.findIcon("text-html"));
+    private static final Icon XMLICON = new ImageIcon(FindIconHelper.findIcon("text-xml"));
+    private static final Icon CSVICON = new ImageIcon(FindIconHelper.findIcon("text-csv"));
+    private static final Icon DIRICON = new ImageIcon(FindIconHelper.findIcon("folder"));
+    private static final Icon OPENDIRICON = new ImageIcon(FindIconHelper.findIcon("folder-open"));
+    private static final Icon READONLYICON = new ImageIcon(FindIconHelper.findIcon("emblem-readonly"));
+    private static final Icon CLOSEDUSERHOMEICON = new ImageIcon(FindIconHelper.findIcon("user-home"));
+    private static final Icon OPENUSERHOMEICON = new ImageIcon(FindIconHelper.findIcon("user-home-open"));
+    private static final Icon UPICON = new ImageIcon(FindIconHelper.findIcon("dynamic-blue-up"));
+    private static final Icon SCIICON = new ImageIcon(FindIconHelper.findIcon("scilab-folder"));
+    private static final Icon OPENSCIICON = new ImageIcon(FindIconHelper.findIcon("scilab-folder-open"));
 
     private static final int CHARTOREAD = 128;
 
index 9b9fbf3..ce7681d 100644 (file)
@@ -25,11 +25,11 @@ import javax.swing.JPopupMenu;
 import javax.swing.SwingUtilities;
 
 import org.scilab.modules.action_binding.InterpreterManagement;
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
 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.utils.UiDataMessages;
 
 /**
@@ -39,8 +39,8 @@ import org.scilab.modules.ui_data.utils.UiDataMessages;
 @SuppressWarnings(value = { "serial" })
 public class ScilabFileBrowserHistory {
 
-    private static final String PREVIOUSICON = ScilabSwingUtilities.findIcon("go-previous");
-    private static final String NEXTICON = ScilabSwingUtilities.findIcon("go-next");
+    private static final String PREVIOUSICON = FindIconHelper.findIcon("go-previous");
+    private static final String NEXTICON = FindIconHelper.findIcon("go-next");
 
     private final SwingScilabTreeTable stt;
     private final List<String> history = new ArrayList<String>();
index bd5fd36..a453616 100644 (file)
@@ -38,8 +38,8 @@ import javax.swing.event.DocumentListener;
 import javax.swing.text.DefaultEditorKit;
 
 import org.scilab.modules.commons.OS;
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
-import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.ui_data.utils.UiDataMessages;
 
 /**
@@ -51,7 +51,7 @@ public class ScilabFileSelectorFilter extends JPanel {
 
     private static boolean isWindows = (OS.get() == OS.WINDOWS);
     private static final int GAP = 3;
-    private static final Icon VALIDATE = new ImageIcon(ScilabSwingUtilities.findIcon("filter"));
+    private static final Icon VALIDATE = new ImageIcon(FindIconHelper.findIcon("filter"));
 
     private MyJTextField textfield;
     private final SwingScilabTreeTable stt;
index 2edd43e..a7e232e 100644 (file)
@@ -45,9 +45,9 @@ import javax.swing.plaf.basic.BasicTreeUI;
 import javax.swing.table.DefaultTableCellRenderer;
 import javax.swing.tree.TreePath;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
 import org.scilab.modules.gui.pushbutton.PushButton;
-import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.ui_data.filebrowser.actions.ChangeCWDAction;
 import org.scilab.modules.ui_data.filebrowser.actions.EditFileWithDefaultAppAction;
 import org.scilab.modules.ui_data.filebrowser.actions.ExecuteFileInConsoleAction;
@@ -403,22 +403,22 @@ public class SwingScilabTreeTable extends JTable {
         JPopupMenu popup = new JPopupMenu();
         JMenuItem item = new JMenuItem(UiDataMessages.OPENINSCINOTES);
         item.addActionListener(actions.get("scinotes"));
-        item.setIcon(new ImageIcon(ScilabSwingUtilities.findIcon("accessories-text-editor")));
+        item.setIcon(new ImageIcon(FindIconHelper.findIcon("accessories-text-editor")));
         popup.add(item);
 
         item = new JMenuItem(UiDataMessages.EXECINCONSOLE);
         item.addActionListener(actions.get("console"));
-        item.setIcon(new ImageIcon(ScilabSwingUtilities.findIcon("media-playback-start")));
+        item.setIcon(new ImageIcon(FindIconHelper.findIcon("media-playback-start")));
         popup.add(item);
 
         item = new JMenuItem(UiDataMessages.OPENINXCOS);
         item.addActionListener(actions.get("xcos"));
-        item.setIcon(new ImageIcon(ScilabSwingUtilities.findIcon("utilities-system-monitor")));
+        item.setIcon(new ImageIcon(FindIconHelper.findIcon("utilities-system-monitor")));
         popup.add(item);
 
         item = new JMenuItem(UiDataMessages.LOADINSCILAB);
         item.addActionListener(actions.get("load"));
-        item.setIcon(new ImageIcon(ScilabSwingUtilities.findIcon("scilab")));
+        item.setIcon(new ImageIcon(FindIconHelper.findIcon("scilab")));
         popup.add(item);
 
         if (actions.get("edit") != null || actions.get("open") != null) {
index 7bfe411..9590c22 100644 (file)
 
 package org.scilab.modules.ui_data.variablebrowser.actions;
 
-import org.scilab.modules.ui_data.variablebrowser.SwingScilabVariableBrowser;
-import javax.swing.ImageIcon;
-
-import org.scilab.modules.ui_data.utils.UiDataMessages;
-import org.scilab.modules.ui_data.BrowseVar;
-
 import static org.scilab.modules.action_binding.highlevel.ScilabInterpreterManagement.asynchronousScilabExec;
 
-import org.scilab.modules.action_binding.highlevel.ScilabInterpreterManagement.InterpreterException;
+import javax.swing.ImageIcon;
 
-import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
+import org.scilab.modules.action_binding.highlevel.ScilabInterpreterManagement.InterpreterException;
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.gui.bridge.menuitem.SwingScilabMenuItem;
+import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
 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.BrowseVar;
+import org.scilab.modules.ui_data.utils.UiDataMessages;
+import org.scilab.modules.ui_data.variablebrowser.SwingScilabVariableBrowser;
 
 /**
  * Manage Delete Actions
@@ -40,7 +38,7 @@ public final class DeleteAction extends CommonCallBack {
 
     private static final long serialVersionUID = 1L;
 
-    private static ImageIcon icon = new ImageIcon(ScilabSwingUtilities.findIcon("edit-delete"));
+    private static ImageIcon icon = new ImageIcon(FindIconHelper.findIcon("edit-delete"));
 
     private static final char MNEMONIC = 'D';
 
index 537ca31..0d3ed94 100644 (file)
 
 package org.scilab.modules.ui_data.variablebrowser.actions;
 
-import org.scilab.modules.ui_data.variablebrowser.SwingScilabVariableBrowser;
 import javax.swing.ImageIcon;
 
-import org.scilab.modules.ui_data.utils.UiDataMessages;
-import org.scilab.modules.ui_data.BrowseVar;
-
-import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.gui.bridge.menuitem.SwingScilabMenuItem;
+import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
 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.BrowseVar;
+import org.scilab.modules.ui_data.utils.UiDataMessages;
+import org.scilab.modules.ui_data.variablebrowser.SwingScilabVariableBrowser;
 
 /**
  * Manage Modify Actions
@@ -36,7 +35,7 @@ public final class ModifyAction extends CommonCallBack {
 
     private static final long serialVersionUID = 1L;
 
-    private static ImageIcon icon = new ImageIcon(ScilabSwingUtilities.findIcon("rrze_table"));
+    private static ImageIcon icon = new ImageIcon(FindIconHelper.findIcon("rrze_table"));
 
     private static final char MNEMONIC = 'M';
 
index efb3bc8..0f7c5d7 100644 (file)
@@ -19,6 +19,7 @@ import javax.swing.ImageIcon;
 
 import org.scilab.modules.action_binding.highlevel.ScilabInterpreterManagement;
 import org.scilab.modules.action_binding.highlevel.ScilabInterpreterManagement.InterpreterException;
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.gui.bridge.menuitem.SwingScilabMenuItem;
 import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
@@ -26,7 +27,6 @@ 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;
 
 /**
  * RefreshAction class
@@ -40,7 +40,7 @@ public final class RefreshAction extends CommonCallBack {
     /** Accelerator key for the action */
     public static final int ACCELERATOR_KEY = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
 
-    private static ImageIcon icon = new ImageIcon(ScilabSwingUtilities.findIcon("view-refresh"));
+    private static ImageIcon icon = new ImageIcon(FindIconHelper.findIcon("view-refresh"));
 
     /**
      * Constructor
index 0e83d9f..b1ef81b 100644 (file)
@@ -15,6 +15,7 @@ package org.scilab.modules.ui_data.variableeditor.actions;
 import javax.swing.ImageIcon;
 import javax.swing.JTable;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.commons.gui.ScilabKeyStroke;
 import org.scilab.modules.gui.bridge.menuitem.SwingScilabMenuItem;
 import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
@@ -22,7 +23,6 @@ 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;
 
 /**
@@ -63,7 +63,7 @@ public final class CopyAction extends CopySelectionAction {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new CopyAction(editor, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("edit-copy"));
+        ImageIcon imageIcon = new ImageIcon(FindIconHelper.findIcon("edit-copy"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index 360008e..f9b492f 100644 (file)
@@ -31,6 +31,7 @@ import javax.swing.JTable;
 import javax.swing.JTextField;
 import javax.swing.SpinnerNumberModel;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.commons.gui.ScilabKeyStroke;
 import org.scilab.modules.gui.bridge.menuitem.SwingScilabMenuItem;
 import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
@@ -39,7 +40,6 @@ 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;
@@ -119,7 +119,7 @@ public final class CreateNewVariableAction extends CommonCallBack {
         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(ScilabSwingUtilities.findIcon("rrze_table", "256x256")).getImage());
+        dialog.setIconImage(new ImageIcon(FindIconHelper.findIcon("rrze_table", "256x256")).getImage());
 
         JPanel panel = new JPanel(new GridBagLayout());
         GridBagConstraints gbc = new GridBagConstraints();
@@ -252,7 +252,7 @@ public final class CreateNewVariableAction extends CommonCallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new CreateNewVariableAction(editor, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("variable-new"));
+        ImageIcon imageIcon = new ImageIcon(FindIconHelper.findIcon("variable-new"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index 2766318..01e9202 100644 (file)
@@ -31,6 +31,7 @@ import javax.swing.JPanel;
 import javax.swing.JTable;
 import javax.swing.JTextField;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.commons.gui.ScilabKeyStroke;
 import org.scilab.modules.gui.bridge.menuitem.SwingScilabMenuItem;
 import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
@@ -39,7 +40,6 @@ 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;
@@ -102,7 +102,7 @@ public final class CreateVariableFromSelectionAction extends CommonCallBack {
         final String[] ret = new String[] { "" };
         dialog.setModalityType(ModalityType.APPLICATION_MODAL);
         dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
-        dialog.setIconImage(new ImageIcon(ScilabSwingUtilities.findIcon("rrze_table", "256x256")).getImage());
+        dialog.setIconImage(new ImageIcon(FindIconHelper.findIcon("rrze_table", "256x256")).getImage());
 
         JPanel panel = new JPanel(new GridBagLayout());
         GridBagConstraints gbc = new GridBagConstraints();
@@ -190,7 +190,7 @@ public final class CreateVariableFromSelectionAction extends CommonCallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new CreateVariableFromSelectionAction(editor, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("variable-from-selection"));
+        ImageIcon imageIcon = new ImageIcon(FindIconHelper.findIcon("variable-from-selection"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index 8cd261c..940eae6 100644 (file)
@@ -19,6 +19,7 @@ import java.util.Vector;
 import javax.swing.ImageIcon;
 import javax.swing.JTable;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.commons.gui.ScilabKeyStroke;
 import org.scilab.modules.gui.bridge.menuitem.SwingScilabMenuItem;
 import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
@@ -27,7 +28,6 @@ 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.datatable.SwingEditvarTableModel;
 import org.scilab.modules.ui_data.variableeditor.SwingScilabVariableEditor;
 
@@ -130,7 +130,7 @@ public final class CutAction extends CommonCallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new CutAction(editor, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("edit-cut"));
+        ImageIcon imageIcon = new ImageIcon(FindIconHelper.findIcon("edit-cut"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index 37e371b..ed81a5a 100644 (file)
@@ -31,12 +31,12 @@ import javax.swing.JPanel;
 import javax.swing.JTable;
 import javax.swing.JTextField;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.commons.gui.ScilabKeyStroke;
 import org.scilab.modules.gui.bridge.menuitem.SwingScilabMenuItem;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
 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;
@@ -92,7 +92,7 @@ public final class DuplicateVariableAction extends CommonCallBack {
         final String[] ret = new String[] { "" };
         dialog.setModalityType(ModalityType.APPLICATION_MODAL);
         dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
-        dialog.setIconImage(new ImageIcon(ScilabSwingUtilities.findIcon("rrze_table", "256x256")).getImage());
+        dialog.setIconImage(new ImageIcon(FindIconHelper.findIcon("rrze_table", "256x256")).getImage());
 
         JPanel panel = new JPanel(new GridBagLayout());
         GridBagConstraints gbc = new GridBagConstraints();
index 5b83a27..d8f926b 100644 (file)
@@ -16,11 +16,11 @@ import javax.swing.ImageIcon;
 import javax.swing.JMenuItem;
 import javax.swing.JTable;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
 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;
 
@@ -68,7 +68,7 @@ public final class InsertColumnAction extends CommonCallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new InsertColumnAction(table, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("short"));
+        ImageIcon imageIcon = new ImageIcon(FindIconHelper.findIcon("short"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index 54f4541..0c1d0c5 100644 (file)
@@ -16,11 +16,11 @@ import javax.swing.ImageIcon;
 import javax.swing.JMenuItem;
 import javax.swing.JTable;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
 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;
 
@@ -64,7 +64,7 @@ public final class InsertRowAction extends CommonCallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new InsertRowAction(table, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("short"));
+        ImageIcon imageIcon = new ImageIcon(FindIconHelper.findIcon("short"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index c52bff6..346d8ad 100644 (file)
@@ -25,6 +25,7 @@ import java.util.Vector;
 import javax.swing.ImageIcon;
 import javax.swing.JTable;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.commons.gui.ScilabKeyStroke;
 import org.scilab.modules.gui.bridge.menuitem.SwingScilabMenuItem;
 import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
@@ -33,7 +34,6 @@ 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.datatable.SwingEditvarTableModel;
 import org.scilab.modules.ui_data.variableeditor.SwingScilabVariableEditor;
 
@@ -143,7 +143,7 @@ public final class PasteAction extends CommonCallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new PasteAction(editor, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("edit-paste"));
+        ImageIcon imageIcon = new ImageIcon(FindIconHelper.findIcon("edit-paste"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index 06c1430..49be06c 100644 (file)
@@ -12,6 +12,8 @@
 
 package org.scilab.modules.ui_data.variableeditor.actions;
 
+import static org.scilab.modules.action_binding.highlevel.ScilabInterpreterManagement.asynchronousScilabExec;
+
 import java.awt.Component;
 import java.util.HashMap;
 import java.util.Map;
@@ -20,25 +22,22 @@ import javax.swing.ImageIcon;
 import javax.swing.JPopupMenu;
 import javax.swing.JTable;
 
-import org.scilab.modules.types.ScilabTypeEnumDescription;
-import org.scilab.modules.gui.bridge.tab.SwingScilabDockablePanel;
+import org.scilab.modules.action_binding.highlevel.ScilabInterpreterManagement.InterpreterException;
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.gui.bridge.menuitem.SwingScilabMenuItem;
 import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
+import org.scilab.modules.gui.bridge.tab.SwingScilabDockablePanel;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
 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.types.ScilabTypeEnumDescription;
 import org.scilab.modules.ui_data.BrowseVar;
 import org.scilab.modules.ui_data.EditVar;
 import org.scilab.modules.ui_data.datatable.SwingEditvarTableModel;
-import org.scilab.modules.ui_data.variableeditor.SwingScilabVariableEditor;
 import org.scilab.modules.ui_data.variablebrowser.SwingScilabVariableBrowser;
-
-import static org.scilab.modules.action_binding.highlevel.ScilabInterpreterManagement.asynchronousScilabExec;
-
-import org.scilab.modules.action_binding.highlevel.ScilabInterpreterManagement.InterpreterException;
+import org.scilab.modules.ui_data.variableeditor.SwingScilabVariableEditor;
 
 
 /**
@@ -238,7 +237,7 @@ public final class PlotAction extends CommonCallBack {
     public static PushButton createButton(SwingScilabDockablePanel editor, String title) {
         final PushButton button = ScilabPushButton.createPushButton();
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("plot"));
+        ImageIcon imageIcon = new ImageIcon(FindIconHelper.findIcon("plot"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         final JPopupMenu popup = new JPopupMenu() {
@@ -288,7 +287,7 @@ public final class PlotAction extends CommonCallBack {
         MenuItem menu = ScilabMenuItem.createMenuItem();
         menu.setCallback(new PlotAction(editor, title, onSelection));
         menu.setText(title);
-        ((SwingScilabMenuItem) menu.getAsSimpleMenuItem()).setIcon(new ImageIcon(ScilabSwingUtilities.findIcon(IMG[map.get(title)])));
+        ((SwingScilabMenuItem) menu.getAsSimpleMenuItem()).setIcon(new ImageIcon(FindIconHelper.findIcon(IMG[map.get(title)])));
 
         return menu;
     }
index 7a5eecf..704ccf5 100644 (file)
@@ -15,6 +15,7 @@ package org.scilab.modules.ui_data.variableeditor.actions;
 import javax.swing.ImageIcon;
 import javax.swing.JTable;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.commons.gui.ScilabKeyStroke;
 import org.scilab.modules.gui.bridge.menuitem.SwingScilabMenuItem;
 import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
@@ -23,7 +24,6 @@ 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.datatable.SwingEditvarTableModel;
 import org.scilab.modules.ui_data.variableeditor.SwingScilabVariableEditor;
 
@@ -77,7 +77,7 @@ public final class RedoAction extends CommonCallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new RedoAction(editor, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("edit-redo"));
+        ImageIcon imageIcon = new ImageIcon(FindIconHelper.findIcon("edit-redo"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index 7cd9d24..7018e9b 100644 (file)
@@ -14,11 +14,11 @@ package org.scilab.modules.ui_data.variableeditor.actions;
 
 import javax.swing.ImageIcon;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
 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.SwingScilabVariableEditor;
 
@@ -59,7 +59,7 @@ public final class RefreshAction extends CommonCallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new RefreshAction(editor, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("view-refresh"));
+        ImageIcon imageIcon = new ImageIcon(FindIconHelper.findIcon("view-refresh"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index 7bfc14a..c9acc21 100644 (file)
@@ -16,11 +16,11 @@ import javax.swing.ImageIcon;
 import javax.swing.JMenuItem;
 import javax.swing.JTable;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
 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;
 
@@ -67,7 +67,7 @@ public final class RemoveColumnAction extends CommonCallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new RemoveColumnAction(table, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("short"));
+        ImageIcon imageIcon = new ImageIcon(FindIconHelper.findIcon("short"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index 9b1f7ce..e24ef7b 100644 (file)
@@ -16,11 +16,11 @@ import javax.swing.ImageIcon;
 import javax.swing.JMenuItem;
 import javax.swing.JTable;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
 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;
 
@@ -67,7 +67,7 @@ public final class RemoveRowAction extends CommonCallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new RemoveRowAction(table, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("short"));
+        ImageIcon imageIcon = new ImageIcon(FindIconHelper.findIcon("short"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index 1dde7b2..77a1f9a 100644 (file)
@@ -16,12 +16,12 @@ import javax.swing.ImageIcon;
 import javax.swing.JMenuItem;
 import javax.swing.JTable;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.commons.gui.ScilabKeyStroke;
 import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
 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;
 
@@ -77,7 +77,7 @@ public final class SetPrecisionLongAction extends CommonCallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new SetPrecisionLongAction(editor, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("long"));
+        ImageIcon imageIcon = new ImageIcon(FindIconHelper.findIcon("long"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index 3158741..917e216 100644 (file)
@@ -16,12 +16,12 @@ import javax.swing.ImageIcon;
 import javax.swing.JMenuItem;
 import javax.swing.JTable;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.commons.gui.ScilabKeyStroke;
 import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
 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;
 
@@ -77,7 +77,7 @@ public final class SetPrecisionLongeAction extends CommonCallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new SetPrecisionLongeAction(editor, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("longe"));
+        ImageIcon imageIcon = new ImageIcon(FindIconHelper.findIcon("longe"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index c16d324..b030f84 100644 (file)
@@ -16,12 +16,12 @@ import javax.swing.ImageIcon;
 import javax.swing.JMenuItem;
 import javax.swing.JTable;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.commons.gui.ScilabKeyStroke;
 import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
 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 +75,7 @@ public final class SetPrecisionShortAction extends CommonCallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new SetPrecisionShortAction(editor, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("short"));
+        ImageIcon imageIcon = new ImageIcon(FindIconHelper.findIcon("short"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index 215760e..1063210 100644 (file)
@@ -16,12 +16,12 @@ import javax.swing.ImageIcon;
 import javax.swing.JMenuItem;
 import javax.swing.JTable;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.commons.gui.ScilabKeyStroke;
 import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
 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;
 
@@ -77,7 +77,7 @@ public final class SetPrecisionShorteAction extends CommonCallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new SetPrecisionShorteAction(editor, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("shorte"));
+        ImageIcon imageIcon = new ImageIcon(FindIconHelper.findIcon("shorte"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index ad68ee9..8e04ac1 100644 (file)
@@ -15,6 +15,7 @@ package org.scilab.modules.ui_data.variableeditor.actions;
 import javax.swing.ImageIcon;
 import javax.swing.JTable;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.commons.gui.ScilabKeyStroke;
 import org.scilab.modules.gui.bridge.menuitem.SwingScilabMenuItem;
 import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
@@ -23,7 +24,6 @@ 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;
 
@@ -77,7 +77,7 @@ public final class SizeColumnsToFitAction extends CommonCallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new SizeColumnsToFitAction(editor, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("SizeColumnsToFit"));
+        ImageIcon imageIcon = new ImageIcon(FindIconHelper.findIcon("SizeColumnsToFit"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index 87938fa..e1f96b7 100644 (file)
@@ -15,6 +15,7 @@ package org.scilab.modules.ui_data.variableeditor.actions;
 import javax.swing.ImageIcon;
 import javax.swing.JTable;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.commons.gui.ScilabKeyStroke;
 import org.scilab.modules.gui.bridge.menuitem.SwingScilabMenuItem;
 import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
@@ -23,7 +24,6 @@ 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.datatable.SwingEditvarTableModel;
 import org.scilab.modules.ui_data.variableeditor.SwingScilabVariableEditor;
 
@@ -77,7 +77,7 @@ public final class UndoAction extends CommonCallBack {
         PushButton button = ScilabPushButton.createPushButton();
         ((SwingScilabPushButton) button.getAsSimplePushButton()).addActionListener(new UndoAction(editor, title));
         button.setToolTipText(title);
-        ImageIcon imageIcon = new ImageIcon(ScilabSwingUtilities.findIcon("edit-undo"));
+        ImageIcon imageIcon = new ImageIcon(FindIconHelper.findIcon("edit-undo"));
         ((SwingScilabPushButton) button.getAsSimplePushButton()).setIcon(imageIcon);
 
         return button;
index 178bb7f..7ab0e2e 100644 (file)
@@ -34,6 +34,7 @@ import javax.swing.ImageIcon;
 import javax.swing.SwingUtilities;
 
 import org.scilab.modules.action_binding.InterpreterManagement;
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.commons.xml.XConfiguration;
 import org.scilab.modules.core.Scilab;
 import org.scilab.modules.graph.actions.base.GraphActionManager;
@@ -49,7 +50,6 @@ import org.scilab.modules.gui.tabfactory.AbstractScilabTabFactory;
 import org.scilab.modules.gui.tabfactory.ScilabTabFactory;
 import org.scilab.modules.gui.utils.BarUpdater;
 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.localization.Messages;
 import org.scilab.modules.xcos.actions.ExternalAction;
@@ -92,7 +92,7 @@ public final class Xcos {
      * The current Xcos tradename
      */
     public static final String TRADENAME = "Xcos";
-    public static final ImageIcon ICON = new ImageIcon(ScilabSwingUtilities.findIcon("utilities-system-monitor", "256x256"));
+    public static final ImageIcon ICON = new ImageIcon(FindIconHelper.findIcon("utilities-system-monitor", "256x256"));
 
     private static final String LOAD_XCOS_LIBS_LOAD_SCICOS = "prot=funcprot(); funcprot(0); loadXcosLibs(); loadScicos(); funcprot(prot); clear prot";
 
index 3036558..51ce9ba 100644 (file)
@@ -36,6 +36,7 @@ import javax.swing.ListSelectionModel;
 
 import org.scilab.modules.action_binding.highlevel.ScilabInterpreterManagement;
 import org.scilab.modules.action_binding.highlevel.ScilabInterpreterManagement.InterpreterException;
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.xcos.actions.DebugLevelAction;
 import org.scilab.modules.xcos.actions.DebugLevelAction.DebugLevel;
@@ -68,7 +69,7 @@ public class DebugLevelDialog extends JDialog {
     public DebugLevelDialog(Component parent, ScicosParameters parameters) {
         this.parameters = parameters;
 
-        ImageIcon scilabIcon = new ImageIcon(ScilabSwingUtilities.findIcon("scilab"));
+        ImageIcon scilabIcon = new ImageIcon(FindIconHelper.findIcon("scilab"));
         Image imageForIcon = scilabIcon.getImage();
         setLayout(new GridBagLayout());
         setIconImage(imageForIcon);
index 77bd787..739544b 100644 (file)
@@ -36,11 +36,12 @@ import javax.swing.JTextArea;
 import javax.swing.ScrollPaneConstants;
 
 import org.scilab.modules.action_binding.highlevel.ScilabInterpreterManagement;
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.xcos.actions.SetContextAction;
 import org.scilab.modules.xcos.graph.ScicosParameters;
-import org.scilab.modules.xcos.graph.XcosDiagram;
 import org.scilab.modules.xcos.graph.SuperBlockDiagram;
+import org.scilab.modules.xcos.graph.XcosDiagram;
 import org.scilab.modules.xcos.io.scicos.ScilabDirectHandler;
 import org.scilab.modules.xcos.utils.XcosMessages;
 
@@ -75,7 +76,7 @@ public class SetContextDialog extends JDialog {
     public SetContextDialog(Component parent, XcosDiagram graph, ScicosParameters parameters) {
         this.parameters = parameters;
 
-        ImageIcon scilabIcon = new ImageIcon(ScilabSwingUtilities.findIcon("scilab"));
+        ImageIcon scilabIcon = new ImageIcon(FindIconHelper.findIcon("scilab"));
         Image imageForIcon = scilabIcon.getImage();
         setLayout(new GridBagLayout());
         setIconImage(imageForIcon);
index 8a27a8c..5107bd8 100644 (file)
@@ -41,6 +41,7 @@ import javax.swing.JFormattedTextField;
 import javax.swing.JLabel;
 import javax.swing.JList;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.xcos.actions.SetupAction;
 import org.scilab.modules.xcos.graph.ScicosParameters;
@@ -246,7 +247,7 @@ public class SetupDialog extends JDialog {
 
         this.parameters = parameters;
 
-        ImageIcon scilabIcon = new ImageIcon(ScilabSwingUtilities.findIcon("scilab"));
+        ImageIcon scilabIcon = new ImageIcon(FindIconHelper.findIcon("scilab"));
         Image imageForIcon = scilabIcon.getImage();
         setLayout(new GridBagLayout());
         setIconImage(imageForIcon);
index 4f2313f..9de54a6 100644 (file)
@@ -28,6 +28,7 @@ import javax.swing.event.ChangeListener;
 import javax.swing.event.EventListenerList;
 import javax.xml.bind.JAXBException;
 
+import org.scilab.modules.commons.gui.FindIconHelper;
 import org.scilab.modules.gui.utils.ScilabSwingUtilities;
 import org.scilab.modules.xcos.modelica.model.Model;
 import org.scilab.modules.xcos.modelica.model.Model.Identifiers;
@@ -134,7 +135,7 @@ public final class ModelicaController {
         dialog.setTitle(ModelicaMessages.MODELICA_SETTINGS);
         dialog.setAlwaysOnTop(false);
 
-        final ImageIcon icon = new ImageIcon(ScilabSwingUtilities.findIcon("scilab"));
+        final ImageIcon icon = new ImageIcon(FindIconHelper.findIcon("scilab"));
         dialog.setIconImage(icon.getImage());
 
         ModelicaController controller;