Remove some java warnings (redundant declarations) 10/13110/3
Sylvestre Ledru [Fri, 8 Nov 2013 10:56:48 +0000 (11:56 +0100)]
Change-Id: I7291954d59bde629ec8164ec9855390091673076

scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/legend/Legend.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/tab/SwingScilabTab.java
scilab/modules/gui/src/java/org/scilab/modules/gui/datatip/DatatipCreate.java
scilab/modules/gui/src/java/org/scilab/modules/gui/editor/Editor.java
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/Inspector.java
scilab/modules/gui/src/java/org/scilab/modules/gui/plotbrowser/PlotBrowser.java

index 804af8b..ed2bb20 100644 (file)
@@ -201,7 +201,7 @@ public class Legend extends ClippableTextObject {
         ArrayList <Integer> validLinks = new ArrayList<Integer>(0);
 
         for (int i = 0; i < links.size(); i++) {
-            GraphicObject object = (GraphicObject) GraphicController.getController().getObjectFromId(links.get(i));
+            GraphicObject object = GraphicController.getController().getObjectFromId(links.get(i));
 
             if (object != null) {
                 validLinks.add(links.get(i));
@@ -218,7 +218,7 @@ public class Legend extends ClippableTextObject {
         int numValidLinks = 0;
 
         for (int i = 0; i < links.size(); i++) {
-            GraphicObject object = (GraphicObject) GraphicController.getController().getObjectFromId(links.get(i));
+            GraphicObject object = GraphicController.getController().getObjectFromId(links.get(i));
 
             if (object != null) {
                 numValidLinks++;
@@ -282,7 +282,7 @@ public class Legend extends ClippableTextObject {
 
         /* Text strings are stored in reverse order relative to links. */
         for (int i = 0; i < links.size(); i++) {
-            GraphicObject object = (GraphicObject) GraphicController.getController().getObjectFromId(links.get(links.size() - i - 1));
+            GraphicObject object = GraphicController.getController().getObjectFromId(links.get(links.size() - i - 1));
 
             if (object != null) {
                 validStrings.add(text[i].getText());
index 324d4bf..f7befa0 100644 (file)
@@ -1461,8 +1461,8 @@ public class SwingScilabTab extends View implements SwingViewObject, SimpleTab,
                 SwingScilabWindow figure = SwingScilabWindow.allScilabWindows.get(parentWindowId);
                 Size oldFigureSize = figure.getDims();
                 figure.setDims(new Size(size[0], size[1]));
-                int deltaFigureX = size[0] - (int) oldFigureSize.getWidth();
-                int deltaFigureY = size[1] - (int) oldFigureSize.getHeight();
+                int deltaFigureX = size[0] - oldFigureSize.getWidth();
+                int deltaFigureY = size[1] - oldFigureSize.getHeight();
                 if ( oldFigureSize.getWidth() != 0 && oldFigureSize.getHeight() != 0
                         && ((oldFigureSize.getWidth() != size[0]) || (oldFigureSize.getHeight() != size[1]))
                         && ((Boolean) GraphicController.getController().getProperty(getId(), __GO_AUTORESIZE__))
index 2d05be5..7e60320 100755 (executable)
@@ -144,8 +144,8 @@ public class DatatipCreate {
         int yInt = (int) pixelCoordinates[1];
 
         int[] coordInteger = new int[2];
-        coordInteger[0] = (int) xInt;
-        coordInteger[1] = (int) yInt;
+        coordInteger[0] = xInt;
+        coordInteger[1] = yInt;
 
         return coordInteger;
     }
index 385032d..9b538c1 100644 (file)
@@ -142,7 +142,7 @@ public class Editor {
             redo.setEnabled(editorHistory.isRedoEnabled());
 
             menu.show(event.getComponent(), event.getX(), event.getY());
-            dialogComponent = (Component)event.getComponent();
+            dialogComponent = event.getComponent();
         } else {
             dataEditor.onRightClick(event);
         }
index 1174366..21771c9 100644 (file)
@@ -94,7 +94,7 @@ public class Inspector {
             }
         } else {
             SwingScilabWindow window = (SwingScilabWindow) SwingUtilities.getAncestorOfClass
-                                       (SwingScilabWindow.class, (SwingInspector) inspectorTab);
+                                       (SwingScilabWindow.class, inspectorTab);
             window.setVisible(true);
             window.toFront();
             new SwapObject(objectID);
index 1021531..20c2b63 100644 (file)
@@ -93,7 +93,7 @@ public class PlotBrowser {
             }
         } else {
             SwingScilabWindow window = (SwingScilabWindow) SwingUtilities.getAncestorOfClass
-                                       (SwingScilabWindow.class, (SwingPlotBrowser) plotBrowserTab);
+                                       (SwingScilabWindow.class, plotBrowserTab);
             window.setVisible(true);
             window.toFront();
             new SwapFigure(objectID);