Package javax.swing

Examples of javax.swing.JComboBox$ComboBoxActionPropertyChangeListener


            palette = new JPanel();
            palette.setLayout(new BoxLayout(palette, BoxLayout.Y_AXIS));

            JPanel capPanel = PaletteHelper.createPaletteJPanel("Line Cap Decoration");
            String[] capStrings = { "Butt", "Round", "Square" };
            capBox = new JComboBox(capStrings);
            capBox.addActionListener(this);
            capPanel.add(capBox);
            palette.add(capPanel);

            JPanel joinPanel = PaletteHelper.createPaletteJPanel("Line Joint Decoration");

            String[] joinStrings = { "Miter", "Round", "Bevel" };
            joinBox = new JComboBox(joinStrings);
            joinBox.addActionListener(this);
            joinPanel.add(joinBox);
            palette.add(joinPanel);

            JPanel widthPanel = new JPanel();
View Full Code Here


        Object oldChoice = null;
        if (requestors != null) {
            oldChoice = requestors.getSelectedItem();
        }

        requestors = new JComboBox(requestorNames);
        requestors.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                JComboBox jcb = (JComboBox) e.getSource();
                String currentChoice = (String) jcb.getSelectedItem();
                setCurrentRequestor(currentChoice);
            }
        });

        if (requestorNames.length > 0) {
            if (oldChoice == null) {
                requestors.setSelectedIndex(0);
            } else {
                requestors.setSelectedItem(oldChoice);
            }
        }

        JPanel panel = PaletteHelper.createPaletteJPanel(i18n.get(OMDrawingToolLauncher.class,
                "panelSendTo",
                "Send To:"));
        panel.add(requestors);
        palette.add(panel);

        if (Debug.debugging("omdtl")) {
            Debug.output("Figuring out tools, using names");
        }

        panel = PaletteHelper.createPaletteJPanel(i18n.get(OMDrawingToolLauncher.class,
                "panelGraphicType",
                "Graphic Type:"));
        panel.add(getToolWidgets(useTextEditToolTitles));
        palette.add(panel);

        String[] renderTypes = new String[3];

        renderTypes[OMGraphic.RENDERTYPE_LATLON - 1] = rtc[0];
        renderTypes[OMGraphic.RENDERTYPE_XY - 1] = rtc[1];
        renderTypes[OMGraphic.RENDERTYPE_OFFSET - 1] = rtc[2];

        JComboBox renderTypeList = new JComboBox(renderTypes);
        renderTypeList.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                JComboBox jcb = (JComboBox) e.getSource();
                String currentChoice = (String) jcb.getSelectedItem();
                if (currentChoice == rtc[2]) {
                    defaultGraphicAttributes.setRenderType(OMGraphic.RENDERTYPE_OFFSET);
                } else if (currentChoice == rtc[1]) {
                    defaultGraphicAttributes.setRenderType(OMGraphic.RENDERTYPE_XY);
                } else {
View Full Code Here

            if (Debug.debugging("omdtl")) {
                Debug.output("Adding TOOL " + toolNames[i] + " to menu");
            }
        }

        JComboBox tools = new JComboBox(toolNames);
        tools.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                JComboBox jcb = (JComboBox) e.getSource();
                String currentChoice = (String) jcb.getSelectedItem();
                setCurrentCreation(currentChoice);
            }
        });

        if (toolNames.length > 0) {
View Full Code Here

                        " 1000 meter "),
                i18n.get(UTMGridPlugIn.class, "resStrings.100m", " 100 meter "),
                i18n.get(UTMGridPlugIn.class, "resStrings.10m", " 10 meter "),
                i18n.get(UTMGridPlugIn.class, "resStrings.1m", " 1 meter ") };

        JComboBox resList = new JComboBox(resStrings);
        resList.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                JComboBox jcb = (JComboBox) e.getSource();
                setDistanceGridResolution(jcb.getSelectedIndex());
                doPrepare();
            }
        });
        resList.setSelectedIndex(getDistanceGridResolution());
