Package view.customs

Examples of view.customs.DropTreeNode


    DefaultMutableTreeNode node = null;
    DefaultMutableTreeNode leaf = null;
    DefaultMutableTreeNode top = (DefaultMutableTreeNode) getModel()
        .getRoot();
    libView = new LibView("Bibliothek", gui.getCore());
    node = new DropTreeNode(libView);
    top.add(node);
    gui.setView(libView);

    node = new DropTreeNode(new QueueView("Warteschlange", gui.getCore()),
        true);
    top.add(node);
    queueTable = ((QueueView) node.getUserObject()).getTrackTable();

    node = new DropTreeNode("Fehlerhafte Dateien");
    top.add(node);

    node = new DropTreeNode(new TaggerView("Tagger", gui.getCore()), true);
   

    top.add(node);

    node = new DropTreeNode("Wiedergabelisten");
    playlistsNode = node;
    top.add(node);
    popupMenu = new TreePopupMenu(this);
    ResultSet rs = null;
    try {
      getAllPlaylistsStmt = PhoenixCore.DBCON.prepareOnLib("select id, name from playlists order by lower(name) asc");
      rs = getAllPlaylistsStmt.executeQuery();
    } catch (SQLException e1) {
      e1.printStackTrace();
    }
   
    try {
      while (rs.next()) {
        leaf = new DropTreeNode(new PlaylistView(gui.getCore(),rs.getInt("id"), rs.getString("name")), true);
        node.add(leaf);
      }
      rs.close();
    } catch (SQLException e) {
      e.printStackTrace();
View Full Code Here


        rs.close();
      } catch (SQLException e) {
        e.printStackTrace();
      }
      DropTreeNode node = new DropTreeNode(new PlaylistView(gui.getCore(),newListID, input), true);
      ((DefaultTreeModel)getModel()).insertNodeInto(node, playlistsNode, playlistsNode.getChildCount());
      setSelectionPath(new TreePath(node.getPath()));
      setSelectionRow(0);
    }
  }
View Full Code Here

    }else if (input == null) {//abbruch?
      return;
    }else if (!isValidPlaylistName(input)) {//sonderzeichen?
      JOptionPane.showMessageDialog(null, "Sonderzeichen sind nicht erlaubt.", "Operation Abgebrochen", JOptionPane.INFORMATION_MESSAGE);
    }else{//gültig, also:
      DropTreeNode node = ((DropTreeNode)getLastSelectedPathComponent());
      PlaylistView pl = ((PlaylistView)node.getUserObject());
      int id = pl.getPlaylistID();
      PhoenixCore.DBCON.deleteOnLib("update playlists set name='"+input+"' where id="+id);
      pl.setPlaylistName(input);
      node.setUserObject(pl);
      ((DefaultTreeModel)getModel()).nodeChanged(node);
    }
  }
View Full Code Here

      // fetch the drop location
      JTree.DropLocation dl = (JTree.DropLocation) support
          .getDropLocation();

      DropTreeNode dropNode = (DropTreeNode) dl.getPath()
          .getLastPathComponent();

      // fetch the data and bail if this fails
      TrackTransferDto data;
      try {
        data = (TrackTransferDto) support.getTransferable()
            .getTransferData(
                new DataFlavor(
                    DataFlavor.javaJVMLocalObjectMimeType
                        + ";class=\""
                        + TrackTransferDto.class
                            .getName() + "\""));
      } catch (UnsupportedFlavorException e) {
        e.printStackTrace();
        return false;
      } catch (java.io.IOException e) {
        e.printStackTrace();
        return false;
      } catch (ClassNotFoundException e) {
        e.printStackTrace();
        return false;
      }
      ((AbstractView) dropNode.getUserObject()).addTracks(data
          .getTracks());

      return false;// false, damit wieder zur urspruenglichen view
              // gesprungen wird.
    }
View Full Code Here

TOP

Related Classes of view.customs.DropTreeNode

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.