Package javax.swing

Examples of javax.swing.JCheckBoxMenuItem$AccessibleJCheckBoxMenuItem


//            }
//        });
//        instrumentation = new DefaultInstrumentation(ClientContextJME.getWorldManager());

        // The menu item for the Gesture (HUD)
        gestureMI = new JCheckBoxMenuItem(bundle.getString("Gesture_UI"));
        gestureMI.setSelected(false);
        gestureMI.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                boolean visible = gestureMI.isSelected();
                if (gestureHUDRef == null || gestureHUDRef.get() == null) {
                    GestureHUD hud = new GestureHUD(gestureMI);
                    hud.setAvatarCharacter(avatarCellRenderer.getAvatarCharacter(), visible);
                    gestureHUDRef = new WeakReference(hud);
                }
                //issue #174 hud visibility management
                if (visible) {
                  gestureHUDRef.get().setMaximized();
                }
                gestureHUDRef.get().setVisible(visible);
            }       
        });

        // The menu item for the avatar configuration
        avatarConfigMI = new JMenuItem(bundle.getString("Avatar_Appearance..."));
        avatarConfigMI.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                AvatarConfigFrame f = new AvatarConfigFrame();
                f.setVisible(true);
            }
        });

        // Check box to set collision enabled
        collisionResponseEnabledMI = new JCheckBoxMenuItem(bundle.getString("Avatar_Collision_Response_Enabled"));
        collisionResponseEnabledMI.setSelected(true); // TODO should be set by server
        collisionResponseEnabledMI.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                boolean isCollisionResponse = collisionResponseEnabledMI.isSelected();
                boolean isGravity = gravityEnabledMI.isSelected();
                ClientContext.getInputManager().postEvent(
                        new AvatarCollisionChangeRequestEvent(isCollisionResponse, isGravity));
            }
        });

        // Check box to set gravity (floor following) enabled
        gravityEnabledMI = new JCheckBoxMenuItem(bundle.getString("Avatar_Gravity_Enabled"));
        gravityEnabledMI.setSelected(true); // TODO should be set by server
        gravityEnabledMI.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                boolean isCollisionResponse = collisionResponseEnabledMI.isSelected();
                boolean isGravity = gravityEnabledMI.isSelected();
View Full Code Here


        userPanelRefMap = new HashMap<String, WeakReference<TextChatPanel>>();

        // Create the global text chat menu item. Listen for when it is
        // selected or de-selected and show/hide the frame as appropriate. This
        // menu item will get added/removed for each primary session.
        textChatMenuItem = new JCheckBoxMenuItem(BUNDLE.getString("Text_Chat"));
        textChatMenuItem.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                // Fetch the global text chat menu item and make it visible
                // if not already so.
