Package de.chris_soft.nanodoa.gui.tree.path

Examples of de.chris_soft.nanodoa.gui.tree.path.DocumentPath


          for (long labelID : labels) {
            LabelPath labelPath = new LabelPath(labelID);
            God.labelTree.addNode(null, labelPath);
            List<Long> docs = God.archive.db.getDocumentsFromLabel(labelID);
            for (long docID : docs) {
              DocumentPath docPath = new DocumentPath(docID);
              God.labelTree.addNode(labelPath, docPath);
            }
          }
        } catch (SQLException exception) {
          // Ignore?
View Full Code Here


   * @param searchTerm Search items.
   * @param documentID Document to show.
   */
  public void showSearchedDocument(String searchTerm, long documentID) {
    God.specialsTree.setCurrentNode(new SearchPath(searchTerm));
    God.specialsTree.setCurrentChild(new DocumentPath(documentID));
  }
View Full Code Here

  }

  private void setDocumentLabel(long documentID, long labelID) {
    LabelPath labelPath = new LabelPath(labelID);
    List<Object> children = God.labelTree.getChildUserObjects(labelPath);
    DocumentPath docPath = new DocumentPath(documentID);
    if (!children.contains(docPath)) {
      God.labelTree.addNode(labelPath, docPath);
    }
  }
View Full Code Here

  private void unsetDocumentLabel(long documentID, long labelID) {
    LabelPath labelPath = new LabelPath(labelID);
    if (God.labelTree.hasNode(labelPath)) {
      List<Object> children = God.labelTree.getChildUserObjects(labelPath);
      for (Object oChild : children) {
        DocumentPath child = (DocumentPath) oChild;
        if (child.docID == documentID) {
          God.labelTree.removeUserObjectPath(new Object[] {God.labelTree.rootObject, labelPath, child});
          break;
        }
      }
View Full Code Here

    TreePath selectionPath = tree.getSelectionPath();
    if (selectionPath != null) {
      DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) selectionPath.getLastPathComponent();
      Object userObject = treeNode.getUserObject();
      if (userObject instanceof DocumentPath) {
        DocumentPath docPath = (DocumentPath) userObject;
        God.appWindow.setCurrentDocument(docPath.docID);
        // selectShownDocumentInArchiveTree(treeNode, docPath);
      }
    }
  }
View Full Code Here

    TreePath selectionPath = tree.getSelectionPath();
    if (selectionPath != null) {
      DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) selectionPath.getLastPathComponent();
      Object userObject = selectedNode.getUserObject();
      if (userObject instanceof DocumentPath) {
        DocumentPath docPath = (DocumentPath) userObject;
        if (docPath.docID == docID) {
          selected = true;
        }
      }
    }

    if (!selected) {
      DocumentPath docPath = new DocumentPath(docID);
      if (!hasNode(docPath)) {
        try {
          fillArchiveTreeToDocumentRecursive(docPath);
        }
        catch (Exception exception) {
View Full Code Here

  }

  private void addAllDocumentsToTreeNode(SubPath subPath) throws Exception {
    List<Long> docs = God.archive.getFilesFromSubDirectory(subPath.id);
    for (long docID : docs) {
      DocumentPath docPath = new DocumentPath(docID);
      if (!hasNode(docPath)) {
        addNode(subPath, docPath);
      }
    }
  }
View Full Code Here

    TreePath selectionPath = tree.getSelectionPath();
    if (selectionPath != null) {
      DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) selectionPath.getLastPathComponent();
      Object userObject = treeNode.getUserObject();
      if (userObject instanceof DocumentPath) {
        DocumentPath docPath = (DocumentPath) userObject;
        God.appWindow.setCurrentDocument(docPath.docID);
        // selectShownDocumentInArchiveTree(treeNode, docPath);
      }
    }
  }
View Full Code Here

    menu.add(menuItem);
    menu.show((JComponent) e.getSource(), e.getX(), e.getY());
  }

  private void rightClickedOnDocumentPath(MouseEvent e, DefaultMutableTreeNode node, JPopupMenu menu) {
    final DocumentPath documentPath = (DocumentPath) node.getUserObject();
    Object parent = ((DefaultMutableTreeNode) node.getParent()).getUserObject();
    if (parent instanceof LabelPath) {
      final LabelPath labelPath = (LabelPath) parent;
      JMenuItem menuItem = new JMenuItem("Remove label '" + labelPath.toString() + "' from this document");
      menuItem.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
          try {
            God.archive.db.removeLabelFromDocument(documentPath.getID(), labelPath.getID());
            God.appWindow.refreshLabelList();
          }
          catch (SQLException exception) {
            SwingUtils.showError(God.appWindow.frame, "Couldn't remove label from document!");
          }
View Full Code Here

  }

  void listAllDocumentsUnderNode(List<Long> documents, DefaultMutableTreeNode node) {
    Object userObject = node.getUserObject();
    if (userObject instanceof DocumentPath) {
      DocumentPath docPath = (DocumentPath) userObject;
      documents.add(docPath.docID);
    }
    Enumeration<?> children = node.children();
    while (children.hasMoreElements()) {
      DefaultMutableTreeNode child = (DefaultMutableTreeNode) children.nextElement();
View Full Code Here

TOP

Related Classes of de.chris_soft.nanodoa.gui.tree.path.DocumentPath

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.