
com.mxgraph.view.mxGraphSelectionModel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yaoqiang-bpmn-editor Show documentation
Show all versions of yaoqiang-bpmn-editor Show documentation
an Open Source BPMN 2.0 Modeler
/*
* $Id: mxGraphSelectionModel.java,v 1.1 2012/11/15 13:26:46 gaudenz Exp $
* Copyright (c) 2001-2005, Gaudenz Alder
*
* All rights reserved.
*
* See LICENSE file for license details. If you are unable to locate
* this file please contact info (at) jgraph (dot) com.
*/
package com.mxgraph.view;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import com.mxgraph.util.mxEvent;
import com.mxgraph.util.mxEventObject;
import com.mxgraph.util.mxEventSource;
import com.mxgraph.util.mxUndoableEdit;
import com.mxgraph.util.mxUndoableEdit.mxUndoableChange;
/**
* Implements the selection model for a graph.
*
* This class fires the following events:
*
* mxEvent.UNDO fires after the selection was changed in changeSelection. The
* edit
property contains the mxUndoableEdit which contains the
* mxSelectionChange.
*
* mxEvent.CHANGE fires after the selection changes by executing an
* mxSelectionChange. The added
and removed
* properties contain Collections of cells that have been added to or removed
* from the selection, respectively.
*
* To add a change listener to the graph selection model:
*
*
* addListener(
* mxEvent.CHANGE, new mxIEventListener()
* {
* public void invoke(Object sender, mxEventObject evt)
* {
* mxGraphSelectionModel model = (mxSelectionModel) sender;
* Collection added = (Collection) evt.getProperty("added");
* Collection removed = (Collection) evt.getProperty("removed");
* selectionChanged(model, added, removed);
* }
* });
*
*/
public class mxGraphSelectionModel extends mxEventSource
{
/**
* Reference to the enclosing graph.
*/
protected mxGraph graph;
/**
* Specifies if only one selected item at a time is allowed.
* Default is false.
*/
protected boolean singleSelection = false;
/**
* Holds the selection cells.
*/
protected Set
© 2015 - 2025 Weber Informatics LLC | Privacy Policy