Package javax.swing

Examples of javax.swing.AbstractButton$AccessibleAbstractButton


        });
        edlMenu = new JMenu(Strings.get("menu_errordialoglevel")) {
          {
            ButtonGroup group = new ButtonGroup();

            AbstractButton jrbn = new JRadioButtonMenuItem(Strings.get("menu_errordialoglevel_normal"));
            group.add(jrbn);
            add(jrbn);
            jrbn.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent ev) {
                System.setProperty("org.knopflerfish.desktop.errordialogfriendliness", "normal");
              }
            });

            AbstractButton jrbm = new JRadioButtonMenuItem(Strings.get("menu_errordialoglevel_more"));
            group.add(jrbm);
            add(jrbm);
            jrbm.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent ev) {
                System.setProperty("org.knopflerfish.desktop.errordialogfriendliness", "more");
              }
            });

            AbstractButton jrba = new JRadioButtonMenuItem(Strings.get("menu_errordialoglevel_advanced"));
            group.add(jrba);
            add(jrba);
            jrba.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent ev) {
                System.setProperty("org.knopflerfish.desktop.errordialogfriendliness", "advanced");
              }
            });

            String curr = Util.getProperty("org.knopflerfish.desktop.errordialogfriendliness", null);
            if ("more".equals(curr)) {
              group.setSelected(jrbm.getModel(), true);
            } else if ("advanced".equals(curr)) {
              group.setSelected(jrba.getModel(), true);
            } else {
              group.setSelected(jrbn.getModel(), true);
            }

            setEnabled(!Util.getBooleanProperty("org.knopflerfish.desktop.dontuseerrordialog", false));
View Full Code Here


                }
            }
        }

        for (Enumeration<AbstractButton> btns = nodeTransformerGroup.getElements(); btns.hasMoreElements();) {
            AbstractButton btn = btns.nextElement();
            btn.setVisible(nodeSelected);
            if (model.getNodeTransformer() != null && btn.getName().equals(model.getNodeTransformer().getSimpleName())) {
                nodeTransformerGroup.setSelected(btn.getModel(), true);
            }
        }
        for (Enumeration<AbstractButton> btns = edgeTransformerGroup.getElements(); btns.hasMoreElements();) {
            AbstractButton btn = btns.nextElement();
            btn.setVisible(edgeSelected);
            if (model.getEdgeTransformer() != null && btn.getName().equals(model.getEdgeTransformer().getSimpleName())) {
                edgeTransformerGroup.setSelected(btn.getModel(), true);
            }
        }
    }
View Full Code Here

        }
    }

    private void initProcessorsUI() {
        for (Enumeration<AbstractButton> enumeration = processorGroup.getElements(); enumeration.hasMoreElements();) {
            AbstractButton radioButton = enumeration.nextElement();
            Processor p = (Processor) radioButton.getClientProperty(PROCESSOR_KEY);
            //Enabled
            ProcessorUI pui = getProcessorUI(p);
            if (pui != null) {
                radioButton.setEnabled(pui.isValid(container));
            }
        }
    }
View Full Code Here

        fillingThreads.interrupt();
    }

    public Processor getProcessor() {
        for (Enumeration<AbstractButton> enumeration = processorGroup.getElements(); enumeration.hasMoreElements();) {
            AbstractButton radioButton = enumeration.nextElement();
            if (radioButton.isSelected()) {
                return (Processor) radioButton.getClientProperty(PROCESSOR_KEY);
            }
        }
        return null;
    }