View Full Code Here

    dfBG.add(simpleTimeButton);
    isoButton.setSelected(true);
    dateFormatChangePopup.add(isoButton);
    dateFormatChangePopup.add(simpleTimeButton);

    final JCheckBoxMenuItem menuItemToggleToolTips =
      new JCheckBoxMenuItem("Show ToolTips");
    menuItemToggleToolTips.addActionListener(
      new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
          preferenceModel.setToolTips(menuItemToggleToolTips.isSelected());
        }
      });
    menuItemToggleToolTips.setIcon(new ImageIcon(ChainsawIcons.TOOL_TIP));

    final JCheckBoxMenuItem menuItemLoggerTree =
      new JCheckBoxMenuItem("Show Logger Tree panel");
    menuItemLoggerTree.addActionListener(
      new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          preferenceModel.setLogTreePanelVisible(
            menuItemLoggerTree.isSelected());
        }
      });
    menuItemLoggerTree.setIcon(new ImageIcon(ChainsawIcons.WINDOW_ICON));

    final JCheckBoxMenuItem menuItemScrollBottom =
      new JCheckBoxMenuItem("Scroll to bottom");
    menuItemScrollBottom.addActionListener(
      new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
          preferenceModel.setScrollToBottom(menuItemScrollBottom.isSelected());
        }
      });

    menuItemScrollBottom.setIcon(
      new ImageIcon(ChainsawIcons.SCROLL_TO_BOTTOM));

    final JCheckBoxMenuItem menuItemToggleDetails =
      new JCheckBoxMenuItem("Show Detail Pane");
    menuItemToggleDetails.addActionListener(
      new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          preferenceModel.setDetailPaneVisible(
            menuItemToggleDetails.isSelected());
        }
      });

    menuItemToggleDetails.setIcon(new ImageIcon(ChainsawIcons.INFO));

    /*
     * add preferencemodel listeners
     */
    preferenceModel.addPropertyChangeListener(
      "levelIcons",
      new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
          renderer.setLevelUseIcons(
            ((Boolean) evt.getNewValue()).booleanValue());
          table.tableChanged(new TableModelEvent(tableModel));
        }
      });

    preferenceModel.addPropertyChangeListener(
      "detailPaneVisible",
      new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
          boolean newValue = ((Boolean) evt.getNewValue()).booleanValue();

          if (newValue) {
            showDetailPane();
          } else {
            hideDetailPane();
          }
        }
      });

    preferenceModel.addPropertyChangeListener(
      "logTreePanelVisible",
      new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
          boolean newValue = ((Boolean) evt.getNewValue()).booleanValue();

          if (newValue) {
            showLogTreePanel();
          } else {
            hideLogTreePanel();
          }
        }
      });

    preferenceModel.addPropertyChangeListener(
      "toolTips",
      new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
          renderer.setToolTipsVisible(
            ((Boolean) evt.getNewValue()).booleanValue());
        }
      });

    preferenceModel.addPropertyChangeListener(
      "visibleColumns",
      new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
          TableColumnModel columnModel = table.getColumnModel();

          for (int i = 0; i < columnModel.getColumnCount(); i++) {
            TableColumn column = columnModel.getColumn(i);

            if (
              !preferenceModel.isColumnVisible(
                  column.getHeaderValue().toString())) {
              columnModel.removeColumn(column);
            }
          }

          Set columnSet = new HashSet();
          Enumeration enumeration = columnModel.getColumns();

          while (enumeration.hasMoreElements()) {
            TableColumn column = (TableColumn) enumeration.nextElement();

            columnSet.add(column.getHeaderValue());
          }

          for (
            Iterator iter = ChainsawColumns.getColumnsNames().iterator();
              iter.hasNext();) {
            String column = (String) iter.next();

            if (
              preferenceModel.isColumnVisible(column)
                && !columnSet.contains(column)) {
              TableColumn newCol =
                new TableColumn(
                  ChainsawColumns.getColumnsNames().indexOf(column));
              newCol.setHeaderValue(column);
              columnModel.addColumn(newCol);
            }
          }
        }
      });

    PropertyChangeListener datePrefsChangeListener =
      new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
          LogPanelPreferenceModel model =
            (LogPanelPreferenceModel) evt.getSource();

          isoButton.setSelected(model.isUseISO8601Format());
          simpleTimeButton.setSelected(
            !model.isUseISO8601Format() && !model.isCustomDateFormat());

          if (model.isUseISO8601Format()) {
            renderer.setDateFormatter(new SimpleDateFormat(Constants.ISO8601_PATTERN));
          } else {
            renderer.setDateFormatter(
              new SimpleDateFormat(model.getDateFormatPattern()));
          }

          table.tableChanged(new TableModelEvent(tableModel));
        }
      };

    preferenceModel.addPropertyChangeListener(
      "dateFormatPattern", datePrefsChangeListener);
    preferenceModel.addPropertyChangeListener(
      "dateFormatPattern", datePrefsChangeListener);

    preferenceModel.addPropertyChangeListener(
      "loggerPrecision",
      new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
          LogPanelPreferenceModel model =
            (LogPanelPreferenceModel) evt.getSource();

          renderer.setLoggerPrecision(model.getLoggerPrecision());

          table.tableChanged(new TableModelEvent(tableModel));
        }
      });

    preferenceModel.addPropertyChangeListener(
      "toolTips",
      new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
          boolean value = ((Boolean) evt.getNewValue()).booleanValue();
          menuItemToggleToolTips.setSelected(value);
        }
      });

    preferenceModel.addPropertyChangeListener(
      "logTreePanelVisible",
      new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
          boolean value = ((Boolean) evt.getNewValue()).booleanValue();
          menuItemLoggerTree.setSelected(value);
        }
      });

    preferenceModel.addPropertyChangeListener(
      "scrollToBottom",
      new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
          boolean value = ((Boolean) evt.getNewValue()).booleanValue();
          menuItemScrollBottom.setSelected(value);
          scroll = value;
          if (scroll) {
            table.scrollToBottom(table.columnAtPoint(table.getVisibleRect().getLocation()));
          }
        }
      });

    preferenceModel.addPropertyChangeListener(
      "detailPaneVisible",
      new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
          boolean value = ((Boolean) evt.getNewValue()).booleanValue();
          menuItemToggleDetails.setSelected(value);
        }
      });

    /*
     *End of preferenceModel listeners
View Full Code Here

        "Other options available via panel's right mouse button popup menu");
    menuItemUseRightMouse.setEnabled(false);

    viewMenu.setMnemonic('V');

    final JCheckBoxMenuItem showToolbarCheck =
      new JCheckBoxMenuItem(toggleToolbarAction);
    showToolbarCheck.setSelected(
      logui.getApplicationPreferenceModel().isToolbar());

    logui.getApplicationPreferenceModel().addPropertyChangeListener(
      "toolbar",
      new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
          boolean value = ((Boolean) evt.getNewValue()).booleanValue();
          showToolbarCheck.setSelected(value);
        }
      });

    menuItemClose.setAction(closeAction);

    JCheckBoxMenuItem pause = new JCheckBoxMenuItem(pauseAction);
    JMenuItem menuPrefs = new JMenuItem(showPreferencesAction);
    menuPrefs.setText(
      showPreferencesAction.getValue(Action.SHORT_DESCRIPTION).toString());

    JMenuItem menuCustomExpressionPanel =
View Full Code Here

    SwingBaseMenuItemPeer<CheckboxMenuItem, JCheckBoxMenuItem> implements
    CheckboxMenuItemPeer {

    public SwingCheckboxMenuItemPeer(SwingToolkit toolkit,
                                     CheckboxMenuItem checkBoxMenuItem) {
        super(toolkit, checkBoxMenuItem, new JCheckBoxMenuItem());
    }
View Full Code Here

    }

    /* Create the pop up menu for the stats shown table. */
    private void createMenu() {
        popup = new JPopupMenu();
        logMenuItem = new JCheckBoxMenuItem("Log This Stat");
        logMenuItem.addActionListener(new LogMenuListener());
        popup.add(logMenuItem);
        graphMenuItem = new JMenuItem("Graph This Stat");
        graphMenuItem.addActionListener(new GraphMenuListener());
        popup.add(graphMenuItem);
View Full Code Here

        registerStrat(new BoxStrategy());
        timer = new Timer();
        NavigatableComponent.addZoomChangeListener(this);

        ToggleAction toggle = new ToggleAction();
        JCheckBoxMenuItem menuItem = MainMenu.addWithCheckbox(Main.main.menu.fileMenu, toggle,
                MainMenu.WINDOW_MENU_GROUP.ALWAYS);
        menuItem.setState(active);
        toggle.addButtonModel(menuItem.getModel());
    }
