Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.greenstone.gatherer.gui
Class GProgressBar  view GProgressBar download GProgressBar.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byorg.greenstone.gatherer.gui.GProgressBar
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class GProgressBar
extends javax.swing.JPanel
implements java.awt.event.ActionListener


Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 javax.swing.JButton action
           
private  java.awt.Dimension bar_size
           
 javax.swing.JButton cancel
           
private  javax.swing.JPanel center_pane
           
private  int current_action
           
private  javax.swing.JLabel current_status
           
private  java.lang.String current_url
           
private  int err_count
           
private  int file_count
           
private  long file_size
           
private  java.lang.String initial_url
           
private  javax.swing.JPanel inner_pane
           
private  javax.swing.JLabel main_status
           
private  org.greenstone.gatherer.collection.Job owner
           
private  javax.swing.JProgressBar progress
           
private  javax.swing.JLabel results_status
           
private  boolean simple
           
private  javax.swing.JLabel status
           
private  int total_count
           
private  long total_size
           
private  int warning_count
           
 
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.Container
 
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
GProgressBar(org.greenstone.gatherer.collection.Job owner, java.lang.String initial_url, boolean simple)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          This method is invoked when an action occurs.
 void addDownload(java.lang.String url)
          This method is called when a new download is begun.
 void downloadComplete()
          When the download of the current url is completed, this method is called to enlighten the GProgressBar of this fact.
 void downloadFailed()
           
 void downloadWarning()
           
 java.awt.Dimension getPreferredSize()
          Get the component's preferred size.
 void increaseFileCount()
          When a link to be downloaded is located, the increaseTotalCount method is called.
 void mirrorBegun(boolean reset, boolean simple)
          When a mirroring task is first initiated this function is called to set initial values for the variables if necessary and to fiddle visual components such as the tool tip etc.
 void mirrorComplete()
          Once a mirroring task is complete, is the Job returns from the native call but the status is still running, then this method is called to once again tinker with the pritty visual components.
private  void refresh()
          Causes the two labels associated with this GProgressBar object to update, thus reflecting the progression of the download.
 void updateProgress(long current, long expected)
          When called this method updates the GProgressBar to reflect the ammount of the current file downloaded.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, swapComponents, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

simple

private boolean simple

bar_size

private java.awt.Dimension bar_size

current_action

private int current_action

err_count

private int err_count

file_count

private int file_count

total_count

private int total_count

warning_count

private int warning_count

current_status

private javax.swing.JLabel current_status

main_status

private javax.swing.JLabel main_status

results_status

private javax.swing.JLabel results_status

status

private javax.swing.JLabel status

center_pane

private javax.swing.JPanel center_pane

inner_pane

private javax.swing.JPanel inner_pane

progress

private javax.swing.JProgressBar progress

file_size

private long file_size

total_size

private long total_size

current_url

private java.lang.String current_url

initial_url

private java.lang.String initial_url

owner

private org.greenstone.gatherer.collection.Job owner

action

public javax.swing.JButton action

cancel

public javax.swing.JButton cancel
Constructor Detail

GProgressBar

public GProgressBar(org.greenstone.gatherer.collection.Job owner,
                    java.lang.String initial_url,
                    boolean simple)
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
Description copied from interface: java.awt.event.ActionListener
This method is invoked when an action occurs.

Specified by:
actionPerformed in interface java.awt.event.ActionListener

addDownload

public void addDownload(java.lang.String url)
This method is called when a new download is begun. The details of the download are updated and a new JProgressBar assigned to track the download.


downloadComplete

public void downloadComplete()
When the download of the current url is completed, this method is called to enlighten the GProgressBar of this fact.


downloadFailed

public void downloadFailed()

downloadWarning

public void downloadWarning()

getPreferredSize

public java.awt.Dimension getPreferredSize()
Description copied from class: javax.swing.JComponent
Get the component's preferred size. If the JComponent.preferredSize>JComponent.preferredSize 55 property has been explicitly set, it is returned. If the JComponent.preferredSize>JComponent.preferredSize 55 property has not been set but the JComponent.ui>JComponent.ui 55 property has been, the result of ComponentUI.getPreferredSize(javax.swing.JComponent)>ComponentUI.getPreferredSize(javax.swing.JComponent) 55 is returned. If neither property has been set, the result of Container.getPreferredSize()>Container.getPreferredSize() 55 is returned.


increaseFileCount

public void increaseFileCount()
When a link to be downloaded is located, the increaseTotalCount method is called. In this way the total count shows the most accurate remaining number of files to be downloaded.


mirrorBegun

public void mirrorBegun(boolean reset,
                        boolean simple)
When a mirroring task is first initiated this function is called to set initial values for the variables if necessary and to fiddle visual components such as the tool tip etc.


mirrorComplete

public void mirrorComplete()
Once a mirroring task is complete, is the Job returns from the native call but the status is still running, then this method is called to once again tinker with the pritty visual components.


updateProgress

public void updateProgress(long current,
                           long expected)
When called this method updates the GProgressBar to reflect the ammount of the current file downloaded.


refresh

private void refresh()
Causes the two labels associated with this GProgressBar object to update, thus reflecting the progression of the download. This method is called by any of the other public setter methods in this class.