Examples of TreeModel


Examples of javax.swing.tree.TreeModel

        treesCardLayout.show(treesPanel, repoName);

        //
        //later on, start fetching the root node
        //
        final TreeModel model = repoTree.getModel();
        if (model instanceof RepoTreeModel) {
            final RepoTreeModel repoModel = (RepoTreeModel) model;
            repoTree.fetchNode(repoModel.getRoot());
        }
        return repoTree;
View Full Code Here

Examples of javax.swing.tree.TreeModel

        if (currentRepo == null)
            return null;

        final Collection<RepoTree> trees = repos.values();
        for (RepoTree tree : trees) {
            final TreeModel treeModel = tree.getModel();
            if (!(treeModel instanceof RepoTreeModel))
                continue;

            final RepoTreeModel model = (RepoTreeModel) treeModel;
            final RepoTreeNode root = model.getRoot();
View Full Code Here

Examples of javax.swing.tree.TreeModel

        for (Category category : categories) {
          DefaultMutableTreeNode categoryNode = new DefaultMutableTreeNode(category);
          rootNode.add(categoryNode);
        }

        TreeModel treeModel = new DefaultTreeModel(rootNode);
        _categoryTree.setModel(treeModel);
      }
    }.start();
  }
View Full Code Here

Examples of javax.swing.tree.TreeModel

  public void encodeChildren(FacesContext facesContext, UIComponent component) throws IOException {

    TreeComponent treeComponent = (TreeComponent) component.getParent();   
    TreeChildrenComponent treeChildrenComponent = (TreeChildrenComponent) component;
    ResponseWriter responseWriter = facesContext.getResponseWriter();   
    TreeModel treeModel = treeComponent.getTreeModel();
    DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) treeModel.getRoot();
    if (treeNode != null) {
      String var = (String) component.getParent().getAttributes().get("var");
      if (var != null) {
        Map sessionMap = facesContext.getExternalContext().getSessionMap();
        synchronized (sessionMap) {
View Full Code Here

Examples of javax.swing.tree.TreeModel

      res = BillOfMaterialsUtil.getBillOfMaterials(conn,compCurr,pk,serverLanguageId,username,customizedFields);
      if (res.isError())
        throw new Exception(res.getErrorMessage());

      BigDecimal reportId = CompanyProgressiveUtils.getInternalProgressive(pk.getCompanyCodeSys01ITM01(),"TMP01_BILL_OF_MATERIALS","REPORT_ID",conn);
      TreeModel model = (TreeModel)((VOResponse)res).getVo();
      DefaultMutableTreeNode root = (DefaultMutableTreeNode)model.getRoot();

      pstmt = conn.prepareStatement(
          "insert into TMP01_BILL_OF_MATERIALS(REPORT_ID,PROGRESSIVE,COMPANY_CODE,PAD,ITEM_CODE,DESCRIPTION,LEV,QTY,UM,PRICE,TOTAL_PRICE,COST,TOTAL_COST,CREATE_USER,CREATE_DATE) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
      );
      expandNode(0,"",0,null,format,qtyFormat,reportId,pstmt,root,username);
View Full Code Here

Examples of javax.swing.tree.TreeModel

           "MACHINERY_CODE,MACHINERY_DESCRIPTION,SUBST_OPERATION_CODE,SUBST_OPERATION_DESCRIPTION,NOTE,CREATE_USER,CREATE_DATE) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
       );

       ProdOrderProductVO prodVO = null;
       Response res = null;
       TreeModel model = null;
       DefaultMutableTreeNode root;
       int sequence = 0;
       HashSet subProductsAlreadyAdded = new HashSet();
       for(int i=0;i<products.size();i++) {
         prodVO = (ProdOrderProductVO)products.get(i);
         // retrieve bill of materials for each product...
         res = BillOfMaterialsUtil.getBillOfMaterials(conn,compCurr,new ItemPK(prodVO.getCompanyCodeSys01DOC23(),prodVO.getItemCodeItm01DOC23()),serverLanguageId,username,new ArrayList());
         if (res.isError())
           throw new Exception(res.getErrorMessage());
         model = (TreeModel)((VOResponse)res).getVo();
         root = (DefaultMutableTreeNode)model.getRoot();

         // expand nodes to retrieve sun-products and fill in DOC25/DOC26...
         sequence = expandNode(sequence,prodOrderVO,root,usedComponents,usedComponentsVO,compAltCodes,subProductsAlreadyAdded,pstmt,pstmt2,serverLanguageId,username,imagePath);
       }
       return new VOResponse(Boolean.TRUE);
View Full Code Here

Examples of javax.swing.tree.TreeModel

            //Thread
            Thread thread = new Thread(fillingThreads, new Runnable() {

                public void run() {
                    busyLabel.setBusy(true);
                    final TreeModel treeMdl = new IssueTreeModel(issues);
                    final OutlineModel mdl = DefaultOutlineModel.createOutlineModel(treeMdl, new IssueRowModel(), true);

                    SwingUtilities.invokeLater(new Runnable() {

                        public void run() {
View Full Code Here

Examples of javax.swing.tree.TreeModel

    {
        InputStream input = null;
        File f = new File( file );
        input = new FileInputStream(f);
        PDDocument document = parseDocument( input );
        TreeModel model=new PDFTreeModel(document);
        jTree1.setModel(model);
        setTitle( "PDFBox - " + f.getAbsolutePath() );
        /*
        List pages = document.getDocumentCatalog().getAllPages();
        for( int i=0; i<pages.size(); i++ )
View Full Code Here

Examples of javax.swing.tree.TreeModel

        Rectangle           cellRect = tree.getPathBounds(treePath);
        return cellRect;
    }

    public Component getRendererComponent() {
        TreeModel treeModel = tree.getModel();
        TreePath treePath = tree.getPathForRow(rowIndex);
        TreeCellRenderer renderer = tree.getCellRenderer();
        boolean isSelected = tree.isPathSelected(treePath);
        boolean isExpanded = tree.isExpanded(treePath);
        boolean hasFocus = tree.hasFocus() && rowIndex == tree.getLeadSelectionRow();
        Object item = treePath.getLastPathComponent();
        boolean isLeaf = treeModel.isLeaf(item);
        Component component = renderer.getTreeCellRendererComponent(tree, item, isSelected, isExpanded, isLeaf, rowIndex, hasFocus);
        component.setFont(tree.getFont());
        return component;
    }
View Full Code Here

Examples of javax.swing.tree.TreeModel

    }
   
    private DefaultMutableTreeNode getTreeNodeByPath(String path)
    {
        PortalTree tree = (PortalTree) getPage().get("siteTree");
        TreeModel treeModel = tree.getModelObject();
        List<DefaultMutableTreeNode> treeNodeList = new ArrayList<DefaultMutableTreeNode>();
        findTreeNodeByPath((DefaultMutableTreeNode) treeModel.getRoot(), path, treeNodeList, 1);
        return (treeNodeList.isEmpty() ? null : treeNodeList.get(0));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.