use of org.vcell.util.document.MathModelInfo in project vcell by virtualcell.
the class BioModelEditor method setRightBottomPanelOnSelection.
@Override
protected void setRightBottomPanelOnSelection(Object[] selections) {
if (selections == null) {
return;
}
JComponent bottomComponent = rightBottomEmptyPanel;
int destComponentIndex = DocumentEditorTabID.object_properties.ordinal();
boolean bShowInDatabaseProperties = false;
boolean bShowPathway = false;
if (selections.length == 1) {
Object singleSelection = selections[0];
if (singleSelection instanceof ReactionStep) {
bottomComponent = getReactionPropertiesPanel();
} else if (singleSelection instanceof ReactionRule) {
bottomComponent = getReactionRulePropertiesPanel();
} else if (singleSelection instanceof SpeciesContext) {
bottomComponent = getSpeciesPropertiesPanel();
} else if (singleSelection instanceof MolecularType) {
bottomComponent = getMolecularTypePropertiesPanel();
} else if (singleSelection instanceof RbmObservable) {
bottomComponent = getObservablePropertiesPanel();
} else if (singleSelection instanceof Structure) {
bottomComponent = getStructurePropertiesPanel();
getStructurePropertiesPanel().setModel(bioModel.getModel());
} else if (singleSelection instanceof Parameter) {
bottomComponent = getParameterPropertiesPanel();
} else if (singleSelection instanceof SimulationContext) {
bottomComponent = getApplicationPropertiesPanel();
} else if (singleSelection instanceof ParameterEstimationTask) {
bottomComponent = parameterEstimationTaskPropertiesPanel;
} else if (singleSelection instanceof Product || singleSelection instanceof Reactant) {
bottomComponent = getReactionParticipantPropertiesPanel();
} else if (singleSelection instanceof BioModelInfo) {
bShowInDatabaseProperties = true;
bottomComponent = bioModelMetaDataPanel;
} else if (singleSelection instanceof MathModelInfo) {
bShowInDatabaseProperties = true;
bottomComponent = mathModelMetaDataPanel;
} else if (singleSelection instanceof GeometryInfo) {
bShowInDatabaseProperties = true;
bottomComponent = geometryMetaDataPanel;
} else if (singleSelection instanceof SpeciesContextSpec) {
bottomComponent = getSpeciesContextSpecPanel();
} else if (singleSelection instanceof ReactionSpec) {
bottomComponent = getKineticsTypeTemplatePanel();
} else if (singleSelection instanceof ReactionRuleSpec) {
//
bottomComponent = getReactionRuleSpecPropertiesPanel();
} else if (singleSelection instanceof BioModelsNetModelInfo) {
bShowInDatabaseProperties = true;
bottomComponent = getBioModelsNetPropertiesPanel();
} else if (singleSelection instanceof Simulation) {
bottomComponent = getSimulationSummaryPanel();
} else if (singleSelection instanceof DataSymbol) {
bottomComponent = getDataSymbolsSpecPanel();
} else if (singleSelection instanceof BioEvent) {
bottomComponent = getEventPanel();
} else if (singleSelection instanceof SpatialObject) {
bottomComponent = getSpatialObjectPropertyPanel();
} else if (singleSelection instanceof SpatialProcess) {
bottomComponent = getSpatialProcessPropertyPanel();
} else if (singleSelection instanceof BioPaxObject) {
bottomComponent = bioPaxObjectPropertiesPanel;
} else if (singleSelection instanceof BioModel || singleSelection instanceof VCMetaData) {
bottomComponent = bioModelEditorAnnotationPanel;
} else if (singleSelection instanceof PathwayData) {
bShowPathway = true;
bottomComponent = getBioModelEditorPathwayPanel();
} else if (singleSelection instanceof Model) {
} else if (singleSelection instanceof RuleParticipantSignature) {
bottomComponent = getReactionRuleParticipantSignaturePropertiesPanel();
} else if (singleSelection instanceof CSGObject) {
bottomComponent = csgObjectPropertiesPanel;
csgObjectPropertiesPanel.setSimulationContext(getSelectedSimulationContext());
} else if (singleSelection instanceof DocumentEditorTreeFolderNode) {
DocumentEditorTreeFolderClass folderClass = ((DocumentEditorTreeFolderNode) singleSelection).getFolderClass();
if ((folderClass == DocumentEditorTreeFolderClass.REACTIONS_NODE) && !(singleSelection instanceof ReactionRule)) {
bottomComponent = getReactionPropertiesPanel();
} else if ((folderClass == DocumentEditorTreeFolderClass.REACTIONS_NODE) && (singleSelection instanceof ReactionRule)) {
bottomComponent = getReactionRulePropertiesPanel();
} else if (folderClass == DocumentEditorTreeFolderClass.STRUCTURES_NODE) {
bottomComponent = getStructurePropertiesPanel();
} else if (folderClass == DocumentEditorTreeFolderClass.SPECIES_NODE) {
bottomComponent = getSpeciesPropertiesPanel();
} else if (folderClass == DocumentEditorTreeFolderClass.MOLECULAR_TYPES_NODE) {
bottomComponent = getMolecularTypePropertiesPanel();
} else if (folderClass == DocumentEditorTreeFolderClass.OBSERVABLES_NODE) {
bottomComponent = getObservablePropertiesPanel();
} else if (folderClass == DocumentEditorTreeFolderClass.APPLICATIONS_NODE) {
bottomComponent = getApplicationsPropertiesPanel();
getApplicationsPropertiesPanel().setBioModel(bioModel);
} else if (folderClass == DocumentEditorTreeFolderClass.PARAMETER_ESTIMATION_NODE) {
bottomComponent = parameterEstimationTaskPropertiesPanel;
}
}
}
if (bShowPathway) {
for (destComponentIndex = 0; destComponentIndex < rightBottomTabbedPane.getTabCount(); destComponentIndex++) {
if (rightBottomTabbedPane.getComponentAt(destComponentIndex) == bottomComponent) {
break;
}
}
String tabTitle = "Pathway Preview";
if (rightBottomTabbedPane.getTabCount() == destComponentIndex) {
rightBottomTabbedPane.addTab(tabTitle, new TabCloseIcon(), bottomComponent);
}
} else if (bShowInDatabaseProperties) {
for (destComponentIndex = 0; destComponentIndex < rightBottomTabbedPane.getTabCount(); destComponentIndex++) {
Component c = rightBottomTabbedPane.getComponentAt(destComponentIndex);
if (c == bioModelMetaDataPanel || c == mathModelMetaDataPanel || c == geometryMetaDataPanel || c == getBioModelsNetPropertiesPanel()) {
break;
}
}
if (rightBottomTabbedPane.getTabCount() == destComponentIndex) {
rightBottomTabbedPane.addTab(DATABASE_PROPERTIES_TAB_TITLE, new TabCloseIcon(), bottomComponent);
}
}
if (rightBottomTabbedPane.getComponentAt(destComponentIndex) != bottomComponent) {
bottomComponent.setBorder(GuiConstants.TAB_PANEL_BORDER);
rightBottomTabbedPane.setComponentAt(destComponentIndex, bottomComponent);
rightSplitPane.repaint();
}
if (rightBottomTabbedPane.getSelectedComponent() != bottomComponent) {
rightBottomTabbedPane.setSelectedComponent(bottomComponent);
}
}
use of org.vcell.util.document.MathModelInfo in project vcell by virtualcell.
the class MathModelPropertiesPanel method updateInterface.
/**
* Comment
*/
private void updateInterface() {
if (mathModel == null || mathModelWindowManager == null) {
return;
}
nameLabel.setText(mathModel.getName());
Version version = mathModel.getVersion();
try {
if (version != null) {
ownerLabel.setText(version.getOwner().getName());
lastModifiedLabel.setText(version.getDate().toString());
MathModelInfo mathModelInfo = mathModelWindowManager.getRequestManager().getDocumentManager().getMathModelInfo(version.getVersionKey());
permissionLabel.setText(mathModelInfo.getVersion().getGroupAccess().getDescription());
changePermissionButton.setEnabled(true);
}
Geometry geometry = mathModel.getGeometry();
String geometryText = "Compartmental geometry";
if (geometry != null) {
Version geometryVersion = geometry.getVersion();
int dimension = geometry.getDimension();
if (dimension > 0) {
String description = geometry.getDimension() + "D " + (geometry.getGeometrySpec().hasImage() ? "image" : "analytic") + " geometry";
geometryText = description;
if (geometryVersion != null) {
geometryText += " - " + geometryVersion.getName() + " (" + geometryVersion.getDate() + ")";
}
}
}
geometryLabel.setText(geometryText);
detStochLabel.setText(mathModel.getMathDescription().getMathType().getDescription());
} catch (DataAccessException e) {
e.printStackTrace();
}
}
use of org.vcell.util.document.MathModelInfo in project vcell by virtualcell.
the class DatabaseWindowPanel method currentDocumentInfo.
/**
* Comment
*/
private void currentDocumentInfo() {
VCDocumentInfo selectedDocInfo = null;
switch(getJTabbedPane1().getSelectedIndex()) {
case 0:
{
// VCDocumentType.BIOMODEL_DOC
selectedDocInfo = (BioModelInfo) getBioModelDbTreePanel1().getSelectedVersionInfo();
break;
}
case 1:
{
// VCDocumentType.MATHMODEL_DOC
selectedDocInfo = (MathModelInfo) getMathModelDbTreePanel1().getSelectedVersionInfo();
break;
}
case 2:
{
// VCDocumentType.GEOMETRY_DOC
selectedDocInfo = (GeometryInfo) getGeometryTreePanel1().getSelectedVersionInfo();
break;
}
}
setSelectedDocumentInfo(selectedDocInfo);
}
use of org.vcell.util.document.MathModelInfo in project vcell by virtualcell.
the class MathModelTable method getInfo.
/**
* This method was created in VisualAge.
* @return cbit.vcell.geometry.GeometryInfo
* @param rset java.sql.ResultSet
* @param log cbit.vcell.server.SessionLog
*/
public VersionInfo getInfo(ResultSet rset, Connection con, DatabaseSyntax dbSyntax) throws SQLException, org.vcell.util.DataAccessException {
KeyValue mathRef = new KeyValue(rset.getBigDecimal(table.mathRef.toString()));
java.math.BigDecimal groupid = rset.getBigDecimal(VersionTable.privacy_ColumnName);
Version version = getVersion(rset, DbDriver.getGroupAccessFromGroupID(con, groupid));
String serialDbChildSummary = DbDriver.varchar2_CLOB_get(rset, MathModelTable.table.childSummarySmall, MathModelTable.table.childSummaryLarge, dbSyntax);
String softwareVersion = rset.getString(SoftwareVersionTable.table.softwareVersion.toString());
return new MathModelInfo(version, mathRef, serialDbChildSummary, VCellSoftwareVersion.fromString(softwareVersion));
}
use of org.vcell.util.document.MathModelInfo in project vcell by virtualcell.
the class MathVerifier method scan.
/**
* Insert the method's description here.
* Creation date: (2/2/01 3:40:29 PM)
*/
public void scan(User[] users, boolean bUpdateDatabase, KeyValue[] bioAndMathModelKeys) throws MathException, MappingException, SQLException, DataAccessException, ModelException, ExpressionException {
// java.util.Calendar calendar = java.util.GregorianCalendar.getInstance();
// // calendar.set(2002,java.util.Calendar.MAY,7+1);
// calendar.set(2002,java.util.Calendar.JULY,1);
// final java.util.Date fluxCorrectionOrDisablingBugFixDate = calendar.getTime();
// // calendar.set(2001,java.util.Calendar.JUNE,13+1);
// calendar.set(2002,java.util.Calendar.JANUARY,1);
// final java.util.Date totalVolumeCorrectionFixDate = calendar.getTime();
KeyValue[] sortedBioAndMathModelKeys = null;
if (bioAndMathModelKeys != null) {
sortedBioAndMathModelKeys = bioAndMathModelKeys.clone();
Arrays.sort(sortedBioAndMathModelKeys, keyValueCpmparator);
}
for (int i = 0; i < users.length; i++) {
User user = users[i];
BioModelInfo[] bioModelInfos0 = dbServerImpl.getBioModelInfos(user, false);
MathModelInfo[] mathModelInfos0 = dbServerImpl.getMathModelInfos(user, false);
if (lg.isTraceEnabled())
lg.trace("Testing user '" + user + "'");
Vector<VCDocumentInfo> userBioAndMathModelInfoV = new Vector<VCDocumentInfo>();
userBioAndMathModelInfoV.addAll(Arrays.asList(bioModelInfos0));
userBioAndMathModelInfoV.addAll(Arrays.asList(mathModelInfos0));
//
for (int j = 0; j < userBioAndMathModelInfoV.size(); j++) {
//
// if certain Bio or Math models are requested, then filter all else out
//
VCDocumentInfo documentInfo = userBioAndMathModelInfoV.elementAt(j);
KeyValue versionKey = documentInfo.getVersion().getVersionKey();
if (sortedBioAndMathModelKeys != null) {
int srch = Arrays.binarySearch(sortedBioAndMathModelKeys, versionKey, keyValueCpmparator);
if (srch < 0) {
continue;
}
}
if (!(documentInfo instanceof BioModelInfo)) {
continue;
}
//
if (skipHash.contains(versionKey)) {
System.out.println("skipping " + (documentInfo instanceof BioModelInfo ? "BioModel" : "MathModel") + " with key '" + versionKey + "'");
continue;
}
try {
//
// read in the BioModel and MathModel from the database
//
VCDocument vcDocumentFromDBCache = null;
BigString vcDocumentXMLFromDBCache = null;
try {
long startTime = System.currentTimeMillis();
if (documentInfo instanceof BioModelInfo) {
vcDocumentXMLFromDBCache = new BigString(dbServerImpl.getServerDocumentManager().getBioModelXML(new QueryHashtable(), user, versionKey, false));
vcDocumentFromDBCache = XmlHelper.XMLToBioModel(new XMLSource(vcDocumentXMLFromDBCache.toString()));
} else {
vcDocumentXMLFromDBCache = new BigString(dbServerImpl.getServerDocumentManager().getMathModelXML(new QueryHashtable(), user, versionKey, false));
vcDocumentFromDBCache = XmlHelper.XMLToMathModel(new XMLSource(vcDocumentXMLFromDBCache.toString()));
}
if (bUpdateDatabase && testFlag.equals(MathVerifier.MV_LOAD_XML)) {
updateLoadModelsStatTable_LoadTest(System.currentTimeMillis() - startTime, versionKey, null);
}
} catch (Exception e) {
lg.error(e.getMessage(), e);
if (bUpdateDatabase && testFlag.equals(MathVerifier.MV_LOAD_XML)) {
updateLoadModelsStatTable_LoadTest(0, versionKey, e);
}
}
if (testFlag.equals(MathVerifier.MV_LOAD_XML)) {
//
if (vcDocumentXMLFromDBCache != null) {
testDocumentLoad(bUpdateDatabase, user, documentInfo, vcDocumentFromDBCache);
}
} else if (testFlag.equals(MathVerifier.MV_DEFAULT)) {
//
if (vcDocumentFromDBCache instanceof BioModel) {
BioModel bioModel = (BioModel) vcDocumentFromDBCache;
checkMathForBioModel(vcDocumentXMLFromDBCache, bioModel, user, bUpdateDatabase);
}
}
} catch (Throwable e) {
// exception in whole BioModel
lg.error(e.getMessage(), e);
// can't update anything in database, since we don't know what simcontexts are involved
}
}
}
}
Aggregations