X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.g2d%2Fsrc%2Forg%2Fsimantics%2Fg2d%2Felement%2Fhandler%2FLifeCycle.java;h=a66121d5d3e157b5afeac8cf7caf87a7444b6b71;hb=refs%2Fchanges%2F38%2F238%2F2;hp=ec69cf29c6511dbfe131f0c1ac0d7de75703a5e7;hpb=24e2b34260f219f0d1644ca7a138894980e25b14;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.g2d/src/org/simantics/g2d/element/handler/LifeCycle.java b/bundles/org.simantics.g2d/src/org/simantics/g2d/element/handler/LifeCycle.java index ec69cf29c..a66121d5d 100644 --- a/bundles/org.simantics.g2d/src/org/simantics/g2d/element/handler/LifeCycle.java +++ b/bundles/org.simantics.g2d/src/org/simantics/g2d/element/handler/LifeCycle.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.g2d.element.handler; - -import org.simantics.g2d.diagram.IDiagram; -import org.simantics.g2d.element.IElement; - -/** - * All ElementContributions that implement LifeCycle get - * element create and destroy events. - * - * @author Toni Kalajainen - * - * @see Stub - */ -public interface LifeCycle extends ElementHandler { - - /** - * a new element has been spawned to the world - * @param e - */ - void onElementCreated(IElement e); - - /** - * Element has been destroyed from the world - * @param e - */ - void onElementDestroyed(IElement e); - - /** - * Element has been activated (after creation, cloning or loading) - * and added to a diagram. - * - * @param d - * @param e - */ - void onElementActivated(IDiagram d, IElement e); - - /** - * Element has been deactivated (disposed) - * @param d - * @param e - */ - void onElementDeactivated(IDiagram d, IElement e); - - /** - * A stub implementation for {@link LifeCycle} that does not do anything. - * Extend this to avoid having to implement all methods. - */ - public static class Stub implements LifeCycle { - private static final long serialVersionUID = -569889719338663795L; - - @Override - public void onElementActivated(IDiagram d, IElement e) { - } - - @Override - public void onElementCreated(IElement e) { - } - - @Override - public void onElementDeactivated(IDiagram d, IElement e) { - } - - @Override - public void onElementDestroyed(IElement e) { - } - } - -} +/******************************************************************************* + * 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.handler; + +import org.simantics.g2d.diagram.IDiagram; +import org.simantics.g2d.element.IElement; + +/** + * All ElementContributions that implement LifeCycle get + * element create and destroy events. + * + * @author Toni Kalajainen + * + * @see Stub + */ +public interface LifeCycle extends ElementHandler { + + /** + * a new element has been spawned to the world + * @param e + */ + void onElementCreated(IElement e); + + /** + * Element has been destroyed from the world + * @param e + */ + void onElementDestroyed(IElement e); + + /** + * Element has been activated (after creation, cloning or loading) + * and added to a diagram. + * + * @param d + * @param e + */ + void onElementActivated(IDiagram d, IElement e); + + /** + * Element has been deactivated (disposed) + * @param d + * @param e + */ + void onElementDeactivated(IDiagram d, IElement e); + + /** + * A stub implementation for {@link LifeCycle} that does not do anything. + * Extend this to avoid having to implement all methods. + */ + public static class Stub implements LifeCycle { + private static final long serialVersionUID = -569889719338663795L; + + @Override + public void onElementActivated(IDiagram d, IElement e) { + } + + @Override + public void onElementCreated(IElement e) { + } + + @Override + public void onElementDeactivated(IDiagram d, IElement e) { + } + + @Override + public void onElementDestroyed(IElement e) { + } + } + +}