Package uk.ac.starlink.table.gui
Class ProgressBarStarTable
- java.lang.Object
-
- uk.ac.starlink.table.WrapperStarTable
-
- uk.ac.starlink.table.gui.ProgressBarStarTable
-
- All Implemented Interfaces:
StarTable
public class ProgressBarStarTable extends WrapperStarTable
A WrapperStarTable which behaves the same as its base, except that UI intervention is permitted on any RowSequence which is taken out on it. For one thing, the RowSequence will update a supplied JProgressBar component as it iterates, and for another thingThread.interrupt()
ing the thread in which the RowSequence is being iterated over will cause the next method to throw an IOException. Said RowSequences may be used from any thread, that is they are not restricted to use from the AWT event dispatcher thread. However you don't want to be using two such row sequences simultaneously or the progress bar will be getting two sets of updates at once.You might think this should be based on a
BoundedRangeModel
(JProgressBar's model) instead, but unfortunately that doesn't allow you use of indeterminate progress states.- Author:
- Mark Taylor (Starlink)
-
-
Field Summary
-
Fields inherited from class uk.ac.starlink.table.WrapperStarTable
baseTable
-
-
Constructor Summary
Constructors Constructor Description ProgressBarStarTable(StarTable baseTable)
ProgressBarStarTable(StarTable baseTable, javax.swing.JProgressBar progBar)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getActiveLabel()
Returns the text of the label which is visible in the progress bar when a RowSequence acquired from this table is active.javax.swing.JProgressBar
getProgressBar()
RowSequence
getRowSequence()
Returns an object which can iterate over all the rows in the table sequentially.void
setActiveLabel(java.lang.String label)
Sets a label which will be visible in the progress bar when a RowSequence acquired from this table is being iterated over.void
setProgressBar(javax.swing.JProgressBar progBar)
-
Methods inherited from class uk.ac.starlink.table.WrapperStarTable
checkedLongToInt, getBaseTable, getCell, getColumnAuxDataInfos, getColumnCount, getColumnInfo, getName, getParameterByName, getParameters, getRow, getRowCount, getURL, isRandom, setName, setParameter, setURL, toString
-
-
-
-
Method Detail
-
setProgressBar
public void setProgressBar(javax.swing.JProgressBar progBar)
-
getProgressBar
public javax.swing.JProgressBar getProgressBar()
-
setActiveLabel
public void setActiveLabel(java.lang.String label)
Sets a label which will be visible in the progress bar when a RowSequence acquired from this table is being iterated over.- Parameters:
label
- label text
-
getActiveLabel
public java.lang.String getActiveLabel()
Returns the text of the label which is visible in the progress bar when a RowSequence acquired from this table is active.- Returns:
- label text
-
getRowSequence
public RowSequence getRowSequence() throws java.io.IOException
Description copied from interface:StarTable
Returns an object which can iterate over all the rows in the table sequentially.- Specified by:
getRowSequence
in interfaceStarTable
- Overrides:
getRowSequence
in classWrapperStarTable
- Returns:
- an object providing sequential access to the table data
- Throws:
java.io.IOException
- if there is an error providing access
-
-