use of org.vcell.util.document.VCDocument.VCDocumentType 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;
}
use of org.vcell.util.document.VCDocument.VCDocumentType in project vcell by virtualcell.
the class ClientMDIManager method createCanonicalTitle.
/**
* Insert the method's description here.
* Creation date: (5/27/2006 4:10:10 PM)
* @return java.lang.String
* @param version cbit.sql.Version
*/
public static String createCanonicalTitle(VCDocument vcDocument) {
Version version = vcDocument.getVersion();
VCDocumentType docType = vcDocument.getDocumentType();
String docName = (version != null ? version.getName() : (vcDocument.getName() == null ? "NoName" : vcDocument.getName() + " (NoVersion)"));
java.util.Date docDate = (version != null ? version.getDate() : null);
VersionFlag versionFlag = (version != null ? version.getFlag() : null);
String title = (versionFlag != null && versionFlag.compareEqual(VersionFlag.Archived) ? "(" + CurateSpec.CURATE_TYPE_STATES[CurateSpec.ARCHIVE] + ") " : "") + (versionFlag != null && versionFlag.compareEqual(VersionFlag.Published) ? "(" + CurateSpec.CURATE_TYPE_STATES[CurateSpec.PUBLISH] + ") " : "") + (docType == VCDocumentType.BIOMODEL_DOC ? "BIOMODEL: " : "") + (docType == VCDocumentType.MATHMODEL_DOC ? "MATHMODEL: " : "") + (docType == VCDocumentType.GEOMETRY_DOC ? "GEOMETRY: " : "") + docName + " " + "(" + (docDate != null ? docDate.toString() : "NoDate") + ")";
title += " -- VCell " + DocumentWindowAboutBox.getVERSION_NO() + " (build " + DocumentWindowAboutBox.getBUILD_NO() + ")";
return title;
}
Aggregations