Revision: 5249
          http://sourceforge.net/p/jump-pilot/code/5249
Author:   ma15569
Date:     2016-12-06 17:40:59 +0000 (Tue, 06 Dec 2016)
Log Message:
-----------
Updated Sextante binding

Modified Paths:
--------------
    plug-ins/SextantePlugIn/.classpath
    
plug-ins/SextantePlugIn/src/es/unex/sextante/openjump/extensions/SextanteExtension.java
    
plug-ins/SextantePlugIn/src/es/unex/sextante/openjump/extensions/SextanteToolboxPlugin.java

Added Paths:
-----------
    plug-ins/SextantePlugIn/dist/ojsextante_binding_dic2016a.jar

Modified: plug-ins/SextantePlugIn/.classpath
===================================================================
--- plug-ins/SextantePlugIn/.classpath  2016-12-06 14:17:55 UTC (rev 5248)
+++ plug-ins/SextantePlugIn/.classpath  2016-12-06 17:40:59 UTC (rev 5249)
@@ -2,13 +2,13 @@
 <classpath>
        <classpathentry kind="src" path="src"/>
        <classpathentry kind="con" 
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-       <classpathentry kind="lib" 
path="C:/Users/Beppe/Desktop/OpenJUM/OpenJUMP-20161124-r5221-PLUS/lib/jai_codec-1.1.3.jar"/>
-       <classpathentry kind="lib" 
path="C:/Users/Beppe/Desktop/OpenJUM/OpenJUMP-20161124-r5221-PLUS/lib/jai_core-1.1.3.jar"/>
-       <classpathentry kind="lib" 
path="C:/Users/Beppe/Desktop/OpenJUM/OpenJUMP-20161124-r5221-PLUS/lib/jts-core-1.14.0.jar"/>
-       <classpathentry kind="lib" 
path="C:/Users/Beppe/Desktop/OpenJUM/OpenJUMP-20161124-r5221-PLUS/lib/jts-io-1.14.0.jar"/>
-       <classpathentry kind="lib" 
path="C:/Users/Beppe/Desktop/OpenJUM/OpenJUMP-20161124-r5221-PLUS/lib/OpenJUMP-1.9.1-r4840-nosrc.jar"/>
-       <classpathentry kind="lib" 
path="C:/Users/Beppe/Desktop/OpenJUM/OpenJUMP-20161124-r5221-PLUS/lib/ext/sextante/sextante_gui.jar"/>
-       <classpathentry kind="lib" 
path="C:/Users/Beppe/Desktop/OpenJUM/OpenJUMP-20161124-r5221-PLUS/lib/ext/sextante/sextante.jar"/>
        <classpathentry kind="con" 
path="org.eclipse.jdt.USER_LIBRARY/OpenJUMP_libraries"/>
+       <classpathentry kind="lib" 
path="C:/Users/Beppe/Desktop/OpenJUM/OpenJUMP-Portable-20161128-r5230-PLUS/OpenJUMP-20161128-r5230-PLUS/lib/ext/sextante/sextante.jar"/>
+       <classpathentry kind="lib" 
path="C:/Users/Beppe/Desktop/OpenJUM/OpenJUMP-Portable-20161128-r5230-PLUS/OpenJUMP-20161128-r5230-PLUS/lib/ext/sextante/sextante_gui.jar"/>
+       <classpathentry kind="lib" 
path="C:/Users/Beppe/Desktop/OpenJUM/OpenJUMP-Portable-20161128-r5230-PLUS/OpenJUMP-20161128-r5230-PLUS/lib/jai_codec-1.1.3.jar"/>
+       <classpathentry kind="lib" 
path="C:/Users/Beppe/Desktop/OpenJUM/OpenJUMP-Portable-20161128-r5230-PLUS/OpenJUMP-20161128-r5230-PLUS/lib/jai_core-1.1.3.jar"/>
+       <classpathentry kind="lib" 
path="C:/Users/Beppe/Desktop/OpenJUM/OpenJUMP-Portable-20161128-r5230-PLUS/OpenJUMP-20161128-r5230-PLUS/lib/jts-core-1.14.0.jar"/>
+       <classpathentry kind="lib" 
path="C:/Users/Beppe/Desktop/OpenJUM/OpenJUMP-Portable-20161128-r5230-PLUS/OpenJUMP-20161128-r5230-PLUS/lib/jts-io-1.14.0.jar"/>
+       <classpathentry kind="lib" 
path="C:/Users/Beppe/Desktop/OpenJUM/OpenJUMP-Portable-20161128-r5230-PLUS/OpenJUMP-20161128-r5230-PLUS/lib/OpenJUMP-20161128-r5230-nolang.jar"/>
        <classpathentry kind="output" path="bin"/>
 </classpath>

