com.bigzip.plugin.support.ui
Class StatusBarHelper

java.lang.Object
  |
  +--com.bigzip.plugin.support.ui.StatusBarHelper

public final class StatusBarHelper
extends java.lang.Object

StatusBarHelper gives control over the status bar located on bottom of the GUI. It allows for changing modes and information within the status bar.

Further,access is given to the right hand side corner so that a JComponent object may be placed into it. This typically is a button so that an actionListener may be attached to it ad allow for aborting and so on.

When BiGZiP is first executed, the status bar enters into the information mode by default, the developer has no access to this mode. Once an acrchive is successfuly opened, the status bar the upgrades to Table Mode and once again the developer does not have access to this either. The table mode has the ArchiveProperties action tied to it so that by clicking on the component in the right hand corner fires the "Properties" menu item.

Once the Open or New action has been instantiated, the developer has the ability to change the status bar mode to either "Information Mode" or "Progress Mode" and naturally, return to the default mode, being "Table Mode".

As a different mode is called, the previous mode is pushed onto a stack. Once the current mode is exited, the previous mode is popped off the stack and restored.


Constructor Summary
StatusBarHelper()
           
 
Method Summary
static javax.swing.JButton createDefaultAbortButton()
          Creates a default button with an abort image and tool tip that can be placed into the status bar.
static javax.swing.JButton createDefaultInfoButton()
          Creates a default button with an information image and tool tip that can be placed into the status bar.
static void enterInformationMode(java.lang.String text)
          Replaces the current mode with an Information Style status bar.
static void enterInformationMode(java.lang.String text, javax.swing.JComponent component)
          Replaces the current mode with an Information Style status bar.
static void enterProgressMode()
          Replaces the current mode with a Progress Style status bar.
static void enterProgressMode(float maxProgressValue)
          Replaces the current mode with a Progress Style status bar.
static void enterProgressMode(float maxProgressValue, javax.swing.JComponent component)
          Replaces the current mode with a Progress Style status bar.
static void enterProgressMode(int maxProgressValue)
          Replaces the current mode with a Progress Style status bar.
static void enterProgressMode(int maxProgressValue, javax.swing.JComponent component)
          Replaces the current mode with a Progress Style status bar.
static void exitMode()
          Ends the current status mode session and restores the previous session.
static void incrementProgressIndicatorValue()
          Increments the progress bar by 1.
static void incrementProgressIndicatorValue(int offset)
          Increments the progress bar by a specified value.
static void ReturnToTableMode()
          Ends all sessions stored in the buffer and returns to the original mode, which is the Table Mode.
static void setFrame(com.bigzip.ui.BiGZiPFrame frame)
          Used by BiGZiP's GUI subsystem.
static void setInformationText(java.lang.String text)
          Sets the text with in the Information status bar.
static void setProgressIndicatorLargeLimit(float limit)
          Sets the maximum value of the progress bar.
static void setProgressIndicatorLargeValue(float value)
          Sets the current value of the progress bar.
static void setProgressIndicatorText(java.lang.String text)
          Sets the text within the actual prograss bar component.
static void setProgressIndicatorValue(int value)
          Sets the progress bar to the specified value.
static void setProgressText(java.lang.String text)
          Sets the text field on the left side of the status bar to the specified text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatusBarHelper

public StatusBarHelper()
Method Detail

enterInformationMode

public static void enterInformationMode(java.lang.String text)
Replaces the current mode with an Information Style status bar. This consists of one text field occupying the entire bar and an optional component on the right.
Parameters:
text - the string to occupy the text field.

enterInformationMode

public static void enterInformationMode(java.lang.String text,
                                        javax.swing.JComponent component)
Replaces the current mode with an Information Style status bar. This consists of one text field occupying the entire bar and an optional component on the right.

Note that the current mode will be stored in a session buffer before the new mode is entered.

Parameters:
text - the string to occupy the text field in the status bar.
component - the Swing Component to occupy the right hand corner.

setInformationText

public static void setInformationText(java.lang.String text)
Sets the text with in the Information status bar.

This will only work when the status bar has entered into the Information Mode.

Parameters:
text - the string to occupy the text field.

enterProgressMode

public static void enterProgressMode()
Replaces the current mode with a Progress Style status bar. This consists of a text field occupying the right left side of the bar and a progress bar on the right, both are set to be equal in width. An ptional component can also be set on the right hand corner.

This method assume the maximum limit of the bar is 100.

Note that the current mode will be stored in a session buffer before the new mode is entered.


enterProgressMode

