Xcos GUI: cleanup Java code 91/17591/2
Paul Bignier [Thu, 17 Dec 2015 15:29:43 +0000 (16:29 +0100)]
Change-Id: I7111b75b3e95024eb8199fbd17b7c10f88b083a5

scilab/modules/xcos/src/java/org/scilab/modules/xcos/actions/InitModelicaAction.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/actions/ViewDiagramTreeShowAction.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/actions/dialog/SetContextDialog.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/block/actions/SuperblockMaskCreateAction.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/block/io/ContextUpdate.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/graph/XcosDiagram.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/io/sax/CustomHandler.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/io/sax/RawDataHandler.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/io/scicos/BlockGraphicElement.java

index 376738e..ff1f59f 100644 (file)
@@ -13,7 +13,6 @@
 package org.scilab.modules.xcos.actions;
 
 import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.util.logging.Logger;
 
 import javax.swing.JButton;
index 8d3c889..f2f9bcd 100644 (file)
@@ -22,8 +22,6 @@ import org.scilab.modules.graph.ScilabComponent;
 import org.scilab.modules.graph.ScilabGraph;
 import org.scilab.modules.graph.actions.base.DefaultAction;
 import org.scilab.modules.gui.menuitem.MenuItem;
-import org.scilab.modules.xcos.Xcos;
-import org.scilab.modules.xcos.explorer.BrowserTab;
 import org.scilab.modules.xcos.graph.XcosDiagram;
 import org.scilab.modules.xcos.utils.XcosMessages;
 
index b2899dd..fd629b6 100644 (file)
@@ -23,10 +23,8 @@ import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.beans.PropertyVetoException;
 import java.io.File;
-import java.io.FileOutputStream;
 import java.io.FileWriter;
 import java.io.IOException;
-import java.nio.CharBuffer;
 import java.util.logging.Logger;
 
 import javax.swing.BorderFactory;