Added: plug-ins/SextantePlugIn/dist/ojsextante_binding_dic2016a.jar
===================================================================
(Binary files differ)

Index: plug-ins/SextantePlugIn/dist/ojsextante_binding_dic2016a.jar
===================================================================
--- plug-ins/SextantePlugIn/dist/ojsextante_binding_dic2016a.jar        
2016-12-06 14:17:55 UTC (rev 5248)
+++ plug-ins/SextantePlugIn/dist/ojsextante_binding_dic2016a.jar        
2016-12-06 17:40:59 UTC (rev 5249)

Property changes on: 
plug-ins/SextantePlugIn/dist/ojsextante_binding_dic2016a.jar
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Modified: 
plug-ins/SextantePlugIn/src/es/unex/sextante/openjump/extensions/SextanteExtension.java
===================================================================
--- 
plug-ins/SextantePlugIn/src/es/unex/sextante/openjump/extensions/SextanteExtension.java
     2016-12-06 14:17:55 UTC (rev 5248)
+++ 
plug-ins/SextantePlugIn/src/es/unex/sextante/openjump/extensions/SextanteExtension.java
     2016-12-06 17:40:59 UTC (rev 5249)
@@ -31,7 +31,7 @@
      */
 
     private static final String NAME = "Sextante 1.0";
