<AHREF="../../../com/mxgraph/view/mxGraph.mxICellVisitor.html"title="interface in com.mxgraph.view"><B>PREV CLASS</B></A>
<AHREF="../../../com/mxgraph/view/mxGraphSelectionModel.mxSelectionChange.html"title="class in com.mxgraph.view"><B>NEXT CLASS</B></A></FONT></TD>
<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">java.lang.Object</A>
<IMGSRC="../../../resources/inherit.gif"ALT="extended by "><AHREF="../../../com/mxgraph/util/mxEventSource.html"title="class in com.mxgraph.util">com.mxgraph.util.mxEventSource</A>
<IMGSRC="../../../resources/inherit.gif"ALT="extended by "><B>com.mxgraph.view.mxGraphSelectionModel</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>mxGraphSelectionModel</B><DT>extends <AHREF="../../../com/mxgraph/util/mxEventSource.html"title="class in com.mxgraph.util">mxEventSource</A></DL>
</PRE>
<P>
Implements the selection model for a graph.
This class fires the following events:
mxEvent.UNDO fires after the selection was changed in changeSelection. The
<code>edit</code> property contains the mxUndoableEdit which contains the
mxSelectionChange.
mxEvent.CHANGE fires after the selection changes by executing an
mxSelectionChange. The <code>added</code> and <code>removed</code>
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:
<code>
addListener(
mxEvent.CHANGE, new mxIEventListener()
{
public void invoke(Object sender, mxEventObject evt)
{
mxGraphSelectionModel model = (mxSelectionModel) sender;
<TD><CODE><B><AHREF="../../../com/mxgraph/view/mxGraphSelectionModel.mxSelectionChange.html"title="class in com.mxgraph.view">mxGraphSelectionModel.mxSelectionChange</A></B></CODE>
<THALIGN="left"><B>Nested classes/interfaces inherited from class com.mxgraph.util.<AHREF="../../../com/mxgraph/util/mxEventSource.html"title="class in com.mxgraph.util">mxEventSource</A></B></TH>
</TR>
<TRBGCOLOR="white"CLASS="TableRowColor">
<TD><CODE><AHREF="../../../com/mxgraph/util/mxEventSource.mxIEventListener.html"title="interface in com.mxgraph.util">mxEventSource.mxIEventListener</A></CODE></TD>
<CODE>protected <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Set.html?is-external=true"title="class or interface in java.util">Set</A><<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A>></CODE></FONT></TD>
<THALIGN="left"><B>Fields inherited from class com.mxgraph.util.<AHREF="../../../com/mxgraph/util/mxEventSource.html"title="class in com.mxgraph.util">mxEventSource</A></B></TH>
<TD><CODE><B><AHREF="../../../com/mxgraph/view/mxGraphSelectionModel.html#mxGraphSelectionModel(com.mxgraph.view.mxGraph)">mxGraphSelectionModel</A></B>(<AHREF="../../../com/mxgraph/view/mxGraph.html"title="class in com.mxgraph.view">mxGraph</A> graph)</CODE>
<BR>
Constructs a new selection model for the specified graph.</TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/view/mxGraphSelectionModel.html#addCell(java.lang.Object)">addCell</A></B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A> cell)</CODE>
<BR>
Adds the given cell to the selection.</TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/view/mxGraphSelectionModel.html#addCells(java.lang.Object[])">addCells</A></B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A>[] cells)</CODE>
<TD><CODE><B><AHREF="../../../com/mxgraph/view/mxGraphSelectionModel.html#cellAdded(java.lang.Object)">cellAdded</A></B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A> cell)</CODE>
<TD><CODE><B><AHREF="../../../com/mxgraph/view/mxGraphSelectionModel.html#cellRemoved(java.lang.Object)">cellRemoved</A></B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A> cell)</CODE>
<TD><CODE><B><AHREF="../../../com/mxgraph/view/mxGraphSelectionModel.html#changeSelection(java.util.Collection, java.util.Collection)">changeSelection</A></B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true"title="class or interface in java.util">Collection</A><<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A>> added,
<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true"title="class or interface in java.util">Collection</A><<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A>> removed)</CODE>
<CODE> <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A></CODE></FONT></TD>
<CODE> <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A>[]</CODE></FONT></TD>
<CODE>protected <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A></CODE></FONT></TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/view/mxGraphSelectionModel.html#getFirstSelectableCell(java.lang.Object[])">getFirstSelectableCell</A></B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A>[] cells)</CODE>
<BR>
Returns the first selectable cell in the given array of cells.</TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/view/mxGraphSelectionModel.html#isSelected(java.lang.Object)">isSelected</A></B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A> cell)</CODE>
<BR>
Returns true if the given cell is selected.</TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/view/mxGraphSelectionModel.html#removeCell(java.lang.Object)">removeCell</A></B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A> cell)</CODE>
<BR>
Removes the given cell from the selection.</TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/view/mxGraphSelectionModel.html#removeCells(java.lang.Object[])">removeCells</A></B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A>[] cells)</CODE>
<TD><CODE><B><AHREF="../../../com/mxgraph/view/mxGraphSelectionModel.html#setCell(java.lang.Object)">setCell</A></B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A> cell)</CODE>
<BR>
Clears the selection and adds the given cell to the selection.</TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/view/mxGraphSelectionModel.html#setCells(java.lang.Object[])">setCells</A></B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A>[] cells)</CODE>
<BR>
Clears the selection and adds the given cells.</TD>
<THALIGN="left"><B>Methods inherited from class com.mxgraph.util.<AHREF="../../../com/mxgraph/util/mxEventSource.html"title="class in com.mxgraph.util">mxEventSource</A></B></TH>
<THALIGN="left"><B>Methods inherited from class java.lang.<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TRBGCOLOR="white"CLASS="TableRowColor">
<TD><CODE><AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#clone()"title="class or interface in java.lang">clone</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)"title="class or interface in java.lang">equals</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#finalize()"title="class or interface in java.lang">finalize</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#getClass()"title="class or interface in java.lang">getClass</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#hashCode()"title="class or interface in java.lang">hashCode</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notify()"title="class or interface in java.lang">notify</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notifyAll()"title="class or interface in java.lang">notifyAll</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#toString()"title="class or interface in java.lang">toString</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait()"title="class or interface in java.lang">wait</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long)"title="class or interface in java.lang">wait</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long, int)"title="class or interface in java.lang">wait</A></CODE></TD>
protected <AHREF="../../../com/mxgraph/view/mxGraph.html"title="class in com.mxgraph.view">mxGraph</A><B>graph</B></PRE>
<DL>
<DD>Reference to the enclosing graph.
<P>
<DL>
</DL>
</DL>
<HR>
<ANAME="singleSelection"><!----></A><H3>
singleSelection</H3>
<PRE>
protected boolean <B>singleSelection</B></PRE>
<DL>
<DD>Specifies if only one selected item at a time is allowed.
Default is false.
<P>
<DL>
</DL>
</DL>
<HR>
<ANAME="cells"><!----></A><H3>
cells</H3>
<PRE>
protected <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Set.html?is-external=true"title="class or interface in java.util">Set</A><<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A>><B>cells</B></PRE>
public boolean <B>isSelected</B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A> cell)</PRE>
<DL>
<DD>Returns true if the given cell is selected.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>cell</CODE> -
<DT><B>Returns:</B><DD>Returns true if the given cell is selected.</DL>
</DD>
</DL>
<HR>
<ANAME="isEmpty()"><!----></A><H3>
isEmpty</H3>
<PRE>
public boolean <B>isEmpty</B>()</PRE>
<DL>
<DD>Returns true if no cells are selected.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<ANAME="size()"><!----></A><H3>
size</H3>
<PRE>
public int <B>size</B>()</PRE>
<DL>
<DD>Returns the number of selected cells.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<ANAME="clear()"><!----></A><H3>
clear</H3>
<PRE>
public void <B>clear</B>()</PRE>
<DL>
<DD>Clears the selection.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<ANAME="getCell()"><!----></A><H3>
getCell</H3>
<PRE>
public <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A><B>getCell</B>()</PRE>
<DL>
<DD>Returns the first selected cell.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<ANAME="getCells()"><!----></A><H3>
getCells</H3>
<PRE>
public <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A>[] <B>getCells</B>()</PRE>
public void <B>setCell</B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A> cell)</PRE>
<DL>
<DD>Clears the selection and adds the given cell to the selection.
public void <B>setCells</B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A>[] cells)</PRE>
<DL>
<DD>Clears the selection and adds the given cells.
protected <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A><B>getFirstSelectableCell</B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A>[] cells)</PRE>
<DL>
<DD>Returns the first selectable cell in the given array of cells.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>cells</CODE> - Array of cells to return the first selectable cell for.
<DT><B>Returns:</B><DD>Returns the first cell that may be selected.</DL>
public void <B>addCell</B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A> cell)</PRE>
public void <B>addCells</B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A>[] cells)</PRE>
public void <B>removeCell</B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A> cell)</PRE>
public void <B>removeCells</B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A>[] cells)</PRE>
protected void <B>changeSelection</B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true"title="class or interface in java.util">Collection</A><<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A>> added,
<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true"title="class or interface in java.util">Collection</A><<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A>> removed)</PRE>
protected void <B>cellAdded</B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A> cell)</PRE>
protected void <B>cellRemoved</B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A> cell)</PRE>
<AHREF="../../../com/mxgraph/view/mxGraph.mxICellVisitor.html"title="interface in com.mxgraph.view"><B>PREV CLASS</B></A>
<AHREF="../../../com/mxgraph/view/mxGraphSelectionModel.mxSelectionChange.html"title="class in com.mxgraph.view"><B>NEXT CLASS</B></A></FONT></TD>