Search in sources :

Example 41 with GeometryInfo

use of cbit.vcell.geometry.GeometryInfo in project vcell by virtualcell.

the class GeometryDbTreeModel method databaseDelete.

/**
 * @param event cbit.vcell.clientdb.DatabaseEvent
 */
public void databaseDelete(DatabaseEvent databaseEvent) {
    if (databaseEvent.getOldVersionInfo() instanceof GeometryInfo) {
        GeometryInfo removedGeometryInfo = (GeometryInfo) databaseEvent.getOldVersionInfo();
        BioModelNode removedNode = ((BioModelNode) getRoot()).findNodeByUserObject(removedGeometryInfo);
        if (removedNode != null) {
            if (removedNode.getParent() != null && removedNode.getSiblingCount() == 1) {
                // just this one version
                removedNode = (BioModelNode) removedNode.getParent();
            }
            removeNodeFromParent(removedNode);
        }
    }
}
Also used : GeometryInfo(cbit.vcell.geometry.GeometryInfo)

Example 42 with GeometryInfo

use of cbit.vcell.geometry.GeometryInfo in project vcell by virtualcell.

the class PublicationInfoNodeTreeModel method createVersionSubTree.

private BioModelNode createVersionSubTree(BioModelNode publicationsInfoNode) throws DataAccessException {
    BioModelNode versionNode = new BioModelNode("Root", true);
    Object uo = publicationsInfoNode.getUserObject();
    if (!(uo instanceof PublicationInfo)) {
        String title = "PublicationInfo missing";
        publicationNode = new BioModelNode(title, false);
        versionNode.add(publicationNode);
        return versionNode;
    }
    publicationNode = null;
    modelsNode = null;
    PublicationInfo pi = (PublicationInfo) uo;
    publicationNode = new BioModelNode("Publication", true);
    publicationNode.setRenderHint("type", "PublicationsInfo");
    BioModelNode piTitleNode = new BioModelNode(pi, true);
    piTitleNode.setRenderHint("type", "PublicationInfoTitle");
    publicationNode.add(piTitleNode);
    BioModelNode piAuthorsNode = new BioModelNode(pi, false);
    piAuthorsNode.setRenderHint("type", "PublicationInfoAuthors");
    piTitleNode.add(piAuthorsNode);
    BioModelNode piCitationNode = new BioModelNode(pi, false);
    piCitationNode.setRenderHint("type", "PublicationInfoCitation");
    piTitleNode.add(piCitationNode);
    BioModelNode piDoiNode = new BioModelNode(pi, false);
    piDoiNode.setRenderHint("type", "PublicationInfoDoi");
    piTitleNode.add(piDoiNode);
    if (pi.getUrl() != null && !pi.getUrl().isEmpty()) {
        if (pi.getUrl().contains("pubmed") || pi.getUrl().contains("PubMed")) {
            BioModelNode piUrlNode = new BioModelNode(pi, false);
            piUrlNode.setRenderHint("type", "PublicationInfoUrl");
            piTitleNode.add(piUrlNode);
        }
    }
    versionNode.add(publicationNode);
    String name = publicationsInfoNode.getChildCount() > 1 ? "Models" : "Model";
    modelsNode = new BioModelNode(name, true);
    modelsNode.setRenderHint("type", "ModelsList");
    for (int i = 0; i < publicationsInfoNode.getChildCount(); i++) {
        TreeNode child = publicationsInfoNode.getChildAt(i);
        if (!(child instanceof BioModelNode)) {
            versionNode.add(modelsNode);
            return versionNode;
        }
        BioModelNode modelNode = (BioModelNode) child;
        uo = modelNode.getUserObject();
        if (!(uo instanceof VCDocumentInfoNode)) {
            versionNode.add(modelsNode);
            return versionNode;
        }
        VCDocumentInfoNode din = (VCDocumentInfoNode) uo;
        Version version = din.getVCDocumentInfo().getVersion();
        BioModelNode mNameNode = new BioModelNode(version.getName(), true);
        mNameNode.setRenderHint("type", "ModelName");
        VCDocumentInfo di = din.getVCDocumentInfo();
        if (di instanceof BioModelInfo) {
            mNameNode.setRenderHint("category", "BioModel");
        } else if (di instanceof MathModelInfo) {
            mNameNode.setRenderHint("category", "MathModel");
        } else if (di instanceof GeometryInfo) {
            mNameNode.setRenderHint("category", "Geometry");
        }
        modelsNode.add(mNameNode);
        BioModelNode mOwnerNode = new BioModelNode(version.getOwner(), true);
        mOwnerNode.setRenderHint("type", "ModelOwner");
        mNameNode.add(mOwnerNode);
        BioModelNode mDateNode = new BioModelNode(version.getDate(), true);
        mDateNode.setRenderHint("type", "ModelDate");
        mNameNode.add(mDateNode);
    }
    versionNode.add(modelsNode);
    return versionNode;
}
Also used : Version(org.vcell.util.document.Version) VCDocumentInfo(org.vcell.util.document.VCDocumentInfo) PublicationInfo(org.vcell.util.document.PublicationInfo) TreeNode(javax.swing.tree.TreeNode) BioModelInfo(org.vcell.util.document.BioModelInfo) GeometryInfo(cbit.vcell.geometry.GeometryInfo) VCDocumentInfoNode(cbit.vcell.desktop.VCellBasicCellRenderer.VCDocumentInfoNode) MathModelInfo(org.vcell.util.document.MathModelInfo)

