csheets.ui.ctrl
Class SelectionEvent

java.lang.Object
  extended by java.util.EventObject
      extended by csheets.ui.ctrl.SelectionEvent
All Implemented Interfaces:
Serializable

public class SelectionEvent
extends EventObject

A selection application event is used to notify interested parties that a new active workbook, spreadsheet and/or cell is selected.

Author:
Einar Pehrson
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
SelectionEvent(Object source, Workbook workbook, Spreadsheet spreadsheet, Cell cell, Workbook prevWorkbook, Spreadsheet prevSpreadsheet, Cell prevCell)
          Creates a new selection event.
 
Method Summary
 Cell getCell()
          Returns the active cell.
 Cell getPreviousCell()
          Returns the previous active cell.
 Spreadsheet getPreviousSpreadsheet()
          Returns the previous active spreadsheet.
 Workbook getPreviousWorkbook()
          Returns the previous active workbook.
 Spreadsheet getSpreadsheet()
          Returns the active spreadsheet.
 Workbook getWorkbook()
          Returns the active workbook.
 boolean isCellChanged()
          Returns whether the event was caused by the active cell being changed
 boolean isSpreadsheetChanged()
          Returns whether the event was caused by the active spreadsheet being changed
 boolean isWorkbookChanged()
          Returns whether the event was caused by the active workbook being changed
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SelectionEvent

public SelectionEvent(Object source,
                      Workbook workbook,
                      Spreadsheet spreadsheet,
                      Cell cell,
                      Workbook prevWorkbook,
                      Spreadsheet prevSpreadsheet,
                      Cell prevCell)
Creates a new selection event.

Parameters:
source - the source of the event
workbook - the active workbook
spreadsheet - the active spreadsheet
cell - the active cell
prevWorkbook - the previous active workbook (or the same as the new one if it didn't change)
prevSpreadsheet - the previous active spreadsheet (or the same as the new one if it didn't change)
prevCell - the previous active cell
Method Detail

getWorkbook

public Workbook getWorkbook()
Returns the active workbook.

Returns:
the active workbook

getSpreadsheet

public Spreadsheet getSpreadsheet()
Returns the active spreadsheet.

Returns:
the active spreadsheet

getCell

public Cell getCell()
Returns the active cell.

Returns:
the active cell

getPreviousWorkbook

public Workbook getPreviousWorkbook()
Returns the previous active workbook.

Returns:
the previous active workbook (or the same as the new one if it didn't change)

getPreviousSpreadsheet

public Spreadsheet getPreviousSpreadsheet()
Returns the previous active spreadsheet.

Returns:
the previous active spreadsheet (or the same as the new one if it didn't change)

getPreviousCell

public Cell getPreviousCell()
Returns the previous active cell.

Returns:
the previous active cell

isWorkbookChanged

public boolean isWorkbookChanged()
Returns whether the event was caused by the active workbook being changed

Returns:
true if the active workbook and the previous active workbook are not the same

isSpreadsheetChanged

public boolean isSpreadsheetChanged()
Returns whether the event was caused by the active spreadsheet being changed

Returns:
true if the active spreadsheet and the previous active spreadsheet are not the same

isCellChanged

public boolean isCellChanged()
Returns whether the event was caused by the active cell being changed

Returns:
true if the active cell and the previous active cell are not the same