Package javax.swing

Examples of javax.swing.JMenu$AccessibleJMenu


            if( FileTransferManager.inst().getPersistenceManager() != null ) {
                add(changePriorityMenu);
                addSeparator();
            }

            final JMenu enabledSubMenu = new JMenu(language.getString("UploadPane.fileTable.popupmenu.enableUploads") + "...");
            enabledSubMenu.add(enableSelectedDownloadsItem);
            enabledSubMenu.add(disableSelectedDownloadsItem);
            enabledSubMenu.add(invertEnabledSelectedItem);
            enabledSubMenu.addSeparator();

            enabledSubMenu.add(enableAllDownloadsItem);
            enabledSubMenu.add(disableAllDownloadsItem);
            enabledSubMenu.add(invertEnabledAllItem);
            add(enabledSubMenu);

            add(startSelectedUploadsNow);
            add(generateChkForSelectedFilesItem);
            add(uploadSelectedFilesItem);
View Full Code Here


    }

    public JPopupMenu setGUI(JPopupMenu popup) {

        //////// Line Cap
        JMenu capMenu = new JMenu(i18n.get(BasicStrokeEditorMenu.class, "Cap_Decoration", "Cap Decoration"));

        ActionListener listener = new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                String command = ae.getActionCommand();
                try {
                    setEndCaps(Integer.parseInt(command));
                    resetStroke();
                } catch (NumberFormatException e) {
                }
            }
        };

        ButtonGroup group = new ButtonGroup();
        JRadioButtonMenuItem button = new JRadioButtonMenuItem(i18n.get(BasicStrokeEditorMenu.class, "Butt", "Butt"), endCaps == BasicStroke.CAP_BUTT);
        button.setActionCommand(String.valueOf(BasicStroke.CAP_BUTT));
        group.add(button);
        button.addActionListener(listener);
        capMenu.add(button);

        button = new JRadioButtonMenuItem(i18n.get(BasicStrokeEditorMenu.class, "Round", "Round"), endCaps == BasicStroke.CAP_ROUND);
        button.setActionCommand(String.valueOf(BasicStroke.CAP_ROUND));
        group.add(button);
        button.addActionListener(listener);
        capMenu.add(button);

        button = new JRadioButtonMenuItem(i18n.get(BasicStrokeEditorMenu.class, "Square", "Square"), endCaps == BasicStroke.CAP_SQUARE);
        button.setActionCommand(String.valueOf(BasicStroke.CAP_SQUARE));
        group.add(button);
        button.addActionListener(listener);
        capMenu.add(button);

        //////// Line Joins

        JMenu joinMenu = new JMenu(i18n.get(BasicStrokeEditorMenu.class, "Joint_Decoration", "Joint Decoration"));

        listener = new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                String command = ae.getActionCommand();
                try {
                    setLineJoins(Integer.parseInt(command));
                    resetStroke();
                } catch (NumberFormatException e) {
                }
            }
        };

        group = new ButtonGroup();
        button = new JRadioButtonMenuItem(i18n.get(BasicStrokeEditorMenu.class, "Miter", "Miter"), lineJoins == BasicStroke.JOIN_MITER);
        button.setActionCommand(String.valueOf(BasicStroke.JOIN_MITER));
        group.add(button);
        button.addActionListener(listener);
        joinMenu.add(button);

        button = new JRadioButtonMenuItem(i18n.get(BasicStrokeEditorMenu.class, "Round", "Round"), lineJoins == BasicStroke.JOIN_ROUND);
        button.setActionCommand(String.valueOf(BasicStroke.JOIN_ROUND));
        group.add(button);
        button.addActionListener(listener);
        joinMenu.add(button);

        button = new JRadioButtonMenuItem(i18n.get(BasicStrokeEditorMenu.class, "Bevel", "Bevel"), lineJoins == BasicStroke.JOIN_BEVEL);
        button.setActionCommand(String.valueOf(BasicStroke.JOIN_BEVEL));
        group.add(button);
        button.addActionListener(listener);
        joinMenu.add(button);

        //////// Line Width

        JMenu widthMenu = new JMenu(i18n.get(BasicStrokeEditorMenu.class, "Line_Width", "Line_Width"));

        listener = new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                String command = ae.getActionCommand();
                try {
                    setStrokeWidth((float) Integer.parseInt(command));
                    resetStroke();
                } catch (NumberFormatException e) {
                }
            }
        };

        group = new ButtonGroup();
        ImageIcon ii;
        int i;
        for (i = 1; i < 13; i++) {
            ii = createIcon(new BasicStroke(i), 50, 20, true);
            button = new JRadioButtonMenuItem(" ", ii, (int) width == i);//without the space as a parameter these instances look strange with some Look&Feel
            button.setActionCommand(String.valueOf(i));
            group.add(button);
            button.addActionListener(listener);
            button.setMargin( new java.awt.Insets(0,10,0,10));
            button.setPreferredSize(new java.awt.Dimension(70,20));
            widthMenu.add(button);
        }

        //////// Dash Pattern

        JMenu dashMenu = new JMenu(i18n.get(BasicStrokeEditorMenu.class, "Dash_Pattern", "Dash Pattern"));

        listener = new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                String command = ae.getActionCommand();
                try {
                    setDash(stringToDashArray(command));
                    resetStroke();
                } catch (NumberFormatException e) {
                }
            }
        };

        group = new ButtonGroup();

        String[] patterns = new String[] { NONE, "1.0 3.0", "3.0 3.0", "12.0 10.0",
                "12.0 10.0 6.0 10.0", "20.0 10.0", "20.0 10.0 6.0 10.0", "20.0 10.0 6.0 10.0 6.0 10.0" };

        String currentDash = dashArrayToString(getDash());
        for (i = 0; i < patterns.length; i++) {
            BasicStroke dashStroke = new BasicStroke(1.0f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER, 10.0f, stringToDashArray(patterns[i]), 0.0f);
            ii = createIcon(dashStroke, 90, 10, true);

            button = new JRadioButtonMenuItem(" ", ii, currentDash.equals(patterns[i]));
            button.setActionCommand(patterns[i]);
            group.add(button);
            button.addActionListener(listener);
            button.setMargin( new java.awt.Insets(0,10,0,10));
            button.setPreferredSize(new java.awt.Dimension(110,20));
            dashMenu.add(button);
        }

        popup.add(widthMenu);
        popup.add(dashMenu);
        popup.add(capMenu);
