java-gnome version 4.0.7

org.gnome.gtk
Class ProgressBar

java.lang.Object
  extended by org.freedesktop.bindings.Proxy
      extended by org.gnome.glib.Object
          extended by org.gnome.gtk.Object
              extended by org.gnome.gtk.Widget
                  extended by org.gnome.gtk.ProgressBar

public class ProgressBar
extends Widget

A Widget that displays the progress of a task as a visual bar. This is principally used to give feedback to a user that things are actually happening when some computationally intensive or long running task is taking place. You can use a ProgressBar in two ways. Usually you know what fraction of a task is complete and that is what you want to display as a steadily increasing bar. On the other hand, if the total duration of the task is unknown or unpredictable, you can still indicate progress is being made by having the bar "pulse" back and forth.

Note that like most things in GTK, most of the code that actually updates the ProgressBar will not run until control is returned to the main loop. Keep that in mind if you're wondering why the bar hasn't "updated".

Since:
4.0.3
Author:
Andrew Cowie, Vreixo Formoso

Nested Class Summary
 
Nested classes/interfaces inherited from class org.gnome.gtk.Widget
Widget.BUTTON_PRESS_EVENT, Widget.BUTTON_RELEASE_EVENT, Widget.ENTER_NOTIFY_EVENT, Widget.EXPOSE_EVENT, Widget.FOCUS_IN_EVENT, Widget.FOCUS_OUT_EVENT, Widget.HIDE, Widget.KEY_PRESS_EVENT, Widget.KEY_RELEASE_EVENT, Widget.LEAVE_NOTIFY_EVENT, Widget.UNMAP_EVENT, Widget.VISIBILITY_NOTIFY_EVENT
 
Constructor Summary
ProgressBar()
          Instantiate a new ProgressBar.
 
Method Summary
 void pulse()
          Causes the ProgressBar to enter "activity mode", used to indicate that the application is making progress but in a way that can't be strictly quantized.
 void setFraction(double fraction)
          Set the fraction of the ProgressBar that shows as completed or "filled-in".
 void setText(java.lang.String text)
          Cause text to appear superimposed on the ProgressBar itself.
 
Methods inherited from class org.gnome.gtk.Widget
activate, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, getAllocation, getHasFocus, getParent, getRequisition, getToplevel, getWindow, grabFocus, hide, modifyBackground, modifyText, setCanFocus, setSensitive, setSizeRequest, setTooltipMarkup, setTooltipText, show, showAll
 
Methods inherited from class org.freedesktop.bindings.Proxy
toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProgressBar

public ProgressBar()
Instantiate a new ProgressBar.

Since:
4.0.3
Method Detail

pulse

public void pulse()
Causes the ProgressBar to enter "activity mode", used to indicate that the application is making progress but in a way that can't be strictly quantized.

An example of this is web: most URLs addressable via http:// are files of known size, and so when downloading them, a web browser can report exactly what percentage has been downloaded relative to the file size that was psssed in the initial HTTP header. Dynamic web pages, on the other hand (ie, your average PHP or JSP script), do not have a known size at the time the HTTP headers are sent, and so the web browser doesn't know ahead of time how many bytes are on the way. In this scenario, all the application can do is "pulse" the ProgressBar back and forth to indicate that traffic is continuing to arrive but that the percentage complete is not known, and that is what this method is for.

Each time this method is invoked, the a little block inside the ProgressBar is moved a small amount. You should therefore call this method fairly frequently (ie with reasonably small time intervals) to cause the effect of the block moving back and forward along the ProgressBar.

Since:
4.0.7

setFraction

public void setFraction(double fraction)
Set the fraction of the ProgressBar that shows as completed or "filled-in".

Parameters:
fraction - a value between 0.0 (not started) and 1.0 (fully complete)
Throws:
java.lang.IllegalArgumentException - If fraction is greater than 1.0 or less than 0.0
Since:
4.0.3

setText

public void setText(java.lang.String text)
Cause text to appear superimposed on the ProgressBar itself.

Parameters:
text - Use null if you want to clear any text there.
Since:
4.0.3


java-gnome