Package nodebox.node

Examples of nodebox.node.MenuItem


            if (dialog.isSuccessful()) {
                nodeAttributesDialog.addPortMenuItem(portName, dialog.getKey(), dialog.getLabel());
                menuItemsTable.tableChanged(new TableModelEvent(menuItemsTable.getModel()));
            }
        } else if (e.getSource() == removeButton) {
            MenuItem item = port.getMenuItems().get(menuItemsTable.getSelectedRow());
            nodeAttributesDialog.removePortMenuItem(portName, item);
        } else if (e.getSource() == upButton) {
            moveMenuItemUp();
        } else if (e.getSource() == downButton) {
            moveMenuItemDown();
View Full Code Here


    }
   
    private void updateMenuItem() {
        int index = menuItemsTable.getSelectedRow();
        if (index == -1) return;
        MenuItem item = getPort().getMenuItems().get(index);
        MenuItemDialog dialog = new MenuItemDialog((Dialog) SwingUtilities.getRoot(this), item);
        dialog.setVisible(true);
        if (dialog.isSuccessful()) {
            nodeAttributesDialog.updatePortMenuItem(portName, index, dialog.getKey(), dialog.getLabel());
            updateValues();
View Full Code Here

        public int getColumnCount() {
            return 2;
        }

        public Object getValueAt(int row, int column) {
            MenuItem item = getPort().getMenuItems().get(row);
            if (column == 0) {
                return item.getKey();
            } else {
                return item.getLabel();
            }
        }
View Full Code Here

        private JTextField keyField;
        private JTextField labelField;
        private JButton okButton, cancelButton;

        private MenuItemDialog(Dialog dialog) {
            this(dialog, new MenuItem("", ""));
        }
View Full Code Here

        menuBox.repaint();
        value = key;
    }

    public void actionPerformed(ActionEvent e) {
        MenuItem item = (MenuItem) menuBox.getSelectedItem();
        if (item != null) {
            setPortValue(item.getKey());
        }
    }
View Full Code Here

        @Override
        public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
            JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
            if (label == null) return null;
            MenuItem item = (MenuItem) value;
            if (item == null) return label;
            label.setText(item.getLabel());
            label.setFont(Theme.SMALL_BOLD_FONT);
            return label;
        }
View Full Code Here

TOP

Related Classes of nodebox.node.MenuItem

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.