View Full Code Here

   
    protected I18n i18n = Environment.getI18n();

    public Component getGUI(GraphicAttributes graphicAttributes) {
        if (graphicAttributes != null) {
            JMenu ahm = getArrowHeadMenu();
            graphicAttributes.setLineMenuAdditions(new JMenu[] { ahm });
            return graphicAttributes.getGUI();
        }
        return null;
    }
View Full Code Here

    }

    public JMenu getArrowHeadMenu() {

        if (arrowheadMenu == null) {
            arrowheadMenu = new JMenu(i18n.get(EditableOMAbstractLine.class, "Arrows", "Arrows"));

            ActionListener listener = new ActionListener() {
                public void actionPerformed(ActionEvent ae) {
                    String command = ae.getActionCommand();
                    try {
View Full Code Here

     * will be connected to OpenMap components. This menu will be named "Map",
     * but you can rename it if you want.
     */
    public JMenu getMenu() {
        if (menu == null) {
            menu = new JMenu(name);
        }

        menu.removeAll();
        Iterator iterator = menus.iterator();
        while (iterator.hasNext()) {
View Full Code Here

    public Properties getProperties(Properties props) {
        props = super.getProperties(props);
        StringBuffer itemList = new StringBuffer();
        Iterator iterator = menus.iterator();
        while (iterator.hasNext()) {
            JMenu menu = (JMenu) iterator.next();

            if (menu instanceof PropertyConsumer) {
                PropertyConsumer ps = (PropertyConsumer) menu;
                String prefix = ps.getPropertyPrefix();
                if (prefix == null) {
                    prefix = menu.getText().toLowerCase();
                    ps.setPropertyPrefix(prefix);
                }

                itemList.append(prefix + " ");
                ps.getProperties(props);
View Full Code Here

        JMenu[] menus = getLineMenuAdditions();

        if (menus != null) {
            for (int i = 0; i < menus.length; i++) {
                JMenu menu = menus[i];
                if (menu != null) {
                    popup.add(menu);
                }
            }
        }
View Full Code Here

     * Gets the JMenu that has the color control options.
     *
     * @return
     */
    public JMenu getColorMenu() {
        JMenu colorMenu = null;
        colorMenu = new JMenu(i18n.get(GraphicAttributes.class,
                "Color",
                "Color"));
        colorMenu.add(lineColorItem);
        colorMenu.add(fillColorItem);
        colorMenu.add(selectColorItem);
        colorMenu.add(mattingColorItem);
        colorMenu.add(new JSeparator());
        colorMenu.add(mattedEnabledItem);
       
        fillColorItem.setEnabled(enableFillPaintChoice);
        return colorMenu;
    }
View Full Code Here

        //Finish setting up the GUI.
        _layerHandler = new LayerHandler(_layers);
        _layerHandler.addLayerListener(_mapBean);
        _layersMenu = new LayersMenu(_layerHandler);
        _fileMenu = new JMenu("File");

        _httpExample = new JMenuItem("HTTP Example");
        _httpExample.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                try {
View Full Code Here

  JMenuItem viewSecondPage;
 
 
  public TestMenuBar(ActionListener parent)
  {
    file = new JMenu("File");
    file.setMnemonic(KeyEvent.VK_F);
   
    printer = new JMenuItem("Print");
    printer.setMnemonic(KeyEvent.VK_R);
    printer.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R,
              ActionEvent.CTRL_MASK));
    printer.addActionListener(parent);
    //printer.setEnabled(false);
    file.add(printer);
   
    close = new JMenuItem("Close");
    close.setMnemonic(KeyEvent.VK_Q);
    close.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q,
            ActionEvent.CTRL_MASK));
    close.addActionListener(parent);
    file.add(close);   
   
    view = new JMenu("View");
    view.setMnemonic(KeyEvent.VK_V);

    // This isn't very extensible
    viewFirstPage = new JMenuItem("First Page");
    viewFirstPage.addActionListener(parent);
    view.add(viewFirstPage);
    viewSecondPage = new JMenuItem("Second Page");
    viewSecondPage.addActionListener(parent);
    view.add(viewSecondPage);
   
   
   
    help = new JMenu("Help");
    help.setMnemonic(KeyEvent.VK_H);
    helpTopics = new JMenuItem("Help Topics");
    helpTopics.addActionListener(parent);
    help.add(helpTopics);
   
    about = new JMenu("About");
    about.setMnemonic(KeyEvent.VK_A);
    aboutApp = new JMenuItem("About");
    aboutApp.addActionListener(parent);
    about.add(aboutApp);
   
View Full Code Here

TOP

Related Classes of javax.swing.JMenu$AccessibleJMenu

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.