Search in sources :

Example 11 with NodeInfo

use of cbit.xml.merge.NodeInfo in project vcell by virtualcell.

the class TMLPanel method setnodeInfo1.

/**
 * Set the nodeInfo1 to a new value.
 * @param newValue cbit.xml.merge.NodeInfo
 *
 */* WARNING: THIS METHOD WILL BE REGENERATED.
 */
private void setnodeInfo1(NodeInfo newValue) {
    if (ivjnodeInfo1 != newValue) {
        try {
            cbit.xml.merge.NodeInfo oldValue = getnodeInfo1();
            ivjnodeInfo1 = newValue;
            connEtoC5(ivjnodeInfo1);
            firePropertyChange("nodeInfo", oldValue, newValue);
        // user code begin {1}
        // user code end
        } catch (java.lang.Throwable ivjExc) {
            // user code begin {2}
            // user code end
            handleException(ivjExc);
        }
    }
    ;
// user code begin {3}
// user code end
}
Also used : NodeInfo(cbit.xml.merge.NodeInfo)

Example 12 with NodeInfo

use of cbit.xml.merge.NodeInfo in project vcell by virtualcell.

the class TMLPanel method keepBaseLine.

/**
 * This method processes the subnodes of the given Node so that it keeps the baseline remaining nodes.
 * Creation date: (9/11/2001 4:55:11 PM)
 * @param object java.lang.Object
 */
private void keepBaseLine(Object object) {
    if (object != null & object instanceof NodeInfo) {
        NodeInfo currentNode = (NodeInfo) object;
        DefaultTreeModel defaultTreeModel = (DefaultTreeModel) (getTree().getModel());
        if (currentNode.getStatus() != NodeInfo.STATUS_NEW) {
            // process himself
            currentNode.setStatus(NodeInfo.STATUS_NORMAL);
            defaultTreeModel.nodeChanged(currentNode);
            // process its subnodes
            LinkedList subNodes = new LinkedList();
            for (Enumeration enumNodes = currentNode.children(); enumNodes.hasMoreElements(); ) {
                subNodes.add(enumNodes.nextElement());
            }
            Iterator iterator = subNodes.iterator();
            while (iterator.hasNext()) {
                NodeInfo tempNode = (NodeInfo) iterator.next();
                keepBaseLine(tempNode);
            }
            // update parents of the change
            updateParents(currentNode.getParent(), currentNode);
        } else {
            NodeInfo parentNode = currentNode;
            // track the farest parent who has as a status of NEW
            while ((parentNode.getParent() != null) && (((NodeInfo) parentNode.getParent()).getStatus() == NodeInfo.STATUS_NEW)) {
                parentNode = (NodeInfo) parentNode.getParent();
            }
            // update parents of the change
            updateParents(parentNode, currentNode);
            // eliminate that node and its subtree (remove the node of interest, not the parent one).
            defaultTreeModel.removeNodeFromParent(currentNode);
        }
    } else {
        throw new IllegalArgumentException("Keep Baseline found an unknown type of node:" + object.getClass().getName());
    }
}
Also used : Enumeration(java.util.Enumeration) NodeInfo(cbit.xml.merge.NodeInfo) ChangedNodeInfo(cbit.xml.merge.ChangedNodeInfo) Iterator(java.util.Iterator) DefaultTreeModel(javax.swing.tree.DefaultTreeModel) LinkedList(java.util.LinkedList)

Example 13 with NodeInfo

use of cbit.xml.merge.NodeInfo in project vcell by virtualcell.

the class TMLPanel method getCurrentModifiedText.

private String getCurrentModifiedText() {
    Object object = getTree().getLastSelectedPathComponent();
    String modifiedText = "";
    if (object instanceof NodeInfo) {
        NodeInfo node = (NodeInfo) object;
        if (node.getStatus() == NodeInfo.STATUS_CHANGED) {
            modifiedText = ((ChangedNodeInfo) node).getModified() != null ? ((ChangedNodeInfo) node).getModified() : "";
        } else {
            if (node.getStatus() == NodeInfo.STATUS_NEW) {
                modifiedText = node.getValue() != null ? node.getValue() : "";
            }
        }
    }
    return modifiedText;
}
Also used : ChangedNodeInfo(cbit.xml.merge.ChangedNodeInfo) NodeInfo(cbit.xml.merge.NodeInfo) ChangedNodeInfo(cbit.xml.merge.ChangedNodeInfo)

Aggregations

NodeInfo (cbit.xml.merge.NodeInfo)13 ChangedNodeInfo (cbit.xml.merge.ChangedNodeInfo)10 DefaultTreeModel (javax.swing.tree.DefaultTreeModel)6 Enumeration (java.util.Enumeration)4 XmlTreeDiff (cbit.xml.merge.XmlTreeDiff)2 Iterator (java.util.Iterator)2 LinkedList (java.util.LinkedList)2 Element (org.jdom.Element)2 ExpressionException (cbit.vcell.parser.ExpressionException)1 XmlReader (cbit.vcell.xml.XmlReader)1 IOException (java.io.IOException)1 JLabel (javax.swing.JLabel)1 TreePath (javax.swing.tree.TreePath)1 XMLStreamException (javax.xml.stream.XMLStreamException)1 Document (org.jdom.Document)1 SBMLException (org.sbml.jsbml.SBMLException)1 SbmlException (org.vcell.sbml.SbmlException)1 VCDocument (org.vcell.util.document.VCDocument)1