View Full Code Here

        nodeTransformerGroup.clearSelection();
        edgeTransformerGroup.clearSelection();

        for (Enumeration<AbstractButton> btns = nodeTransformerGroup.getElements(); btns.hasMoreElements();) {
            AbstractButton btn = btns.nextElement();
            btn.setVisible(nodeSelected);
            if (model.getNodeTransformerBuilder() != null && btn.getName().equals(model.getNodeTransformerBuilder().getClass().getName())) {
                nodeTransformerGroup.setSelected(btn.getModel(), true);
            }
        }
        for (Enumeration<AbstractButton> btns = edgeTransformerGroup.getElements(); btns.hasMoreElements();) {
            AbstractButton btn = btns.nextElement();
            btn.setVisible(edgeSelected);
            if (model.getEdgeTransformerBuilder() != null && btn.getName().equals(model.getEdgeTransformerBuilder().getClass().getName())) {
                edgeTransformerGroup.setSelected(btn.getModel(), true);
            }
        }
    }
View Full Code Here

        }
    }

    private static Component option2Button(Object option, NotifyDescriptor nd, ActionListener l, JRootPane rp) {
        if (option instanceof AbstractButton) {
            AbstractButton b = (AbstractButton) option;
            b.addActionListener(l);

            return b;
        } else if (option instanceof Component) {
            return (Component) option;
        } else if (option instanceof Icon) {
            return new JLabel((Icon) option);
        } else {
            String text;
            boolean defcap;

            if (option == NotifyDescriptor.OK_OPTION) {
                text = "OK"; // XXX I18N
                defcap = true;
            } else if (option == NotifyDescriptor.CANCEL_OPTION) {
                text = "Cancel"; // XXX I18N
                defcap = false;
            } else if (option == NotifyDescriptor.YES_OPTION) {
                text = "Yes"; // XXX I18N
                defcap = true;
            } else if (option == NotifyDescriptor.NO_OPTION) {
                text = "No"; // XXX I18N
                defcap = false;
            } else if (option == NotifyDescriptor.CLOSED_OPTION) {
                throw new IllegalArgumentException();
            } else {
                text = option.toString();
                defcap = false;
            }

            JButton b = new JButton(text);

            if (defcap && (rp.getDefaultButton() == null)) {
                rp.setDefaultButton(b);
            }

            // added a simple accessible name to buttons
            b.getAccessibleContext().setAccessibleName(text);
            b.addActionListener(l);

            return b;
        }
    }
View Full Code Here

        addMouseListener(new MouseAdapter() {
          public void mouseEntered(MouseEvent e) {
            Component component = e.getComponent();

            if (component instanceof AbstractButton) {
              AbstractButton button = (AbstractButton) component;
              button.setBorderPainted(true);
            }
          }

          public void mouseExited(MouseEvent e) {
            Component component = e.getComponent();
            if (component instanceof AbstractButton) {
              AbstractButton button = (AbstractButton) component;
              button.setBorderPainted(false);
            }
          }
        });
        setRolloverEnabled(true);
        //Close the proper tab by clicking the button
View Full Code Here

        putValue(SMALL_ICON, WATCH_ICON);
        setEnabled(false);
    }

    public void actionPerformed(final ActionEvent ae) {
        final AbstractButton source = (AbstractButton)ae.getSource();
        if (source.isSelected()) {
            final GCDocument selectedGCDocument = gcViewer.getSelectedGCDocument();
            selectedGCDocument.setWatched(true);
            selectedGCDocument.getRefreshWatchDog().setAction(this);
            selectedGCDocument.getRefreshWatchDog().start();
        }
View Full Code Here

        }

        public void mouseEntered(MouseEvent evt)
        {
            if (evt.getSource() instanceof AbstractButton) {
                AbstractButton button = (AbstractButton) evt.getSource();
                Action action = button.getAction();
                if (action != null && enabledChange) {
                    String message = (String) action
                            .getValue(Action.LONG_DESCRIPTION);
                    label.setText(message);
                }
View Full Code Here

      super( getResourceString( "buttonMonitoring" ));
    }

    public void actionPerformed( ActionEvent e )
    {
      final AbstractButton b = (AbstractButton) e.getSource();
     
      player.setActiveOutput( b.isSelected() );
    }
View Full Code Here

TOP

Related Classes of javax.swing.AbstractButton$AccessibleAbstractButton

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.