org.das2.components.DasProgressPanel

ProgressMonitor component used throughout das2. Here's an Autoplot script demoing its operation:

{@code
monitor.setTaskSize( 100 )
monitor.started()

for i in range(100):
  if ( i>50 and monitor.isCancelled() ):
    raise Exception('cancel pressed')
  print i
  java.lang.Thread.sleep(100)
  monitor.setTaskProgress(i)

monitor.finished()
}


MSG_CANCEL_TASK


MSG_TASK_CANNOT_BE_CANCELED


PROP_STARTED


PROP_FINISHED


PROP_CANCELLED

true if the task is cancelled. Note cancelled will be set before finished.


canBeCancelled

canBeCancelled( ) → boolean

Returns:

boolean

search for examples view on GitHub view source


cancel

cancel( ) → void

Returns:

void (returns nothing)

search for examples view on GitHub view source


createComponent

createComponent( String label ) → DasProgressPanel

return a progress panel which can be embedded within a GUI. Use getComponent() to return the component which should be embedded.

Parameters

label - string label for the label.

Returns:

a new DasProgressPanel

See Also:

getComponent()


search for examples view on GitHub view source


createComponentPanel

createComponentPanel( org.das2.graph.DasCanvasComponent component, String initialMessage ) → DasProgressPanel

return a new progress panel with component indicating status for the component.

Parameters

component - the canvas component providing a context for the progress, for example a DasPlot which will load some data.
initialMessage - initial message for the monitor

Returns:

the new component

search for examples view on GitHub view source


createFramed

createFramed( String label ) → DasProgressPanel

this may be called from off the event thread, but it does assume that the event thread is free.

Parameters

label - label describing the task.

Returns:

a DasProgressPanel.

search for examples view on GitHub view source


finished

finished( ) → void

Returns:

void (returns nothing)

search for examples view on GitHub view source


getComponent

getComponent( ) → Component

returns the JPanel component.

Returns:

the JPanel component.

search for examples view on GitHub view source


getConsumer

getConsumer( ) → Exception

Returns:

java.lang.Exception

search for examples view on GitHub view source


getSource

getSource( ) → Exception

Returns:

java.lang.Exception

search for examples view on GitHub view source


getSubtaskMonitor

getSubtaskMonitor( int start, int end, String label ) → ProgressMonitor

Returns:

org.das2.util.monitor.ProgressMonitor

search for examples view on GitHub view source


getTaskProgress

getTaskProgress( ) → long

Returns:

long

search for examples view on GitHub view source


getTaskSize

getTaskSize( ) → long

Returns:

long

search for examples view on GitHub view source


isCancelled

isCancelled( ) → boolean

Returns:

boolean

search for examples view on GitHub view source


isFinished

isFinished( ) → boolean

Returns:

boolean

search for examples view on GitHub view source


isStarted

isStarted( ) → boolean

Returns:

boolean

search for examples view on GitHub view source


isValidateRoot

isValidateRoot( ) → boolean

Returning true here keeps the progress bar from forcing the whole canvas to repaint when the label of the progress bar changes.

Returns:

this always returns true

search for examples view on GitHub view source


isVisible

isVisible( ) → boolean

Returns:

boolean

search for examples view on GitHub view source


maybeCenter

maybeCenter( ProgressMonitor mon, java.awt.Component window ) → void

provide convenient code which will center DasProgressMonitors on window.

Parameters

mon - the monitor, which may be a DasProgressPanel.
window - the component about which to center the monitor.

Returns:

void (returns nothing)

search for examples view on GitHub view source


setAdditionalInfo

setAdditionalInfo( String s ) → void

Returns:

void (returns nothing)

search for examples view on GitHub view source


setContextComponent

setContextComponent( java.awt.Component window ) → void

set the component where this progress monitor is understood. This is typically the DasCanvas.

Parameters

window -

Returns:

void (returns nothing)

search for examples view on GitHub view source


setProgressMessage

setProgressMessage( String message ) → void

Returns:

void (returns nothing)

search for examples view on GitHub view source


setShowProgressRate

setShowProgressRate( boolean showProgressRate ) → void

Setter for property showProgressRate.

Parameters

showProgressRate - New value of property showProgressRate.

Returns:

void (returns nothing)

search for examples view on GitHub view source


setTaskProgress

setTaskProgress( long position ) → void

Returns:

void (returns nothing)

search for examples view on GitHub view source


setTaskSize

setTaskSize( long taskSize ) → void

Returns:

void (returns nothing)

search for examples view on GitHub view source


setVisible

setVisible( boolean visible ) → void

make the progressPanel visible or hide it. This

Parameters

visible - true if the progressPanel should be visible.

Returns:

void (returns nothing)

search for examples view on GitHub view source


started

started( ) → void

Returns:

void (returns nothing)

search for examples view on GitHub view source