From: Tuukka Lehtonen Date: Tue, 31 Jan 2017 09:09:06 +0000 (+0200) Subject: Removed old and useless org.simantics.sysdyn.ui.old. X-Git-Tag: v1.29.0~9 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=f3a4bcf163f1d44205d4f5df9836f4f92ca5ddc0;p=simantics%2Fsysdyn.git Removed old and useless org.simantics.sysdyn.ui.old. refs #6879 --- diff --git a/bundles/org.simantics.sysdyn.ui.old/.classpath b/bundles/org.simantics.sysdyn.ui.old/.classpath deleted file mode 100644 index 8a8f1668..00000000 --- a/bundles/org.simantics.sysdyn.ui.old/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/bundles/org.simantics.sysdyn.ui.old/.project b/bundles/org.simantics.sysdyn.ui.old/.project deleted file mode 100644 index 2ebd5691..00000000 --- a/bundles/org.simantics.sysdyn.ui.old/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.simantics.sysdyn.ui - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/bundles/org.simantics.sysdyn.ui.old/.settings/org.eclipse.jdt.core.prefs b/bundles/org.simantics.sysdyn.ui.old/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 6d816954..00000000 --- a/bundles/org.simantics.sysdyn.ui.old/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,8 +0,0 @@ -#Thu Nov 05 12:45:23 EET 2009 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/bundles/org.simantics.sysdyn.ui.old/META-INF/MANIFEST.MF b/bundles/org.simantics.sysdyn.ui.old/META-INF/MANIFEST.MF deleted file mode 100644 index 33131cad..00000000 --- a/bundles/org.simantics.sysdyn.ui.old/META-INF/MANIFEST.MF +++ /dev/null @@ -1,18 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Ui -Bundle-SymbolicName: org.simantics.sysdyn.ui;singleton:=true -Bundle-Version: 1.0.0.qualifier -Bundle-Activator: org.simantics.sysdyn.ui.Activator -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.simantics.ui;bundle-version="1.0.0", - org.simantics.diagram;bundle-version="1.0.0", - org.simantics.db;bundle-version="0.6.2", - org.simantics.db.common;bundle-version="0.6.2", - org.simantics.db.layer0;bundle-version="0.7.0", - org.simantics.g2d;bundle-version="1.0.0", - org.simantics.scenegraph;bundle-version="1.0.0", - org.simantics.layer0.utils;bundle-version="0.6.2" -Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/bundles/org.simantics.sysdyn.ui.old/adapters.xml b/bundles/org.simantics.sysdyn.ui.old/adapters.xml deleted file mode 100644 index 86c2aa36..00000000 --- a/bundles/org.simantics.sysdyn.ui.old/adapters.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/bundles/org.simantics.sysdyn.ui.old/build.properties b/bundles/org.simantics.sysdyn.ui.old/build.properties deleted file mode 100644 index 6f20375d..00000000 --- a/bundles/org.simantics.sysdyn.ui.old/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml diff --git a/bundles/org.simantics.sysdyn.ui.old/plugin.xml b/bundles/org.simantics.sysdyn.ui.old/plugin.xml deleted file mode 100644 index cac6482e..00000000 --- a/bundles/org.simantics.sysdyn.ui.old/plugin.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - diff --git a/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/Activator.java b/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/Activator.java deleted file mode 100644 index 21342378..00000000 --- a/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/Activator.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.simantics.sysdyn.ui; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.simantics.sysdyn.ui"; - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/SysdynResource.java b/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/SysdynResource.java deleted file mode 100644 index 426b3220..00000000 --- a/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/SysdynResource.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007- VTT Technical Research Centre of Finland. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.sysdyn.ui; - - -import org.simantics.db.Resource; -import org.simantics.db.ReadGraph; -import org.simantics.db.Session; -import org.simantics.db.exception.DatabaseException; - -public class SysdynResource { - - public final Resource HasX; - public final Resource HasY; - public final Resource SysdynModel; - public final Resource SysdynModelManager; - public final Resource SysdynModellingDomain; - public final Resource TestDiagram; - public final Resource Variable; - public final Resource VariableElement; - - public static class URIs { - public static final String HasX = "http://www.simantics.org/Sysdyn#HasX"; - public static final String HasY = "http://www.simantics.org/Sysdyn#HasY"; - public static final String SysdynModel = "http://www.simantics.org/Sysdyn#SysdynModel"; - public static final String SysdynModelManager = "http://www.simantics.org/Sysdyn#SysdynModelManager"; - public static final String SysdynModellingDomain = "http://www.simantics.org/Sysdyn#SysdynModellingDomain"; - public static final String TestDiagram = "http://www.simantics.org/Sysdyn#TestDiagram"; - public static final String Variable = "http://www.simantics.org/Sysdyn#Variable"; - public static final String VariableElement = "http://www.simantics.org/Sysdyn#VariableElement"; - } - - public static Resource getResourceOrNull(ReadGraph graph, String uri) { - try { - return graph.getResourceByURI(uri); - } catch(DatabaseException e) { - System.err.println(e.getMessage()); - return null; - } - } - - public SysdynResource(ReadGraph graph) { - HasX = getResourceOrNull(graph, URIs.HasX); - HasY = getResourceOrNull(graph, URIs.HasY); - SysdynModel = getResourceOrNull(graph, URIs.SysdynModel); - SysdynModelManager = getResourceOrNull(graph, URIs.SysdynModelManager); - SysdynModellingDomain = getResourceOrNull(graph, URIs.SysdynModellingDomain); - TestDiagram = getResourceOrNull(graph, URIs.TestDiagram); - Variable = getResourceOrNull(graph, URIs.Variable); - VariableElement = getResourceOrNull(graph, URIs.VariableElement); - } - - public static SysdynResource getInstance(ReadGraph graph) { - Session session = graph.getSession(); - SysdynResource ret = session.getService(SysdynResource.class); - if(ret == null) { - ret = new SysdynResource(graph); - session.registerService(SysdynResource.class, ret); - } - return ret; - } - -} - diff --git a/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/adapters/VariableClassFactory.java b/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/adapters/VariableClassFactory.java deleted file mode 100644 index e45047f4..00000000 --- a/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/adapters/VariableClassFactory.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.simantics.sysdyn.ui.adapters; - -import org.simantics.db.ReadGraph; -import org.simantics.db.Resource; -import org.simantics.db.exception.DatabaseException; -import org.simantics.diagram.adapter.ElementQuerySupport; -import org.simantics.diagram.adapter.GraphElementClassFactory; -import org.simantics.diagram.adapter.GraphElementFactory; -import org.simantics.g2d.diagram.IDiagram; -import org.simantics.g2d.element.ElementClass; -import org.simantics.g2d.element.IElement; -import org.simantics.g2d.element.impl.Element; -import org.simantics.sysdyn.ui.SysdynResource; -import org.simantics.sysdyn.ui.diagram.DrawableElementClass; -import org.simantics.sysdyn.ui.elements.TestDrawable; - -public class VariableClassFactory implements GraphElementFactory, GraphElementClassFactory { - - @Override - public IElement spawn(ReadGraph g, Resource resource, - ElementQuerySupport support, IDiagram diagram) - throws DatabaseException { - SysdynResource sr = SysdynResource.getInstance(g); - - ElementClass elementClass = - DrawableElementClass.createElementClass(sr.VariableElement); - IElement element = Element.spawnNew(elementClass); - - TestDrawable drawable = new TestDrawable(); - drawable.moveTo( - (Double)g.getRelatedValue(resource, sr.HasX), - (Double)g.getRelatedValue(resource, sr.HasY) - ); - element.setHint(DrawableElementClass.KEY_CONTENT, drawable); - - //diagram.addElement(element); - return element; - } - - @Override - public ElementClass create(ReadGraph g, Resource elementType, - ElementQuerySupport support) throws DatabaseException { - return DrawableElementClass.createElementClass(elementType); - } - -} diff --git a/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/adapters/VariableElementWriter.java b/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/adapters/VariableElementWriter.java deleted file mode 100644 index a671b6ba..00000000 --- a/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/adapters/VariableElementWriter.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.simantics.sysdyn.ui.adapters; - -import org.simantics.db.Resource; -import org.simantics.db.WriteGraph; -import org.simantics.db.exception.DatabaseException; -import org.simantics.diagram.synchronization.graph.ElementWriter; -import org.simantics.g2d.element.IElement; - -public class VariableElementWriter implements ElementWriter { - - @Override - public void addToGraph(WriteGraph graph, IElement element, - Resource elementResource) throws DatabaseException { - System.out.println("addToGraph"); - } - - @Override - public void removeFromGraph(WriteGraph graph, Resource elementResource) - throws DatabaseException { - System.out.println("removeFromGraph"); - } - -} diff --git a/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/diagram/DiagramEditorFacade.java b/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/diagram/DiagramEditorFacade.java deleted file mode 100644 index daf35821..00000000 --- a/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/diagram/DiagramEditorFacade.java +++ /dev/null @@ -1,124 +0,0 @@ -package org.simantics.sysdyn.ui.diagram; - -import java.awt.Color; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Composite; -import org.simantics.db.ReadGraph; -import org.simantics.db.common.request.ReadRequest; -import org.simantics.db.exception.DatabaseException; -import org.simantics.diagram.adapter.GraphToDiagramSynchronizer; -import org.simantics.diagram.adapter.IDiagramLoader; -import org.simantics.diagram.participant.SGFocusParticipant; -import org.simantics.g2d.canvas.Hints; -import org.simantics.g2d.canvas.ICanvasContext; -import org.simantics.g2d.canvas.impl.CanvasContext; -import org.simantics.g2d.chassis.SWTChassis; -import org.simantics.g2d.diagram.DiagramHints; -import org.simantics.g2d.diagram.IDiagram; -import org.simantics.g2d.diagram.participant.CanvasBoundsParticipant; -import org.simantics.g2d.diagram.participant.DiagramParticipant; -import org.simantics.g2d.diagram.participant.ElementInteractor; -import org.simantics.g2d.diagram.participant.ElementPainter; -import org.simantics.g2d.diagram.participant.Selection; -import org.simantics.g2d.diagram.participant.pointertool.PointerInteractor; -import org.simantics.g2d.element.ElementClassProviders; -import org.simantics.g2d.element.IElement; -import org.simantics.g2d.element.impl.Element; -import org.simantics.g2d.participant.CanvasGrab; -import org.simantics.g2d.participant.KeyUtil; -import org.simantics.g2d.participant.MousePanZoomInteractor; -import org.simantics.g2d.participant.MouseUtil; -import org.simantics.g2d.participant.Notifications; -import org.simantics.g2d.participant.PanZoomRotateHandler; -import org.simantics.g2d.participant.PointerPainter; -import org.simantics.g2d.participant.RulerPainter; -import org.simantics.g2d.participant.SGTransformUtil; -import org.simantics.g2d.snap.GridSnapAdvisor; -import org.simantics.layer0.utils.ResourceArray; -import org.simantics.sysdyn.ui.elements.IDrawable; -import org.simantics.ui.SimanticsUI; -import org.simantics.ui.workbench.ResourceEditorPart; -import org.simantics.utils.datastructures.hints.IHintContext; -import org.simantics.utils.threads.AWTThread; - -public abstract class DiagramEditorFacade extends ResourceEditorPart { - - SWTChassis chassis; - IDiagram diagram; - IDiagramLoader loader; - - public DiagramEditorFacade() { - super(); - } - - @Override - public void reload(ReadGraph g) throws DatabaseException { - // TODO Auto-generated method stub - } - - @Override - public void createPartControl(Composite parent) { - chassis = new SWTChassis(parent, SWT.NONE); - chassis.syncPopulate(); - - final ICanvasContext context = new CanvasContext( - AWTThread.getThreadAccess()); - chassis.setCanvasContext(context); - - context.add(new SGTransformUtil()); - context.add(new MouseUtil()); - context.add(new KeyUtil()); - context.add(new PanZoomRotateHandler()); - context.add(new MousePanZoomInteractor()); - context.add(new RulerPainter()); - context.add(new CanvasGrab()); - context.add(new CanvasBoundsParticipant()); - context.add(new Notifications()); - context.add(new SGFocusParticipant(chassis)); - context.add(new DiagramParticipant()); - context.add(new ElementPainter()); - context.add(new PointerInteractor(true, true, true, false, true, false, null)); - context.add(new ElementInteractor()); - context.add(new Selection()); - - IHintContext h = context.getDefaultHintContext(); - h.setHint(PointerPainter.KEY_PAINT_POINTER, true); - - h.setHint(ElementPainter.KEY_SELECTION_FRAME_COLOR, Color.MAGENTA); - h.setHint(Hints.KEY_TOOL, Hints.POINTERTOOL); - - h.setHint(PanZoomRotateHandler.KEY_ZOOM_IN_LIMIT, 100000.0); - h.setHint(PanZoomRotateHandler.KEY_ZOOM_OUT_LIMIT, 10.0); - - h.setHint(DiagramHints.SNAP_ADVISOR, - new GridSnapAdvisor(10.0)); - - try { - SimanticsUI.getSession().syncRequest(new ReadRequest() { - - @Override - public void run(ReadGraph graph) throws DatabaseException { - loader = new GraphToDiagramSynchronizer(graph, context, - ElementClassProviders.staticProvider(null)); - - diagram = loader.loadDiagram(graph, - getResourceInput().getResource(), - ResourceArray.EMPTY, - null); - } - - }); - h.setHint(DiagramHints.KEY_DIAGRAM, diagram); - } catch (DatabaseException e) { - e.printStackTrace(); - } - - } - - @Override - public void setFocus() { - chassis.setFocus(); - } - -} diff --git a/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/diagram/DrawableElementClass.java b/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/diagram/DrawableElementClass.java deleted file mode 100644 index 2851dccd..00000000 --- a/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/diagram/DrawableElementClass.java +++ /dev/null @@ -1,137 +0,0 @@ -package org.simantics.sysdyn.ui.diagram; - -import java.awt.Shape; -import java.awt.geom.AffineTransform; -import java.awt.geom.Point2D; -import java.awt.geom.Rectangle2D; -import java.util.Collection; - -import org.simantics.db.Resource; -import org.simantics.diagram.adapter.handler.ResourceAdapter; -import org.simantics.g2d.diagram.handler.PickRequest.PickPolicy; -import org.simantics.g2d.element.ElementClass; -import org.simantics.g2d.element.IElement; -import org.simantics.g2d.element.handler.InternalSize; -import org.simantics.g2d.element.handler.Move; -import org.simantics.g2d.element.handler.Outline; -import org.simantics.g2d.element.handler.Pick2; -import org.simantics.g2d.element.handler.SceneGraph; -import org.simantics.g2d.element.handler.Transform; -import org.simantics.scenegraph.g2d.G2DParentNode; -import org.simantics.sysdyn.ui.elements.IDrawable; -import org.simantics.sysdyn.ui.elements.ITransformable; -import org.simantics.utils.datastructures.hints.IHintContext.KeyOf; - -public class DrawableElementClass { - private DrawableElementClass() {} - - public static KeyOf KEY_CONTENT = new KeyOf(IDrawable.class, "CONTENT"); - public static AffineTransform IDENTITY_TRANSFORM = new AffineTransform(); - - public static WidgetHandler WIDGET_HANDLER_INSTANCE = new WidgetHandler(); - - private static class WidgetHandler implements Transform, SceneGraph, InternalSize, Move, Outline, Pick2 { - - private static final long serialVersionUID = 1722978969083481038L; - - @Override - public void setTransform(IElement e, AffineTransform at) { - IDrawable drawable = (IDrawable)e.getHint(KEY_CONTENT); - if(drawable instanceof ITransformable) { - drawable = ((ITransformable)drawable).setTransform(at); - e.setHint(KEY_CONTENT, drawable); - drawable.updateSG(); - } - } - - @Override - public AffineTransform getTransform(IElement e) { - IDrawable drawable = (IDrawable)e.getHint(KEY_CONTENT); - if(drawable instanceof ITransformable) - return ((ITransformable)drawable).getTransform(); - else - return IDENTITY_TRANSFORM; - } - - @Override - public void cleanup(IElement e) { - ((IDrawable)e.getHint(KEY_CONTENT)).cleanupSG(); - } - - @Override - public void init(IElement e, G2DParentNode parent) { - ((IDrawable)e.getHint(KEY_CONTENT)).initSG(parent); - } - - @Override - public Rectangle2D getBounds(IElement e, Rectangle2D size) { - if(size == null) - size = new Rectangle2D.Double(); - ((IDrawable)e.getHint(KEY_CONTENT)).getBounds(size); - return size; - } - - @Override - public Point2D getPosition(IElement e) { - IDrawable drawable = (IDrawable)e.getHint(KEY_CONTENT); - if(drawable instanceof ITransformable) - return ((ITransformable)drawable).getPosition(); - else - return new Point2D.Double(0.0, 0.0); - } - - @Override - public void moveTo(IElement e, double x, double y) { - IDrawable drawable = (IDrawable)e.getHint(KEY_CONTENT); - if(drawable instanceof ITransformable) { - drawable = ((ITransformable)drawable).moveTo(x, y); - e.setHint(KEY_CONTENT, drawable); - drawable.updateSG(); - } - } - - @Override - public Shape getElementShape(IElement e) { - return getBounds(e, null); - } - - @Override - public int pick(IElement e, Shape s, PickPolicy policy, - Collection result) { - if(pickTest(e, s, policy)) { - result.add(e); - return 1; - } - else - return 0; - } - - @Override - public boolean pickTest(IElement e, Shape s, PickPolicy policy) { - IDrawable drawable = (IDrawable)e.getHint(KEY_CONTENT); - switch(policy) { - case PICK_CONTAINED_OBJECTS: - return drawable.pickContained(s); - case PICK_INTERSECTING_OBJECTS: - return drawable.pickIntersecting(s); - default: - return false; - } - } - - } - - public static ElementClass createElementClass(final Resource resource) { - return ElementClass.compile( - WIDGET_HANDLER_INSTANCE, - new ResourceAdapter() { - - @Override - public Resource getResource() { - return resource; - } - - } - ); - } -} diff --git a/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/diagram/SysdynDiagramEditor.java b/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/diagram/SysdynDiagramEditor.java deleted file mode 100644 index 614a4374..00000000 --- a/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/diagram/SysdynDiagramEditor.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.simantics.sysdyn.ui.diagram; - -import org.simantics.sysdyn.ui.elements.TestDrawable; - - -public class SysdynDiagramEditor extends DiagramEditorFacade { - - public SysdynDiagramEditor() { - super(); - } - -} diff --git a/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/elements/Drawable.java b/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/elements/Drawable.java deleted file mode 100644 index 90ab9cd5..00000000 --- a/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/elements/Drawable.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.simantics.sysdyn.ui.elements; - -import java.awt.Shape; -import java.awt.geom.AffineTransform; - -import org.simantics.scenegraph.g2d.G2DParentNode; - -public abstract class Drawable implements IDrawable { - - public static final AffineTransform IDENTITY = new AffineTransform(); - - @Override - public void initSG(G2DParentNode parent) { - } - - @Override - public void cleanupSG() { - } - - @Override - public void updateSG() { - } - - @Override - public boolean pickContained(Shape s) { - return false; - } - - @Override - public boolean pickIntersecting(Shape s) { - return false; - } - -} diff --git a/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/elements/IDrawable.java b/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/elements/IDrawable.java deleted file mode 100644 index d48a3c90..00000000 --- a/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/elements/IDrawable.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.simantics.sysdyn.ui.elements; - -import java.awt.Shape; -import java.awt.geom.Rectangle2D; - -import org.simantics.scenegraph.g2d.G2DParentNode; - -public interface IDrawable { - void getBounds(Rectangle2D size); - void initSG(G2DParentNode parent); - void updateSG(); - void cleanupSG(); - boolean pickIntersecting(Shape s); - boolean pickContained(Shape s); -} diff --git a/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/elements/ITransformable.java b/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/elements/ITransformable.java deleted file mode 100644 index 266b8b5c..00000000 --- a/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/elements/ITransformable.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.simantics.sysdyn.ui.elements; - -import java.awt.geom.AffineTransform; -import java.awt.geom.Point2D; - -public interface ITransformable extends IDrawable { - ITransformable setTransform(AffineTransform at); - AffineTransform getTransform(); - public ITransformable moveTo(double x, double y); - Point2D getPosition(); -} diff --git a/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/elements/PositionableDrawable.java b/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/elements/PositionableDrawable.java deleted file mode 100644 index 58d697e3..00000000 --- a/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/elements/PositionableDrawable.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.simantics.sysdyn.ui.elements; - -import java.awt.geom.AffineTransform; -import java.awt.geom.Point2D; - -public abstract class PositionableDrawable extends Drawable implements ITransformable, Cloneable { - protected double posX; - protected double posY; - - @Override - public Point2D getPosition() { - return new Point2D.Double(posX, posY); - } - @Override - public AffineTransform getTransform() { - return new AffineTransform(1.0, 0.0, 0.0, 1.0, posX, posY); - } - @Override - public ITransformable moveTo(double x, double y) { - try { - PositionableDrawable d = (PositionableDrawable)clone(); - d.posX = x; - d.posY = y; - return d; - } catch(CloneNotSupportedException e) { - throw new Error(e); - } - } - @Override - public ITransformable setTransform(AffineTransform at) { - try { - PositionableDrawable d = (PositionableDrawable)clone(); - d.posX = at.getTranslateX(); - d.posY = at.getTranslateY(); - return d; - } catch(CloneNotSupportedException e) { - throw new Error(e); - } - } -} diff --git a/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/elements/TestDrawable.java b/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/elements/TestDrawable.java deleted file mode 100644 index 5d35c5ec..00000000 --- a/bundles/org.simantics.sysdyn.ui.old/src/org/simantics/sysdyn/ui/elements/TestDrawable.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.simantics.sysdyn.ui.elements; - -import java.awt.Shape; -import java.awt.geom.AffineTransform; -import java.awt.geom.Rectangle2D; - -import org.simantics.scenegraph.g2d.G2DParentNode; -import org.simantics.scenegraph.g2d.nodes.ShapeNode; - - -public class TestDrawable extends PositionableDrawable { - - @Override - public void getBounds(Rectangle2D size) { - size.setFrame(-10.0, -10.0, 20.0, 20.0); - } - - ShapeNode node; - - @Override - public void initSG(G2DParentNode parent) { - node = parent.addNode(ShapeNode.class); - node.setShape(new Rectangle2D.Double(-10.0, -10.0, 20.0, 20.0)); - } - - @Override - public boolean pickContained(Shape s) { - return s.contains(-10.0, -10.0, 20.0, 20.0); - } - - @Override - public boolean pickIntersecting(Shape s) { - return s.intersects(-10.0, -10.0, 20.0, 20.0); - } - -}