com.google.gwt.visualization.client
Class Selection

java.lang.Object
  extended by com.google.gwt.core.client.JavaScriptObject
      extended by com.google.gwt.visualization.client.Selection

public class Selection
extends com.google.gwt.core.client.JavaScriptObject

Selection stores information about the current selection.


Constructor Summary
protected Selection()
           
 
Method Summary
static
<E extends Visualization<?>,Selectable>
void
addSelectHandler(E viz, SelectHandler handler)
          Add a SelectHandler to an AbstractVisualization.
static Selection createCellSelection(int row, int column)
          Create a selection that specifies a row and a column.
static Selection createColumnSelection(int i)
          Create a selection with a null row.
static Selection createRowSelection(int i)
          Create a selection with a null column.
 int getColumn()
           
 int getRow()
           
static
<E extends Visualization<?>,Selectable>
com.google.gwt.core.client.JsArray<Selection>
getSelections(E viz)
          Get the Selections that are currently selected.
 boolean isCell()
           
 boolean isColumn()
           
 boolean isRow()
           
static
<E extends Visualization<?>,Selectable>
void
setSelections(E viz, com.google.gwt.core.client.JsArray<Selection> selections)
          Set the selections that will be selected.
static
<E extends Visualization<?>,Selectable>
void
triggerSelection(E viz, com.google.gwt.core.client.JsArray<Selection> selections)
          Trigger a select event.
 
Methods inherited from class com.google.gwt.core.client.JavaScriptObject
cast, createArray, createFunction, createObject, equals, hashCode, toSource, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Selection

protected Selection()
Method Detail

addSelectHandler

public static <E extends Visualization<?>,Selectable> void addSelectHandler(E viz,
                                                                            SelectHandler handler)
Add a SelectHandler to an AbstractVisualization.

Parameters:
viz - An AbstractVisualization that implements Selectable.
handler - The SelectHandler to add.

createCellSelection

public static Selection createCellSelection(int row,
                                            int column)
Create a selection that specifies a row and a column.

Parameters:
row - the row of the selection.
column - The column of the selection.
Returns:
A selection that specifies a row and a column.

createColumnSelection

public static Selection createColumnSelection(int i)
Create a selection with a null row.

Parameters:
i - The column of the selection.
Returns:
A selection with a null row.

createRowSelection

public static Selection createRowSelection(int i)
Create a selection with a null column.

Parameters:
i - The row of the selection.
Returns:
A selection with a null column.

getSelections

public static final <E extends Visualization<?>,Selectable> com.google.gwt.core.client.JsArray<Selection> getSelections(E viz)
Get the Selections that are currently selected.

Parameters:
viz - A Selectable visualization.
Returns:
A JsArray of Selections.

setSelections

public static final <E extends Visualization<?>,Selectable> void setSelections(E viz,
                                                                               com.google.gwt.core.client.JsArray<Selection> selections)
Set the selections that will be selected.

Parameters:
viz - A Selectable visualization.
selections - The Selections that will be selected.

triggerSelection

public static <E extends Visualization<?>,Selectable> void triggerSelection(E viz,
                                                                            com.google.gwt.core.client.JsArray<Selection> selections)
Trigger a select event.

Parameters:
viz - A Selectable visualization.
selections - The selections that will be selected.

getColumn

public final int getColumn()
Returns:
the column of the selection. Only call this if the selection is either a column or a cell.

getRow

public final int getRow()
Returns:
the row of the selection. Only call this if the selection is either a row or a cell.

isCell

public final boolean isCell()
Returns:
true if the selection is a cell, otherwise false.

isColumn

public final boolean isColumn()
Returns:
true if the selection is a column, otherwise false.

isRow

public final boolean isRow()
Returns:
true if the selection is a row, otherwise false.