View Full Code Here

        try {
            LookAndFeelInfo[] installedLookAndFeels = UIManager.getInstalledLookAndFeels();
            menusLnF = new JCheckBoxMenuItem[installedLookAndFeels.length];
            for (int i = 0; i < installedLookAndFeels.length; i++) {
                LookAndFeelInfo info = installedLookAndFeels[i];
                final JCheckBoxMenuItem jCheckBoxMenuItem = new JCheckBoxMenuItem(info.getName());
                jCheckBoxMenuItem.addItemListener(new ItemListener() {
                    @Override
                    public void itemStateChanged(ItemEvent e) {
                        if (e.getStateChange() == ItemEvent.SELECTED) {
                            try {
                                LookAndFeelInfo findLookAndFeel = findLookAndFeel(jCheckBoxMenuItem.getText());
                                if (UIManager.getLookAndFeel().getName().contains(jCheckBoxMenuItem.getText())
                                        || UIManager.getLookAndFeel().getID().contains(jCheckBoxMenuItem.getText())
                                        || UIManager.getLookAndFeel().getClass().getName().equals(findLookAndFeel.getClassName())) {
                                    return;
                                }
                                setLookAndFeel(findLookAndFeel);
                                for (JCheckBoxMenuItem menuItem : menusLnF) {
View Full Code Here

            }
        });
        viewMenu.add(filterMenu);
        for(final Matcher m : filters) {
            JCheckBoxMenuItem f = new JCheckBoxMenuItem(m.toString(), suppressionFilter.isEnabled(m));
            viewMenu.add(f);
            f.addItemListener(new ItemListener() {

                @Override
                public void itemStateChanged(ItemEvent e) {
                    boolean enabled = e.getStateChange() == ItemEvent.SELECTED;
                    suppressionFilter.setEnabled(m, enabled);
View Full Code Here

    refreshMenuItem = new JMenuItem("Refresh Descriptors from File System");
    refreshMenuItem.addActionListener(this);
    menuItemList.add(refreshMenuItem);

    JMenu saveOptionsSubmenu = new JMenu ("Save Options");
    saveUsingImportMenuItem = new JCheckBoxMenuItem("Use <import>");
    saveUsingImportMenuItem.addActionListener(this);
    saveUsingImportMenuItem.setSelected(saveUsingImports);
    saveOptionsSubmenu.add(saveUsingImportMenuItem);
    menuItemList.add(saveOptionsSubmenu);
       
View Full Code Here

TOP

Related Classes of javax.swing.JCheckBoxMenuItem$AccessibleJCheckBoxMenuItem

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.