Package javax.swing.tree

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


      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

           "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

            //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

    {
        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

        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

    }
   
    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

            }
        }
       
        if (treeNode == null)
        {
            TreeModel treeModel = tree.getModelObject();
           
            if (treeModel != null && treeModel.getRoot() != null)
            {
                treeNode = (DefaultMutableTreeNode) treeModel.getRoot();
            }
        }

        if (treeNode == null)
        {
View Full Code Here

  }

  @RunsInCurrentThread
  @Nonnull TreePath findMatchingPath(@Nonnull JTree tree, @Nonnull String path) {
    String[] pathStrings = splitPath(path);
    TreeModel model = tree.getModel();
    List<Object> newPathValues = newArrayList();
    Object node = model.getRoot();
    int pathElementCount = pathStrings.length;
    for (int stringIndex = 0; stringIndex < pathElementCount; stringIndex++) {
      String pathString = pathStrings[stringIndex];
      Object match = null;
      if (stringIndex == 0 && tree.isRootVisible()) {
        if (!pathString.equals(value(tree, node))) {
          throw pathNotFound(path);
        }
        newPathValues.add(node);
        continue;
      }
      int childCount = model.getChildCount(node);
      for (int childIndex = 0; childIndex < childCount; childIndex++) {
        Object child = model.getChild(node, childIndex);
        if (pathString.equals(value(tree, child))) {
          if (match != null) {
            throw multipleMatchingNodes(pathString, value(tree, node));
          }
          match = child;
View Full Code Here

     */
    public void renderNode(BridgePeer peer, BridgeRenderContext context,
            Object output, TreePath path, String treePath) throws RenderingException
    {
        JTree tree = (JTree) peer.getComponentObject();
        TreeModel model = tree.getModel();  
        Component com = null;
        Object value = path.getLastPathComponent();
               
        boolean enableFlag = true;
        boolean edit = tree.isEditable();
        if (edit)
        {
            com = (Component)tree.getCellEditor().getTreeCellEditorComponent(tree, value, true, true, model.isLeaf(value), 0);           
        } else
        {
            com = (Component)tree.getCellRenderer().getTreeCellRendererComponent(tree, value, true, true, model.isLeaf(value), 0, true);           
        }
        BridgePeer childPeer = context.getContext().getPeer(com);
        if (childPeer == null)
        {
            tree.add(com);
View Full Code Here

TOP

Related Classes of javax.swing.tree.TreeModel

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.