-    private static final String VERSION = "OpenJUMP binding 2016-11-28";
+    private static final String VERSION = "OpenJUMP binding 2016-12-06";
 
     public String getName() {
         return NAME;

Modified: 
plug-ins/SextantePlugIn/src/es/unex/sextante/openjump/extensions/SextanteToolboxPlugin.java
===================================================================
--- 
plug-ins/SextantePlugIn/src/es/unex/sextante/openjump/extensions/SextanteToolboxPlugin.java
 2016-12-06 14:17:55 UTC (rev 5248)
+++ 
plug-ins/SextantePlugIn/src/es/unex/sextante/openjump/extensions/SextanteToolboxPlugin.java
 2016-12-06 17:40:59 UTC (rev 5249)
@@ -3,6 +3,7 @@
 import java.io.File;
 
 import javax.swing.ImageIcon;
+import javax.swing.JFrame;
 
 import org.apache.log4j.Logger;
 
@@ -11,7 +12,6 @@
 
 import es.unex.sextante.core.Sextante;
 import es.unex.sextante.gui.core.SextanteGUI;
-import es.unex.sextante.gui.toolbox.ToolboxDialog;
 import es.unex.sextante.gui.toolbox.ToolboxPanel;
 import es.unex.sextante.openjump.core.OpenJUMPOutputFactory;
 import es.unex.sextante.openjump.gui.OpenJUMPGUIFactory;
@@ -21,26 +21,17 @@
 import es.unex.sextante.openjump.language.I18NPlug;
 
 public class SextanteToolboxPlugin implements PlugIn {
-    protected static ToolboxPanel m_Toolbox;
 
     public boolean execute(final PlugInContext context) throws Exception {
 
-        SextanteGUI.getInputFactory().createDataObjects();
-        final ToolboxDialog toolbox = new ToolboxDialog(
-                SextanteGUI.getMainFrame());
-        m_Toolbox = toolbox.getToolboxPanel();
-        toolbox.pack();
-        // toolbox.setModalityType(Dialog.ModalityType.MODELESS);
-        toolbox.setVisible(true);
-        SextanteGUI.getInputFactory().clearDataObjects();
-        m_Toolbox = null;
+        SextanteGUI.getGUIFactory().showToolBoxDialog();
 
-        // SextanteGUI.getGUIFactory().showToolBoxDialog();
-
         return true;
 
     }
 
+    protected static ToolboxPanel m_Toolbox;
+
     public String getName() {// Giuseppe Aruta - PlugIn Internationalized
                              // 2013_05_25//
 
@@ -49,101 +40,173 @@
 
     }
 
-    public void initialize(PlugInContext context) throws Exception {
-        System.out.println("starting Sextante initialization >>");
-        // [Giuseppe Aruta] This part activates GRASS/SAGA/R panels on Setting
-        // Frame
-        // Those part of Sextante has not been implemented in OpenJUMP so it is
-        // deactivated for now
-        // HashMap<String, String> map = new HashMap();
-        // map.put("isFirstTimeUsingSextante" + Sextante.getVersionNumber(),
-        // Boolean.FALSE.toString());
-        // SextanteGUI.addAlgorithmProvider(new GrassAlgorithmProvider());
-        // map.put("GrassActivate", Boolean.TRUE.toString());
-        // SextanteGUI.addAlgorithmProvider(new SagaAlgorithmProvider());
-        // map.put("SagaActivate", Boolean.TRUE.toString());
-        // SextanteGUI.addAlgorithmProvider(new RAlgorithmProvider());
-        // map.put("RActivate", Boolean.TRUE.toString());
-        // SextanteGUI.setCustomDefaultSettings(map);
+    public void initialize(final PlugInContext context) throws Exception {
+
+        // System.out.println("starting Sextante initialization >>");
+        LOGGER.debug("starting Sextante initialization >>");
+        String jarspath = getJarsFolder();
         try {
-            Sextante.initialize(jarsFolder());
-            SextanteGUI.setSextantePath(jarsFolder());
-            SextanteGUI.initialize(jarsFolder());
-            SextanteGUI.setMainFrame(context.getWorkbenchFrame());
-            SextanteGUI.setOutputFactory(new OpenJUMPOutputFactory(context
-                    .getWorkbenchContext()));
+
+            // [Giuseppe Aruta 6/12/2016] - Begin of First modification
+
+            // --- comment out lines
+            // Sextante.initialize(jarspath);
+            // Sextante.initialize();
+            // SextanteGUI.setSextantePath(getHelpPath());
+            // SextanteGUI.initialize();
+            // --- end of comment out lines
+
+            // ---- New lines-----
+            Sextante.initialize(jarspath);
+            SextanteGUI.setSextantePath(jarspath);
+            SextanteGUI.initialize(jarspath);
+            // ---- End of new lines-----
+
+            // [Giuseppe Aruta 6/12/2016] - End of first modification
+
             SextanteGUI.setGUIFactory(new OpenJUMPGUIFactory());
+            JFrame frame = context.getWorkbenchFrame();
+            SextanteGUI.setMainFrame(frame);
+
             SextanteGUI.setInputFactory(new OpenJUMPInputFactory(context
                     .getWorkbenchContext()));
+            SextanteGUI.setOutputFactory(new OpenJUMPOutputFactory(context
+                    .getWorkbenchContext()));
             SextanteGUI
                     .setPostProcessTaskFactory(new 
OpenJUMPPostProcessTaskFactory());
+
             OJSextanteApiInitialiser.isInitialized = true;
+
             context.getFeatureInstaller().addMainMenuPlugin(this,
                     new String[] { "Sextante" }, getName(), false, getIcon(),
                     null);
+
         } catch (Exception e) {// this is most likely thrown while Debugging
-            // with the eclipse IDE.
-            System.out.println("Sextante not initialized!");
-            System.out
-                    .println("Check for problems with Sextante initialization, 
path for libs and resources: "
-                            + jarsFolder());
-            System.out.println("Check if image 'terminal.png' exist");
-            System.out.println("Check also for Sextante help classes path: "
-                    + jarsFolder() + "/help");
-            System.out.println("=> Will do 2nd try with OJ-IDE-Dev settings: 
");
+                               // with the eclipse IDE.
+            // System.out.println("Sextante not initialized!");
+            // System.out
+            // .println("Check for problems with Sextante initialization, path 
for libs and resources: "
+            // + jarspath);
+            // System.out.println("Check if image 'terminal.png' exist");
+            // System.out.println("Check also for Sextante help classes path: "
+            // + getHelpPath());
+            // System.out.println("=> Will do 2nd try with OJ-IDE-Dev 
settings: ");
+            LOGGER.debug("Error: " + e);
+            LOGGER.debug("Sextante not initialized!");
+            LOGGER.debug("Check for problems with Sextante initialization, 
path for libs and resources: "
+                    + jarspath);
+            LOGGER.debug("Check if image 'terminal.png' exist");
+            LOGGER.debug("Check also for Sextante help classes path: "
+                    + getHelpPath());
+            LOGGER.debug("=> Will do 2nd try with OJ-IDE-Dev settings: ");
+            // == do a second trial ==
 
-            // == do a second trial ==
-            String idePath = System.getProperty("user.dir")
-                    .concat(File.separator).concat("lib")
-                    .concat(File.separator).concat("plus")
-                    .concat(File.separator).concat("sextante");
-            SextanteGUI.setSextantePath(idePath);
+            String idePathSextante = System.getProperty("user.dir")
+                    + "/lib/plus/sextante";
+
+            // [Giuseppe Aruta 6/12/2016] - Second modification
+
+            // --- comment out lines
+            // String idePathSHelp = System.getProperty("user.dir")
+            // + "/lib/plus/sextante_help";
+            // --- end of comment out lines
+
+            // ---- new lines-----
+            String idePathSHelp = System.getProperty("user.dir")
+                    + "/lib/plus/sextante/help";
+            // --- end of new lines-----
+
+            // [Giuseppe Aruta 6/12/2016] - End of Second modification
+
+            SextanteGUI.setSextantePath(idePathSHelp);
             System.out.println("=> looking for algorithms and image in: "
-                    + idePath);
+                    + idePathSextante);
             try {
-                Sextante.initialize(idePath);
-                SextanteGUI.setSextantePath(idePath);
-                SextanteGUI.initialize(idePath);
+
+                // [Giuseppe Aruta 6/12/2016] - Third modification
+
+                // --- comment out lines
+                // Sextante.initialize(idePathSextante);
+                // Sextante.initialize();
+                // SextanteGUI.setSextantePath(idePathSHelp);
+                // --- end of comment out lines
+
+                // --- new lines-----
+                Sextante.initialize(idePathSextante);
+                SextanteGUI.setSextantePath(idePathSextante);
+                SextanteGUI.initialize(idePathSextante);
+                // --- end of new lines-----
+
+                // [Giuseppe Aruta 6/12/2016] - End of third modification
+
+                SextanteGUI.setGUIFactory(new OpenJUMPGUIFactory());
                 SextanteGUI.setMainFrame(context.getWorkbenchFrame());
+                SextanteGUI.setInputFactory(new OpenJUMPInputFactory(context
+                        .getWorkbenchContext()));
                 SextanteGUI.setOutputFactory(new OpenJUMPOutputFactory(context
                         .getWorkbenchContext()));
-                SextanteGUI.setGUIFactory(new OpenJUMPGUIFactory());
-                SextanteGUI.setInputFactory(new OpenJUMPInputFactory(context
-                        .getWorkbenchContext()));
                 SextanteGUI
                         .setPostProcessTaskFactory(new 
OpenJUMPPostProcessTaskFactory());
+
                 OJSextanteApiInitialiser.isInitialized = true;
+
+                // System.out
+                // .println("Success initializing Sextante at 2nd trial!");
+                LOGGER.debug("Success initializing Sextante at 2nd trial!");
                 context.getFeatureInstaller().addMainMenuPlugin(this,
                         new String[] { "Sextante" }, getName(), false,
                         getIcon(), null);
             } catch (Exception e1) {// this is most likely thrown while
-                // Debugging with the eclipse IDE.
-                System.out
-                        .println("No success with Sextante initialization - 
printing error log:");
+                                    // Debugging with the eclipse IDE.
+
+                // System.out
+                // .println("No success with Sextante initialization - 
printing error log:");
+                LOGGER.debug(
+                        "No success with Sextante initialization - printing 
error log:",
+                        e1);
                 e1.printStackTrace();
             }
         }
     }
 
-    private String jarsFolder() {
+    private String getJarsFolder() {
+
+        // [Giuseppe Aruta 6/12/2016] - fourth modification
+
+        // --- comment out lines
+        // final String sPath = System.getProperty("user.dir")
+        // + "/lib/ext/sextante";
+        // --- end of comment out lines
+
+        // --- new lines-----
         final String sPath = System.getProperty("user.dir")
                 .concat(File.separator).concat("lib").concat(File.separator)
                 .concat("ext").concat(File.separator).concat("sextante");
-        return sPath;
+        // --- end of new lines-----
 
-    }
+        // [Giuseppe Aruta 6/12/2016] - End of third modification
 
-    private String ideJarsFolder() {
-        final String sPath = System.getProperty("user.dir")
-                .concat(File.separator).concat("lib").concat(File.separator)
-                .concat("plus").concat(File.separator).concat("sextante");
+        return sPath;
 
-        return sPath;
     }
 
     private static final Logger LOGGER = Logger
             .getLogger(SextanteToolboxPlugin.class);
 
+    private String getHelpPath() {
+        String str = System.getProperty("user.dir") + "/lib/ext/sextante_help";
+
+        System.out.println("Sextante help path folder: " + str);
+        return str;
+    }
+
+    // [Giuseppe Aruta 6/12/2016] this method is not used
+    private String getSextantePath() {
+        String str = System.getProperty("user.dir") + File.separator
+                + "sextante";
+        return str;
+    }
+
     public ImageIcon getIcon() {
 
         return new ImageIcon(SextanteGUI.class.getClassLoader().getResource(


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to