X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.diagram%2Fsrc%2Forg%2Fsimantics%2Fdiagram%2Fcontent%2FResourceTerminal.java;fp=bundles%2Forg.simantics.diagram%2Fsrc%2Forg%2Fsimantics%2Fdiagram%2Fcontent%2FResourceTerminal.java;h=ccd86086e6ca51c5ef3429250a38bef644ef695b;hp=d18468b49c9f504523b5af1cd4f20ca79ef6e2b9;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/content/ResourceTerminal.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/content/ResourceTerminal.java index d18468b49..ccd86086e 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/content/ResourceTerminal.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/content/ResourceTerminal.java @@ -1,79 +1,79 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * 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.diagram.content; - -import java.awt.Shape; -import java.awt.geom.AffineTransform; - -import org.simantics.db.Resource; -import org.simantics.diagram.adapter.GraphToDiagramSynchronizer; -import org.simantics.g2d.diagram.handler.Topology.Terminal; -import org.simantics.g2d.element.handler.impl.ObjectTerminal; -import org.simantics.g2d.utils.geom.DirectionSet; -import org.simantics.utils.Container; -import org.simantics.utils.DataContainer; - -/** - * A default DB resource based implementation of the g2d {@link Terminal} - * interface. - * - *

- * Elements that intend to contain terminal and use - * {@link GraphToDiagramSynchronizer} must use this implementation to represent - * the terminals of the element. - *

- * - *

- * Also contains a relative transformation with respect to its parent, a set of - * allowed drawing directions and a graphical shape to depict the terminal. - *

- * - *

- * The specified terminal resource is expected to have at least the following - * graph attached to it: - *

- * specified-resource
- *     DIAGRAM.HasConnectionVariable
- *         _ : STRUCTURAL.ConnectionVariable
- *             STRUCTURAL.Binds TerminalRelation
- * 
- *

- * - * @author Tuukka Lehtonen - */ -public class ResourceTerminal extends ObjectTerminal { - - public ResourceTerminal(Resource r, AffineTransform transform, DirectionSet ds, Container shape) { - super(r, transform, ds, shape); - } - - public ResourceTerminal(Resource r, AffineTransform transform, DirectionSet ds, Shape shape) { - super(r, transform, ds, new DataContainer(shape)); - } - - public ResourceTerminal(Resource r, AffineTransform transform, DirectionSet ds) { - super(r, transform, ds); - } - - public ResourceTerminal(Resource r, AffineTransform transform) { - super(r, transform); - } - - public ResourceTerminal(Resource r) { - super(r, new AffineTransform()); - } - - public Resource getResource() { - return (Resource) getData(); - } - +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * 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.diagram.content; + +import java.awt.Shape; +import java.awt.geom.AffineTransform; + +import org.simantics.db.Resource; +import org.simantics.diagram.adapter.GraphToDiagramSynchronizer; +import org.simantics.g2d.diagram.handler.Topology.Terminal; +import org.simantics.g2d.element.handler.impl.ObjectTerminal; +import org.simantics.g2d.utils.geom.DirectionSet; +import org.simantics.utils.Container; +import org.simantics.utils.DataContainer; + +/** + * A default DB resource based implementation of the g2d {@link Terminal} + * interface. + * + *

+ * Elements that intend to contain terminal and use + * {@link GraphToDiagramSynchronizer} must use this implementation to represent + * the terminals of the element. + *

+ * + *

+ * Also contains a relative transformation with respect to its parent, a set of + * allowed drawing directions and a graphical shape to depict the terminal. + *

+ * + *

+ * The specified terminal resource is expected to have at least the following + * graph attached to it: + *

+ * specified-resource
+ *     DIAGRAM.HasConnectionVariable
+ *         _ : STRUCTURAL.ConnectionVariable
+ *             STRUCTURAL.Binds TerminalRelation
+ * 
+ *

+ * + * @author Tuukka Lehtonen + */ +public class ResourceTerminal extends ObjectTerminal { + + public ResourceTerminal(Resource r, AffineTransform transform, DirectionSet ds, Container shape) { + super(r, transform, ds, shape); + } + + public ResourceTerminal(Resource r, AffineTransform transform, DirectionSet ds, Shape shape) { + super(r, transform, ds, new DataContainer(shape)); + } + + public ResourceTerminal(Resource r, AffineTransform transform, DirectionSet ds) { + super(r, transform, ds); + } + + public ResourceTerminal(Resource r, AffineTransform transform) { + super(r, transform); + } + + public ResourceTerminal(Resource r) { + super(r, new AffineTransform()); + } + + public Resource getResource() { + return (Resource) getData(); + } + } \ No newline at end of file