Example 43 with GeometryInfo

use of cbit.vcell.geometry.GeometryInfo in project vcell by virtualcell.

the class GeometryMetaDataPanel method setGeometryInfo.

/**
 * Sets the geometryInfo property (cbit.vcell.geometry.GeometryInfo) value.
 * @param geometryInfo The new value for the property.
 * @see #getGeometryInfo
 */
public void setGeometryInfo(GeometryInfo geometryInfo) {
    GeometryInfo oldValue = fieldGeometryInfo;
    fieldGeometryInfo = geometryInfo;
    firePropertyChange("geometryInfo", oldValue, geometryInfo);
}
Also used : GeometryInfo(cbit.vcell.geometry.GeometryInfo)

Example 44 with GeometryInfo

use of cbit.vcell.geometry.GeometryInfo in project vcell by virtualcell.

the class GeometryTreePanel method documentManager_DatabaseUpdate.

/**
 * Comment
 */
protected void documentManager_DatabaseUpdate(DatabaseEvent event) {
    if (event.getNewVersionInfo() instanceof GeometryInfo && getSelectedVersionInfo() instanceof GeometryInfo) {
        GeometryInfo selectedGeoInfo = (GeometryInfo) getSelectedVersionInfo();
        GeometryInfo eventGeoInfo = (GeometryInfo) event.getNewVersionInfo();
        if (eventGeoInfo.getVersion().getVersionKey().equals(selectedGeoInfo.getVersion().getVersionKey())) {
            setSelectedVersionInfo(event.getNewVersionInfo());
        }
    }
}
Also used : GeometryInfo(cbit.vcell.geometry.GeometryInfo)

Example 45 with GeometryInfo

use of cbit.vcell.geometry.GeometryInfo in project vcell by virtualcell.

the class GeometryTreePanel method documentManager_DatabaseDelete.

/**
 * Comment
 */
protected void documentManager_DatabaseDelete(DatabaseEvent event) {
    if (event.getOldVersionInfo() instanceof GeometryInfo && getSelectedVersionInfo() instanceof GeometryInfo) {
        GeometryInfo selectedGeoInfo = (GeometryInfo) getSelectedVersionInfo();
        GeometryInfo eventGeoInfo = (GeometryInfo) event.getOldVersionInfo();
        if (eventGeoInfo.getVersion().getVersionKey().equals(selectedGeoInfo.getVersion().getVersionKey())) {
            setSelectedVersionInfo(null);
            getJTree1().getSelectionModel().clearSelection();
        }
    }
}
Also used : GeometryInfo(cbit.vcell.geometry.GeometryInfo)

Aggregations

GeometryInfo (cbit.vcell.geometry.GeometryInfo)47 BioModelInfo (org.vcell.util.document.BioModelInfo)27 MathModelInfo (org.vcell.util.document.MathModelInfo)27 DataAccessException (org.vcell.util.DataAccessException)19 VCDocumentInfo (org.vcell.util.document.VCDocumentInfo)11 AsynchClientTask (cbit.vcell.client.task.AsynchClientTask)8 Hashtable (java.util.Hashtable)8 Geometry (cbit.vcell.geometry.Geometry)7 VCImageInfo (cbit.image.VCImageInfo)6 BioModel (cbit.vcell.biomodel.BioModel)6 User (org.vcell.util.document.User)6 VersionInfo (org.vcell.util.document.VersionInfo)6 CSGObject (cbit.vcell.geometry.CSGObject)5 SimulationContext (cbit.vcell.mapping.SimulationContext)5 RemoteProxyException (cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)5 Vector (java.util.Vector)5 ObjectNotFoundException (org.vcell.util.ObjectNotFoundException)5 ImageException (cbit.image.ImageException)4 DocumentManager (cbit.vcell.clientdb.DocumentManager)4 GeometryException (cbit.vcell.geometry.GeometryException)4