use of cbit.vcell.desktop.ImageDbTreePanel in project vcell by virtualcell.
the class ClientRequestManager method createSelectDocTask.
private AsynchClientTask createSelectDocTask(final TopLevelWindowManager requester) {
AsynchClientTask selectDocumentTypeTask = new AsynchClientTask("Select/Load geometry", AsynchClientTask.TASKTYPE_SWING_BLOCKING) {
@Override
public void run(Hashtable<String, Object> hashTable) throws Exception {
String[][] docTypeoptions = new String[][] { { "BioModel names" }, { "MathModel names" } };
VCDocumentType[] sourceDocumentTypes = new VCDocumentType[] { VCDocumentType.BIOMODEL_DOC, VCDocumentType.MATHMODEL_DOC };
VCAssert.assertTrue(docTypeoptions.length == sourceDocumentTypes.length, "Label and types mismatch");
int[] geomType = DialogUtils.showComponentOKCancelTableList(JOptionPane.getFrameForComponent(requester.getComponent()), "Select different Geometry", new String[] { "Search by" }, docTypeoptions, ListSelectionModel.SINGLE_SELECTION);
final int selectedType = geomType[0];
VCDocumentType sourceDocumentType = sourceDocumentTypes[selectedType];
VersionInfo vcVersionInfo = null;
if (geomType[0] == 3) {
ImageDbTreePanel imageDbTreePanel = new ImageDbTreePanel();
imageDbTreePanel.setDocumentManager(getDocumentManager());
imageDbTreePanel.setPreferredSize(new java.awt.Dimension(200, 400));
vcVersionInfo = DialogUtils.getDBTreePanelSelection(requester.getComponent(), imageDbTreePanel, "OK", "Select Image:");
} else {
vcVersionInfo = selectDocumentFromType(sourceDocumentType, requester);
}
hashTable.put(VERSIONINFO_KEY, vcVersionInfo);
}
};
return selectDocumentTypeTask;
}
Aggregations