|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.EventObject
ca.macewan.lmsreporter.api.AnalysisEvent
The event type sent by Analyzer
objects to AnalysisListener
objects. The events are used to signal that an anlysis has started or finished, the level of progress
inbetween, and whether or not an error occurred. Additionally, an Analyzer
object can
request the display of a supplementary user interface element while the analysis is in progress.
Field Summary | |
static double |
PROGRESS_MAX
The maximum value of analysis progress. |
static double |
PROGRESS_MIN
The minimum value of analysis progress. |
static int |
TYPE_ERROR
The event type signaling an error occurred in the analysis. |
static int |
TYPE_FINISHED
The event type signaling the analysis finished. |
static int |
TYPE_PROGRESS
The event type signaling the level of progress of the analysis. |
static int |
TYPE_REQUEST_UI_DISPLAY
The event type signaling the analysis requests a supplementary user interface element to be displayed. |
static int |
TYPE_STARTED
The event type signaling the analysis started. |
Fields inherited from class java.util.EventObject |
source |
Constructor Summary | |
AnalysisEvent(Analyzer source)
The event constructor. |
Method Summary | |
Analyzer |
getAnalyzer()
Returns the source of the event as an Analyzer object. |
Component |
getComponent()
Gets the component to be displayed. |
Throwable |
getError()
Gets the error that occurred in the analysis. |
String |
getInfo()
Gets an information message to be displayed to the user in conjunction with this event. |
double |
getProgress()
Gets the level of progress for the analysis. |
int |
getType()
Gets the type of this event. |
void |
setComponent(Component c)
Sets the component to be displayed when sending the event as type TYPE_REQUEST_UI_DISPLAY . |
void |
setError(Throwable t)
Sets the error that occurred in the analysis. |
void |
setInfo(String information)
Sets an information message to be displayed to the user in conjunction with this event. |
void |
setProgress(double progress)
Sets the level of progress for the analysis. |
void |
setType(int type)
Sets the event type. |
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 |
Field Detail |
public static final int TYPE_STARTED
public static final int TYPE_FINISHED
public static final int TYPE_PROGRESS
public static final int TYPE_ERROR
public static final int TYPE_REQUEST_UI_DISPLAY
public static final double PROGRESS_MIN
public static final double PROGRESS_MAX
Constructor Detail |
public AnalysisEvent(Analyzer source)
source
- The Analyzer
object generating the event.Method Detail |
public Analyzer getAnalyzer()
Analyzer
object.
Analyzer
object that generated the event.public void setType(int type)
type
- The event type. Should be one of:
public int getType()
public void setProgress(double progress)
progress
- A double
between PROGRESS_MIN
and
PROGRESS_MAX
.public double getProgress()
double
between PROGRESS_MIN
and
PROGRESS_MAX
.public void setError(Throwable t)
t
- The error, as a Throwable
object. Typically
this should be a checked exception (as opposed to an error or a runtime exception) but the
event class makes no restrictions.public Throwable getError()
Throwable
object. Typically
this should be a checked exception (as opposed to an error or a runtime exception) but the
event class makes no restrictions.public void setInfo(String information)
information
- The message to be set.public String getInfo()
public void setComponent(Component c)
TYPE_REQUEST_UI_DISPLAY
.
c
- The component to be displayed. All the application does is show a
javax.swing.JOptionPane
dialog with your component
as the message. Any user interaction (other than closing the dialog) has to be handled by
your own listeners. The component is only guaranteed to be retained as long as the event type
is equal to TYPE_REQUEST_UI_DISPLAY
.public Component getComponent()
TYPE_REQUEST_UI_DISPLAY
, this method will likely return
null
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |