summaryrefslogtreecommitdiffstats
path: root/scilab
diff options
context:
space:
mode:
authorSylvestre Ledru <sylvestre.ledru@scilab.org>2010-04-14 10:15:16 +0200
committerPierre MARECHAL <pierre.marechal@scilab.org>2010-04-14 10:36:21 +0200
commitd17cbe8559c1857798a15cdd9bffc53093b0ffc2 (patch)
tree5092525fbec073574c02b3c18ab1739d51ceda7c /scilab
parent2373c91ba5dd83ed8b279e896974d412ba8bc888 (diff)
downloadscilab-d17cbe8559c1857798a15cdd9bffc53093b0ffc2.zip
scilab-d17cbe8559c1857798a15cdd9bffc53093b0ffc2.tar.gz
Move the load of the jar files straight into the graphic export module
instead of the print method. This will: * put the right code only where it is needed * avoid the circular dependency between the module GUI <=> JVM Thanks to Calixte for the suggestion. Change-Id: I1d97e9831b5d43b88e959a65644cf159f12a3dc0
Diffstat (limited to 'scilab')
-rw-r--r--scilab/modules/Makefile.am2
-rw-r--r--scilab/modules/Makefile.in4
-rw-r--r--scilab/modules/graphic_export/src/java/org/scilab/modules/graphic_export/FileExporter.java9
-rw-r--r--scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/CallScilabBridge.java8
4 files changed, 12 insertions, 11 deletions
diff --git a/scilab/modules/Makefile.am b/scilab/modules/Makefile.am
index 0fe92de..b03d823 100644
--- a/scilab/modules/Makefile.am
+++ b/scilab/modules/Makefile.am
@@ -34,8 +34,8 @@ shell \
34completion \ 34completion \
35console \ 35console \
36graphic_export \ 36graphic_export \
37jvm \
38gui \ 37gui \
38jvm \
39graphics \ 39graphics \
40optimization \ 40optimization \
41symbolic \ 41symbolic \
diff --git a/scilab/modules/Makefile.in b/scilab/modules/Makefile.in
index 001b206..301c1c8 100644
--- a/scilab/modules/Makefile.in
+++ b/scilab/modules/Makefile.in
@@ -154,7 +154,7 @@ CTAGS = ctags
154DIST_SUBDIRS = core output_stream action_binding arnoldi \ 154DIST_SUBDIRS = core output_stream action_binding arnoldi \
155 elementary_functions string api_scilab dynamic_link fileio \ 155 elementary_functions string api_scilab dynamic_link fileio \
156 history_manager spreadsheet tclsci localization renderer shell \ 156 history_manager spreadsheet tclsci localization renderer shell \
157 completion console graphic_export jvm gui graphics \ 157 completion console graphic_export gui jvm graphics \
158 optimization symbolic randlib statistics special_functions \ 158 optimization symbolic randlib statistics special_functions \
159 interpolation linear_algebra integer data_structures mexlib \ 159 interpolation linear_algebra integer data_structures mexlib \
160 differential_equations cacsd polynomials boolean double pvm io \ 160 differential_equations cacsd polynomials boolean double pvm io \
@@ -431,7 +431,7 @@ top_srcdir = @top_srcdir@
431SUBDIRS = core output_stream action_binding arnoldi \ 431SUBDIRS = core output_stream action_binding arnoldi \
432 elementary_functions string api_scilab dynamic_link fileio \ 432 elementary_functions string api_scilab dynamic_link fileio \
433 history_manager spreadsheet tclsci localization renderer shell \ 433 history_manager spreadsheet tclsci localization renderer shell \
434 completion console graphic_export jvm gui graphics \ 434 completion console graphic_export gui jvm graphics \
435 optimization symbolic randlib statistics special_functions \ 435 optimization symbolic randlib statistics special_functions \
436 interpolation linear_algebra integer data_structures mexlib \ 436 interpolation linear_algebra integer data_structures mexlib \
437 differential_equations cacsd polynomials boolean double pvm io \ 437 differential_equations cacsd polynomials boolean double pvm io \
diff --git a/scilab/modules/graphic_export/src/java/org/scilab/modules/graphic_export/FileExporter.java b/scilab/modules/graphic_export/src/java/org/scilab/modules/graphic_export/FileExporter.java
index 2b8ae66..1804a11 100644
--- a/scilab/modules/graphic_export/src/java/org/scilab/modules/graphic_export/FileExporter.java
+++ b/scilab/modules/graphic_export/src/java/org/scilab/modules/graphic_export/FileExporter.java
@@ -17,6 +17,7 @@ package org.scilab.modules.graphic_export;
17import java.io.File; 17import java.io.File;
18import org.scilab.modules.renderer.FigureMapper; 18import org.scilab.modules.renderer.FigureMapper;
19import org.scilab.modules.renderer.figureDrawing.DrawableFigureGL; 19import org.scilab.modules.renderer.figureDrawing.DrawableFigureGL;
20import org.scilab.modules.jvm.LoadClassPath;
20 21
21/** 22/**
22 * Static class used to create file export of graphic figures 23 * Static class used to create file export of graphic figures
@@ -27,6 +28,9 @@ public class FileExporter {
27 /** Export waiting message */ 28 /** Export waiting message */
28 private static final String exportingMessage = "Exporting figure, please wait..."; 29 private static final String exportingMessage = "Exporting figure, please wait...";
29 30
31 /** The id used on classpath.xml to load vectorial export JARs */
32 private static final String CLASSPATH_PDF_PS_EPS_EXPORT_NAME = "pdf_ps_eps_graphic_export";
33
30 /** 34 /**
31 * Default constructor 35 * Default constructor
32 */ 36 */
@@ -58,6 +62,11 @@ public class FileExporter {
58 String oldInfoMessage = exportedFig.getInfoMessage(); 62 String oldInfoMessage = exportedFig.getInfoMessage();
59 exportedFig.setInfoMessage(exportingMessage); 63 exportedFig.setInfoMessage(exportingMessage);
60 if (fileType == ExportRenderer.PDF_EXPORT || fileType == ExportRenderer.EPS_EXPORT || fileType == ExportRenderer.PS_EXPORT ) { 64 if (fileType == ExportRenderer.PDF_EXPORT || fileType == ExportRenderer.EPS_EXPORT || fileType == ExportRenderer.PS_EXPORT ) {
65
66 /* Under !Windows, make sure that the library for ps export
67 * are already loaded */
68 LoadClassPath.loadOnUse(CLASSPATH_PDF_PS_EPS_EXPORT_NAME);
69
61 String ext = ""; 70 String ext = "";
62 71
63 switch (fileType) { 72 switch (fileType) {
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/CallScilabBridge.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/CallScilabBridge.java
index 7cec277..b01edf6 100644
--- a/scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/CallScilabBridge.java
+++ b/scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/CallScilabBridge.java
@@ -113,7 +113,6 @@ import org.scilab.modules.gui.waitbar.WaitBar;
113import org.scilab.modules.gui.widget.Widget; 113import org.scilab.modules.gui.widget.Widget;
114import org.scilab.modules.gui.window.ScilabWindow; 114import org.scilab.modules.gui.window.ScilabWindow;
115import org.scilab.modules.gui.window.Window; 115import org.scilab.modules.gui.window.Window;
116import org.scilab.modules.jvm.LoadClassPath;
117import org.scilab.modules.localization.Messages; 116import org.scilab.modules.localization.Messages;
118import org.scilab.modules.renderer.FigureMapper; 117import org.scilab.modules.renderer.FigureMapper;
119import org.scilab.modules.renderer.figureDrawing.DrawableFigureGL; 118import org.scilab.modules.renderer.figureDrawing.DrawableFigureGL;
@@ -166,9 +165,6 @@ public class CallScilabBridge {
166 165
167 private static final String CONSOLE = "Console"; 166 private static final String CONSOLE = "Console";
168 167
169 /** The id used on classpath.xml to load vectorial export JARs */
170 private static final String CLASSPATH_PDF_PS_EPS_EXPORT_NAME = "pdf_ps_eps_graphic_export";
171
172 /** 168 /**
173 * Constructor 169 * Constructor
174 */ 170 */
@@ -2365,10 +2361,6 @@ public class CallScilabBridge {
2365 String fileExtension = ".ps"; 2361 String fileExtension = ".ps";
2366 2362
2367 try { 2363 try {
2368 /* Under !Windows, make sure that the library for ps export
2369 * are already loaded */
2370 LoadClassPath.loadOnUse(CLASSPATH_PDF_PS_EPS_EXPORT_NAME);
2371
2372 /** Export image to PostScript */ 2364 /** Export image to PostScript */
2373 if (((PrintRequestAttribute) scilabPageFormat.get(OrientationRequested.class)) == OrientationRequested.PORTRAIT) { 2365 if (((PrintRequestAttribute) scilabPageFormat.get(OrientationRequested.class)) == OrientationRequested.PORTRAIT) {
2374 FileExporter.fileExport(figureID, 2366 FileExporter.fileExport(figureID,