X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=inline;f=bundles%2Forg.simantics.g2d%2Fsrc%2Forg%2Fsimantics%2Fg2d%2Fdiagram%2FIDiagram.java;h=ddef14539311701d80197d79b14f83eee6a50b27;hb=31000619;hp=d07a2b2e29407d245d56f55fe68621f9aecdd6b7;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/IDiagram.java b/bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/IDiagram.java index d07a2b2e2..ddef14539 100644 --- a/bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/IDiagram.java +++ b/bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/IDiagram.java @@ -1,168 +1,168 @@ -/******************************************************************************* - * 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; - -import java.util.Comparator; -import java.util.List; - -import org.simantics.g2d.diagram.impl.Diagram; -import org.simantics.g2d.diagram.participant.ZOrderHandler; -import org.simantics.g2d.element.IElement; -import org.simantics.utils.datastructures.hints.IHintContext; - -/** - * Diagram is a flat ordered composition of elements. - *
- * Diagram may only be accessed from canvas thread. - *
- * Diagram variables are persistent. - *
- * Elements are ordered according to their z-value
- *
- * @see Diagram Default implementation
- * @see IElement
- * @see ZOrderHandler
- * @author Toni Kalajainen
- */
-public interface IDiagram extends IHintContext {
-
- public interface CompositionVetoListener {
- /**
- * Invoked before an element is actually added on to a diagram. This
- * provides the possibility to veto the addition by returning
- *
+ * Diagram may only be accessed from canvas thread.
+ *
+ * Diagram variables are persistent.
+ *
+ * Elements are ordered according to their z-value
+ *
+ * @see Diagram Default implementation
+ * @see IElement
+ * @see ZOrderHandler
+ * @author Toni Kalajainen
+ */
+public interface IDiagram extends IHintContext {
+
+ public interface CompositionVetoListener {
+ /**
+ * Invoked before an element is actually added on to a diagram. This
+ * provides the possibility to veto the addition by returning
+ * false
.
- *
- * @param d the diagram to be changed
- * @param e the element to be added
- * @return true
to allow the addition or false
- * to veto the addition
- */
- boolean beforeElementAdded(IDiagram d, IElement e);
-
- /**
- * Invoked before an element is actually removed from a diagram. This
- * provides the possibility to veto the addition by returning
- * false
.
- *
- * @param d the diagram to be changed
- * @param e the element to be removed
- * @return true
to allow the removal or false
- * to veto the removal
- */
- boolean beforeElementRemoved(IDiagram d, IElement e);
- }
-
- public interface CompositionListener {
- /**
- * @param d
- * @param e
- */
- void onElementAdded(IDiagram d, IElement e);
-
- /**
- * @param d
- * @param e
- */
- void onElementRemoved(IDiagram d, IElement e);
- }
-
- /**
- * Add a composition listener that can veto element addition/removal
- * @param listener
- */
- void addCompositionVetoListener(CompositionVetoListener listener);
- /**
- * Remove composition veto listener
- * @param listener
- */
- void removeCompositionVetoListener(CompositionVetoListener listener);
-
- /**
- * Add a composition listener that notifies about element composition
- * @param listener
- */
- void addCompositionListener(CompositionListener listener);
- /**
- * Remove composition listener
- * @param listener
- */
- void removeCompositionListener(CompositionListener listener);
-
- /**
- * Get diagram class
- * @return diagram class
- */
- DiagramClass getDiagramClass();
-
- /**
- * Get a snapshot of elements. The list is z-ordered, where
- * top most elements are at the end of the list.
- * @return a snapshot of elements
- */
- Listtrue
if the position changed
- */
- boolean moveTo(IElement e, int position);
-
-}
+/*******************************************************************************
+ * 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;
+
+import java.util.Comparator;
+import java.util.List;
+
+import org.simantics.g2d.diagram.impl.Diagram;
+import org.simantics.g2d.diagram.participant.ZOrderHandler;
+import org.simantics.g2d.element.IElement;
+import org.simantics.utils.datastructures.hints.IHintContext;
+
+/**
+ * Diagram is a flat ordered composition of elements.
+ * false
.
+ *
+ * @param d the diagram to be changed
+ * @param e the element to be added
+ * @return true
to allow the addition or false
+ * to veto the addition
+ */
+ boolean beforeElementAdded(IDiagram d, IElement e);
+
+ /**
+ * Invoked before an element is actually removed from a diagram. This
+ * provides the possibility to veto the addition by returning
+ * false
.
+ *
+ * @param d the diagram to be changed
+ * @param e the element to be removed
+ * @return true
to allow the removal or false
+ * to veto the removal
+ */
+ boolean beforeElementRemoved(IDiagram d, IElement e);
+ }
+
+ public interface CompositionListener {
+ /**
+ * @param d
+ * @param e
+ */
+ void onElementAdded(IDiagram d, IElement e);
+
+ /**
+ * @param d
+ * @param e
+ */
+ void onElementRemoved(IDiagram d, IElement e);
+ }
+
+ /**
+ * Add a composition listener that can veto element addition/removal
+ * @param listener
+ */
+ void addCompositionVetoListener(CompositionVetoListener listener);
+ /**
+ * Remove composition veto listener
+ * @param listener
+ */
+ void removeCompositionVetoListener(CompositionVetoListener listener);
+
+ /**
+ * Add a composition listener that notifies about element composition
+ * @param listener
+ */
+ void addCompositionListener(CompositionListener listener);
+ /**
+ * Remove composition listener
+ * @param listener
+ */
+ void removeCompositionListener(CompositionListener listener);
+
+ /**
+ * Get diagram class
+ * @return diagram class
+ */
+ DiagramClass getDiagramClass();
+
+ /**
+ * Get a snapshot of elements. The list is z-ordered, where
+ * top most elements are at the end of the list.
+ * @return a snapshot of elements
+ */
+ Listtrue
if the position changed
+ */
+ boolean moveTo(IElement e, int position);
+
+}