X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.g2d%2Fsrc%2Forg%2Fsimantics%2Fg2d%2Felement%2FIElement.java;h=50d31318e50ef21382c63f253444b0d94ff29dbc;hb=ad5b573b5db77a3e00429fc24e2de855bce7f48a;hp=3deb49094c941390f4b08daa76328f9ea5ebadb8;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.g2d/src/org/simantics/g2d/element/IElement.java b/bundles/org.simantics.g2d/src/org/simantics/g2d/element/IElement.java index 3deb49094..50d31318e 100644 --- a/bundles/org.simantics.g2d/src/org/simantics/g2d/element/IElement.java +++ b/bundles/org.simantics.g2d/src/org/simantics/g2d/element/IElement.java @@ -1,83 +1,83 @@ -/******************************************************************************* - * 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.g2d.element; - -import org.simantics.g2d.diagram.IDiagram; -import org.simantics.g2d.element.handler.LifeCycle; -import org.simantics.g2d.element.impl.Element; -import org.simantics.utils.datastructures.hints.IHintContext; - -/** - * Element is an object on a diagram. Element is part of one diagram. - *
- * Element variables describe visual properties of the element.
- *
- * Variables (all of them) may be cloned, and serialized.
- * Do not put non-visualization specific variables in element, e.g. Canvas Specific
- * variables.
- *
- * Use DiagramParticipant to write _canvas_specific_variables_ e.g.
- * DiagramParticipant dp = ctx.getSingleItem(DiagramParticipant.class);
- * dp.setElementHint(...);
- * dp.setDiagramHint(...);
- *
- * Note! all values should be treated as if they are immutable.
- *
- * @see ElementUtils
- * @see Element
- * @author Toni Kalajainen
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface IElement extends IHintContext {
-
- /**
- * @return
- */
- ElementClass getElementClass();
-
- /**
- * Returns the diagram this element is directly a part of.
- *
- * @return the diagram
- */
- IDiagram getDiagram();
-
- /**
- * Looks whether this element is a a direct part of a diagram.
- *
- * @return null
if not a direct part of a diagram
- */
- IDiagram peekDiagram();
-
- /**
- * (INTERNAL!) Invoked as a notification when this element is added to a
- * diagram or removed from a diagram.
- *
- * @param diagram
- * diagram or null
if the element was removed from a
- * diagram
- */
- void addedToDiagram(IDiagram diagram);
-
- /**
- * Destroys the element from the world. Notifies all life-cycle handlers
- * through {@link LifeCycle#onElementDestroyed(IElement)} of the event.
- */
- void destroy();
-
- /**
- * Silently disposes of the element without performing any {@link LifeCycle}
- * notifications.
- */
- void dispose();
-
-}
+/*******************************************************************************
+ * 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.g2d.element;
+
+import org.simantics.g2d.diagram.IDiagram;
+import org.simantics.g2d.element.handler.LifeCycle;
+import org.simantics.g2d.element.impl.Element;
+import org.simantics.utils.datastructures.hints.IHintContext;
+
+/**
+ * Element is an object on a diagram. Element is part of one diagram.
+ *
+ * Element variables describe visual properties of the element.
+ *
+ * Variables (all of them) may be cloned, and serialized.
+ * Do not put non-visualization specific variables in element, e.g. Canvas Specific
+ * variables.
+ *
+ * Use DiagramParticipant to write _canvas_specific_variables_ e.g.
+ * DiagramParticipant dp = ctx.getSingleItem(DiagramParticipant.class);
+ * dp.setElementHint(...);
+ * dp.setDiagramHint(...);
+ *
+ * Note! all values should be treated as if they are immutable.
+ *
+ * @see ElementUtils
+ * @see Element
+ * @author Toni Kalajainen
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface IElement extends IHintContext {
+
+ /**
+ * @return
+ */
+ ElementClass getElementClass();
+
+ /**
+ * Returns the diagram this element is directly a part of.
+ *
+ * @return the diagram
+ */
+ IDiagram getDiagram();
+
+ /**
+ * Looks whether this element is a a direct part of a diagram.
+ *
+ * @return null
if not a direct part of a diagram
+ */
+ IDiagram peekDiagram();
+
+ /**
+ * (INTERNAL!) Invoked as a notification when this element is added to a
+ * diagram or removed from a diagram.
+ *
+ * @param diagram
+ * diagram or null
if the element was removed from a
+ * diagram
+ */
+ void addedToDiagram(IDiagram diagram);
+
+ /**
+ * Destroys the element from the world. Notifies all life-cycle handlers
+ * through {@link LifeCycle#onElementDestroyed(IElement)} of the event.
+ */
+ void destroy();
+
+ /**
+ * Silently disposes of the element without performing any {@link LifeCycle}
+ * notifications.
+ */
+ void dispose();
+
+}