Xcos: checkstyle and comment 62/1562/4
Clément DAVID [Fri, 6 Aug 2010 15:38:01 +0000 (17:38 +0200)]
Change-Id: I05b7ec822dbdd32942fb51650775b5d6afa4083c

39 files changed:
scilab/modules/xcos/src/java/org/scilab/modules/xcos/actions/SimulationNotRunningAction.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/actions/ViewGridAction.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/block/AfficheBlock.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/block/BasicBlock.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/block/actions/CodeGenerationAction.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/block/actions/SuperblockMaskCustomizeAction.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/block/positionning/BigSom.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/block/positionning/Product.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/block/positionning/Summation.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/graph/CompilationEngineStatus.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/io/XcosObjectCodec.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/io/codec/BasicBlockCodec.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/io/scicos/AbstractElement.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/io/scicos/BlockElement.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/io/scicos/BlockGraphicElement.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/io/scicos/BlockModelElement.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/io/scicos/DiagramElement.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/io/scicos/LinkElement.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/palette/actions/ViewPaletteBrowserAction.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/palette/listener/PaletteBlockMouseListener.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/palette/listener/PaletteManagerMouseListener.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/palette/listener/PaletteManagerTreeSelectionListener.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/palette/model/Category.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/palette/model/PaletteNode.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/palette/model/PreLoaded.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/palette/view/PaletteComponent.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/palette/view/PaletteView.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/port/BasicPort.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/port/Orientation.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/port/command/CommandPort.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/port/control/ControlPort.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/port/input/InputPort.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/port/output/OutputPort.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/utils/FileUtils.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/utils/PaletteComponent.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/utils/XcosEvent.java

