|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.fhg.igd.ui.ProgressIterator
This iterator wraps around an iterator and illustrates the
progress by means of a ProgressBar
.
Field Summary | |
protected AnimatedIcon |
anim_
The animated icon. |
static String |
ANIM_NAME
The name of the animation that is played. |
static String |
AUDIO_NAME
The name of the audio file that is played once the process finished. |
private int |
current_
The current item number. |
protected JFrame |
frame_
The frame that holds the progress bar. |
private Iterator |
i_
The wrapped iterator. |
private int |
max_
The max number of items. |
protected JProgressBar |
pbar_
The progress bar that shows the progress of this Iterator . |
protected String |
title_
The title of the frame that shows the progress bar. |
Constructor Summary | |
ProgressIterator(Iterator i,
String title)
Creates an iterator that wraps around the given iterator and illustrates the progress by means of a
ProgressBar . |
Method Summary | |
protected void |
advance()
|
protected void |
close()
|
int |
getMaximum()
Returns the maximum number of elements or -1 if this Iterator is not yet properly initialized. |
boolean |
hasNext()
|
protected void |
init()
|
static void |
main(String[] argv)
|
Object |
next()
|
void |
remove()
|
void |
setMaximum(int max)
Sets the max number of elements. |
void |
setMaximum(Iterator i)
Computes the maximum number of items from the given iterator . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String ANIM_NAME
public static final String AUDIO_NAME
private Iterator i_
private int max_
private int current_
protected JFrame frame_
protected JProgressBar pbar_
Iterator
.
protected AnimatedIcon anim_
protected String title_
Constructor Detail |
public ProgressIterator(Iterator i, String title)
ProgressBar
. Before this instance can be used it
must be initialized with a maximum number of items.
i
- The wrapped Iterator
.title
- The title of the frame in which the
progress bar is shown.Method Detail |
public void setMaximum(int max)
max
- The maximum number of elements.public void setMaximum(Iterator i)
iterator
.
i
- The Iterator
that is used to find
the maximum number of items by simply iterating through
it and counting.public int getMaximum()
Iterator
is not yet properly initialized.
public boolean hasNext()
hasNext
in interface Iterator
public Object next() throws NoSuchElementException
next
in interface Iterator
NoSuchElementException
public void remove()
remove
in interface Iterator
protected void advance()
protected void init()
protected void close()
public static void main(String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |