chemaxon.alchemist.commonpages
Class ProgressPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by chemaxon.alchemist.AlchemistPage
                      extended by chemaxon.alchemist.commonpages.ProgressPanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class ProgressPanel
extends AlchemistPage

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static java.lang.String CLOSE_RESULTS
           
protected  AlchemistTask currentTask
          current task working background
static java.lang.String DEFAULT_PROGRESS_CAPTION
          default progress caption
static int DELAY
           
static java.lang.String SHOW_RESULTS
          result button captions
static int STATE_PROGRESS
           
static int STATE_RESULT
           
static int STATE_SUMMARY
          panel states
protected  AlchemistTask task
          super task
 
Fields inherited from class chemaxon.alchemist.AlchemistPage
PROPERTY_KEY_MOVE_NEXT
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ProgressPanel(javax.swing.Action doneAction, AlchemistTask task)
          Constructor.
 
Method Summary
 void addProgressCustomComponent(javax.swing.JComponent component)
          Adds a JComponent after the last item in the progress panel for custom progress actions (For example show current operations)
 void enterPage(AlchemistState state)
          This method is called when this page becomes the active.
protected  javax.swing.JPanel getProcessingPanel()
          This method initializes pnlProgress
protected  javax.swing.JProgressBar getProgressBar()
          This method initializes progressBar
protected  javax.swing.JButton getResultButton()
           
 javax.swing.JPanel getResultPanel()
          This method initializes jPanel
 javax.swing.JScrollPane getResultScrollPanel()
          This method initializes jScrollPane
protected  AlchemistMoleculeView getResultView()
           
protected  void initialize()
          This method initializes this
 boolean isCorrect()
          Returns if the current state of the form is correct.
 void leavePage(AlchemistState state)
          This method is called before this bage becomes inactive.
 void refreshInformations()
          Refresh the panel
 void runTask()
          Starts the task
 void runTask(int priority)
          Starts the task with given priority
 void setCaption(java.lang.String caption, int state)
          Sets the caption of the panel for a state
 void setMessage(java.lang.String message, int state)
          Sets the message of the panel for a state
 void setOutputFilePath(java.lang.String outputFilePath)
          Sets the path of the output file
 void setPanelState(int state)
          Sets the panel state.
protected  void setProgressValue(int percent)
          Sets the progress bar value to the given percentage
 void setResultCustomPanel(javax.swing.JPanel panel)
          Sets a JPanel component to the bottom of the results panel for custom result actions (For example a panel with an 'Open Resulst' JButton)
protected  void startRefresh()
          Invoked at task start.
 
Methods inherited from class chemaxon.alchemist.AlchemistPage
getGlassPane, getNotifier, hideProgressBar, isBottomTextVisible, isPageEnabled, isTopTextVisible, performLeavePage, setBottomText, setBottomTextVisible, setGlassPane, setPageEnabled, setTopText, setTopTextVisible, showProgressBar, showProgressBar, updateProgressBar, updateProgressBar
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STATE_SUMMARY

public static final int STATE_SUMMARY
panel states

See Also:
Constant Field Values

STATE_PROGRESS

public static final int STATE_PROGRESS
See Also:
Constant Field Values

STATE_RESULT

public static final int STATE_RESULT
See Also:
Constant Field Values

DEFAULT_PROGRESS_CAPTION

public static final java.lang.String DEFAULT_PROGRESS_CAPTION
default progress caption

See Also:
Constant Field Values

task

protected final AlchemistTask task
super task


currentTask

protected AlchemistTask currentTask
current task working background


DELAY

public static final int DELAY
See Also:
Constant Field Values

SHOW_RESULTS

public static final java.lang.String SHOW_RESULTS
result button captions

See Also:
Constant Field Values

CLOSE_RESULTS

public static final java.lang.String CLOSE_RESULTS
See Also:
Constant Field Values
Constructor Detail

ProgressPanel

public ProgressPanel(javax.swing.Action doneAction,
                     AlchemistTask task)
Constructor. Creates a new ProgressPanel.

Parameters:
doneAction - is the action invoked when task is done
task - is the AlchemistTask doing the job
Method Detail

initialize

protected void initialize()
This method initializes this


runTask

public void runTask()
Starts the task


runTask

public void runTask(int priority)
Starts the task with given priority

Parameters:
priority - is the task priority

startRefresh

protected void startRefresh()
Invoked at task start. Sets the progress bar values


isCorrect

public boolean isCorrect()
Description copied from class: AlchemistPage
Returns if the current state of the form is correct.

Specified by:
isCorrect in class AlchemistPage
Returns:
boolean

enterPage

public void enterPage(AlchemistState state)
Description copied from class: AlchemistPage
This method is called when this page becomes the active. Initializes the page depending on parameters contained in state object.

Specified by:
enterPage in class AlchemistPage
Parameters:
state - is the state object holding workflow data

leavePage

public void leavePage(AlchemistState state)
Description copied from class: AlchemistPage
This method is called before this bage becomes inactive. Saves the page state into the state object

Specified by:
leavePage in class AlchemistPage
Parameters:
state - is the state object holding workflow data

getProcessingPanel

protected javax.swing.JPanel getProcessingPanel()
This method initializes pnlProgress

Returns:
javax.swing.JPanel

getProgressBar

protected javax.swing.JProgressBar getProgressBar()
This method initializes progressBar

Returns:
javax.swing.JProgressBar

setPanelState

public void setPanelState(int state)
Sets the panel state.

Parameters:
state - can be one of STATE_SUMMARY, STATE_PROGRESS or STATE_RESULT

setCaption

public void setCaption(java.lang.String caption,
                       int state)
Sets the caption of the panel for a state

Parameters:
caption - is the new caption
state - is the state, can be one of STATE_SUMMARY, STATE_PROGRESS or STATE_RESULT

setMessage

public void setMessage(java.lang.String message,
                       int state)
Sets the message of the panel for a state

Parameters:
message - is the new message
state - is the state, can be one of STATE_SUMMARY, STATE_PROGRESS or STATE_RESULT

setProgressValue

protected void setProgressValue(int percent)
Sets the progress bar value to the given percentage

Parameters:
percent -

getResultPanel

public javax.swing.JPanel getResultPanel()
This method initializes jPanel

Returns:
javax.swing.JPanel

getResultScrollPanel

public javax.swing.JScrollPane getResultScrollPanel()
This method initializes jScrollPane

Returns:
javax.swing.JScrollPane

setResultCustomPanel

public void setResultCustomPanel(javax.swing.JPanel panel)
Sets a JPanel component to the bottom of the results panel for custom result actions (For example a panel with an 'Open Resulst' JButton)

Parameters:
panel - is the custom panel to set

addProgressCustomComponent

public void addProgressCustomComponent(javax.swing.JComponent component)
Adds a JComponent after the last item in the progress panel for custom progress actions (For example show current operations)

Parameters:
component - is the custom component to add

refreshInformations

public void refreshInformations()
Refresh the panel


getResultButton

protected javax.swing.JButton getResultButton()

getResultView

protected AlchemistMoleculeView getResultView()

setOutputFilePath

public void setOutputFilePath(java.lang.String outputFilePath)
Sets the path of the output file

Parameters:
outputFilePath -