From 08b799f26678260625a45b7064c6e36fd82d3bd5 Mon Sep 17 00:00:00 2001 From: lempinen Date: Tue, 16 Mar 2010 13:11:29 +0000 Subject: [PATCH] Removed unnecessary imports and other warnings git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@14971 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../sysdyn/ui/actions/ConnectDependency.java | 3 -- .../sysdyn/ui/actions/ConnectFlow.java | 3 -- .../sysdyn/ui/actions/CreateAuxiliary.java | 1 - .../sysdyn/ui/elements/DependencyElement.java | 3 +- .../sysdyn/ui/elements/StockElement.java | 1 - .../sysdyn/ui/elements/ValveElement.java | 1 - .../sysdyn/ui/equation/EquationView.java | 31 ------------------- .../simantics/sysdyn/ui/trend/TrendView.java | 4 +-- 8 files changed, 4 insertions(+), 43 deletions(-) diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/actions/ConnectDependency.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/actions/ConnectDependency.java index d2dc2ae2..1392fc48 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/actions/ConnectDependency.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/actions/ConnectDependency.java @@ -13,9 +13,6 @@ package org.simantics.sysdyn.ui.actions; import org.simantics.h2d.editor.IDiagramEditor; import org.simantics.h2d.element.handler.Connectable; -import org.simantics.sysdyn.representation.Auxiliary; -import org.simantics.sysdyn.representation.Stock; -import org.simantics.sysdyn.representation.Valve; import org.simantics.sysdyn.ui.elements.AuxiliaryElement; import org.simantics.sysdyn.ui.elements.DependencyElement; import org.simantics.sysdyn.ui.elements.StockElement; diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/actions/ConnectFlow.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/actions/ConnectFlow.java index 050542c7..4885f7ad 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/actions/ConnectFlow.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/actions/ConnectFlow.java @@ -15,9 +15,6 @@ import java.awt.geom.Point2D; import org.simantics.h2d.editor.IDiagramEditor; import org.simantics.h2d.element.handler.Connectable; -import org.simantics.sysdyn.representation.Cloud; -import org.simantics.sysdyn.representation.Stock; -import org.simantics.sysdyn.representation.Valve; import org.simantics.sysdyn.ui.elements.CloudElement; import org.simantics.sysdyn.ui.elements.FlowElement; import org.simantics.sysdyn.ui.elements.StockElement; diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/actions/CreateAuxiliary.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/actions/CreateAuxiliary.java index 10b611a9..4bde7cc6 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/actions/CreateAuxiliary.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/actions/CreateAuxiliary.java @@ -16,7 +16,6 @@ import org.simantics.h2d.event.IEvent; import org.simantics.h2d.event.ILocatableEvent; import org.simantics.h2d.event.handler.IEventHandler; import org.simantics.sysdyn.ui.elements.AuxiliaryElement; -import org.simantics.sysdyn.ui.elements.StockElement; public class CreateAuxiliary implements IEventHandler { diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/DependencyElement.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/DependencyElement.java index 0c35c036..4a4b641b 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/DependencyElement.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/DependencyElement.java @@ -201,7 +201,8 @@ public class DependencyElement extends Element implements IElementListener { } } - @Override + @SuppressWarnings("unchecked") + @Override public T getInterface(Class clazz) { if(clazz == IEventHandler.class) return (T)new EventHandler(); diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/StockElement.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/StockElement.java index f2dc13d3..97d28727 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/StockElement.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/StockElement.java @@ -13,7 +13,6 @@ package org.simantics.sysdyn.ui.elements; import org.simantics.h2d.node.RectangleNode; import org.simantics.objmap.annotations.GraphType; -import org.simantics.objmap.annotations.UpdateMethod; import org.simantics.scenegraph.g2d.G2DParentNode; @GraphType("http://www.simantics.org/Sysdyn-1.0/Stock") diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/ValveElement.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/ValveElement.java index d5dcd06b..81f14937 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/ValveElement.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/ValveElement.java @@ -15,7 +15,6 @@ import java.awt.BasicStroke; import java.awt.Color; import java.awt.geom.Path2D; -import org.simantics.h2d.element.handler.Connectable; import org.simantics.h2d.element.handler.Rotatable; import org.simantics.h2d.node.ShapeNode; import org.simantics.objmap.annotations.GraphType; diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/equation/EquationView.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/equation/EquationView.java index 512dba3e..5994b54c 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/equation/EquationView.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/equation/EquationView.java @@ -38,9 +38,7 @@ import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.RowLayout; import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableItem; import org.eclipse.swt.widgets.Text; @@ -90,9 +88,6 @@ public class EquationView extends ViewPart implements ISelectionListener { UnitSelector unitSelector; ExpressionComposite expressionComposite; - // Dummies - //Composite range; - @Override public void createPartControl(Composite parent) { // Listeners @@ -158,32 +153,6 @@ public class EquationView extends ViewPart implements ISelectionListener { expressionComposite = new ExpressionComposite(parent, SWT.NONE); GridDataFactory.fillDefaults().span(3, 1).grab(true, true).applyTo(expressionComposite); - - // Lower part of the view: Range - /* - range = new Composite(parent, SWT.NONE); - GridDataFactory.fillDefaults().span(3, 1).grab(true, false).applyTo(range); - - GridLayoutFactory.fillDefaults().applyTo(range); - - RowLayout layout = new RowLayout(); - layout.spacing = 3; - range.setLayout(layout); - Label label = new Label(range, SWT.SINGLE); - label.setText("Range:"); - label.setAlignment(SWT.RIGHT); - Composite c = new Composite(range, SWT.NONE); - layout = new RowLayout(); - layout.spacing = 2; - c.setLayout(layout); - Text text1 = new Text(c, SWT.SINGLE | SWT.BORDER); - text1.setToolTipText("Start"); - text1 = new Text(c, SWT.SINGLE | SWT.BORDER); - text1.setToolTipText("Stop"); - text1 = new Text(c, SWT.SINGLE | SWT.BORDER); - text1.setToolTipText("Step"); - */ - } static class Auxiliary { diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/trend/TrendView.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/trend/TrendView.java index 6d602f4a..94c577ab 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/trend/TrendView.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/trend/TrendView.java @@ -43,7 +43,6 @@ import org.simantics.sysdyn.manager.SysdynModel; import org.simantics.sysdyn.manager.SysdynModelManager; import org.simantics.sysdyn.representation.IElement; import org.simantics.sysdyn.representation.Variable; -import org.simantics.sysdyn.ui.simulation.SimulationJob; import org.simantics.sysdyn.ui.simulation.SimulationScheduler; import org.simantics.ui.SimanticsUI; import org.simantics.utils.ui.jface.ActiveSelectionProvider; @@ -54,6 +53,7 @@ public class TrendView extends ViewPart { ChartPanel panel; SysdynDataset sysdynDataset = new SysdynDataset(); + @SuppressWarnings("serial") class SysdynDataset extends AbstractXYDataset { DataSet[] sets = new DataSet[0]; @@ -78,6 +78,7 @@ public class TrendView extends ViewPart { return sets[series].times.length; } + @SuppressWarnings("unchecked") @Override public Comparable getSeriesKey(int series) { return sets[series].name; @@ -160,7 +161,6 @@ public class TrendView extends ViewPart { SimanticsUI.getSession().asyncRequest(new ReadRequest() { @Override public void run(ReadGraph g) throws DatabaseException { - SysdynResource sr = SysdynResource.getInstance(g); final DataSet[] sets = new DataSet[resources.length]; for(int i=0;i