public static void enterProgressMode(int maxProgressValue)
Replaces the current mode with a Progress Style status bar. This consists of a text field occupying the right left side of the bar and a progress bar on the right, both are set to be equal in width. An ptional component can also be set on the right hand corner.

Note that the current mode will be stored in a session buffer before the new mode is entered.

Parameters:
maxProgressValue - the maximum limit of the progress bar.

enterProgressMode

public static void enterProgressMode(int maxProgressValue,
                                     javax.swing.JComponent component)
Replaces the current mode with a Progress Style status bar. This consists of a text field occupying the right left side of the bar and a progress bar on the right, both are set to be equal in width. An ptional component can also be set on the right hand corner.

Note that the current mode will be stored in a session buffer before the new mode is entered.

Parameters:
maxProgressValue - the maximum limit of the progress bar.
component - the Swing Component to occupy the right hand corner.

enterProgressMode

public static void enterProgressMode(float maxProgressValue)
Replaces the current mode with a Progress Style status bar. This consists of a text field occupying the right left side of the bar and a progress bar on the right, both are set to be equal in width. An ptional component can also be set on the right hand corner.

Note that the current mode will be stored in a session buffer before the new mode is entered.

Parameters:
maxProgressValue - the maximum limit of the progress bar. this is to allow for either decimals or values large than the capacity of an int.

enterProgressMode

public static void enterProgressMode(float maxProgressValue,
                                     javax.swing.JComponent component)
Replaces the current mode with a Progress Style status bar. This consists of a text field occupying the right left side of the bar and a progress bar on the right, both are set to be equal in width. An ptional component can also be set on the right hand corner.

Note that the current mode will be stored in a session buffer before the new mode is entered.

Parameters:
maxProgressValue - the maximum limit of the progress bar. this is to allow for either decimals or values large than the capacity of an int.
component - the Swing Component to occupy the right hand corner.

setProgressIndicatorText

public static void setProgressIndicatorText(java.lang.String text)
Sets the text within the actual prograss bar component.

This will only work when the status bar has entered into the Progress Mode.

Parameters:
text - the string to occupy the progress bar in the status bar.

incrementProgressIndicatorValue

public static void incrementProgressIndicatorValue()
Increments the progress bar by 1.

This will only work when the status bar has entered into the Progress Mode.


incrementProgressIndicatorValue

public static void incrementProgressIndicatorValue(int offset)
Increments the progress bar by a specified value.

This will only work when the status bar has entered into the Progress Mode.

Parameters:
offset - the value to increment current vlaue by.

setProgressIndicatorValue

public static void setProgressIndicatorValue(int value)
Sets the progress bar to the specified value.

This will only work when the status bar has entered into the Progress Mode.

Parameters:
value - the value to set the progress bar to.

setProgressIndicatorLargeLimit

public static void setProgressIndicatorLargeLimit(float limit)
Sets the maximum value of the progress bar. This should be used in instances where the maximum limit cannot be contained in an integer or the value to increment cannot be passed as an integer.

This will only work when the status bar has entered into the Progress Mode.

Parameters:
limit - the maximum value of the progress.

setProgressIndicatorLargeValue

public static void setProgressIndicatorLargeValue(float value)
Sets the current value of the progress bar. This should be used in instances where the maximum limit cannot be contained in an integer or the value to increment cannot be passed as an integer.

This will only work when the status bar has entered into the Progress Mode.

Parameters:
value - the value to set the progress bar to.

setProgressText

public static void setProgressText(java.lang.String text)
Sets the text field on the left side of the status bar to the specified text.

This will only work when the status bar has entered into the Progress Mode.

Parameters:
text - the string to occupy the text field.

exitMode

public static void exitMode()
Ends the current status mode session and restores the previous session. This can be called several times if more than one session exhists in the session buffer.

ReturnToTableMode

public static void ReturnToTableMode()
Ends all sessions stored in the buffer and returns to the original mode, which is the Table Mode.

setFrame

public static void setFrame(com.bigzip.ui.BiGZiPFrame frame)
Used by BiGZiP's GUI subsystem.
Parameters:
frame - parent frame.

createDefaultAbortButton

public static javax.swing.JButton createDefaultAbortButton()
Creates a default button with an abort image and tool tip that can be placed into the status bar.
Returns:
BiGZiP default abort button.

createDefaultInfoButton

public static javax.swing.JButton createDefaultInfoButton()
Creates a default button with an information image and tool tip that can be placed into the status bar.
Returns:
BiGZiP default information button.