Package fr.soleil.comete.bean.technicaldata.full.genericclasses.treeutil

Examples of fr.soleil.comete.bean.technicaldata.full.genericclasses.treeutil.TreeNodeMember$RecordabilityDevice


        while (enumChildren.hasMoreElements())
        {
            DefaultMutableTreeNode node = (DefaultMutableTreeNode) enumChildren.nextElement();
            if (node instanceof TreeNodeMember)
            {
                TreeNodeMember tnMember = (TreeNodeMember) node;
                //verify if the node belongs to the list iList
                // it must be selected in the threeTable in the col iList
                Boolean value = (Boolean) m_model.getValueAt(tnMember, iCol);
                if (value.booleanValue())
                {
                    //device is selected -> add it in the vector
                    String strDeviceName = tnMember.getDeviceName();
                    vect.add(strDeviceName);
                }
            }
        }
View Full Code Here


        {
            //find all treenodemembers
            DefaultMutableTreeNode node = (DefaultMutableTreeNode) enumChildren.nextElement();
            if (node instanceof TreeNodeMember)
            {
                TreeNodeMember tnMember = (TreeNodeMember) node;
                //uncheck all checkbox corresponding to this node
                m_model.setValueAt(new Boolean(false), tnMember, 1);
                m_model.setValueAt(new Boolean(false), tnMember, 2);
            }
        }