index f7d35d0..f648699 100644 (file)
@@ -32,6 +32,7 @@ public abstract class SimulationNotRunningAction extends DefaultAction {
                super(scilabGraph);
                
                GraphActionManager.get(scilabGraph, StartAction.class).addPropertyChangeListener(new PropertyChangeListener() {
+                       @Override
                        public void propertyChange(PropertyChangeEvent evt) {
                                setEnabled((Boolean) evt.getNewValue());
                        }
index aa975d6..bd8a689 100644 (file)
@@ -55,6 +55,7 @@ public final class ViewGridAction extends DefaultAction {
                menu.setChecked(true);
                
                scilabGraph.addPropertyChangeListener("gridEnabled", new PropertyChangeListener() {
+                       @Override
                        public void propertyChange(PropertyChangeEvent evt) {
                                XcosDiagram graph = (XcosDiagram) evt.getSource();
                                
@@ -73,6 +74,6 @@ public final class ViewGridAction extends DefaultAction {
         */
        @Override
        public void actionPerformed(ActionEvent e) {
-               ((ScilabGraph) getGraph(e)).setGridEnabled(!((XcosDiagram) getGraph(e)).isGridEnabled());
+               (getGraph(e)).setGridEnabled(!((XcosDiagram) getGraph(e)).isGridEnabled());
        }
 }
index 33d6c64..53e889b 100644 (file)
@@ -121,13 +121,14 @@ public class DebugLevelDialog extends JDialog {
 
 
                cancelButton.addActionListener(new ActionListener() {
+                       @Override
                        public void actionPerformed(ActionEvent e) {
                                dispose();
                        }
                });
 
                okButton.addActionListener(new ActionListener() {
-
+                       @Override
                        public void actionPerformed(ActionEvent e) {
                                int value = ((DebugLevel) debugList.getSelectedValue()).getValue();
                                try {
index 7af56bb..f65fe5d 100644 (file)
@@ -38,6 +38,7 @@ import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
 import javax.swing.JTextArea;
+import javax.swing.ScrollPaneConstants;
 
 import org.apache.commons.logging.LogFactory;
 import org.scilab.modules.xcos.actions.SetContextAction;
@@ -97,7 +98,7 @@ public class SetContextDialog extends JDialog {
         contextArea = new JTextArea(contextBuilder.toString());
       
         JScrollPane contextAreaScroll = new JScrollPane(contextArea, 
-                       JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
+                       ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
         
                JButton cancelButton = new JButton(XcosMessages.CANCEL);
                JButton okButton = new JButton(XcosMessages.OK);
@@ -153,6 +154,7 @@ public class SetContextDialog extends JDialog {
                 * The cancel button just exit without doing anything
                 */
                cancelButton.addActionListener(new ActionListener() {
+                       @Override
                        public void actionPerformed(ActionEvent e) {
                                dispose();
                        }
@@ -164,6 +166,7 @@ public class SetContextDialog extends JDialog {
                 */
                okButton.addActionListener(new ActionListener() {
 
+                       @Override
                        public void actionPerformed(ActionEvent e) {
                                List<String> contextList = new ArrayList<String>();
                                int i = 0;
index ad80240..b7c5a76 100644 (file)
@@ -297,12 +297,14 @@ public class SetupDialog extends JDialog {
        private void installActionListeners(JButton cancelButton, JButton okButton,
                        JButton defaultButton, JButton setContextButton) {
                cancelButton.addActionListener(new ActionListener() {
+                       @Override
                        public void actionPerformed(ActionEvent e) {
                                dispose();
                        }
                });
 
                defaultButton.addActionListener(new ActionListener() {
+                       @Override
                        public void actionPerformed(ActionEvent e) {
                                integration.setValue(new BigDecimal(ScicosParameters.FINAL_INTEGRATION_TIME));
                                rts.setValue(new BigDecimal(ScicosParameters.REAL_TIME_SCALING));
@@ -316,6 +318,7 @@ public class SetupDialog extends JDialog {
                });
 
                okButton.addActionListener(new ActionListener() {
+                       @Override
                        public void actionPerformed(ActionEvent e) {
                            if (((JButton) e.getSource()).hasFocus()) {
                            try {
@@ -346,6 +349,7 @@ public class SetupDialog extends JDialog {
                });
 
                setContextButton.addActionListener(new ActionListener() {
+                       @Override
                        public void actionPerformed(ActionEvent e) {
                                final SetContextDialog dialog = new SetContextDialog(SetupDialog.this, parameters);
                                
index 2de0a72..7b63f84 100644 (file)
@@ -203,10 +203,12 @@ public final class AfficheBlock extends BasicBlock {
         * @see java.lang.Object#finalize()
         */
        @Override
+       // CSOFF: IllegalThrows
        protected void finalize() throws Throwable {
                INSTANCES.remove(hashCode());
                super.finalize();
        }
+       // CSON: IllegalThrows
        
        /**
         * @return a clone of the block
index b8c6965..7746ade 100644 (file)
@@ -36,6 +36,7 @@ import ncsa.hdf.hdf5lib.exceptions.HDF5Exception;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.scilab.modules.action_binding.InterpreterManagement;
 import org.scilab.modules.action_binding.highlevel.ScilabInterpreterManagement;
 import org.scilab.modules.action_binding.highlevel.ScilabInterpreterManagement.InterpreterException;
 import org.scilab.modules.graph.ScilabGraph;
@@ -44,6 +45,7 @@ import org.scilab.modules.graph.actions.CopyAction;
 import org.scilab.modules.graph.actions.CutAction;
 import org.scilab.modules.graph.actions.DeleteAction;
 import org.scilab.modules.graph.actions.base.DefaultAction;
+import org.scilab.modules.graph.utils.ScilabGraphConstants;
 import org.scilab.modules.graph.utils.StyleMap;
 import org.scilab.modules.gui.bridge.contextmenu.SwingScilabContextMenu;
 import org.scilab.modules.gui.contextmenu.ContextMenu;
@@ -97,16 +99,86 @@ import org.scilab.modules.xcos.utils.XcosMessages;
 import com.mxgraph.model.mxGeometry;
 import com.mxgraph.model.mxICell;
 import com.mxgraph.model.mxIGraphModel;
+import com.mxgraph.util.mxConstants;
 import com.mxgraph.util.mxEventObject;
 import com.mxgraph.util.mxUtils;
 
 public class BasicBlock extends ScilabGraphUniqueObject implements Serializable {
+       /**
+        * Property name of {@link #interfaceFunctionName}
+        */
+       public static final String INTERFACE_FUNCTION_NAME = "interfaceFunctionName";
+       /**
+        * Property name of {@link #simulationFunctionName}
+        */
+       public static final String SIMULATION_FUNCTION_NAME = "simulationFunctionName";
+       /**
+        * Property name of {@link #simulationFunctionType}
+        */
+       public static final String SIMULATION_FUNCTION_TYPE = "simulationFunctionType";
+       /**
+        * Property name of {@link #realParameters}
+        */
+       public static final String REAL_PARAMETERS = "realParameters";
+       /**
+        * Property name of {@link #integerParameters}
+        */
+       public static final String INTEGER_PARAMETERS = "integerParameters";
+       /**
+        * Property name of {@link #objectsParameters}
+        */
+       public static final String OBJECTS_PARAMETERS = "objectsParameters";
+       /**
+        * Property name of {@link #dependsOnU}
+        */
+       public static final String DEPENDS_ON_U = "dependsOnU";
+       /**
+        * Property name of {@link #dependsOnT}
+        */
+       public static final String DEPENDS_ON_T = "dependsOnT";
+       /**
+        * Property name of {@link #blockType}
+        */
+       public static final String BLOCK_TYPE = "blockType";
+       /**
+        * Property name of {@link #ordering}
+        */
+       public static final String ORDERING = "ordering";
+       /**
+        * Property name of {@link #exprs}
+        */
+       public static final String EXPRS = "exprs";
+       /**
+        * Property name of {@link #nbZerosCrossing}
+        */
+       public static final String NB_ZEROS_CROSSING = "nbZerosCrossing";
+       /**
+        * Property name of {@link #nmode}
+        */
+       public static final String NMODE = "nmode";
+       /**
+        * Property name of {@link #state}
+        */
+       public static final String STATE = "state";
+       /**
+        * Property name of {@link #dState}
+        */
+       public static final String D_STATE = "dState";
+       /**
+        * Property name of {@link #oDState}
+        */
+       public static final String O_D_STATE = "oDState";
+       /**
+        * Property name of {@link #equations}
+        */
+       public static final String EQUATIONS = "equations";
+       
        private static final double DEFAULT_POSITION_X = 10.0;
        private static final double DEFAULT_POSITION_Y = 10.0;
        private static final double DEFAULT_WIDTH = 40.0;
        private static final double DEFAULT_HEIGHT = 40.0;
        
-       private static final PropertyChangeListener styleUpdater = new UpdateStyleFromInterfunction();
+       private static final PropertyChangeListener STYLE_UPDATER = new UpdateStyleFromInterfunction();
        private static final Log LOG = LogFactory.getLog(BasicBlock.class);
        
        /**
@@ -130,8 +202,10 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
         *     - "dependsOnT"
         *     - "blockType"
         *     - "ordering"
+        *  
+        *  you can easily access to then by using property name constants.
         */
-       protected PropertyChangeSupport parametersPCS = new PropertyChangeSupport(this);
+       private PropertyChangeSupport parametersPCS = new PropertyChangeSupport(this);
        
     private String interfaceFunctionName = "xcos_block";
     private String simulationFunctionName = "xcos_simulate";
@@ -216,16 +290,22 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
                 * @return The corresponding Scilab/Scicos descriptor
                 */
                public double getAsDouble() {
-                       return this.value;
+                       return value;
                }
        };
 
        /**
         * Update the source block when the interfunction change. 
         */
-       private static class UpdateStyleFromInterfunction implements PropertyChangeListener, Serializable {
+       private static final class UpdateStyleFromInterfunction implements PropertyChangeListener, Serializable {
 
                /**
+                * Default constructor.
+                */
+               public UpdateStyleFromInterfunction() {
+               }
+               
+               /**
                 * Update the label on interfunction change.
                 * 
                 * @param evt the property change event.
@@ -243,9 +323,17 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
                
        }
        
-       private static class TraceParametersListener implements PropertyChangeListener, Serializable {
+       /**
+        * Trace the parameters change on the {@link Log}.
+        * 
+        * This listener is only installed if the trace is enable.
+        */
+       private static final class TraceParametersListener implements PropertyChangeListener, Serializable {
                private static TraceParametersListener instance;
                
+               /**
+                * Default constructor.
+                */
                private TraceParametersListener() {
                        super();
                }
@@ -260,6 +348,11 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
                        return instance;
                }
                
+               /**
+                * Trace.
+                * @param evt the event
+                * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
+                */
                @Override
                public void propertyChange(PropertyChangeEvent evt) {
                        LOG.trace(evt.getPropertyName() + ": " + evt.getOldValue() + ", " + evt.getNewValue());
@@ -267,7 +360,7 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
        }
        
        /**
-        * 
+        * Default constructor.
         */
        public BasicBlock() {
                super();
@@ -279,8 +372,8 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
                        setStyle(getInterfaceFunctionName());
                }
                
-               parametersPCS.addPropertyChangeListener("interfaceFunctionName",
-                               styleUpdater);
+               parametersPCS.addPropertyChangeListener(INTERFACE_FUNCTION_NAME,
+                               STYLE_UPDATER);
                
                /*
                 * Trace block parameters change if applicable.
@@ -319,7 +412,7 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
                setValue("");
                setStyle("");
        }
-
+       
     /**
      * @return parent diagram
      */
@@ -351,7 +444,7 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
                        
                        final String oldValue = this.interfaceFunctionName;
                        this.interfaceFunctionName = interfaceFunctionName;
-                       parametersPCS.firePropertyChange("interfaceFunctionName", oldValue,
+                       parametersPCS.firePropertyChange(INTERFACE_FUNCTION_NAME, oldValue,
                                        interfaceFunctionName);
                }
     }
@@ -365,7 +458,7 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
                        
                final String oldValue = this.simulationFunctionName;
                this.simulationFunctionName = simulationFunctionName;
-               parametersPCS.firePropertyChange("simulationFunctionName", oldValue, simulationFunctionName);
+               parametersPCS.firePropertyChange(SIMULATION_FUNCTION_NAME, oldValue, simulationFunctionName);
        }
     }
 
@@ -380,8 +473,8 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
      * @param scilabValue simulation function type
      */
     public void setSimulationFunctionType(int scilabValue) {
-               SimulationFunctionType simulationFunctionType = SimulationFunctionType.convertScilabValue(scilabValue);
-               setSimulationFunctionType(simulationFunctionType);
+               SimulationFunctionType simFunctionType = SimulationFunctionType.convertScilabValue(scilabValue);
+               setSimulationFunctionType(simFunctionType);
     }
 
     /**
@@ -393,7 +486,7 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
                        
                        final SimulationFunctionType oldValue = this.simulationFunctionType;
                        this.simulationFunctionType = simulationFunctionType;
-                       parametersPCS.firePropertyChange("simulationFunctionType", oldValue,
+                       parametersPCS.firePropertyChange(SIMULATION_FUNCTION_TYPE, oldValue,
                                        simulationFunctionType);
                }
        }
@@ -421,7 +514,7 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
                        
                        final ScilabType oldValue = this.realParameters;
                        this.realParameters = realParameters;
-                       parametersPCS.firePropertyChange("realParameters", oldValue, realParameters);
+                       parametersPCS.firePropertyChange(REAL_PARAMETERS, oldValue, realParameters);
                }
     } 
 
@@ -441,7 +534,7 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
                        
                        final ScilabType oldValue = this.integerParameters;
                        this.integerParameters = integerParameters;
-                       parametersPCS.firePropertyChange("integerParameters", oldValue, integerParameters);
+                       parametersPCS.firePropertyChange(INTEGER_PARAMETERS, oldValue, integerParameters);
                }
     }
 
@@ -461,7 +554,7 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
                        
                        final ScilabType oldValue = this.objectsParameters;
                        this.objectsParameters = objectsParameters;
-                       parametersPCS.firePropertyChange("objectsParameters", oldValue, objectsParameters);
+                       parametersPCS.firePropertyChange(OBJECTS_PARAMETERS, oldValue, objectsParameters);
                }
     }
 
@@ -473,7 +566,7 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
                        
                        final boolean oldValue = this.dependsOnU;
                        this.dependsOnU = dependsOnU;
-                       parametersPCS.firePropertyChange("dependsOnU", oldValue, dependsOnU);
+                       parametersPCS.firePropertyChange(DEPENDS_ON_U, oldValue, dependsOnU);
                }
     }
 
@@ -492,7 +585,7 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
                        
                        final boolean oldValue = this.dependsOnT;
                        this.dependsOnT = dependsOnT;
-                       parametersPCS.firePropertyChange("dependsOnT", oldValue, dependsOnT);
+                       parametersPCS.firePropertyChange(DEPENDS_ON_T, oldValue, dependsOnT);
                }
     }
 
@@ -512,7 +605,7 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
                        
                        final String oldValue = this.blockType;
                        this.blockType = blockType;
-                       parametersPCS.firePropertyChange("blockType", oldValue, blockType);
+                       parametersPCS.firePropertyChange(BLOCK_TYPE, oldValue, blockType);
                }
     }
 
@@ -531,7 +624,7 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
                        
                        final int oldValue = this.ordering;
                        this.ordering = ordering;
-                       parametersPCS.firePropertyChange("ordering", oldValue, ordering);
+                       parametersPCS.firePropertyChange(ORDERING, oldValue, ordering);
                }
     }
 
@@ -551,7 +644,7 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
                        
                        final ScilabType oldValue = this.exprs;
                        this.exprs = exprs;
-                       parametersPCS.firePropertyChange("exprs", oldValue, exprs);
+                       parametersPCS.firePropertyChange(EXPRS, oldValue, exprs);
                }
     }
 
@@ -578,7 +671,7 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
                        
                        final ScilabType oldValue = this.nbZerosCrossing;
                        this.nbZerosCrossing = nbZerosCrossing;
-                       parametersPCS.firePropertyChange("nbZerosCrossing", oldValue, nbZerosCrossing);
+                       parametersPCS.firePropertyChange(NB_ZEROS_CROSSING, oldValue, nbZerosCrossing);
                }
     }
 
@@ -598,7 +691,7 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
                        
                        final ScilabType oldValue = this.nmode;
                        this.nmode = nmode;
-                       parametersPCS.firePropertyChange("nmode", oldValue, nmode);
+                       parametersPCS.firePropertyChange(NMODE, oldValue, nmode);
                }
     }
 
@@ -618,7 +711,7 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
                        
                        final ScilabType oldValue = this.state;
                        this.state = state;
-                       parametersPCS.firePropertyChange("state", oldValue, state);
+                       parametersPCS.firePropertyChange(STATE, oldValue, state);
                }
     }
 
@@ -630,7 +723,7 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
     }
 
     /**
-     * @param state new dstate
+     * @param dState new dstate
      */
     public void setDState(ScilabType dState) {
                if ((this.dState == null && dState != null)
@@ -638,7 +731,7 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
                        
                        final ScilabType oldValue = this.dState;
                        this.dState = dState;
-                       parametersPCS.firePropertyChange("dState", oldValue, dState);
+                       parametersPCS.firePropertyChange(D_STATE, oldValue, dState);
                }
     }
 
@@ -650,7 +743,7 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
     }
 
     /**
-     * @param state new ostate
+     * @param oDState new odstate
      */
     public void setODState(ScilabType oDState) {
                if ((this.oDState == null && oDState != null)
@@ -658,7 +751,7 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
                        
                        final ScilabType oldValue = this.oDState;
                        this.oDState = oDState;
-                       parametersPCS.firePropertyChange("oDState", oldValue, oDState);
+                       parametersPCS.firePropertyChange(O_D_STATE, oldValue, oDState);
                }
     }
 
@@ -678,7 +771,7 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
                        
                        final ScilabType oldValue = this.equations;
                        this.equations = equations;
-                       parametersPCS.firePropertyChange("equations", oldValue, equations);
+                       parametersPCS.firePropertyChange(EQUATIONS, oldValue, equations);
                }
     }
 
@@ -803,17 +896,21 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
         * @param modifiedBlock the new block instance
         */
        private void updateChildren(BasicBlock modifiedBlock) {
-               Set<Class<? extends mxICell>> types = new HashSet<Class<? extends mxICell>>(
+               /*
+                * Checked as port classes only
+                */
+               @SuppressWarnings("unchecked")
+               Set<Class< ? extends mxICell>> types = new HashSet<Class< ? extends mxICell>>(
                                Arrays.asList(InputPort.class, OutputPort.class,
                                                ControlPort.class, CommandPort.class));
 
-               Map<Class<? extends mxICell>, Deque<mxICell>> annotatedOlds = getTypedChildren(types);
-               Map<Class<? extends mxICell>, Deque<mxICell>> annotatedNews = modifiedBlock
+               Map<Class< ? extends mxICell>, Deque<mxICell>> annotatedOlds = getTypedChildren(types);
+               Map<Class< ? extends mxICell>, Deque<mxICell>> annotatedNews = modifiedBlock
                                .getTypedChildren(types);
 
                getParentDiagram().getModel().beginUpdate();
                try {
-                       for (Class<? extends mxICell> klass : types) {
+                       for (Class< ? extends mxICell> klass : types) {
                                final Deque<mxICell> olds = annotatedOlds.get(klass);
                                final Deque<mxICell> news = annotatedNews.get(klass);
 
@@ -833,9 +930,9 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
                                                modified.insertEdge(edge, isOutgoing);
                                        }
 
-                                       getParentDiagram().removeCells(new Object[] { previous },
+                                       getParentDiagram().removeCells(new Object[] {previous},
                                                        false);
-                                       getParentDiagram().addCells(new Object[] { modified },
+                                       getParentDiagram().addCells(new Object[] {modified},
                                                        this, previousIndex);
                                }
 
@@ -860,18 +957,18 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
         * @param types the classes to search for.
         * @return a map which linked foreach type the corresponding cell list. 
         */
-       private Map<Class<? extends mxICell>, Deque<mxICell>> getTypedChildren(Set<Class<? extends mxICell>> types) {
-               Map<Class<? extends mxICell>, Deque<mxICell>> oldPorts = new HashMap<Class<? extends mxICell>, Deque<mxICell>>();
+       private Map<Class< ? extends mxICell>, Deque<mxICell>> getTypedChildren(Set<Class< ? extends mxICell>> types) {
+               Map<Class< ? extends mxICell>, Deque<mxICell>> oldPorts = new HashMap<Class< ? extends mxICell>, Deque<mxICell>>();
                
                // Allocate all types set
-               for (Class<? extends mxICell> type : types) {
+               for (Class< ? extends mxICell> type : types) {
                        oldPorts.put(type, new LinkedList<mxICell>());
                }
                
                // children lookup
                for (Object cell : children) {
                        
-                       Class<? extends Object> klass = cell.getClass();
+                       Class< ? extends Object> klass = cell.getClass();
                        while (klass != null) {
                                if (types.contains(klass)) {
                                        break;
@@ -1000,24 +1097,24 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
      */
     public String getToolTipText() {
        StringBuilder result = new StringBuilder();
-       result.append(XcosConstants.HTML_BEGIN);
-       result.append("Block Name : " + getInterfaceFunctionName() + XcosConstants.HTML_NEWLINE);
-       result.append("Simulation : " + getSimulationFunctionName() + XcosConstants.HTML_NEWLINE);
+       result.append(ScilabGraphConstants.HTML_BEGIN);
+       result.append("Block Name : " + getInterfaceFunctionName() + ScilabGraphConstants.HTML_NEWLINE);
+       result.append("Simulation : " + getSimulationFunctionName() + ScilabGraphConstants.HTML_NEWLINE);
 
        if (getParentDiagram() instanceof PaletteDiagram) {
            if (getIntegerParameters() != null) {
-               result.append("Integer parameters : " + getIntegerParameters() + XcosConstants.HTML_NEWLINE);
+               result.append("Integer parameters : " + getIntegerParameters() + ScilabGraphConstants.HTML_NEWLINE);
            }
            
            if (getRealParameters() != null && getRealParameters().getHeight() != 0 && getRealParameters().getWidth() != 0) {
-               result.append("Real parameters : " + getRealParameters() + XcosConstants.HTML_NEWLINE);
+               result.append("Real parameters : " + getRealParameters() + ScilabGraphConstants.HTML_NEWLINE);
            }
            
            if (getObjectsParameters() != null) {
-               result.append("Object parameters : " + getObjectsParameters() + XcosConstants.HTML_NEWLINE);
+               result.append("Object parameters : " + getObjectsParameters() + ScilabGraphConstants.HTML_NEWLINE);
            }
        } else {
-           result.append("UID : " + getId() + XcosConstants.HTML_NEWLINE);
+           result.append("UID : " + getId() + ScilabGraphConstants.HTML_NEWLINE);
                final int length = getStyle().length();
                result.append("Style : ");
                if (length > XcosConstants.MAX_CHAR_IN_STYLE) {
@@ -1026,20 +1123,24 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
                } else {
                        result.append(getStyle());
                }
-               result.append(XcosConstants.HTML_NEWLINE);
-           result.append("Flip : " + getFlip() + XcosConstants.HTML_NEWLINE);
-           result.append("Mirror : " + getMirror() + XcosConstants.HTML_NEWLINE);
-           result.append("Input ports : " + BasicBlockInfo.getAllTypedPorts(this, false, InputPort.class).size() + XcosConstants.HTML_NEWLINE);
-           result.append("Output ports : " + BasicBlockInfo.getAllTypedPorts(this, false, OutputPort.class).size() + XcosConstants.HTML_NEWLINE);
-           result.append("Control ports : " + BasicBlockInfo.getAllTypedPorts(this, false, ControlPort.class).size() + XcosConstants.HTML_NEWLINE);
-           result.append("Command ports : " + BasicBlockInfo.getAllTypedPorts(this, false, CommandPort.class).size() + XcosConstants.HTML_NEWLINE);
+               result.append(ScilabGraphConstants.HTML_NEWLINE);
+           result.append("Flip : " + getFlip() + ScilabGraphConstants.HTML_NEWLINE);
+           result.append("Mirror : " + getMirror() + ScilabGraphConstants.HTML_NEWLINE);
+           result.append("Input ports : "
+                       + BasicBlockInfo.getAllTypedPorts(this, false, InputPort.class).size() + ScilabGraphConstants.HTML_NEWLINE);
+           result.append("Output ports : "
+                       + BasicBlockInfo.getAllTypedPorts(this, false, OutputPort.class).size() + ScilabGraphConstants.HTML_NEWLINE);
+           result.append("Control ports : "
+                       + BasicBlockInfo.getAllTypedPorts(this, false, ControlPort.class).size() + ScilabGraphConstants.HTML_NEWLINE);
+           result.append("Command ports : "
+                       + BasicBlockInfo.getAllTypedPorts(this, false, CommandPort.class).size() + ScilabGraphConstants.HTML_NEWLINE);
        }
 
-       result.append("x : " + getGeometry().getX() + XcosConstants.HTML_NEWLINE);
-       result.append("y : " + getGeometry().getY() + XcosConstants.HTML_NEWLINE);
-       result.append("w : " + getGeometry().getWidth() + XcosConstants.HTML_NEWLINE);
-       result.append("h : " + getGeometry().getHeight() + XcosConstants.HTML_NEWLINE);
-       result.append(XcosConstants.HTML_END);
+       result.append("x : " + getGeometry().getX() + ScilabGraphConstants.HTML_NEWLINE);
+       result.append("y : " + getGeometry().getY() + ScilabGraphConstants.HTML_NEWLINE);
+       result.append("w : " + getGeometry().getWidth() + ScilabGraphConstants.HTML_NEWLINE);
+       result.append("h : " + getGeometry().getHeight() + ScilabGraphConstants.HTML_NEWLINE);
+       result.append(ScilabGraphConstants.HTML_END);
        return result.toString();
     }
 
@@ -1150,7 +1251,7 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
 
                @Override
            public void callBack() {
-               ScilabInterpreterManagement.requestScilabExec("help " + getInterfaceFunctionName());
+               InterpreterManagement.requestScilabExec("help " + getInterfaceFunctionName());
            }
        });
        menu.add(help);
@@ -1257,8 +1358,8 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
                if (getParentDiagram() != null) {
                        isFlipped = flip;
                        final mxIGraphModel model = getParentDiagram().getModel();
-                       mxUtils.setCellStyles(model, new Object[] { this },
-                                       XcosConstants.STYLE_FLIP, Boolean.toString(flip));
+                       mxUtils.setCellStyles(model, new Object[] {this},
+                                       ScilabGraphConstants.STYLE_FLIP, Boolean.toString(flip));
                }
        }
 
@@ -1285,8 +1386,8 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
                if (getParentDiagram() != null) {
                        isMirrored = mirror;
                        final mxIGraphModel model = getParentDiagram().getModel();
-                       mxUtils.setCellStyles(model, new Object[] { this },
-                                       XcosConstants.STYLE_MIRROR, Boolean.toString(mirror));
+                       mxUtils.setCellStyles(model, new Object[] {this},
+                                       ScilabGraphConstants.STYLE_MIRROR, Boolean.toString(mirror));
                }
        }
 
@@ -1333,7 +1434,7 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
        this.angle = angle;
        
        if (getParentDiagram() != null) {
-           mxUtils.setCellStyles(getParentDiagram().getModel(), new Object[] {this}, XcosConstants.STYLE_ROTATION, Integer.toString(angle));
+           mxUtils.setCellStyles(getParentDiagram().getModel(), new Object[] {this}, mxConstants.STYLE_ROTATION, Integer.toString(angle));
        }
     }
 
@@ -1343,14 +1444,14 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
        public void updateFieldsFromStyle() {
                StyleMap map = new StyleMap(getStyle());
 
-               if (map.get(XcosConstants.STYLE_ROTATION) != null) {
-                       angle = Integer.parseInt(map.get(XcosConstants.STYLE_ROTATION));
+               if (map.get(mxConstants.STYLE_ROTATION) != null) {
+                       angle = Integer.parseInt(map.get(mxConstants.STYLE_ROTATION));
                } else {
                        angle = 0;
                }
                
-               isFlipped = Boolean.parseBoolean(map.get(XcosConstants.STYLE_FLIP));
-               isMirrored = Boolean.parseBoolean(map.get(XcosConstants.STYLE_MIRROR));
+               isFlipped = Boolean.parseBoolean(map.get(ScilabGraphConstants.STYLE_FLIP));
+               isMirrored = Boolean.parseBoolean(map.get(ScilabGraphConstants.STYLE_MIRROR));
        }
 
        /**
@@ -1386,7 +1487,7 @@ public class BasicBlock extends ScilabGraphUniqueObject implements Serializable
         * 
         * @return the associated {@link PropertyChangeSupport} instance
         */
-       public PropertyChangeSupport getParametersPCS() {
+       protected PropertyChangeSupport getParametersPCS() {
                return parametersPCS;
        }
        
index 8c8773a..bc09ede 100644 (file)
@@ -100,6 +100,7 @@ public class CodeGenerationAction extends SuperBlockSelectedAction {
                                                tempInput.getAbsolutePath());
                                
                                final ActionListener callback = new ActionListener() {
+                                       @Override
                                        public void actionPerformed(ActionEvent arg0) {
                                                
                                                if (!tempInput.exists()) {
index 157bba9..848fe92 100644 (file)
@@ -23,6 +23,7 @@ import javax.swing.BorderFactory;
 import javax.swing.DefaultCellEditor;
 import javax.swing.JComboBox;
 import javax.swing.JFrame;
+import javax.swing.WindowConstants;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 import javax.swing.event.ListSelectionEvent;
@@ -132,7 +133,7 @@ public final class SuperblockMaskCustomizeAction extends DefaultAction {
                 */
                public CustomizeFrame() {
                        setTitle(XcosMessages.MASK_TITLE);
-                       setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
+                       setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
                        controler = new CustomizeFrameControler();
                        initComponents();
                }
@@ -542,12 +543,14 @@ public final class SuperblockMaskCustomizeAction extends DefaultAction {
                        private CustomizeFrameModel model;
 
                        private final ActionListener cancelActionListener = new ActionListener() {
+                               @Override
                                public void actionPerformed(ActionEvent e) {
                                        dispose();
                                }
                        };
 
                        private final ActionListener okActionListener = new ActionListener() {
+                               @Override
                                public void actionPerformed(ActionEvent arg0) {
                                        /* TODO : handle ok click when editing a cell. */
                                        model.exportToBlock();
@@ -556,6 +559,7 @@ public final class SuperblockMaskCustomizeAction extends DefaultAction {
                        };
 
                        private final ChangeListener rowSpinnerChangeListener = new ChangeListener() {
+                               @Override
                                public void stateChanged(ChangeEvent e) {
                                        int rowCount = varCustomizeTable.getRowCount();
                                        int value = (Integer) rowSpinner.getModel().getValue();
@@ -573,22 +577,26 @@ public final class SuperblockMaskCustomizeAction extends DefaultAction {
                        };
 
                        private final ActionListener moveDownActionListener = new ActionListener() {
+                               @Override
                                public void actionPerformed(ActionEvent arg0) {
                                        int selectedRow = varCustomizeTable.getSelectedRow();
-                                       /**
+                                       /*
                                         * doesn't need to be checked as the operation doesn't
                                         * depend on it
                                         */
+                                       @SuppressWarnings("unchecked")
                                        List<List< ? >> data = model.customizeTableModel
                                                        .getDataVector();
 
                                        if (selectedRow > 0
                                                        && selectedRow < varCustomizeTable.getRowCount() - 1) {
-                                               /**
+                                               /*
                                                 * doesn't need to be checked as the operation doesn't
                                                 * depend on it
                                                 */
+                                               @SuppressWarnings("unchecked")
                                                List<Integer> current = (List<Integer>) data.get(selectedRow);
+                                               @SuppressWarnings("unchecked")
                                                List<Integer> next = (List<Integer>) data.get(selectedRow + 1);
 
                                                /* Inverting data */
@@ -596,8 +604,8 @@ public final class SuperblockMaskCustomizeAction extends DefaultAction {
                                                data.set(selectedRow, next);
 
                                                /* Update the index field */
-                                               current.set(0, ((Integer) current.get(0)) + 1);
-                                               next.set(0, ((Integer) next.get(0)) - 1);
+                                               current.set(0, (current.get(0)) + 1);
+                                               next.set(0, (next.get(0)) - 1);
 
                                                /* Keep the same row selected */
                                                varCustomizeTable.changeSelection(selectedRow + 1,
@@ -608,21 +616,25 @@ public final class SuperblockMaskCustomizeAction extends DefaultAction {
                        };
 
                        private final ActionListener moveUpActionListener = new ActionListener() {
+                               @Override
                                public void actionPerformed(ActionEvent arg0) {
                                        int selectedRow = varCustomizeTable.getSelectedRow();
-                                       /**
+                                       /*
                                         * doesn't need to be checked as the operation doesn't
                                         * depend on it
                                         */
+                                       @SuppressWarnings("unchecked")
                                        final List<List< ? >> data = model.customizeTableModel
                                                        .getDataVector();
 
                                        if (selectedRow > 1) {
-                                               /**
+                                               /*
                                                 * doesn't need to be checked as the operation doesn't
                                                 * depend on it
                                                 */
+                                               @SuppressWarnings("unchecked")
                                                List<Integer> current = (List<Integer>) data.get(selectedRow);
+                                               @SuppressWarnings("unchecked")
                                                List<Integer> next = (List<Integer>) data.get(selectedRow - 1);
 
                                                /* Inverting data */
@@ -630,8 +642,8 @@ public final class SuperblockMaskCustomizeAction extends DefaultAction {
                                                data.set(selectedRow, next);
 
                                                /* Update the index field */
-                                               current.set(0, ((Integer) current.get(0)) - 1);
-                                               next.set(0, ((Integer) next.get(0)) + 1);
+                                               current.set(0, (current.get(0)) - 1);
+                                               next.set(0, (next.get(0)) + 1);
 
                                                /* Keep the same row selected */
                                                varCustomizeTable.changeSelection(selectedRow - 1,
@@ -642,6 +654,7 @@ public final class SuperblockMaskCustomizeAction extends DefaultAction {
                        };
 
                        private final ActionListener deleteActionListener = new ActionListener() {
+                               @Override
                                public void actionPerformed(ActionEvent e) {
                                        int selected = varCustomizeTable.getSelectedRow();
                                        int nbOfRows = varCustomizeTable.getRowCount();
@@ -673,6 +686,7 @@ public final class SuperblockMaskCustomizeAction extends DefaultAction {
                        };
 
                        private final ActionListener insertActionListener = new ActionListener() {
+                               @Override
                                public void actionPerformed(ActionEvent e) {
                                        model.customizeTableModel.addRow(new Object[] {
                                                        model.customizeTableModel.getRowCount() + 1, "",
@@ -686,6 +700,7 @@ public final class SuperblockMaskCustomizeAction extends DefaultAction {
                         * Update the buttons on selection change.
                         */
                        private final ListSelectionListener updateButtonsSensibleForSelectionChange = new ListSelectionListener() {
+                               @Override
                                public void valueChanged(ListSelectionEvent e) {
                                        /* We cannot move up anymore */
                                        boolean isFirst = false;
@@ -707,6 +722,7 @@ public final class SuperblockMaskCustomizeAction extends DefaultAction {
                         * Update the buttons/spinner on modifications
                         */
                        private final TableModelListener updateButtonsSensibleForModifications = new TableModelListener() {
+                               @Override
                                public void tableChanged(TableModelEvent e) {
                                        /* We cannot delete anymore */
                                        boolean canDelete = false;
@@ -724,6 +740,7 @@ public final class SuperblockMaskCustomizeAction extends DefaultAction {
                         * Update the values table on change on the customize table.
                         */
                        private final TableModelListener updateValuesTable = new TableModelListener() {
+                               @Override
                                public void tableChanged(TableModelEvent e) {
                                        final DefaultTableModel valuesModel = model.valuesTableModel;
                                        final DefaultTableModel customModel = model.customizeTableModel;
@@ -778,6 +795,7 @@ public final class SuperblockMaskCustomizeAction extends DefaultAction {
         */
        public static void main(String[] args) {
                java.awt.EventQueue.invokeLater(new Runnable() {
+                       @Override
                        public void run() {
                                new SuperblockMaskCustomizeAction(null).new CustomizeFrame()
                                        .setVisible(true);
index 3123014..7295412 100644 (file)
@@ -27,7 +27,7 @@ public class BigSom extends BasicBlock {
        public BigSom() {
                super();
 
-               parametersPCS.addPropertyChangeListener("realParameters",
+               getParametersPCS().addPropertyChangeListener("realParameters",
                                SumPortLabelingListener.getInstance());
        }
 
index 3814c19..2d68b7f 100644 (file)
@@ -27,7 +27,7 @@ public class Product extends BasicBlock {
        public Product() {
                super();
 
-               parametersPCS.addPropertyChangeListener("integerParameters",
+               getParametersPCS().addPropertyChangeListener("integerParameters",
                                ProdPortLabelingListener.getInstance());
        }
 }
index 09c0133..7e6e059 100644 (file)
@@ -27,8 +27,8 @@ public class Summation extends BasicBlock {
        public Summation() {
                super();
 
-               parametersPCS.addPropertyChangeListener("integerParameters",
+               getParametersPCS().addPropertyChangeListener("integerParameters",
                                SumPortLabelingListener.getInstance());
        }
 
-}
\ No newline at end of file
+}
index 53246aa..eacc3c5 100644 (file)
@@ -46,7 +46,7 @@ public class CompilationEngineStatus implements mxIEventListener, PropertyChange
         *            otherwise.
         */
        public void setCompilationNeeded(boolean status) {
-               this.compilationNeeded = status;
+               compilationNeeded = status;
        }
 
        /**
index cddcac6..804284f 100644 (file)
@@ -14,15 +14,14 @@ package org.scilab.modules.xcos.io;
 
 import java.util.Map;
 
+import org.scilab.modules.graph.utils.ScilabGraphConstants;
 import org.scilab.modules.graph.utils.StyleMap;
 import org.scilab.modules.xcos.link.commandcontrol.CommandControlLink;
 import org.scilab.modules.xcos.link.explicit.ExplicitLink;
 import org.scilab.modules.xcos.link.implicit.ImplicitLink;
-import org.scilab.modules.xcos.utils.XcosConstants;
 
 import com.mxgraph.io.mxCellCodec;
 import com.mxgraph.io.mxCodecRegistry;
-import com.mxgraph.model.mxCell;
 
 /**
  * Codec for any xcos object
@@ -34,7 +33,7 @@ public class XcosObjectCodec extends mxCellCodec {
        protected static final String[] REFS = {"parent", "source", "target"};
        
        /**
-        * Attribute name containing {@link mxCell} style.
+        * Attribute name containing {@link com.mxgraph.model.mxCell} style.
         */
     protected static final String STYLE = "style";
     private static final String ROTATION = "rotation";
@@ -98,12 +97,12 @@ public class XcosObjectCodec extends mxCellCodec {
 
                }
 
-               if (!style.containsKey(XcosConstants.STYLE_FLIP)) {
-                       style.put(XcosConstants.STYLE_FLIP, Boolean.FALSE.toString());
+               if (!style.containsKey(ScilabGraphConstants.STYLE_FLIP)) {
+                       style.put(ScilabGraphConstants.STYLE_FLIP, Boolean.FALSE.toString());
                }
 
-               if (!style.containsKey(XcosConstants.STYLE_MIRROR)) {
-                       style.put(XcosConstants.STYLE_MIRROR, Boolean.FALSE.toString());
+               if (!style.containsKey(ScilabGraphConstants.STYLE_MIRROR)) {
+                       style.put(ScilabGraphConstants.STYLE_MIRROR, Boolean.FALSE.toString());
                }
        }
 }
index f367c13..382c0cf 100644 (file)
@@ -81,7 +81,6 @@ public class BasicBlockCodec extends XcosObjectCodec {
                BasicBlockCodec codec = (BasicBlockCodec) mxCodecRegistry.getCodec("AfficheBlock");
                codec.exclude.add("printTimer");
                codec.exclude.add("updateAction");
-               
        }
        
        /**
index 56e0746..4d0660f 100644 (file)
@@ -35,6 +35,9 @@ public abstract class AbstractElement<T> implements Element<T> {
        /**
         * Default implementation is empty.
         * 
+        * @param from the source data
+        * @param element where to encode data
+        * @return the updated encoded data
         * @see org.scilab.modules.xcos.io.scicos.Element#beforeDecode(ScilabType, Object)
         */
        @Override
@@ -61,6 +64,9 @@ public abstract class AbstractElement<T> implements Element<T> {
        /**
         * Default implementation is empty.
         * 
+        * @param from the source data
+        * @param element where to encode data
+        * @return the updated encoded data
         * @see org.scilab.modules.xcos.io.scicos.Element#afterEncode(Object, ScilabType)
         */
        @Override
@@ -71,6 +77,9 @@ public abstract class AbstractElement<T> implements Element<T> {
        /**
         * Default implementation is empty.
         * 
+        * @param element where to decode data
+        * @param into where read data
+        * @return the updated decoded data
         * @see org.scilab.modules.xcos.io.scicos.Element#beforeDecode(ScilabType, Object)
         */
        @Override
@@ -81,6 +90,9 @@ public abstract class AbstractElement<T> implements Element<T> {
        /**
         * Default implementation is empty.
         * 
+        * @param element where to decode data
+        * @param into where read data
+        * @return the updated decoded data
         * @see org.scilab.modules.xcos.io.scicos.Element#afterDecode(ScilabType, Object)
         */
        @Override
index 0884b77..01b30b8 100644 (file)
@@ -386,12 +386,16 @@ public class BlockElement extends AbstractElement<BasicBlock> {
         */
        private void setupPortSize(BasicBlock from) {
                // Getting children size per type.
-               int in, out, ein, eout;
+               int in;
+               int out;
+               int ein;
+               int eout;
+
                in = BasicBlockInfo.getAllTypedPorts(from, false, InputPort.class).size();
                out = BasicBlockInfo.getAllTypedPorts(from, false, OutputPort.class).size();
                ein = BasicBlockInfo.getAllTypedPorts(from, false, ControlPort.class).size();
                eout = BasicBlockInfo.getAllTypedPorts(from, false, CommandPort.class).size();
-               
+
                // Setup the graphics and model ports size
                graphicElement.setPortsSize(in, out, ein, eout);
                modelElement.setPortsSize(in, out, ein, eout);
index 6ded43f..a95e1d1 100644 (file)
@@ -87,26 +87,27 @@ class BlockGraphicElement extends BlockPartsElement {
                if (into == null) {
                        throw new IllegalArgumentException();
                }
-
+               BasicBlock block = into;
+               
                data = (ScilabMList) element;
 
                validate();
                
-               into = beforeDecode(element, into);
+               block = beforeDecode(element, block);
                
                /*
                 * fill the data
                 */
-               fillDimension(into);
-               fillOrigin(into);
-               fillFlipAndRotation(into);
+               fillDimension(block);
+               fillOrigin(block);
+               fillFlipAndRotation(block);
                
-               into.setExprs(data.get(EXPRS_INDEX));
+               block.setExprs(data.get(EXPRS_INDEX));
                
                
-               into = afterDecode(element, into);
+               block = afterDecode(element, block);
                
-               return into;
+               return block;
        }
 
        /**
index 1660a6b..db90c92 100644 (file)
@@ -476,6 +476,7 @@ class BlockModelElement extends BlockPartsElement {
         * @return the element parameter
         * @see org.scilab.modules.xcos.io.scicos.Element#encode(java.lang.Object, org.scilab.modules.types.scilabTypes.ScilabType)
         */
+       // CSOFF: JavaNCSS
        @Override
        public ScilabType encode(BasicBlock from, ScilabType element) {
                data = (ScilabMList) element;
@@ -496,8 +497,13 @@ class BlockModelElement extends BlockPartsElement {
                data.set(field, from.getSimulationFunctionNameAndType());
                
                /*
-                * Fields managed by specific elements.
-                * 
+                * Fields managed by specific elements :
+                *  - in
+                *  - in2
+                *  - intyp
+                *  - out
+                *  - out2
+                *  - outyp
                 * see InputPortElement and OutputPortElement.
                 */
                field++; // in
@@ -507,6 +513,9 @@ class BlockModelElement extends BlockPartsElement {
                field++; // out2
                field++; // outtyp
                
+               /*
+                * Event ports
+                */
                field++; // evtin
                final List<ControlPort> ctrlPorts = BasicBlockInfo.getAllTypedPorts(from, false, ControlPort.class);
                data.set(field, BasicBlockInfo.getAllPortsDataLines(ctrlPorts));
@@ -514,6 +523,9 @@ class BlockModelElement extends BlockPartsElement {
                final List<CommandPort> cmdPorts = BasicBlockInfo.getAllTypedPorts(from, false, CommandPort.class);
                data.set(field, BasicBlockInfo.getAllPortsDataLines(cmdPorts));
                
+               /*
+                * State
+                */
                field++; // state
                data.set(field, from.getState());
                field++; // dstate
@@ -521,6 +533,9 @@ class BlockModelElement extends BlockPartsElement {
                field++; // odstate
                data.set(field, from.getODState());
                
+               /*
+                * Parameters
+                */
                field++; // rpar
                data.set(field, from.getRealParameters());
                field++; // ipar
@@ -556,7 +571,8 @@ class BlockModelElement extends BlockPartsElement {
                
                return data;
        }
-
+       // CSON: JavaNCSS
+       
        /**
         * Allocate a new element
         * @return the new element
index dd6ce1c..be81698 100644 (file)
@@ -78,7 +78,7 @@ public class DiagramElement extends AbstractElement<XcosDiagram> {
        private static final ScilabTList DIAGRAM_OPTIONS = new ScilabTList(
                        OPTS_FIELDS,
                Arrays.asList(
-                       new ScilabList( // 3D
+                       new ScilabList(// 3D
                                Arrays.asList(
                                        new ScilabBoolean(true),
                                        new ScilabDouble(33)
@@ -86,7 +86,7 @@ public class DiagramElement extends AbstractElement<XcosDiagram> {
                        ),
                        new ScilabDouble(new double[][] {{8, 1}}), // Background
                        new ScilabDouble(new double[][] {{1, 5}}), // Link
-                       new ScilabList( // ID
+                       new ScilabList(// ID
                                Arrays.asList(
                                        new ScilabDouble(new double[][] {{5, 1}}),
                                        new ScilabDouble(new double[][] {{4, 1}})
index 40e9147..345403a 100644 (file)
@@ -39,6 +39,7 @@ import com.mxgraph.util.mxPoint;
  * Perform a link transformation between Scicos and Xcos.
  */
 // CSOFF: ClassDataAbstractionCoupling
+// CSOFF: FanOutComplexity
 public class LinkElement extends AbstractElement<BasicLink> {
        private static final List<String> DATA_FIELD_NAMES = asList("Link", "xx",
                        "yy", "id", "thick", "ct", "from", "to");
@@ -487,3 +488,4 @@ public class LinkElement extends AbstractElement<BasicLink> {
        }
 }
 // CSON: ClassDataAbstractionCoupling
+// CSON: FanOutComplexity
index 33cbb92..9aedacf 100644 (file)
@@ -16,8 +16,6 @@ package org.scilab.modules.xcos.palette.actions;
 import java.awt.event.ActionEvent;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
-import java.util.ArrayList;
-import java.util.List;
 
 import org.scilab.modules.graph.ScilabGraph;
 import org.scilab.modules.graph.actions.base.DefaultAction;
@@ -38,8 +36,6 @@ public final class ViewPaletteBrowserAction extends DefaultAction {
        /** Accelerator key for the action */
        public static final int ACCELERATOR_KEY = 0;
 
-    private static List<CheckBoxMenuItem> menus = new ArrayList<CheckBoxMenuItem>();
-
     /**
      * Constructor
      * 
index 6c7fe66..0035fb0 100644 (file)
@@ -47,6 +47,7 @@ public final class PaletteBlockMouseListener implements MouseListener {
         * Load and perform display update on mouse click
         * @param e The associated event 
         */
+       @Override
        public void mouseClicked(MouseEvent e) {
                if ((e.getClickCount() == 1 && SwingUtilities.isRightMouseButton(e))
                                || e.isPopupTrigger()
@@ -148,18 +149,21 @@ public final class PaletteBlockMouseListener implements MouseListener {
         * Not used
         * @param e Not used
         */
+       @Override
        public void mouseEntered(MouseEvent e) { }
 
        /**
         * Not used
         * @param e Not used
         */
+       @Override
        public void mouseExited(MouseEvent e) { }
 
        /**
         * Select on mouse press
         * @param e The associated event
         */
+       @Override
        public void mousePressed(MouseEvent e) {
                PaletteBlockView view = (PaletteBlockView) e.getSource();
                view.getController().setSelected(true);
@@ -169,5 +173,6 @@ public final class PaletteBlockMouseListener implements MouseListener {
         * Not used
         * @param e Not used
         */
+       @Override
        public void mouseReleased(MouseEvent e) { }
 }
index 62f5893..d3dee02 100644 (file)
@@ -138,6 +138,7 @@ public class PaletteManagerMouseListener implements MouseListener {
         * @param path the current path
         * @param remove the menu item
         */
+       // CSOFF: IllegalCatch
        private void setupRemove(final JTree paletteTree, final TreePath path,
                        final MenuItem remove) {
                remove.setText(XcosMessages.REMOVE);
@@ -167,6 +168,7 @@ public class PaletteManagerMouseListener implements MouseListener {
                
                remove.setEnabled(canBeRemoved);
        }
+       // CSON: IllegalCatch
        
        /**
         * Not used
index 0fc2f1b..b5c1822 100644 (file)
@@ -30,8 +30,8 @@ import org.scilab.modules.xcos.palette.model.PaletteBlock;
 import org.scilab.modules.xcos.palette.model.PaletteNode;
 import org.scilab.modules.xcos.palette.model.PreLoaded;
 import org.scilab.modules.xcos.palette.view.PaletteConfiguratorListView;
-import org.scilab.modules.xcos.palette.view.PaletteView;
 import org.scilab.modules.xcos.palette.view.PaletteConfiguratorListView.PaletteListModel;
+import org.scilab.modules.xcos.palette.view.PaletteView;
 
 /**
  * Implement the tree selection listener 
@@ -54,6 +54,7 @@ public class PaletteManagerTreeSelectionListener implements
         * @param tree The source event
         * @see javax.swing.event.TreeSelectionListener#valueChanged(javax.swing.event.TreeSelectionEvent)
         */
+       @Override
        public void valueChanged(TreeSelectionEvent tree) {
                JTree component = (JTree) tree.getSource();
                JSplitPane splitPanel = (JSplitPane) component.getParent().getParent().getParent();
index be2fdb4..b152dfe 100644 (file)
@@ -18,6 +18,7 @@ import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 
 import javax.swing.tree.TreeNode;
 import javax.xml.bind.Marshaller;
@@ -54,8 +55,8 @@ import javax.xml.bind.annotation.XmlType;
 @XmlRootElement
 @XmlType(name = "Category", propOrder = { "node" })
 public class Category extends PaletteNode {
-       private static transient final 
-               HashMap<String, List<PaletteNode>> SAVED_NODELIST = new HashMap<String, List<PaletteNode>>();
+       private static final transient
+               Map<String, List<PaletteNode>> SAVED_NODELIST = new HashMap<String, List<PaletteNode>>();
        
        @XmlElement(nillable = true)
        private List<PaletteNode> node;
@@ -93,7 +94,7 @@ public class Category extends PaletteNode {
                if (node == null) {
                        node = new ArrayList<PaletteNode>();
                }
-               return this.node;
+               return node;
        }
 
        /*
@@ -162,7 +163,10 @@ public class Category extends PaletteNode {
         * Customize the marshalling operation
         */
 
-       /* Invoked by Marshaller after it has created an instance of this object. */
+       /**
+        * Invoked by Marshaller after it has created an instance of this object.
+        * @param m the marshaller
+        */
        void beforeMarshal(Marshaller m) {
                SAVED_NODELIST.put(getName(), new ArrayList<PaletteNode>(node));
                
@@ -173,9 +177,11 @@ public class Category extends PaletteNode {
                }
        }
 
-       /*
+       /**
         * Invoked by Marshaller after it has marshalled all properties of this
         * object.
+        *
+        * @param m the marshaller
         */
        void afterMarshal(Marshaller m) {
                node = SAVED_NODELIST.get(getName());
index fb1d660..ab7d6fd 100644 (file)
@@ -12,6 +12,7 @@
 
 package org.scilab.modules.xcos.palette.model;
 
+import java.util.Deque;
 import java.util.LinkedList;
 
 import javax.swing.JTree;
@@ -140,19 +141,23 @@ public abstract class PaletteNode implements TreeNode {
         */
        public static void checkRemoving(final PaletteNode node) {
                if (node == null) {
-                       throw new RuntimeException(String.format(
-                                       org.scilab.modules.xcos.palette.Palette.WRONG_INPUT_ARGUMENT_S_INVALID_TREE_PATH, org.scilab.modules.xcos.palette.Palette.NAME));
+                       throw new RuntimeException(
+                                       String.format(
+                                                       org.scilab.modules.xcos.palette.Palette.WRONG_INPUT_ARGUMENT_S_INVALID_TREE_PATH,
+                                                       org.scilab.modules.xcos.palette.Palette.NAME));
                } else if (node instanceof PreLoaded
                                && !(node instanceof PreLoaded.Dynamic)) {
-                       throw new RuntimeException(String.format(
-                                       org.scilab.modules.xcos.palette.Palette.WRONG_INPUT_ARGUMENT_S_INVALID_NODE, org.scilab.modules.xcos.palette.Palette.NAME));
+                       throw new RuntimeException(
+                                       String.format(
+                                                       org.scilab.modules.xcos.palette.Palette.WRONG_INPUT_ARGUMENT_S_INVALID_NODE,
+                                                       org.scilab.modules.xcos.palette.Palette.NAME));
                } else if (node instanceof Category) {
                        // Iterate over all nodes
                        for (final PaletteNode n : ((Category) node).getNode()) {
                                checkRemoving(n);
                        }
                }
-               
+
                /*
                 * others can be removed safely.
                 */
@@ -164,11 +169,16 @@ public abstract class PaletteNode implements TreeNode {
         */
        public static void remove(final PaletteNode node) {
                if (node == null) {
-                       throw new RuntimeException(String.format(
-                                       org.scilab.modules.xcos.palette.Palette.WRONG_INPUT_ARGUMENT_S_INVALID_TREE_PATH, org.scilab.modules.xcos.palette.Palette.NAME));
-               } else if (node instanceof PreLoaded && !(node instanceof PreLoaded.Dynamic)) {
-                       throw new RuntimeException(String.format(
-                                       org.scilab.modules.xcos.palette.Palette.WRONG_INPUT_ARGUMENT_S_INVALID_NODE, org.scilab.modules.xcos.palette.Palette.NAME));
+                       throw new RuntimeException(
+                                       String.format(
+                                                       org.scilab.modules.xcos.palette.Palette.WRONG_INPUT_ARGUMENT_S_INVALID_TREE_PATH,
+                                                       org.scilab.modules.xcos.palette.Palette.NAME));
+               } else if (node instanceof PreLoaded
+                               && !(node instanceof PreLoaded.Dynamic)) {
+                       throw new RuntimeException(
+                                       String.format(
+                                                       org.scilab.modules.xcos.palette.Palette.WRONG_INPUT_ARGUMENT_S_INVALID_NODE,
+                                                       org.scilab.modules.xcos.palette.Palette.NAME));
                } else if (node instanceof Category) {
                        // Iterate over all nodes
                        for (final PaletteNode n : ((Category) node).getNode()) {
@@ -180,10 +190,10 @@ public abstract class PaletteNode implements TreeNode {
                                LOG.error("parent node is null");
                                throw new RuntimeException("Parent node is 'null'");
                        }
-                       
+
                        toBeReloaded.getNode().remove(node);
                        node.setParent(null);
-       
+
                        refreshView(toBeReloaded);
                }
        }
@@ -214,7 +224,7 @@ public abstract class PaletteNode implements TreeNode {
                         */
                        
                        // getting the current path
-                       final LinkedList<TreeNode> objectPath = new LinkedList<TreeNode>();
+                       final Deque<TreeNode> objectPath = new LinkedList<TreeNode>();
                        TreeNode current = toBeReloaded;
                        do {
                                objectPath.addFirst(current);
index 86f583c..0808cd0 100644 (file)
@@ -47,12 +47,18 @@ import javax.xml.bind.annotation.XmlType;
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "PreLoaded", propOrder = { "block" })
 public class PreLoaded extends Palette {
-
+       
        /**
         * Not marshalled {@link PreLoaded} class
         */
        @XmlTransient
-       public static class Dynamic extends PreLoaded { }
+       public static class Dynamic extends PreLoaded {
+               /**
+                * Default constructor.
+                */
+               public Dynamic() {
+               }
+       }
        
        @XmlElement(nillable = true)
        private List<PaletteBlock> block;
@@ -89,7 +95,7 @@ public class PreLoaded extends Palette {
                if (block == null) {
                        block = new ArrayList<PaletteBlock>();
                }
-               return this.block;
+               return block;
        }
 
 }
index 10515f9..4594ec6 100644 (file)
@@ -35,23 +35,26 @@ public class PaletteComponent extends ScilabComponent {
        super(graph);
        
        addComponentListener(new ComponentListener() {
-           
-           public void componentShown(ComponentEvent arg0) {
+           @Override
+               public void componentShown(ComponentEvent arg0) {
                if (getGraph() instanceof PaletteDiagram) {
                    ((PaletteDiagram) getGraph()).updateDiagram(getSize().getWidth());
                }               
            }
            
-           public void componentResized(ComponentEvent arg0) {
+           @Override
+               public void componentResized(ComponentEvent arg0) {
                if (getGraph() instanceof PaletteDiagram) {
                    ((PaletteDiagram) getGraph()).updateDiagram(getSize().getWidth());
                }               
            }
            
-           public void componentMoved(ComponentEvent arg0) {
+           @Override
+               public void componentMoved(ComponentEvent arg0) {
            }
            
-           public void componentHidden(ComponentEvent arg0) {
+           @Override
+               public void componentHidden(ComponentEvent arg0) {
            }
        });
     }
index 0fa2446..11098f6 100644 (file)
@@ -78,6 +78,7 @@ public class PaletteView extends JPanel implements Scrollable {
         * @return The prefered Scrollable dimension
         * @see javax.swing.Scrollable#getPreferredScrollableViewportSize()
         */
+       @Override
        public Dimension getPreferredScrollableViewportSize() {
                return getPreferredSize();
        }
@@ -95,6 +96,7 @@ public class PaletteView extends JPanel implements Scrollable {
         * @see javax.swing.Scrollable#getScrollableBlockIncrement(java.awt.Rectangle,
         *      int, int)
         */
+       @Override
        public int getScrollableBlockIncrement(Rectangle visibleRect,
                        int orientation, int direction) {
                if (orientation == SwingConstants.VERTICAL) {
@@ -110,6 +112,7 @@ public class PaletteView extends JPanel implements Scrollable {
         * @return always false
         * @see javax.swing.Scrollable#getScrollableTracksViewportHeight()
         */
+       @Override
        public boolean getScrollableTracksViewportHeight() {
                return false;
        }
@@ -118,6 +121,7 @@ public class PaletteView extends JPanel implements Scrollable {
         * @return always true
         * @see javax.swing.Scrollable#getScrollableTracksViewportWidth()
         */
+       @Override
        public boolean getScrollableTracksViewportWidth() {
                return true;
        }
@@ -135,6 +139,7 @@ public class PaletteView extends JPanel implements Scrollable {
         * @see javax.swing.Scrollable#getScrollableUnitIncrement(java.awt.Rectangle,
         *      int, int)
         */
+       @Override
        public int getScrollableUnitIncrement(Rectangle visibleRect,
                        int orientation, int direction) {
                if (orientation == SwingConstants.VERTICAL) {
index fe77ccc..7c44fc3 100644 (file)
 package org.scilab.modules.xcos.port;
 
 import org.scilab.modules.graph.ScilabGraphUniqueObject;
+import org.scilab.modules.graph.utils.ScilabGraphConstants;
 import org.scilab.modules.graph.utils.StyleMap;
 import org.scilab.modules.types.scilabTypes.ScilabType;
 import org.scilab.modules.xcos.utils.XcosConstants;
 import org.scilab.modules.xcos.utils.XcosMessages;
 
 import com.mxgraph.model.mxGeometry;
+import com.mxgraph.util.mxConstants;
 
 /**
  * Common implementation of any Port.
@@ -172,7 +174,7 @@ public abstract class BasicPort extends ScilabGraphUniqueObject {
      * @param portOrdering a unique order number per type
      */
     public void setOrdering(int portOrdering) {
-       this.ordering = portOrdering;
+       ordering = portOrdering;
     }
 
     /**
@@ -207,9 +209,9 @@ public abstract class BasicPort extends ScilabGraphUniqueObject {
         *            The default orientation of this port
         */
        public final void setOrientation(Orientation defaultOrientation) {
-               if (this.orientation != defaultOrientation) {
-                       this.orientation = defaultOrientation;
-                       setLabelPosition(this.orientation);
+               if (orientation != defaultOrientation) {
+                       orientation = defaultOrientation;
+                       setLabelPosition(orientation);
                }
        }
     
@@ -218,8 +220,8 @@ public abstract class BasicPort extends ScilabGraphUniqueObject {
         */
     public String getToolTipText() {
        StringBuilder result = new StringBuilder();
-       result.append(XcosConstants.HTML_BEGIN);
-       result.append("Port number : " + getOrdering() + XcosConstants.HTML_NEWLINE);
+       result.append(ScilabGraphConstants.HTML_BEGIN);
+       result.append("Port number : " + getOrdering() + ScilabGraphConstants.HTML_NEWLINE);
        
        final int length = getStyle().length();
        result.append("Style : ");
@@ -229,9 +231,9 @@ public abstract class BasicPort extends ScilabGraphUniqueObject {
        } else {
                result.append(getStyle());
        }
-       result.append(XcosConstants.HTML_NEWLINE);
+       result.append(ScilabGraphConstants.HTML_NEWLINE);
        
-       result.append(XcosConstants.HTML_END);
+       result.append(ScilabGraphConstants.HTML_END);
        return result.toString();
     }
 
@@ -270,18 +272,18 @@ public abstract class BasicPort extends ScilabGraphUniqueObject {
                        StyleMap style = new StyleMap(getStyle());
                        
                        // set label position
-                       style.put(XcosConstants.STYLE_ALIGN, XcosConstants.ALIGN_CENTER);
-                       style.put(XcosConstants.STYLE_LABEL_POSITION, current.getLabelPosition());
-                       style.put(XcosConstants.STYLE_VERTICAL_LABEL_POSITION, current.getVerticalLabelPosition());
+                       style.put(mxConstants.STYLE_ALIGN, mxConstants.ALIGN_CENTER);
+                       style.put(mxConstants.STYLE_LABEL_POSITION, current.getLabelPosition());
+                       style.put(mxConstants.STYLE_VERTICAL_LABEL_POSITION, current.getVerticalLabelPosition());
                        
                        // clean up any spacing values
-                       style.remove(XcosConstants.STYLE_SPACING_BOTTOM);
-                       style.remove(XcosConstants.STYLE_SPACING_LEFT);
-                       style.remove(XcosConstants.STYLE_SPACING_RIGHT);
-                       style.remove(XcosConstants.STYLE_SPACING_TOP);
+                       style.remove(mxConstants.STYLE_SPACING_BOTTOM);
+                       style.remove(mxConstants.STYLE_SPACING_LEFT);
+                       style.remove(mxConstants.STYLE_SPACING_RIGHT);
+                       style.remove(mxConstants.STYLE_SPACING_TOP);
                        
                        // setting spacing values
-                       style.put(current.getSpacingSide(), Integer.toString(BasicPort.DEFAULT_PORTSIZE/2 + 1));
+                       style.put(current.getSpacingSide(), Integer.toString(BasicPort.DEFAULT_PORTSIZE / 2 + 1));
                        
                        setStyle(style.toString());
                }
index 8c2ea02..c397c38 100644 (file)
@@ -16,7 +16,6 @@ import java.util.NoSuchElementException;
 
 import org.scilab.modules.xcos.port.command.CommandPort;
 import org.scilab.modules.xcos.port.output.OutputPort;
-import org.scilab.modules.xcos.utils.XcosConstants;
 
 import com.mxgraph.util.mxConstants;
 
@@ -108,7 +107,7 @@ public enum Orientation {
         * @return the angle associated with this orientation.
         */
        private int getOrientationAngle() {
-               return this.ordinal() * PERPENDICULAR_ROTATION;
+               return ordinal() * PERPENDICULAR_ROTATION;
        }
 
        /**
@@ -132,20 +131,20 @@ public enum Orientation {
        
        /**
         * @return The label position of the current port.
-        * @see mxConstants#STYLE_LABEL_POSITION
+        * @see com.mxgraph.util.mxConstants#STYLE_LABEL_POSITION
         */
        public String getLabelPosition() {
                final String ret;
                
                switch (this) {
                        case EAST:
-                               ret = XcosConstants.ALIGN_LEFT;
+                               ret = mxConstants.ALIGN_LEFT;
                                break;
                        case WEST:
-                               ret = XcosConstants.ALIGN_RIGHT;
+                               ret = mxConstants.ALIGN_RIGHT;
                                break;
                        default:
-                               ret = XcosConstants.ALIGN_CENTER;
+                               ret = mxConstants.ALIGN_CENTER;
                                break;
                }
                
@@ -154,20 +153,20 @@ public enum Orientation {
        
        /**
         * @return The vertical label position of the current port.
-        * @see mxConstants#STYLE_VERTICAL_LABEL_POSITION
+        * @see com.mxgraph.util.mxConstants#STYLE_VERTICAL_LABEL_POSITION
         */
        public String getVerticalLabelPosition() {
                final String ret;
                
                switch (this) {
                        case NORTH:
-                               ret = XcosConstants.ALIGN_BOTTOM;
+                               ret = mxConstants.ALIGN_BOTTOM;
                                break;
                        case SOUTH:
-                               ret = XcosConstants.ALIGN_TOP;
+                               ret = mxConstants.ALIGN_TOP;
                                break;
                        default:
-                               ret = XcosConstants.ALIGN_MIDDLE;
+                               ret = mxConstants.ALIGN_MIDDLE;
                                break;
                }
                
@@ -176,27 +175,27 @@ public enum Orientation {
        
        /**
         * @return the spacing side to increment
-        * @see mxConstants#STYLE_SPACING_BOTTOM
-        * @see mxConstants#STYLE_SPACING_LEFT
-        * @see mxConstants#STYLE_SPACING_RIGHT
-        * @see mxConstants#STYLE_SPACING_TOP
+        * @see com.mxgraph.util.mxConstants#STYLE_SPACING_BOTTOM
+        * @see com.mxgraph.util.mxConstants#STYLE_SPACING_LEFT
+        * @see com.mxgraph.util.mxConstants#STYLE_SPACING_RIGHT
+        * @see com.mxgraph.util.mxConstants#STYLE_SPACING_TOP
         */
        public String getSpacingSide() {
                final String ret;
                
                switch (this) {
                        case NORTH:
-                               ret = XcosConstants.STYLE_SPACING_TOP;
+                               ret = mxConstants.STYLE_SPACING_TOP;
                                break;
                        case SOUTH:
-                               ret = XcosConstants.STYLE_SPACING_BOTTOM;
+                               ret = mxConstants.STYLE_SPACING_BOTTOM;
                                break;
                        case EAST:
-                               ret = XcosConstants.STYLE_SPACING_RIGHT;
+                               ret = mxConstants.STYLE_SPACING_RIGHT;
                                break;
                        case WEST:
                        default:
-                               ret = XcosConstants.STYLE_SPACING_LEFT;
+                               ret = mxConstants.STYLE_SPACING_LEFT;
                                break;
                }
                
index 56dc508..61b880e 100644 (file)
@@ -14,16 +14,15 @@ package org.scilab.modules.xcos.port.command;
 
 import org.scilab.modules.xcos.port.BasicPort;
 import org.scilab.modules.xcos.port.Orientation;
-import org.scilab.modules.xcos.port.control.ControlPort;
 
 /**
  * A command port acts generate execution ticks to another block.
  * 
  * The connected block is executed only when a rising edge occurs on this port.
  * As we are writing 'edge', this port can only be connected to a
- * {@link ControlPort}. To specify initial conditions, this block offers a
- * {@link #setInitialState(double)} method. The port default orientation is the
- * SOUTH.
+ * {@link org.scilab.modules.xcos.port.control.ControlPort}. To specify initial
+ * conditions, this block offers a {@link #setInitialState(double)} method. The
+ * port default orientation is the SOUTH.
  */
 public class CommandPort extends BasicPort {
 
index 787c12c..89dc0e6 100644 (file)
@@ -14,14 +14,14 @@ package org.scilab.modules.xcos.port.control;
 
 import org.scilab.modules.xcos.port.BasicPort;
 import org.scilab.modules.xcos.port.Orientation;
-import org.scilab.modules.xcos.port.command.CommandPort;
 
 /**
  * A control port acts as the execution tick for the block.
  * 
  * The block is executed only when a rising edge occurs on this port. As we are
- * writing 'edge', this port can only be connected to a {@link CommandPort}. The
- * port default orientation is the NORTH.
+ * writing 'edge', this port can only be connected to a 
+ * {@link org.scilab.modules.xcos.port.command.CommandPort}. The port default
+ * orientation is the NORTH.
  */
 public class ControlPort extends BasicPort {
 
index a8eac32..9d88be9 100644 (file)
@@ -14,14 +14,13 @@ package org.scilab.modules.xcos.port.input;
 
 import org.scilab.modules.xcos.port.BasicPort;
 import org.scilab.modules.xcos.port.Orientation;
-import org.scilab.modules.xcos.port.output.OutputPort;
 
 /**
  * An input port acts as a protection barrier between a link and the internal functions of
  * the block.
  * 
  * It's default orientation is on the block's WEST side and it <b>must</b> be
- * connected to an {@link OutputPort} .
+ * connected to an {@link org.scilab.modules.xcos.port.output.OutputPort} .
  */
 public abstract class InputPort extends BasicPort {
 
index 42b9da3..bfaf760 100644 (file)
@@ -14,14 +14,13 @@ package org.scilab.modules.xcos.port.output;
 
 import org.scilab.modules.xcos.port.BasicPort;
 import org.scilab.modules.xcos.port.Orientation;
-import org.scilab.modules.xcos.port.input.InputPort;
 
 /**
  * An output port acts as a protection barrier between the internal functions of
  * the block and a link.
  * 
  * It's default orientation is on the block's EAST side and it <b>must</b> be
- * connected to an {@link InputPort} .
+ * connected to an {@link org.scilab.modules.xcos.port.input.InputPort} .
  */
 public abstract class OutputPort extends BasicPort {
 
index 936e7d6..be3ec84 100644 (file)
@@ -30,8 +30,10 @@ import com.mxgraph.view.mxStylesheet;
  * Contains useful method for managing files.
  */
 public final class FileUtils {
-       public static String STYLE_FILENAME = "Xcos-style.xml";
-       
+       /**
+        * Stylesheet filename.
+        */
+       public static final String STYLE_FILENAME = "Xcos-style.xml";
        
        /**
         * Default constructor
index 22fd6fd..9ed38a2 100644 (file)
@@ -36,22 +36,26 @@ public class PaletteComponent extends ScilabComponent {
        
        addComponentListener(new ComponentListener() {
            
-           public void componentShown(ComponentEvent arg0) {
+           @Override
+               public void componentShown(ComponentEvent arg0) {
                if (getGraph() instanceof PaletteDiagram) {
                    ((PaletteDiagram) getGraph()).updateDiagram(getSize().getWidth());
                }               
            }
            
-           public void componentResized(ComponentEvent arg0) {
+           @Override
+               public void componentResized(ComponentEvent arg0) {
                if (getGraph() instanceof PaletteDiagram) {
                    ((PaletteDiagram) getGraph()).updateDiagram(getSize().getWidth());
                }               
            }
            
-           public void componentMoved(ComponentEvent arg0) {
+           @Override
+               public void componentMoved(ComponentEvent arg0) {
            }
            
-           public void componentHidden(ComponentEvent arg0) {
+           @Override
+               public void componentHidden(ComponentEvent arg0) {
            }
        });
     }
index e04cdcd..c6e2ac9 100644 (file)
@@ -12,8 +12,6 @@
 
 package org.scilab.modules.xcos.utils;
 
-import org.scilab.modules.xcos.block.SuperBlock;
-
 import com.mxgraph.util.mxEvent;
 
 /**
@@ -32,7 +30,7 @@ public final class XcosEvent extends mxEvent {
        public static final String FORCE_CELL_VALUE_UPDATE = "ForceCellValueUpdate";
 
        /**
-        * Fired when a {@link SuperBlock} I/O block as been updated by the user
+        * Fired when a {@link org.scilab.modules.xcos.block.SuperBlock} I/O block as been updated by the user
         */
        public static final String IO_PORT_VALUE_UPDATED = "IoPortValueUpdated";