public class TableSupport extends Object
Modifier and Type | Field and Description |
---|---|
TaskScheduler |
scheduler
Record access task scheduler.
|
Modifier and Type | Method and Description |
---|---|
void |
enqueueUpdate()
Enqueues an update task.
|
Dimension |
getDefaultSize()
Gets the default size of an MViewPane containing the generated table.
|
MDocStorage |
getDocStorage()
Gets the sparse dynamic document storage.
|
TableOptions |
getTableOptions()
Gets the table options component.
|
void |
makeTableMenu(Container menu)
Creates Table menu items.
|
void |
setCellSize(Dimension size)
Sets the molecule cell size for GridBagView.
|
boolean |
setDocument(int k,
MDocument doc)
Sets the k-th record directly.
|
void |
setSDFColoring(String tag,
Properties props)
Sets SDF coloring.
|
void |
start(MDocSource dsrc,
String inputLocName)
Starts loading molecules.
|
void |
startNow(MDocSource dsrc,
String inputLocName)
Starts loading molecules immediately.
|
public final TaskScheduler scheduler
final MDocStorage ds = tableSupport.getDocStorage(); final int start = 0; final int end = ds.getSize(); Runnable task = new Runnable() { public void run() { try { for(int i = start; i < end; ++i) { MDocument d = ds.getMainDoc(i); ... } } catch(MDocStorage.RecordUnavailableException ex) { ... } catch(IOException ex) { ... } } }; tableSupport.scheduler.invokeLater(task, start); try { tableSupport.scheduler.waitForAll(); } catch(InterruptedException ex) { ex.printStackTrace(); }
public TableOptions getTableOptions()
public void setCellSize(Dimension size)
size
- the molecule cell sizepublic void setSDFColoring(String tag, Properties props)
tag
- ?props
- ?public void start(MDocSource dsrc, String inputLocName)
dsrc
- the document sourceinputLocName
- input file name or other identifierpublic void startNow(MDocSource dsrc, String inputLocName) throws InterruptedException, InvocationTargetException
dsrc
- the document sourceinputLocName
- input file name or other identifierInterruptedException
- if another thread has interrupted the task threadInvocationTargetException
- if an throwable is thrown when running runnable
public void enqueueUpdate()
public boolean setDocument(int k, MDocument doc)
Note that this method should normally not be used if the input is an MDocSource
; use
start(MDocSource, String)
instead.
k
- record indexdoc
- the documenttrue
if setting was successful, false
if no ViewHandler
foundpublic MDocStorage getDocStorage()
Note that MDocStorage
should only be used via record access
tasks,
scheduler
public Dimension getDefaultSize()
public void makeTableMenu(Container menu)
menu
- the Table menu