View Full Code Here

                                SpRecordingDevices.updateRecordabilityNodes(familyNode.children());
                                familyNode.setBuilt(true);
                            }
                            // get the good member node and check it
                            String strDeviceMember = vectDevice.elementAt(2).toString();
                            TreeNodeMember memberNode = familyNode.getNodeMember(strDeviceMember);
                            if(memberNode != null)
                            {
                                //check this node
                                //check corresponding column of this node
                                m_model.setValueAt(new Boolean(true), memberNode, iCol);
                                //add this node in vector selectedNodes
                                vectSelectedNodes.add(memberNode);
                            }
                        }
                    }

                    /** Create all families*/
                    /** Create all members of the good family */
                    /** Check the good member node */
                    else
                    {
                        //add families to domain node
                        domainNode.addFamilies();
                        domainNode.setBuilt(true);
                        //get family name
                        String strDeviceFamily = vectDevice.elementAt(1).toString();
                        //get family node which contains member node
                        TreeNodeFamily familyNode = domainNode.getNodeFamily(strDeviceFamily);
                        if(familyNode != null)
                        {
                            //add members to family node
                            familyNode.addMembers(false);
                            familyNode.setBuilt(true);
                            SpRecordingDevices.updateRecordabilityNodes(familyNode.children());
                            // get member node
                            String strDeviceMember = vectDevice.elementAt(2).toString();
                            TreeNodeMember memberNode = familyNode.getNodeMember(strDeviceMember);
                            if (memberNode != null)
                            {
                                // check this node
                                // check corresponding column of this node
                                m_model.setValueAt(new Boolean(true), memberNode, iCol);
View Full Code Here

    private void expandSelectedNodes(Vector vecSelectedNodes)
    {
        // iteration on this vector
        for (int i=0 ; i<vecSelectedNodes.size() ; i++)
        {
            TreeNodeMember tn = (TreeNodeMember) vecSelectedNodes.elementAt(i);
            TreePath tp = new TreePath(tn.getPath());
            m_treeTable.getTree().setSelectionPath(tp);
            m_treeTable.getTree().addSelectionPath(m_treeTable.getTree().getSelectionPath());
        }
    }
View Full Code Here

                Vector vectAttribute = Utils.breakUp(strAttributePath, "/");
                //get device's domain
                String strDeviceDomain = vectAttribute.elementAt(0).toString();
                //get device domain node
                TreeNodeDomain domainNode = (TreeNodeDomain) TreeUtilities.getANode(m_treeTable.getTree(), strDeviceDomain);
                TreeNodeMember memberNode = null;
                if(domainNode != null)
                {
                    //test if node domain has been built
                    if(domainNode.isBuilt())
                    {
                        //get family node
                        TreeNodeFamily familyNode = domainNode.getNodeFamily(vectAttribute.elementAt(1).toString());
                        if(familyNode != null)
                        {
                            if(familyNode.isBuilt())
                            {
                                memberNode = familyNode.getNodeMember(vectAttribute.elementAt(2).toString());
                                if(memberNode != null)
                                {
                                    if(!memberNode.isBuilt())
                                    {
                                        try
                                        {
                                            memberNode.addAttributes();
                                            memberNode.setBuilt(true);
                                        }
                                        catch (DevFailed e)
                                        {
                                            System.out.println("Device " + memberNode.getDeviceName() + " is not alive." );
                                            memberNode.setBuilt(true);
                                        }
                                    }
                                }
                            }

                            else
                            {
                                familyNode.addMembers(true);
                                familyNode.setBuilt(true);

                                memberNode = familyNode.getNodeMember(vectAttribute.elementAt(2).toString());
                                if(memberNode != null)
                                {
                                    if(!memberNode.isBuilt())
                                    {
                                        try
                                        {
                                            memberNode.addAttributes();
                                            memberNode.setBuilt(true);
                                        }
                                        catch (DevFailed e)
                                        {
                                            System.out.println("Device " + memberNode.getDeviceName() + " is not alive." );
                                        }
                                    }
                                }
                            }
                            // get the good attribute node and check it
                            String strAttribute = vectAttribute.elementAt(3).toString();
                            if(memberNode != null)
                            {
                                TreeNodeAttribute attributeNode = memberNode.getNodeAttribute(strAttribute);
                                if(attributeNode != null)
                                {
                                    //check this node
                                    //check corresponding column of this node
                                    m_model.setValueAt(new Boolean(true), attributeNode, 1);
                                    //add this node in vector selectedNodes
                                    vectSelectedNodes.add(attributeNode);
                                }
                            }
                        }
                    }

                    /** Create all families*/
                    /** Create all members of the good family */
                    /** Check the good member node */
                    else
                    {
                        //add families to domain node
                        domainNode.addFamilies();
                        domainNode.setBuilt(true);
                        //get family name
                        String strDeviceFamily = vectAttribute.elementAt(1).toString();
                        //get family node which contains member node
                        TreeNodeFamily familyNode = domainNode.getNodeFamily(strDeviceFamily);
                        if(familyNode != null)
                        {
                            //add members to family node
                            familyNode.addMembers(true);
                            familyNode.setBuilt(true);
                            SpRecordingDevices.updateRecordabilityNodes(familyNode.children());
                            // get member node
                            String strDeviceMember = vectAttribute.elementAt(2).toString();
                            memberNode = familyNode.getNodeMember(strDeviceMember);
                            if (memberNode != null)
                            {

                                TreeNodeAttribute attributeNode = memberNode.getNodeAttribute(vectAttribute
                                        .elementAt(3).toString());
                                if (attributeNode != null)
                                {
                                    // check this node
                                    // check corresponding column of this node
View Full Code Here

            //the second column represented the value "Pre" associated to this node
            case 1:
            {
                if (currentNode instanceof TreeNodeMember)
                {
                    TreeNodeMember memberNode = (TreeNodeMember) currentNode;
                    return new Boolean (memberNode.isPre());
                } else {
                    return null;
                }
            }
            //the second column represented the value "Pre" associated to this node
            case 2:
                if (currentNode instanceof TreeNodeMember)
                {
                    TreeNodeMember memberNode = (TreeNodeMember) currentNode;
                    return new Boolean (memberNode.isPost());
                } else {
                    return null;
                }
        }
View Full Code Here

            return;
        }
        //set value only for node TreeNodeMember
        if (node instanceof TreeNodeMember)
        {
            TreeNodeMember nodeMember = (TreeNodeMember) node;
            boolean bSelected = new Boolean(aValue.toString()).booleanValue();
            switch(iCol)
            {
                //the first column of the table represents the value "Pre" associated to the node
                case 1 :
                    nodeMember.setPre(bSelected);
                    break;
                    //the first column of the table represents the value "Post" associated to the node
                case 2 :
                    nodeMember.setPost(bSelected);
                    break;
            }
        }
    }
View Full Code Here

                }
              }

              else if (event.getPath().getLastPathComponent() instanceof TreeNodeMember) {
                // add attribute nodes
                TreeNodeMember memberNode = (TreeNodeMember) event
                    .getPath().getLastPathComponent();
                if (!memberNode.isBuilt()) {
                  try {
                    memberNode.addAttributes();
                    memberNode.setBuilt(true);
                  } catch (DevFailed e) {
                    String errorMessage = "Device "
                        + memberNode.getDeviceName()
                        + " is not alive "
                        + DevFailedUtils.toString(e);
                    memberNode.setBuilt(false);
                    TechnicalDataMessageManager
                        .notifyNewErrorDetected(new Exception(
                            errorMessage));
                  }
                  m_model.reload(memberNode);
View Full Code Here

                    }

                    else if (event.getPath().getLastPathComponent() instanceof TreeNodeMember)
                    {
                        //add attribute nodes
                        TreeNodeMember memberNode = (TreeNodeMember) event.getPath().getLastPathComponent();
                        if(!memberNode.isBuilt())
                        {
                            try
                            {
                                memberNode.addAttributes();
                                memberNode.setBuilt(true);
                            }
                            catch (DevFailed e)
                            {
                                memberNode.setBuilt(false);
                                JOptionPane.showMessageDialog(m_pnl.getParentWindow(),
                                        "Device: " + memberNode.getDeviceName() + " is not alive.",
                                        "DevFailed Eroor",
                                        JOptionPane.ERROR_MESSAGE);
                            }
                            m_model.reload(memberNode);
                        }
View Full Code Here

    {
        super.getTreeCellRendererComponent(tree,value,sel,expanded,leaf,row,hasFocus);

        if(value instanceof TreeNodeMember)
        {
            TreeNodeMember tm = (TreeNodeMember) value;
            if(tm.getAllowsChildren()) {
                setIcon(m_imgDevice);
            } else
            {
                if (tm.getRecordableState() == 1) {
                    setIcon(m_imgOk);
                } else if (tm.getRecordableState() == 2) {
                    setIcon(m_imgKO);
                } else {
                    setIcon(m_imgNULL);
                }
            }
View Full Code Here

TOP

Related Classes of fr.soleil.comete.bean.technicaldata.full.genericclasses.treeutil.TreeNodeMember$RecordabilityDevice

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.