public class ProgressBarStarTable extends WrapperStarTable
getRowSequence()
or getRowSplittable()
will update a supplied JProgressBar
as it goes.
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.
baseTable
Constructor and Description |
---|
ProgressBarStarTable(StarTable baseTable,
JProgressBar progBar)
Constructor with default cancellation control.
|
ProgressBarStarTable(StarTable baseTable,
JProgressBar progBar,
java.util.function.BooleanSupplier isCancelled)
Constructor with supplied cancellation control.
|
Modifier and Type | Method and Description |
---|---|
String |
getActiveLabel()
Returns the text of the label which is visible in the progress bar
when a RowSequence acquired from this table is active.
|
JProgressBar |
getProgressBar()
Returns the progress bar which this table controls.
|
RowSequence |
getRowSequence()
Returns an object which can iterate over all the rows in the table
sequentially.
|
RowSplittable |
getRowSplittable()
Returns an object which can iterate over all the rows in the table,
but which may also be requested to split recursively
for potentially parallel processing.
|
void |
setActiveLabel(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(JProgressBar progBar)
Sets the progress bar which this table controls.
|
checkedLongToInt, close, getBaseTable, getCell, getColumnAuxDataInfos, getColumnCount, getColumnInfo, getName, getParameterByName, getParameters, getRow, getRowAccess, getRowCount, getURL, isRandom, setName, setParameter, setURL, toString
public ProgressBarStarTable(StarTable baseTable, JProgressBar progBar)
RowSequence
),
but is unlikely to achieve cancellation of multi-threaded iteration
(using a RowSplittable
).baseTable
- table supplying dataprogBar
- progress bar to updatepublic ProgressBarStarTable(StarTable baseTable, JProgressBar progBar, java.util.function.BooleanSupplier isCancelled)
baseTable
- table supplying dataprogBar
- progress bar to updateisCancelled
- object controlling cancellation:
if it supplies a true value,
the next
method of any
RowSequence
or
RowSplittable
taken out on
this table will (probably, at some point)
throw IOExceptionspublic void setProgressBar(JProgressBar progBar)
progBar
- progress barpublic JProgressBar getProgressBar()
public void setActiveLabel(String label)
label
- label textpublic String getActiveLabel()
public RowSequence getRowSequence() throws IOException
StarTable
getRowSequence
in interface StarTable
getRowSequence
in class WrapperStarTable
IOException
- if there is an error providing accesspublic RowSplittable getRowSplittable() throws IOException
StarTable
The return value must be non-null, and may provide splitting
arrangements specially appropriate for the implementation.
If this table 'wraps' an upstream table, it is usually best to
base the implementation on calls to the the upstream
getRowSplittable
method, so that upstream policy
about how to divide up the table is respected.
However, implementations without special requirements may return
Tables.getDefaultRowSplittable
(this)
.
getRowSplittable
in interface StarTable
getRowSplittable
in class WrapperStarTable
IOException
RowRunner
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.