/*******************************************************************************
* 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.diagram.handler;
import java.util.ArrayList;
import java.util.Collection;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.simantics.db.ReadGraph;
import org.simantics.db.Resource;
import org.simantics.db.exception.DatabaseException;
import org.simantics.diagram.content.EdgeResource;
import org.simantics.diagram.stubs.DiagramResource;
import org.simantics.g2d.element.ElementHints;
import org.simantics.g2d.element.ElementUtils;
import org.simantics.g2d.element.IElement;
import org.simantics.modeling.ModelingResources;
/**
* An element assortment is used to categorize diagram contents in diagram
* cut-copy-paste operations.
*
*
* This version of {@link ElementAssortment} contains only the back-end objects
* (see {@link ElementHints#KEY_OBJECT}) of IElement instances instead of the
* IElement instances themselves. This version doesn't have the dependency on
* the diagram runtime model that {@link ElementAssortment} has. This object can
* be used even if the diagram runtime model and its elements are disposed.
*
* @author Tuukka Lehtonen
*/
public class ElementObjectAssortment implements IElementAssortment {
private EnumSet contents;
public Set