]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/GetElementClassRequest.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.diagram / src / org / simantics / diagram / adapter / GetElementClassRequest.java
diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/GetElementClassRequest.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/GetElementClassRequest.java
new file mode 100644 (file)
index 0000000..b23de4b
--- /dev/null
@@ -0,0 +1,45 @@
+/*******************************************************************************\r
+ * Copyright (c) 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ *     VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.diagram.adapter;\r
+\r
+import org.simantics.db.AsyncReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.common.request.BinaryAsyncRead;\r
+import org.simantics.db.procedure.AsyncProcedure;\r
+import org.simantics.g2d.canvas.ICanvasContext;\r
+import org.simantics.g2d.diagram.IDiagram;\r
+import org.simantics.g2d.element.ElementClass;\r
+\r
+/**\r
+ * @author Tuukka Lehtonen\r
+ * \r
+ * @see CreateElementClassRequest\r
+ * @see NodeRequest\r
+ * @see ConnectionRequest\r
+ */\r
+class GetElementClassRequest extends BinaryAsyncRead<Resource, ICanvasContext, ElementClass> {\r
+\r
+    private final ElementFactory elementFactory;\r
+    private final IDiagram       diagram;\r
+\r
+    public GetElementClassRequest(ElementFactory elementFactory, Resource element, ICanvasContext canvas, IDiagram diagram) {\r
+        super(element, canvas);\r
+        this.elementFactory = elementFactory; \r
+        this.diagram = diagram;\r
+    }\r
+\r
+    @Override\r
+    public void perform(AsyncReadGraph graph, AsyncProcedure<ElementClass> procedure) {\r
+        elementFactory.getClass(graph, parameter2, diagram, parameter, procedure);\r
+    }\r
+\r
+}
\ No newline at end of file