1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.diagram.adapter;
14 import org.simantics.db.AsyncReadGraph;
15 import org.simantics.db.Resource;
16 import org.simantics.db.procedure.AsyncProcedure;
17 import org.simantics.g2d.canvas.ICanvasContext;
18 import org.simantics.g2d.diagram.IDiagram;
19 import org.simantics.g2d.element.ElementClass;
20 import org.simantics.g2d.elementclass.connection.EdgeClass;
23 * An element class factory for connection edge segments.
25 * @author Tuukka Lehtonen
27 public class DefaultConnectionEdgeClassFactory extends ElementFactoryAdapter {
29 private static final ElementClass CLASS = EdgeClass.STRAIGHT;
31 public static ElementClass create() {
36 public void create(AsyncReadGraph graph, ICanvasContext canvas, IDiagram diagram, Resource elementType,
37 AsyncProcedure<ElementClass> procedure) {
38 procedure.execute(graph, CLASS);
42 public void getClass(AsyncReadGraph graph, ICanvasContext canvas, IDiagram diagram, Resource elementResource,
43 AsyncProcedure<ElementClass> procedure) {
44 procedure.execute(graph, CLASS);