## 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.

## addPropertyChangeListener

addPropertyChangeListener( java.beans.PropertyChangeListener listener ) → void

### Parameters

listener - a PropertyChangeListener

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]
addPropertyChangeListener( String propertyName, java.beans.PropertyChangeListener listener ) → void [view source]

## canBeCancelled

canBeCancelled( ) → boolean

### Returns:

boolean
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## cancel

cancel( ) → void

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## createComponent

createComponent( String label ) → org.das2.components.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 on old javadoc] [view source]

## createComponentPanel

createComponentPanel( org.das2.graph.DasCanvasComponent component, String initialMessage ) → org.das2.components.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 on old javadoc] [view source]

## createComponentPanel

createComponentPanel( org.das2.graph.DasCanvas canvas, String initialMessage ) → org.das2.components.DasProgressPanel

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

### Parameters

canvas - the canvas client providing a context for the task.
initialMessage - initial message for the monitor

### Returns:

an org.das2.components.DasProgressPanel
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## createFramed

createFramed( String label ) → org.das2.components.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 on old javadoc] [view source]

## createFramed

createFramed( java.awt.Window parent, String label ) → org.das2.components.DasProgressPanel

creates a dialog object that follows a parent

### Parameters

parent - the Window that owns this popup gui.
label - label describing the task.

### Returns:

a DasProgressPanel.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## finished

finished( ) → void

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getComponent

getComponent( ) → java.awt.Component

returns the JPanel component.

### Returns:

the JPanel component.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getConsumer

getConsumer( ) → java.lang.Exception

### Returns:

java.lang.Exception
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getLabel

getLabel( ) → String

### Returns:

java.lang.String
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getSource

getSource( ) → java.lang.Exception

### Returns:

java.lang.Exception
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getSubtaskMonitor

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

### Parameters

start - an int
end - an int
label - a String

### Returns:

org.das2.util.monitor.ProgressMonitor
[search for examples] [view on GitHub] [view on old javadoc] [view source]
getSubtaskMonitor( String label ) → ProgressMonitor [view source]

## getTaskProgress

getTaskProgress( ) → long

### Returns:

long
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getTaskSize

getTaskSize( ) → long

### Returns:

long
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## isCancelled

isCancelled( ) → boolean

### Returns:

boolean
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## isFinished

isFinished( ) → boolean

### Returns:

boolean
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## isStarted

isStarted( ) → boolean

### Returns:

boolean
[search for examples] [view on GitHub] [view on old javadoc] [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 on old javadoc] [view source]

## isVisible

isVisible( ) → boolean

### Returns:

boolean
[search for examples] [view on GitHub] [view on old javadoc] [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 on old javadoc] [view source]

## removePropertyChangeListener

removePropertyChangeListener( java.beans.PropertyChangeListener listener ) → void

### Parameters

listener - a PropertyChangeListener

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]
removePropertyChangeListener( String propertyName, java.beans.PropertyChangeListener listener ) → void [view source]

## setAdditionalInfo

setAdditionalInfo( String s ) → void

### Parameters

s - a String

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [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 - a Component

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## setLabel

setLabel( String label ) → void

### Parameters

label - a String

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## setProgressMessage

setProgressMessage( String message ) → void

### Parameters

message - a String

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [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 on old javadoc] [view source]

## setTaskProgress

setTaskProgress( long position ) → void

### Parameters

position - a long

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## setTaskSize

setTaskSize( long taskSize ) → void

### Parameters

taskSize - a long

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [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 on old javadoc] [view source]

## started

started( ) → void

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## toString

toString( ) → String

### Returns:

java.lang.String
[search for examples] [view on GitHub] [view on old javadoc] [view source]