public abstract class Scheduler extends Object
isActive
method returns true at both scheduling time and run time.Constructor and Description |
---|
Scheduler(JComponent parent)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
JComponent |
getParent()
Returns the component specified for this scheduler at construction time.
|
abstract boolean |
isActive()
Indicates whether this object is considered active.
|
void |
schedule(Runnable runnable)
Schedules a runnable to be performed later on the Event Dispatch Thread,
as long as this object is considered active.
|
void |
scheduleError(String title,
Throwable error)
Schedules display of an ErrorDialog error message.
|
void |
scheduleMemoryError(OutOfMemoryError error)
Schedules display of an OutOfMemoryError.
|
void |
scheduleMessage(String message,
String title,
int messageType)
Schedules display of a JOptionPane message.
|
public Scheduler(JComponent parent)
parent
- parent component used for parenting popup windows;
may be nullpublic abstract boolean isActive()
The expectation is that this method starts off by returning true, but may eventually transition to returning false. Once that has happened, it will not return true again.
public void schedule(Runnable runnable)
isActive
returns false either when this method is
called, or when the runnable comes to be executed on the EDT,
nothing is done.
This method may be called on any thread.
runnable
- action to run on the EDT if still activepublic void scheduleMessage(String message, String title, int messageType)
This method may be called on any thread.
message
- the Object to displaytitle
- the title string for the dialogmessageType
- the type of message to be displayed,
one of the JOptionPane.*_MESSAGE constantsJOptionPane
public void scheduleError(String title, Throwable error)
This method may be called on any thread.
title
- window titleerror
- throwableErrorDialog
public void scheduleMemoryError(OutOfMemoryError error)
error
- throwableTopcatUtils.memoryError(java.lang.OutOfMemoryError)
public JComponent getParent()
Copyright © 2003-2025 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.