View Full Code Here

        }
       
        JPanel pnlDrives = new JPanel();
        pnlDrives.setLayout(Layout.getGBL());
       
        JComboBox cbDrives = ComponentFactory.getComboBox();
       
        JButton btAddDrive = ComponentFactory.getIconButton(IconLibrary._icoAdd);
        btAddDrive.setToolTipText(DcResources.getText("tpAddDrive"));
        btAddDrive.setActionCommand("addDrive");
        btAddDrive.addActionListener(this);

        pnlDrives.add(cbDrives, Layout.getGBC( 0, 1, 1, 1, 30.0, 1.0
                ,GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
                 new Insets(15, 5, 5, 5), 0, 0));   
        pnlDrives.add(btAddDrive, Layout.getGBC( 1, 1, 1, 1, 1.0, 1.0
                ,GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
                 new Insets(15, 5, 5, 5), 0, 0))
       
        add(pnlDrives, Layout.getGBC( 0, 1, 3, 1, 20.0, 1.0
                ,GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
                new Insets(0, 0, 0, 0), 0, 0))
       
        DcTree tree;
        for (Drive drive : new Drives().getDrives()) {
            tree = new DcTree(new FileSystemTreeModel(drive.getPath(), filter));
           
            tree.setCellRenderer(new FileSystemTreeNodeRenderer());
            tree.setCellEditor(new FileSystemTreeNodeEditor());
            tree.setEditable(true);
           
            JScrollPane scroller = new JScrollPane(tree);
            scroller.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
            add(scroller, Layout.getGBC( 0, 2, 1, 1, 20.0, 20.0
                        ,GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH,
                         new Insets(5, 5, 5, 5), 0, 0));     
           
            scroller.setVisible(false);
            scrollers.put(drive, scroller);
            models.put(drive, (FileSystemTreeModel) tree.getModel());
            cbDrives.addItem(drive)
        }
       
        cbDrives.setActionCommand("drvChanged");
        cbDrives.addActionListener(this);
        cbDrives.setSelectedIndex(0);
    }
View Full Code Here

    }

    @Override
    public void actionPerformed(ActionEvent e) {
        if (e.getActionCommand().equals("drvChanged")) {
            JComboBox cb = (JComboBox) e.getSource();
            setSelectedDrive((Drive) cb.getSelectedItem());
        } else if (e.getActionCommand().equals("addDrive")) {
            addDrive();
        }
    }
View Full Code Here

        TableColumn columnName = table.getColumnModel().getColumn(1);
        columnName.setCellEditor(new DefaultCellEditor(ComponentFactory.getTextFieldDisabled()));
        columnName.setHeaderValue(DcResources.getText("lblSourceName"));

        TableColumn columnField = table.getColumnModel().getColumn(2);
        JComboBox comboFields = ComponentFactory.getComboBox();
        columnField.setHeaderValue(DcResources.getText("lblTargetName"));

        for (DcField field : wizard.getModule().getFields()) {
            if (    (!field.isUiOnly() ||
                      field.getValueType() == DcRepository.ValueTypes._PICTURE ||
                      field.getValueType() == DcRepository.ValueTypes._DCOBJECTCOLLECTION) &&
                     field.getIndex() != DcObject._ID)
               
                comboFields.addItem(field);
        }
       
        columnField.setCellEditor(new DefaultCellEditor(comboFields));

        table.applyHeaders();
View Full Code Here

            JCheckBox checkEnabled = new JCheckBox();
            columnEnabled.setCellEditor(new DefaultCellEditor(checkEnabled));
            columnEnabled.setCellRenderer(CheckBoxTableCellRenderer.getInstance());
            columnEnabled.setHeaderValue(DcResources.getText("lblEnabled"));
           
            JComboBox comboDirection = ComponentFactory.getComboBox(
                    new String[] {DcResources.getText("lblHorizontal"), DcResources.getText("lblVertical")});

            TableColumn columnDirection = table.getColumnModel().getColumn(2);
            columnDirection.setCellEditor(new DefaultCellEditor(comboDirection));
            columnDirection.setHeaderValue(DcResources.getText("lblDirection"));
View Full Code Here

        TableColumn cFillGaps = table.getColumnModel().getColumn(2);
        cFillGaps.setCellEditor(new DefaultCellEditor(new JCheckBox()));
        cFillGaps.setCellRenderer(CheckBoxTableCellRenderer.getInstance());

        TableColumn cStep = table.getColumnModel().getColumn(3);
        JComboBox comboWeight = ComponentFactory.getComboBox();
        for (int i = 1; i < 101; i++)
            comboWeight.addItem(i);

        cStep.setCellEditor(new DefaultCellEditor(comboWeight));

        cField.setHeaderValue(DcResources.getText("lblField"));
        columnEnabled.setHeaderValue(DcResources.getText("lblEnabled"));
View Full Code Here

                comboCriteria.setRenderer(ComboBoxRenderer.getInstance());
                comboCriteria.setEditable(false);
            }
           
        } else if (c instanceof JComboBox) {
            JComboBox combo = (JComboBox) c;
            for (int i = 0; i < combo.getItemCount(); i++)
                comboCriteria.addItem(combo.getItemAt(i));
           
            comboCriteria.setRenderer(combo.getRenderer());
            comboCriteria.setEditable(false);
        } else {
            comboCriteria.setEditable(true);
        }
View Full Code Here

TOP

Related Classes of javax.swing.JComboBox$ComboBoxActionPropertyChangeListener

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.