@@ -50,7 +48,6 @@ 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.io.scicos.ScilabDirectHandler;
-import org.scilab.modules.xcos.utils.FileUtils;
 import org.scilab.modules.xcos.utils.XcosMessages;
 
 /**
@@ -207,8 +204,8 @@ public class SetContextDialog extends JDialog {
                 parameters.setContext(new JavaController(), v);
 
                 /*
-                * Validate the context
-                */
+                 * Validate the context
+                 */
                 try {
                     File f = File.createTempFile(ScilabDirectHandler.CONTEXT, ".sce");
                     try (FileWriter writer = new FileWriter(f)) {
index c3cef4a..5c2be34 100644 (file)
@@ -25,10 +25,8 @@ import org.scilab.modules.gui.menuitem.MenuItem;
 import org.scilab.modules.types.ScilabDouble;
 import org.scilab.modules.types.ScilabList;
 import org.scilab.modules.types.ScilabString;
-import org.scilab.modules.types.ScilabTList;
 import org.scilab.modules.types.ScilabType;
 import org.scilab.modules.xcos.JavaController;
-import org.scilab.modules.xcos.Kind;
 import org.scilab.modules.xcos.ObjectProperties;
 import org.scilab.modules.xcos.VectorOfDouble;
 import org.scilab.modules.xcos.block.SuperBlock;
index 242edbd..463fedd 100644 (file)
@@ -18,7 +18,6 @@ import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 import java.io.Serializable;
 import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
 import java.util.ArrayList;
 import java.util.EnumMap;
 import java.util.List;
index ea21db6..e9beb89 100644 (file)
@@ -110,7 +110,6 @@ import com.mxgraph.util.mxUndoableEdit.mxUndoableChange;
 import com.mxgraph.view.mxGraphSelectionModel;
 import com.mxgraph.view.mxMultiplicity;
 import java.lang.reflect.Constructor;
-import java.rmi.server.UID;
 import java.util.Hashtable;
 import org.scilab.modules.types.ScilabString;
 import org.scilab.modules.types.ScilabType;
index 248c4aa..5484c30 100644 (file)
@@ -24,7 +24,6 @@ import org.scilab.modules.xcos.ObjectProperties;
 import org.scilab.modules.xcos.VectorOfDouble;
 import org.scilab.modules.xcos.VectorOfInt;
 import org.scilab.modules.xcos.graph.ScicosParameters;
-import org.scilab.modules.xcos.graph.model.ScicosObjectOwner;
 import org.scilab.modules.xcos.graph.model.XcosCell;
 import org.scilab.modules.xcos.graph.model.XcosCellFactory;
 import org.scilab.modules.xcos.io.HandledElement;
@@ -130,7 +129,7 @@ class CustomHandler implements ScilabHandler {
 
                 saxHandler.controller.setObjectProperty(uid, Kind.DIAGRAM, ObjectProperties.PROPERTIES, properties);
 
-            // no break on purpose, we decode non-root specific properties later
+                // no break on purpose, we decode non-root specific properties later
             case SuperBlockDiagram:
                 final Kind kind;
                 XcosCell parent;
index 5ebafe8..5a126fa 100644 (file)
@@ -40,7 +40,6 @@ import org.xml.sax.Attributes;
 
 import com.mxgraph.model.mxGeometry;
 import com.mxgraph.util.mxPoint;
-import org.scilab.modules.xcos.Kind;
 import org.scilab.modules.xcos.VectorOfInt;
 import org.scilab.modules.xcos.VectorOfScicosID;
 
@@ -98,13 +97,13 @@ class RawDataHandler implements ScilabHandler {
 
         switch (found) {
             case ScilabBoolean:
-            // no break on purpose
+                // no break on purpose
             case ScilabDouble:
-            // no break on purpose
+                // no break on purpose
             case ScilabInteger:
-            // no break on purpose
+                // no break on purpose
             case ScilabString:
-            // no break on purpose
+                // no break on purpose
             case Array: {
                 String as = atts.getValue("as");
 
@@ -307,25 +306,25 @@ class RawDataHandler implements ScilabHandler {
                     switch (ScilabIntegerTypeEnum.valueOf(v)) {
                         case sci_int8:
                             unsigned = false;
-                        // no break on purpose
+                            // no break on purpose
                         case sci_uint8:
                             container = new ScilabInteger(new byte[height][width], unsigned);
                             break;
                         case sci_int16:
                             unsigned = false;
-                        // no break on purpose
+                            // no break on purpose
                         case sci_uint16:
                             container = new ScilabInteger(new short[height][width], unsigned);
                             break;
                         case sci_int32:
                             unsigned = false;
-                        // no break on purpose
+                            // no break on purpose
                         case sci_uint32:
                             container = new ScilabInteger(new int[height][width], unsigned);
                             break;
                         case sci_int64:
                             unsigned = false;
-                        // no break on purpose
+                            // no break on purpose
                         case sci_uint64:
                             container = new ScilabInteger(new long[height][width], unsigned);
                             break;
@@ -359,13 +358,13 @@ class RawDataHandler implements ScilabHandler {
     public void endElement(HandledElement found) {
         switch (found) {
             case Array:
-            // no break on purpose
+                // no break on purpose
             case ScilabBoolean:
-            // no break on purpose
+                // no break on purpose
             case ScilabDouble:
-            // no break on purpose
+                // no break on purpose
             case ScilabInteger:
-            // no break on purpose
+                // no break on purpose
             case ScilabString: {
                 // defensive programming
                 if (!(saxHandler.parents.peek() instanceof RawDataDescriptor)) {
index 4d6b3d2..74a2685 100644 (file)
@@ -37,7 +37,6 @@ import org.scilab.modules.xcos.io.scicos.ScicosFormatException.WrongTypeExceptio
 import org.scilab.modules.xcos.utils.BlockPositioning;
 
 import com.mxgraph.model.mxCell;
-import com.mxgraph.model.mxGeometry;
 import com.mxgraph.util.mxConstants;
 
 /**