X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=bundles%2Forg.simantics.g2d%2Fsrc%2Forg%2Fsimantics%2Fg2d%2Fdiagram%2Fhandler%2FLifeCycle.java;h=22130a9a2c1ca8249b1906b4a4b84332b8934a7f;hb=refs%2Fchanges%2F38%2F238%2F2;hp=628b1f652cbf9b45969a0385b57789be4e1d877b;hpb=24e2b34260f219f0d1644ca7a138894980e25b14;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/handler/LifeCycle.java b/bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/handler/LifeCycle.java index 628b1f652..22130a9a2 100644 --- a/bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/handler/LifeCycle.java +++ b/bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/handler/LifeCycle.java @@ -1,72 +1,72 @@ -/******************************************************************************* - * 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.diagram.handler; - -import java.util.Collection; - -import org.simantics.g2d.diagram.IDiagram; -import org.simantics.g2d.element.IElement; - -/** - * @author Toni Kalajainen - */ -public interface LifeCycle extends DiagramHandler { - - /** - * New empty diagram has spawned to the world. - * - * @param diagram - */ - void onDiagramCreated(IDiagram diagram); - - /** - * An old diagram has been restored from a other form of state - * (loaded or cloned). - * - * @param diagram - */ - void onDiagramLoaded(IDiagram diagram, Collection initialElements); - - /** - * Diagram is about to be disposed - * @param diagram - */ - void onDiagramDisposed(IDiagram diagram); - - /** - * Diagram is about to be destoyed permanently from the world - * @param diagram - */ - void onDiagramDestroyed(IDiagram diagram); - - /** - * A stub implementation for {@link LifeCycle} that does not do anything. - * Extend this to avoid having to implement all methods. - */ - public class Stub implements LifeCycle { - @Override - public void onDiagramCreated(IDiagram diagram) { - } - - @Override - public void onDiagramLoaded(IDiagram diagram, Collection initialElements) { - } - - @Override - public void onDiagramDisposed(IDiagram diagram) { - } - - @Override - public void onDiagramDestroyed(IDiagram diagram) { - } - } -} +/******************************************************************************* + * 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.diagram.handler; + +import java.util.Collection; + +import org.simantics.g2d.diagram.IDiagram; +import org.simantics.g2d.element.IElement; + +/** + * @author Toni Kalajainen + */ +public interface LifeCycle extends DiagramHandler { + + /** + * New empty diagram has spawned to the world. + * + * @param diagram + */ + void onDiagramCreated(IDiagram diagram); + + /** + * An old diagram has been restored from a other form of state + * (loaded or cloned). + * + * @param diagram + */ + void onDiagramLoaded(IDiagram diagram, Collection initialElements); + + /** + * Diagram is about to be disposed + * @param diagram + */ + void onDiagramDisposed(IDiagram diagram); + + /** + * Diagram is about to be destoyed permanently from the world + * @param diagram + */ + void onDiagramDestroyed(IDiagram diagram); + + /** + * A stub implementation for {@link LifeCycle} that does not do anything. + * Extend this to avoid having to implement all methods. + */ + public class Stub implements LifeCycle { + @Override + public void onDiagramCreated(IDiagram diagram) { + } + + @Override + public void onDiagramLoaded(IDiagram diagram, Collection initialElements) { + } + + @Override + public void onDiagramDisposed(IDiagram diagram) { + } + + @Override + public void onDiagramDestroyed(IDiagram diagram) { + } + } +}