/*
 * 作成日: 2007/08/26
 */
package net.sourceforge.swingx.jspread;

import java.util.EventObject;

import net.sourceforge.swingx.jspread.JSpreadSheet.CurrentFocus;

public class JSpreadSelectionEvent extends EventObject {
	// getter/setterを定義する代わりに、finalにして、変更不可能なフィールドとする。
	public final int prevFocusRow;
	public final int prevFocusCol;
	public final int prevCurRow;
	public final int prevCurCol;
	public final int nextFocusRow;
	public final int nextFocusCol;
	public final int nextCurRow;
	public final int nextCurCol;
	
	public JSpreadSelectionEvent(Object source,
			int prevFocusRow, int prevFocusCol, int prevCurRow, int prevCurCol,
			int nextFocusRow, int nextFocusCol, int nextCurRow, int nextCurCol) {
		super(source);
		this.prevFocusRow = prevFocusRow;
		this.prevFocusCol = prevFocusCol;
		this.prevCurRow = prevCurRow;
		this.prevCurCol = prevCurCol;
		this.nextFocusRow = nextFocusRow;
		this.nextFocusCol = nextFocusCol;
		this.nextCurRow = nextCurRow;
		this.nextCurCol = nextCurCol;
	}
	public JSpreadSelectionEvent(Object source,
			CurrentFocus prev, CurrentFocus next) {
		super(source);
		this.prevFocusRow = prev.focusRow;
		this.prevFocusCol = prev.focusCol;
		this.prevCurRow = prev.curRow;
		this.prevCurCol = prev.curCol;
		this.nextFocusRow = next.focusRow;
		this.nextFocusCol = next.focusCol;
		this.nextCurRow = next.curRow;
		this.nextCurCol = next.curCol;
	}
}
