/******************************************************************************* | |
* <copyright> | |
* | |
* Copyright (c) 2013, 2013 SAP AG. | |
* 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: | |
* SAP AG - initial API, implementation and documentation | |
* | |
* </copyright> | |
* | |
*******************************************************************************/ | |
package org.eclipse.fmc.blockdiagram.editor.algorithm.node; | |
import org.eclipse.graphiti.features.IFeatureProvider; | |
import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm; | |
import org.eclipse.graphiti.mm.pictograms.ContainerShape; | |
/** | |
* This is the interface for all nodes with multiplicity option. | |
* | |
* @author Heiko Witteborg | |
* | |
*/ | |
public interface MultipleNode extends GraphicsNode { | |
/** | |
* Defines the size of the gap between the multiple instance algorithms. | |
*/ | |
public static final int MULTI_INSTANCE_GAP = 5; | |
/** | |
* @param container | |
* @param multipleInstances | |
*/ | |
public void setMultipleInstances(ContainerShape container, | |
IFeatureProvider provider, boolean multipleInstances); | |
/** | |
* When there are multiple instances, there are two graphics algorithms | |
* showing up. If main == true, then the main part in the front will be | |
* returned, otherwise the part behind the main part. Returns null if this | |
* container is not a a multi instance shape. | |
* | |
* @param container | |
* The container shape of the multiple node. | |
* @param main | |
* True if the graphics algorithm in the foreground should be | |
* returned | |
* @return The selected graphics algorithms of the multiple node. Null if | |
* multiplicity of the node is set to false. | |
*/ | |
public GraphicsAlgorithm getMultiInstanceChild(ContainerShape container, | |
boolean main); | |
/** | |
* Checks if the multiplicity of the multiple node is set to true. | |
* | |
* @param container | |
* The container of the MultipleNode. | |
* @return True if the multiplicity of the MultipleNode is true. | |
*/ | |
public boolean isMultipleInstances(ContainerShape container); | |
/** | |
* Ensures that the multiple instance children are in sync (e.g. size, | |
* position). | |
* | |
* @param container | |
* The container of the MultipleNode. | |
*/ | |
public void synchronizeMultiInstanceChildren(ContainerShape container); | |
} |