summaryrefslogtreecommitdiffstats
path: root/scilab/modules
diff options
context:
space:
mode:
authorSylvestre Ledru <sylvestre.ledru@scilab.org>2010-05-07 18:18:40 +0200
committerClément DAVID <clement.david@scilab.org>2010-05-18 10:06:16 +0200
commit88b9103bc068187257412b450a56c677aacd9adc (patch)
tree79c2e2324120fd9b5a0ea293a4ab9d465f914885 /scilab/modules
parent1fbcd0c5ba2d0adfc8b1c94a2f4ed07ba493cb91 (diff)
downloadscilab-88b9103bc068187257412b450a56c677aacd9adc.zip
scilab-88b9103bc068187257412b450a56c677aacd9adc.tar.gz
* Introduce org.scilab.modules.jvm.utils.ScilabConstants to allow access from other
modules * Old org.scilab.modules.graph.utils.ScilabConstants split between org.scilab.modules.jvm.utils.ScilabConstants and org.scilab.modules.graph.utils.ScilabGraphConstants Update of the code based on them. Fixes bug #7062 Change-Id: I2251c99d6b54e3b55bfea3b28202dc63f49d94ea
Diffstat (limited to 'scilab/modules')
-rw-r--r--scilab/modules/graph/src/java/org/scilab/modules/graph/ScilabCanvas.java7
-rw-r--r--scilab/modules/graph/src/java/org/scilab/modules/graph/ScilabGraph.java7
-rw-r--r--scilab/modules/graph/src/java/org/scilab/modules/graph/utils/ScilabGraphConstants.java (renamed from scilab/modules/graph/src/java/org/scilab/modules/graph/utils/ScilabConstants.java)24
-rw-r--r--scilab/modules/graph/src/java/org/scilab/modules/graph/utils/ScilabInterpreterManagement.java1
-rw-r--r--scilab/modules/helptools/src/java/org/scilab/modules/helptools/CopyConvert.java7
-rw-r--r--scilab/modules/jvm/src/java/org/scilab/modules/jvm/utils/ScilabConstants.java47
-rw-r--r--scilab/modules/xcos/src/java/org/scilab/modules/xcos/configuration/ConfigurationManager.java13
-rw-r--r--scilab/modules/xcos/src/java/org/scilab/modules/xcos/graph/XcosDiagram.java10
-rw-r--r--scilab/modules/xcos/src/java/org/scilab/modules/xcos/palette/PaletteManager.java13
-rw-r--r--scilab/modules/xcos/src/java/org/scilab/modules/xcos/utils/FileUtils.java3
-rw-r--r--scilab/modules/xcos/src/java/org/scilab/modules/xcos/utils/XcosConstants.java4
11 files changed, 88 insertions, 48 deletions
diff --git a/scilab/modules/graph/src/java/org/scilab/modules/graph/ScilabCanvas.java b/scilab/modules/graph/src/java/org/scilab/modules/graph/ScilabCanvas.java
index 571a12b..a2ed538 100644
--- a/scilab/modules/graph/src/java/org/scilab/modules/graph/ScilabCanvas.java
+++ b/scilab/modules/graph/src/java/org/scilab/modules/graph/ScilabCanvas.java
@@ -26,11 +26,12 @@ import java.util.Map;
26import org.apache.batik.ext.awt.RenderingHintsKeyExt; 26import org.apache.batik.ext.awt.RenderingHintsKeyExt;
27import org.apache.batik.gvt.GraphicsNode; 27import org.apache.batik.gvt.GraphicsNode;
28import org.apache.commons.logging.LogFactory; 28import org.apache.commons.logging.LogFactory;
29import org.scilab.modules.jvm.utils.ScilabConstants;
29import org.scilab.modules.graph.shape.LatexTextShape; 30import org.scilab.modules.graph.shape.LatexTextShape;
30import org.scilab.modules.graph.shape.MathMLTextShape; 31import org.scilab.modules.graph.shape.MathMLTextShape;
31import org.scilab.modules.graph.utils.MathMLRenderUtils; 32import org.scilab.modules.graph.utils.MathMLRenderUtils;
32import org.scilab.modules.graph.utils.ScilabConstants;
33import org.scilab.modules.graph.utils.ScilabGraphUtils; 33import org.scilab.modules.graph.utils.ScilabGraphUtils;
34import org.scilab.modules.graph.utils.ScilabGraphConstants;
34import org.scilab.modules.graph.view.SupportedLabelType; 35import org.scilab.modules.graph.view.SupportedLabelType;
35import org.xml.sax.SAXException; 36import org.xml.sax.SAXException;
36 37
@@ -137,9 +138,9 @@ public class ScilabCanvas extends mxInteractiveCanvas {
137 * @param style Style contents 138 * @param style Style contents
138 */ 139 */
139 private void applyFlipAndMirror(Map<String, Object> style) { 140 private void applyFlipAndMirror(Map<String, Object> style) {
140 String flip = mxUtils.getString(style, ScilabConstants.STYLE_FLIP, 141 String flip = mxUtils.getString(style, ScilabGraphConstants.STYLE_FLIP,
141 Boolean.FALSE.toString()); 142 Boolean.FALSE.toString());
142 String mirror = mxUtils.getString(style, ScilabConstants.STYLE_MIRROR, 143 String mirror = mxUtils.getString(style, ScilabGraphConstants.STYLE_MIRROR,
143 Boolean.FALSE.toString()); 144 Boolean.FALSE.toString());
144 145
145 // scale, 1st flip, 2nd mirror 146 // scale, 1st flip, 2nd mirror
diff --git a/scilab/modules/graph/src/java/org/scilab/modules/graph/ScilabGraph.java b/scilab/modules/graph/src/java/org/scilab/modules/graph/ScilabGraph.java
index 89cdb28..15bbb0c 100644
--- a/scilab/modules/graph/src/java/org/scilab/modules/graph/ScilabGraph.java
+++ b/scilab/modules/graph/src/java/org/scilab/modules/graph/ScilabGraph.java
@@ -17,7 +17,8 @@ import java.beans.PropertyChangeEvent;
17import java.beans.PropertyChangeListener; 17import java.beans.PropertyChangeListener;
18import java.util.List; 18import java.util.List;
19 19
20import org.scilab.modules.graph.utils.ScilabConstants; 20import org.scilab.modules.jvm.utils.ScilabConstants;
21import org.scilab.modules.graph.utils.ScilabGraphConstants;
21import org.scilab.modules.graph.utils.ScilabGraphMessages; 22import org.scilab.modules.graph.utils.ScilabGraphMessages;
22import org.scilab.modules.graph.view.ScilabGraphView; 23import org.scilab.modules.graph.view.ScilabGraphView;
23import org.scilab.modules.gui.tab.Tab; 24import org.scilab.modules.gui.tab.Tab;
@@ -73,7 +74,7 @@ public class ScilabGraph extends mxGraph {
73 private final mxIEventListener undoHandler = new mxIEventListener() { 74 private final mxIEventListener undoHandler = new mxIEventListener() {
74 public void invoke(Object source, mxEventObject evt) { 75 public void invoke(Object source, mxEventObject evt) {
75 undoManager.undoableEditHappened((mxUndoableEdit) evt 76 undoManager.undoableEditHappened((mxUndoableEdit) evt
76 .getProperty(ScilabConstants.EVENT_CHANGE_EDIT)); 77 .getProperty(ScilabGraphConstants.EVENT_CHANGE_EDIT));
77 } 78 }
78 }; 79 };
79 80
@@ -97,7 +98,7 @@ public class ScilabGraph extends mxGraph {
97 */ 98 */
98 private mxIEventListener selectionHandler = new mxIEventListener() { 99 private mxIEventListener selectionHandler = new mxIEventListener() {
99 public void invoke(Object source, mxEventObject evt) { 100 public void invoke(Object source, mxEventObject evt) {
100 List<mxUndoableChange> changes = ((mxUndoableEdit) evt.getProperty(ScilabConstants.EVENT_CHANGE_EDIT)).getChanges(); 101 List<mxUndoableChange> changes = ((mxUndoableEdit) evt.getProperty(ScilabGraphConstants.EVENT_CHANGE_EDIT)).getChanges();
101 getSelectionModel().setCells(getSelectionCellsForChanges(changes)); 102 getSelectionModel().setCells(getSelectionCellsForChanges(changes));
102 } 103 }
103 }; 104 };
diff --git a/scilab/modules/graph/src/java/org/scilab/modules/graph/utils/ScilabConstants.java b/scilab/modules/graph/src/java/org/scilab/modules/graph/utils/ScilabGraphConstants.java
index 0a7e2b8..e546d3e 100644
--- a/scilab/modules/graph/src/java/org/scilab/modules/graph/utils/ScilabConstants.java
+++ b/scilab/modules/graph/src/java/org/scilab/modules/graph/utils/ScilabGraphConstants.java
@@ -21,7 +21,7 @@ import com.mxgraph.util.mxConstants;
21/** 21/**
22 * Define all the constants used on a Scilab graph 22 * Define all the constants used on a Scilab graph
23 */ 23 */
24public class ScilabConstants extends mxConstants { 24public class ScilabGraphConstants extends mxConstants {
25 25
26 /** 26 /**
27 * Defines the size of the arcs for rounded edges. Default is 10. 27 * Defines the size of the arcs for rounded edges. Default is 10.
@@ -77,26 +77,6 @@ public class ScilabConstants extends mxConstants {
77 /** Name of the edit event */ 77 /** Name of the edit event */
78 public static final String EVENT_CHANGE_EDIT = "edit"; 78 public static final String EVENT_CHANGE_EDIT = "edit";
79 79
80 /* Scilab */
81
82 /**
83 * The tmp directory
84 */
85 public static final File TMPDIR = new File(System.getenv("TMPDIR"));
86
87 /**
88 * The SCI directory (Scilab root directory)
89 */
90 public static final File SCI = new File(System.getenv("SCI"));
91
92 /**
93 * The SCI configuration directory (Scilab home directory)
94 */
95 public static final File SCIHOME = new File(GuiManagement.getSCIHOME());
96
97 /** Escape double quote symbol */
98 public static final char QUOTE = '\"';
99
100 /** This class is a static singleton, thus it must not be instantiated */ 80 /** This class is a static singleton, thus it must not be instantiated */
101 protected ScilabConstants() { } 81 protected ScilabGraphConstants() { }
102} 82}
diff --git a/scilab/modules/graph/src/java/org/scilab/modules/graph/utils/ScilabInterpreterManagement.java b/scilab/modules/graph/src/java/org/scilab/modules/graph/utils/ScilabInterpreterManagement.java
index a2e20d8..d9df4c3 100644
--- a/scilab/modules/graph/src/java/org/scilab/modules/graph/utils/ScilabInterpreterManagement.java
+++ b/scilab/modules/graph/src/java/org/scilab/modules/graph/utils/ScilabInterpreterManagement.java
@@ -26,6 +26,7 @@ import java.util.concurrent.Executors;
26 26
27import javax.swing.SwingUtilities; 27import javax.swing.SwingUtilities;
28 28
29import org.scilab.modules.jvm.utils.ScilabConstants;
29import org.scilab.modules.action_binding.InterpreterManagement; 30import org.scilab.modules.action_binding.InterpreterManagement;
30 31
31/** 32/**
diff --git a/scilab/modules/helptools/src/java/org/scilab/modules/helptools/CopyConvert.java b/scilab/modules/helptools/src/java/org/scilab/modules/helptools/CopyConvert.java
index f5d7400..eb657b5 100644
--- a/scilab/modules/helptools/src/java/org/scilab/modules/helptools/CopyConvert.java
+++ b/scilab/modules/helptools/src/java/org/scilab/modules/helptools/CopyConvert.java
@@ -67,6 +67,11 @@ public class CopyConvert extends DefaultHandler implements ErrorHandler {
67 "http://www.w3.org/1998/Math/MathML"; 67 "http://www.w3.org/1998/Math/MathML";
68 private static final String SVG_NS = "http://www.w3.org/2000/svg"; 68 private static final String SVG_NS = "http://www.w3.org/2000/svg";
69 69
70 /**
71 * The tmp directory
72 */
73 public static final File TMPDIR = new File(System.getenv("TMPDIR"));
74
70 private boolean verbose; 75 private boolean verbose;
71 private String printFormat; 76 private String printFormat;
72 77
@@ -639,7 +644,7 @@ public class CopyConvert extends DefaultHandler implements ErrorHandler {
639 throws IOException { 644 throws IOException {
640 String tex = Helpers.loadString(inFile, "ISO-8859-1"); 645 String tex = Helpers.loadString(inFile, "ISO-8859-1");
641 646
642 File latexFile = File.createTempFile("CopyConvert", ".tex"); 647 File latexFile = File.createTempFile("CopyConvert", ".tex", TMPDIR);
643 648
644 StringBuilder buffer = new StringBuilder(); 649 StringBuilder buffer = new StringBuilder();
645 buffer.append("\\documentclass[12pt]{article}\n"); 650 buffer.append("\\documentclass[12pt]{article}\n");
diff --git a/scilab/modules/jvm/src/java/org/scilab/modules/jvm/utils/ScilabConstants.java b/scilab/modules/jvm/src/java/org/scilab/modules/jvm/utils/ScilabConstants.java
new file mode 100644
index 0000000..76d905f
--- /dev/null
+++ b/scilab/modules/jvm/src/java/org/scilab/modules/jvm/utils/ScilabConstants.java
@@ -0,0 +1,47 @@
1/*
2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2010 - DIGITEO - Clément DAVID
4 * Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU
5 *
6 * This file must be used under the terms of the CeCILL.
7 * This source file is licensed as described in the file COPYING, which
8 * you should have received as part of this distribution. The terms
9 * are also available at
10 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
11 *
12 */
13
14package org.scilab.modules.jvm.utils;
15
16import java.io.File;
17
18import org.scilab.modules.console.GuiManagement;
19
20/**
21 * Define all the constants used on a Scilab
22 */
23public class ScilabConstants {
24
25 /* Scilab */
26
27 /**
28 * The tmp directory
29 */
30 public static final File TMPDIR = new File(System.getenv("TMPDIR"));
31
32 /**
33 * The SCI directory (Scilab root directory)
34 */
35 public static final File SCI = new File(System.getenv("SCI"));
36
37 /**
38 * The SCI configuration directory (Scilab home directory)
39 */
40 public static final File SCIHOME = new File(GuiManagement.getSCIHOME());
41
42 /** Escape double quote symbol */
43 public static final char QUOTE = '\"';
44
45 /** This class is a static singleton, thus it must not be instantiated */
46 protected ScilabConstants() { }
47}
diff --git a/scilab/modules/xcos/src/java/org/scilab/modules/xcos/configuration/ConfigurationManager.java b/scilab/modules/xcos/src/java/org/scilab/modules/xcos/configuration/ConfigurationManager.java
index 061b98f..24867ca 100644
--- a/scilab/modules/xcos/src/java/org/scilab/modules/xcos/configuration/ConfigurationManager.java
+++ b/scilab/modules/xcos/src/java/org/scilab/modules/xcos/configuration/ConfigurationManager.java
@@ -31,6 +31,7 @@ import javax.xml.validation.Schema;
31import javax.xml.validation.SchemaFactory; 31import javax.xml.validation.SchemaFactory;
32 32
33import org.apache.commons.logging.LogFactory; 33import org.apache.commons.logging.LogFactory;
34import org.scilab.modules.jvm.utils.ScilabConstants;
34import org.scilab.modules.gui.messagebox.ScilabModalDialog; 35import org.scilab.modules.gui.messagebox.ScilabModalDialog;
35import org.scilab.modules.gui.messagebox.ScilabModalDialog.IconType; 36import org.scilab.modules.gui.messagebox.ScilabModalDialog.IconType;
36import org.scilab.modules.xcos.actions.OpenAction; 37import org.scilab.modules.xcos.actions.OpenAction;
@@ -99,11 +100,11 @@ public final class ConfigurationManager {
99 100
100 File f; 101 File f;
101 try { 102 try {
102 f = new File(XcosConstants.SCIHOME.getAbsoluteFile() 103 f = new File(ScilabConstants.SCIHOME.getAbsoluteFile()
103 + INSTANCE_FILENAME); 104 + INSTANCE_FILENAME);
104 105
105 if (!f.exists()) { 106 if (!f.exists()) {
106 File base = new File(XcosConstants.SCI.getAbsoluteFile() 107 File base = new File(ScilabConstants.SCI.getAbsoluteFile()
107 + XcosConstants.XCOS_ETC + INSTANCE_FILENAME); 108 + XcosConstants.XCOS_ETC + INSTANCE_FILENAME);
108 FileUtils.forceCopy(base, f); 109 FileUtils.forceCopy(base, f);
109 } 110 }
@@ -120,7 +121,7 @@ public final class ConfigurationManager {
120 XcosMessages.XCOS_ERROR, IconType.ERROR_ICON); 121 XcosMessages.XCOS_ERROR, IconType.ERROR_ICON);
121 122
122 try { 123 try {
123 f = new File(XcosConstants.SCI.getAbsoluteFile() 124 f = new File(ScilabConstants.SCI.getAbsoluteFile()
124 + XcosConstants.XCOS_ETC + INSTANCE_FILENAME); 125 + XcosConstants.XCOS_ETC + INSTANCE_FILENAME);
125 return (SettingType) unmarshaller.unmarshal(f); 126 return (SettingType) unmarshaller.unmarshal(f);
126 } catch (JAXBException ex) { 127 } catch (JAXBException ex) {
@@ -142,7 +143,7 @@ public final class ConfigurationManager {
142 * @throws JAXBException when an unsupported error has occured 143 * @throws JAXBException when an unsupported error has occured
143 */ 144 */
144 private void initUnmarshaller() throws JAXBException { 145 private void initUnmarshaller() throws JAXBException {
145 final String schemaPath = XcosConstants.SCI.getAbsolutePath() 146 final String schemaPath = ScilabConstants.SCI.getAbsolutePath()
146 + XcosConstants.XCOS_ETC + SCHEMA_FILENAME; 147 + XcosConstants.XCOS_ETC + SCHEMA_FILENAME;
147 148
148 JAXBContext jaxbContext = JAXBContext 149 JAXBContext jaxbContext = JAXBContext
@@ -173,7 +174,7 @@ public final class ConfigurationManager {
173 174
174 File f; 175 File f;
175 try { 176 try {
176 f = new File(XcosConstants.SCIHOME.getAbsoluteFile() 177 f = new File(ScilabConstants.SCIHOME.getAbsoluteFile()
177 + INSTANCE_FILENAME); 178 + INSTANCE_FILENAME);
178 marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); 179 marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
179 marshaller.marshal(getSettings(), f); 180 marshaller.marshal(getSettings(), f);
@@ -194,7 +195,7 @@ public final class ConfigurationManager {
194 * @throws JAXBException when an unsupported error has occured 195 * @throws JAXBException when an unsupported error has occured
195 */ 196 */
196 private void initMarshaller() throws JAXBException { 197 private void initMarshaller() throws JAXBException {
197 final String schemaPath = XcosConstants.SCI.getAbsolutePath() 198 final String schemaPath = ScilabConstants.SCI.getAbsolutePath()
198 + XcosConstants.XCOS_ETC + SCHEMA_FILENAME; 199 + XcosConstants.XCOS_ETC + SCHEMA_FILENAME;
199 200
200 JAXBContext jaxbContext = JAXBContext 201 JAXBContext jaxbContext = JAXBContext
diff --git a/scilab/modules/xcos/src/java/org/scilab/modules/xcos/graph/XcosDiagram.java b/scilab/modules/xcos/src/java/org/scilab/modules/xcos/graph/XcosDiagram.java
index 0402fe1..c9c3cb0 100644
--- a/scilab/modules/xcos/src/java/org/scilab/modules/xcos/graph/XcosDiagram.java
+++ b/scilab/modules/xcos/src/java/org/scilab/modules/xcos/graph/XcosDiagram.java
@@ -41,6 +41,8 @@ import javax.xml.parsers.ParserConfigurationException;
41 41
42import org.apache.commons.logging.Log; 42import org.apache.commons.logging.Log;
43import org.apache.commons.logging.LogFactory; 43import org.apache.commons.logging.LogFactory;
44import org.scilab.modules.jvm.utils.ScilabConstants;
45
44import org.scilab.modules.graph.ScilabCanvas; 46import org.scilab.modules.graph.ScilabCanvas;
45import org.scilab.modules.graph.ScilabGraph; 47import org.scilab.modules.graph.ScilabGraph;
46import org.scilab.modules.graph.actions.PasteAction; 48import org.scilab.modules.graph.actions.PasteAction;
@@ -512,14 +514,14 @@ public class XcosDiagram extends ScilabGraph {
512 * Initialize constants 514 * Initialize constants
513 */ 515 */
514 final String file = "Xcos-style.xml"; 516 final String file = "Xcos-style.xml";
515 final String homePath = XcosConstants.SCIHOME.getAbsolutePath(); 517 final String homePath = ScilabConstants.SCIHOME.getAbsolutePath();
516 final File userStyleSheet = new File(homePath + '/' + file); 518 final File userStyleSheet = new File(homePath + '/' + file);
517 519
518 /* 520 /*
519 * Copy the base stylesheet into the user dir when it doesn't exist. 521 * Copy the base stylesheet into the user dir when it doesn't exist.
520 */ 522 */
521 if (!userStyleSheet.exists()) { 523 if (!userStyleSheet.exists()) {
522 final String sciPath = XcosConstants.SCI.getAbsolutePath(); 524 final String sciPath = ScilabConstants.SCI.getAbsolutePath();
523 525
524 File baseStyleSheet = new File(sciPath + "/modules/xcos/etc/" + file); 526 File baseStyleSheet = new File(sciPath + "/modules/xcos/etc/" + file);
525 FileUtils.forceCopy(baseStyleSheet, userStyleSheet); 527 FileUtils.forceCopy(baseStyleSheet, userStyleSheet);
@@ -528,8 +530,8 @@ public class XcosDiagram extends ScilabGraph {
528 /* 530 /*
529 * Load the stylesheet 531 * Load the stylesheet
530 */ 532 */
531 final String sciURL = XcosConstants.SCI.toURI().toURL().toString(); 533 final String sciURL = ScilabConstants.SCI.toURI().toURL().toString();
532 final String homeURL = XcosConstants.SCIHOME.toURI().toURL().toString(); 534 final String homeURL = ScilabConstants.SCIHOME.toURI().toURL().toString();
533 535
534 String xml = mxUtils.readFile(userStyleSheet.getAbsolutePath()); 536 String xml = mxUtils.readFile(userStyleSheet.getAbsolutePath());
535 xml = xml.replaceAll("\\$SCILAB", sciURL); 537 xml = xml.replaceAll("\\$SCILAB", sciURL);
diff --git a/scilab/modules/xcos/src/java/org/scilab/modules/xcos/palette/PaletteManager.java b/scilab/modules/xcos/src/java/org/scilab/modules/xcos/palette/PaletteManager.java
index f65b014..82044b4 100644
--- a/scilab/modules/xcos/src/java/org/scilab/modules/xcos/palette/PaletteManager.java
+++ b/scilab/modules/xcos/src/java/org/scilab/modules/xcos/palette/PaletteManager.java
@@ -25,6 +25,7 @@ import javax.xml.validation.SchemaFactory;
25 25
26import org.apache.commons.logging.LogFactory; 26import org.apache.commons.logging.LogFactory;
27import org.scilab.modules.action_binding.InterpreterManagement; 27import org.scilab.modules.action_binding.InterpreterManagement;
28import org.scilab.modules.jvm.utils.ScilabConstants;
28import org.scilab.modules.gui.messagebox.ScilabModalDialog; 29import org.scilab.modules.gui.messagebox.ScilabModalDialog;
29import org.scilab.modules.gui.messagebox.ScilabModalDialog.IconType; 30import org.scilab.modules.gui.messagebox.ScilabModalDialog.IconType;
30import org.scilab.modules.xcos.palette.model.Category; 31import org.scilab.modules.xcos.palette.model.Category;
@@ -122,11 +123,11 @@ public final class PaletteManager {
122 123
123 File f; 124 File f;
124 try { 125 try {
125 f = new File(XcosConstants.SCIHOME.getAbsoluteFile() 126 f = new File(ScilabConstants.SCIHOME.getAbsoluteFile()
126 + INSTANCE_FILENAME); 127 + INSTANCE_FILENAME);
127 128
128 if (!f.exists()) { 129 if (!f.exists()) {
129 File base = new File(XcosConstants.SCI.getAbsoluteFile() 130 File base = new File(ScilabConstants.SCI.getAbsoluteFile()
130 + XcosConstants.XCOS_ETC + INSTANCE_FILENAME); 131 + XcosConstants.XCOS_ETC + INSTANCE_FILENAME);
131 FileUtils.forceCopy(base, f); 132 FileUtils.forceCopy(base, f);
132 } 133 }
@@ -143,7 +144,7 @@ public final class PaletteManager {
143 XcosMessages.XCOS_ERROR, IconType.ERROR_ICON); 144 XcosMessages.XCOS_ERROR, IconType.ERROR_ICON);
144 145
145 try { 146 try {
146 f = new File(XcosConstants.SCI.getAbsoluteFile() 147 f = new File(ScilabConstants.SCI.getAbsoluteFile()
147 + XcosConstants.XCOS_ETC + INSTANCE_FILENAME); 148 + XcosConstants.XCOS_ETC + INSTANCE_FILENAME);
148 setRoot((Category) unmarshaller.unmarshal(f)); 149 setRoot((Category) unmarshaller.unmarshal(f));
149 } catch (JAXBException ex) { 150 } catch (JAXBException ex) {
@@ -165,7 +166,7 @@ public final class PaletteManager {
165 * @throws JAXBException when an unsupported error has occured 166 * @throws JAXBException when an unsupported error has occured
166 */ 167 */
167 private void initUnmarshaller() throws JAXBException { 168 private void initUnmarshaller() throws JAXBException {
168 final String schemaPath = XcosConstants.SCI.getAbsolutePath() 169 final String schemaPath = ScilabConstants.SCI.getAbsolutePath()
169 + XcosConstants.XCOS_ETC + SCHEMA_FILENAME; 170 + XcosConstants.XCOS_ETC + SCHEMA_FILENAME;
170 171
171 JAXBContext jaxbContext = JAXBContext 172 JAXBContext jaxbContext = JAXBContext
@@ -196,7 +197,7 @@ public final class PaletteManager {
196 197
197 File f; 198 File f;
198 try { 199 try {
199 f = new File(XcosConstants.SCIHOME.getAbsoluteFile() 200 f = new File(ScilabConstants.SCIHOME.getAbsoluteFile()
200 + INSTANCE_FILENAME); 201 + INSTANCE_FILENAME);
201 marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); 202 marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
202 marshaller.marshal(getRoot(), f); 203 marshaller.marshal(getRoot(), f);
@@ -217,7 +218,7 @@ public final class PaletteManager {
217 * @throws JAXBException when an unsupported error has occured 218 * @throws JAXBException when an unsupported error has occured
218 */ 219 */
219 private void initMarshaller() throws JAXBException { 220 private void initMarshaller() throws JAXBException {
220 final String schemaPath = XcosConstants.SCI.getAbsolutePath() 221 final String schemaPath = ScilabConstants.SCI.getAbsolutePath()
221 + XcosConstants.XCOS_ETC + SCHEMA_FILENAME; 222 + XcosConstants.XCOS_ETC + SCHEMA_FILENAME;
222 223
223 JAXBContext jaxbContext = JAXBContext 224 JAXBContext jaxbContext = JAXBContext
diff --git a/scilab/modules/xcos/src/java/org/scilab/modules/xcos/utils/FileUtils.java b/scilab/modules/xcos/src/java/org/scilab/modules/xcos/utils/FileUtils.java
index 9819c64..3689100 100644
--- a/scilab/modules/xcos/src/java/org/scilab/modules/xcos/utils/FileUtils.java
+++ b/scilab/modules/xcos/src/java/org/scilab/modules/xcos/utils/FileUtils.java
@@ -19,6 +19,7 @@ import java.io.IOException;
19import java.nio.channels.FileChannel; 19import java.nio.channels.FileChannel;
20 20
21import org.apache.commons.logging.LogFactory; 21import org.apache.commons.logging.LogFactory;
22import org.scilab.modules.jvm.utils.ScilabConstants;
22 23
23/** 24/**
24 * Contains useful method for managing files. 25 * Contains useful method for managing files.
@@ -109,7 +110,7 @@ public final class FileUtils {
109 */ 110 */
110 public static File createTempFile() throws IOException { 111 public static File createTempFile() throws IOException {
111 return File.createTempFile(XcosFileType.XCOS.getExtension(), 112 return File.createTempFile(XcosFileType.XCOS.getExtension(),
112 XcosFileType.HDF5.getDottedExtension(), XcosConstants.TMPDIR); 113 XcosFileType.HDF5.getDottedExtension(), ScilabConstants.TMPDIR);
113 } 114 }
114 115
115 /** 116 /**
diff --git a/scilab/modules/xcos/src/java/org/scilab/modules/xcos/utils/XcosConstants.java b/scilab/modules/xcos/src/java/org/scilab/modules/xcos/utils/XcosConstants.java
index c660811..81c26ad 100644
--- a/scilab/modules/xcos/src/java/org/scilab/modules/xcos/utils/XcosConstants.java
+++ b/scilab/modules/xcos/src/java/org/scilab/modules/xcos/utils/XcosConstants.java
@@ -12,12 +12,12 @@
12 12
13package org.scilab.modules.xcos.utils; 13package org.scilab.modules.xcos.utils;
14 14
15import org.scilab.modules.graph.utils.ScilabConstants; 15import org.scilab.modules.graph.utils.ScilabGraphConstants;
16 16
17/** 17/**
18 * Contains all the constants used trough the source code. 18 * Contains all the constants used trough the source code.
19 */ 19 */
20public final class XcosConstants extends ScilabConstants { 20public final class XcosConstants extends ScilabGraphConstants {
21 21
22 /** Define the default block width on the palette */ 22 /** Define the default block width on the palette */
23 public static final int PALETTE_BLOCK_WIDTH = 100; 23 public static final int PALETTE_BLOCK_WIDTH = 100;