Package com.tulskiy.musique.gui.model

Examples of com.tulskiy.musique.gui.model.MultiTagFieldModel


    public TracksInfoDialog(final PlaylistTable parent, final List<Track> tracks) {
        this.parent = parent;
        setTitle("Properties");
        setModal(false);

        final MultiTagFieldModel tagFieldsModel = new MultiTagFieldModel(tracks);
        final JComponent tagsTable = createTable(tagFieldsModel);
        final JComponent propsTable = createTable(new FileInfoModel(tracks));

        JTabbedPane tp = new JTabbedPane();
        tp.setFocusable(false);
        tp.addTab("Metadata", tagsTable);
        tp.addTab("Properties", propsTable);

        add(tp, BorderLayout.CENTER);

        Box b1 = new Box(BoxLayout.X_AXIS);
        b1.add(Box.createHorizontalStrut(10));
        final JButton tools = new JButton("Tools");
        b1.add(tools);
        tools.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                final JPopupMenu menu = new JPopupMenu();

                JMenuItem menuItemEdit = new JMenuItem("Auto track number");
                menu.add(menuItemEdit).addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
              Tools.autoTrackNumber(tagFieldsModel);
              tagFieldsModel.sort();
             
                tagsTable.revalidate();
                tagsTable.repaint();
            }
              });
               
                menu.show(tools, 0, tools.getBounds().height);
            }
        });
        b1.add(Box.createHorizontalGlue());
        JButton write = new JButton("Write");
        b1.add(write);
        write.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
              tagFieldsModel.approveModel();
                writeTracks(tracks);
            }
        });
        cancel = new JButton("Cancel");
        cancel.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
              tagFieldsModel.rejectModel();
              setVisible(false);
                dispose();
                parent.requestFocus();
            }
        });
View Full Code Here


        }
        catch (UnsupportedFlavorException ufe) {
          // ignore since we already checked at menu construction that flavor is supported
        }
        if (items != null) {
          MultiTagFieldModel model = getTagFieldModel(table);
          model.mergeTrackInfoItems(items);
          model.sort();
          refreshTable(table);
        }
            }
        });
View Full Code Here

TOP

Related Classes of com.tulskiy.musique.gui.model.MultiTagFieldModel

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.