com.habibsweb.commons.components.event.SelectionBoxEvent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of selectlistbox Show documentation
Show all versions of selectlistbox Show documentation
List box with multiple ways to select including a selection rectangle
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.habibsweb.commons.components.event;
import java.awt.Rectangle;
import java.util.EventObject;
/**
*
* @author David Hamilton
*/
public class SelectionBoxEvent extends EventObject {
/**
* The selection has just started
*/
public static final int SELECTION_STARTED = 0;
/**
* The size of the selection area has changed
*/
public static final int SELECTION_SIZE_CHANGED = 1;
/**
* The mouse has been released and the selection box is complete
*/
public static final int SELECTION_ENDED = 2;
private final Rectangle selectionBounds;
private final int eventType;
/**
* Constructs a new SelectionBoxSeletionEvent
*
* @param source the source component of the SelectionBox
* @param eventType the type of event
*
* -
* SELECTION_STARTED = 0
*
* -
* ELECTION_SIZE_CHANGED = 1
*
* -
* SELECTION_ENDED = 2
*
*
* @param selectionBounds the area of the selection box
*/
public SelectionBoxEvent(Object source, int eventType,
Rectangle selectionBounds) {
super(source);
this.selectionBounds = selectionBounds;
this.eventType = eventType;
}
/**
* Gets the area of the selection box
*
* @return the area of the selection box
*/
public Rectangle getSelectionBounds() {
return selectionBounds;
}
/**
* Gets the event type of this event
*
* @return the eventType
*
*
*
* -
* SELECTION_STARTED = 0
*
* -
* ELECTION_SIZE_CHANGED = 1
*
* -
* SELECTION_ENDED = 2
*
*
*/
public int getEventType() {
return eventType;
}
}