|
java-gnome version 4.0.19 | ||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Objectorg.freedesktop.bindings.Pointer
org.freedesktop.bindings.Proxy
org.gnome.glib.Object
org.gnome.gtk.Object
org.gnome.gtk.Widget
org.gnome.gtk.ProgressBar
public class ProgressBar
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".
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.gnome.gtk.Widget |
---|
Widget.ButtonPressEvent, Widget.ButtonReleaseEvent, Widget.EnterNotifyEvent, Widget.ExposeEvent, Widget.FocusInEvent, Widget.FocusOutEvent, Widget.Hide, Widget.KeyPressEvent, Widget.KeyReleaseEvent, Widget.LeaveNotifyEvent, Widget.MapEvent, Widget.MotionNotifyEvent, Widget.PopupMenu, Widget.ScrollEvent, Widget.UnmapEvent, Widget.VisibilityNotifyEvent |
Nested classes/interfaces inherited from class org.gnome.gtk.Object |
---|
Object.Destroy |
Constructor Summary | |
---|---|
ProgressBar()
Instantiate a new ProgressBar. |
Method Summary | |
---|---|
double |
getFraction()
Get the current progress bar fraction |
ProgressBarOrientation |
getOrientation()
Get orientation currently in effect in this ProgressBar |
double |
getPulseStep()
Get the current progress bar pulse step |
String |
getText()
Getting the text superimposed on the ProgressBar itself. |
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 |
setOrientation(ProgressBarOrientation orientation)
Set orientation of this ProgressBar |
void |
setPulseStep(double fraction)
Set the progress bar pulse step. |
void |
setText(String text)
Cause text to appear superimposed on the ProgressBar itself. |
Methods inherited from class org.gnome.gtk.Widget |
---|
activate, addEvents, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, getAllocation, getCanDefault, getCanFocus, getHasFocus, getName, getParent, getRequisition, getSensitive, getToplevel, getWindow, grabAdd, grabDefault, grabFocus, grabRemove, hide, isSensitive, modifyBackground, modifyBase, modifyFont, modifyText, queueDraw, queueDrawArea, realize, setCanDefault, setCanFocus, setColormap, setEvents, setName, setSensitive, setSizeRequest, setTooltipMarkup, setTooltipText, show, showAll |
Methods inherited from class org.gnome.gtk.Object |
---|
connect, destroy |
Methods inherited from class org.freedesktop.bindings.Pointer |
---|
toString |
Methods inherited from class Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ProgressBar()
Method Detail |
---|
public double getFraction()
public ProgressBarOrientation getOrientation()
public double getPulseStep()
public String getText()
public void pulse()
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.
public void setFraction(double fraction)
fraction
- a value between 0.0 (not started) and 1.0 (fully complete)
IllegalArgumentException
- If fraction is greater than 1.0 or less than 0.0public void setOrientation(ProgressBarOrientation orientation)
public void setPulseStep(double fraction)
pulse()
; is called.
fraction
- a value between 0.0 and 1.0
IllegalArgumentException
- If fraction is greater than 1.0 or less than 0.0public void setText(String text)
text
- Use null
if you want to clear any text there.
|
![]() java-gnome |
||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |