]> gerrit.simantics Code Review - simantics/sysdyn.git/blob
97bb8452936213f5c343b05f7dc3d75b8430a975
[simantics/sysdyn.git] /
1 /*******************************************************************************\r
2  * Copyright (c) 2007, 2011 Association for Decentralized Information Management in\r
3  * Industry THTH ry.\r
4  * All rights reserved. This program and the accompanying materials\r
5  * are made available under the terms of the Eclipse Public License v1.0\r
6  * which accompanies this distribution, and is available at\r
7  * http://www.eclipse.org/legal/epl-v10.html\r
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.sysdyn.ui.elements.connections;\r
13 \r
14 import org.simantics.db.AsyncReadGraph;\r
15 import org.simantics.db.Resource;\r
16 import org.simantics.db.procedure.AsyncProcedure;\r
17 import org.simantics.diagram.adapter.ElementFactoryAdapter;\r
18 import org.simantics.g2d.canvas.ICanvasContext;\r
19 import org.simantics.g2d.diagram.IDiagram;\r
20 import org.simantics.g2d.element.ElementClass;\r
21 \r
22 public class RouteFlowEdgeFactory extends ElementFactoryAdapter {\r
23 \r
24     private static final ElementClass CLASS = RouteFlowEdgeClass.FLOW_CLASS;\r
25 \r
26     @Override\r
27     public void create(AsyncReadGraph graph, ICanvasContext canvas, IDiagram diagram, Resource elementType,\r
28             AsyncProcedure<ElementClass> procedure) {\r
29         procedure.execute(graph, CLASS);\r
30     }\r
31 \r
32     @Override\r
33     public void getClass(AsyncReadGraph graph, ICanvasContext canvas, IDiagram diagram, Resource elementResource,\r
34             AsyncProcedure<ElementClass> procedure) {\r
35         procedure.execute(graph, CLASS);\r
36     }\r
37 \r
38 }\r