Example usage for javax.swing JMenu setFont

List of usage examples for javax.swing JMenu setFont

Introduction

In this page you can find the example usage for javax.swing JMenu setFont.

Prototype

@BeanProperty(preferred = true, visualUpdate = true, description = "The font for the component.")
public void setFont(Font font) 

Source Link

Document

Sets the font for this component.

Usage

From source file:Main.java

static public JMenu createJMenu(JMenuBar pMenuBar, String pMenuText, char pMnemonic) {
    final JMenu menu = new JMenu(pMenuText);
    menu.setMnemonic(pMnemonic);/*from  www.  j  a v a 2 s. c o m*/

    if (defaultFont != null)
        menu.setFont(defaultFont);

    pMenuBar.add(menu);
    return menu;
}

From source file:org.biojava.bio.view.MotifAnalyzer.java

/**
 * This method initializes jJMenuBar   /*  w  w w .  j  a  va2  s. co  m*/
 *    
 * @return javax.swing.JMenuBar   
 */
private JMenuBar getJJMenuBar() {
    if (jJMenuBar == null) {
        jJMenuBar = new JMenuBar();
        jJMenuBar.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
    }
    /* File Menu */
    JMenu fileMenu = new JMenu("File");
    fileMenu.setFont(menuFont);
    jJMenuBar.add(fileMenu);

    JMenuItem loadItem = new JMenuItem(loadMenuName);
    loadItem.addActionListener(this);
    fileMenu.add(loadItem);

    JMenuItem saveItem = new JMenuItem(saveMenuName);
    saveItem.addActionListener(this);
    fileMenu.add(saveItem);

    JMenuItem openMotifVoterItem = new JMenuItem(convertMotifVoterMenuName);
    openMotifVoterItem.addActionListener(this);
    fileMenu.add(openMotifVoterItem);

    JMenuItem runPatchConverMVItem = new JMenuItem(runPatchConverMVMenuName);
    runPatchConverMVItem.addActionListener(this);
    fileMenu.add(runPatchConverMVItem);

    JMenuItem convertAllItem = new JMenuItem(convertAllMenuName);
    convertAllItem.addActionListener(this);
    fileMenu.add(convertAllItem);

    JMenuItem runPatchConverAllItem = new JMenuItem(runPatchConverAllMenuName);
    runPatchConverAllItem.addActionListener(this);
    fileMenu.add(runPatchConverAllItem);

    JMenuItem compareSetsItem = new JMenuItem(compareSetsName);
    compareSetsItem.addActionListener(this);
    fileMenu.add(compareSetsItem);

    JMenuItem mergeCompareSetsItem = new JMenuItem(mergeCompareSetsName);
    mergeCompareSetsItem.addActionListener(this);
    fileMenu.add(mergeCompareSetsItem);

    JMenuItem copyFilesWithExtensionItem = new JMenuItem(copyCleanInputFilesName);
    copyFilesWithExtensionItem.addActionListener(this);
    fileMenu.add(copyFilesWithExtensionItem);

    JMenuItem exitItem = new JMenuItem("Exit");
    exitItem.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent actionEvent) {
            System.exit(0);
        }
    });
    fileMenu.add(exitItem);

    /* Tools Menu */
    JMenu toolsMenu = new JMenu("Tools");
    toolsMenu.setFont(menuFont);
    jJMenuBar.add(toolsMenu);

    JMenuItem gibbsItem = new JMenuItem(gibbsMenuName);
    gibbsItem.addActionListener(this);
    toolsMenu.add(gibbsItem);

    JMenuItem infoContentItem = new JMenuItem(infoContentMenuName);
    infoContentItem.addActionListener(this);
    toolsMenu.add(infoContentItem);

    JMenuItem removeRedundantSitesItem = new JMenuItem(removeRedundantSitesName);
    removeRedundantSitesItem.addActionListener(this);
    toolsMenu.add(removeRedundantSitesItem);

    JMenuItem extractSitesItem = new JMenuItem(extractSitesName);
    extractSitesItem.addActionListener(this);
    toolsMenu.add(extractSitesItem);

    JMenuItem drawKDistanceGraphItem = new JMenuItem(drawKDistanceGraphName);
    drawKDistanceGraphItem.addActionListener(this);
    toolsMenu.add(drawKDistanceGraphItem);

    JMenuItem computeWeightItem = new JMenuItem(computeWeightName);
    computeWeightItem.addActionListener(this);
    toolsMenu.add(computeWeightItem);

    /* Run Methods Menu */
    JMenu methodMenu = new JMenu("Run Method");
    methodMenu.setFont(menuFont);
    jJMenuBar.add(methodMenu);

    /*
    JMenuItem bioProspectorItem = new JMenuItem(runBioProspectorName);
    bioProspectorItem.addActionListener(this);
    methodMenu.add(bioProspectorItem);
            
    JMenuItem KMeansItem = new JMenuItem(runKMeansName);
    KMeansItem.addActionListener(this);
    methodMenu.add(KMeansItem);
            
    JMenuItem DBScanItem = new JMenuItem(runDBScanName);
    DBScanItem.addActionListener(this);
    methodMenu.add(DBScanItem);
            
    JMenuItem OPTICSItem = new JMenuItem(runOPTICSName);
    OPTICSItem.addActionListener(this);
    methodMenu.add(OPTICSItem);
            
    JMenuItem motifVoteItem = new JMenuItem(runMotifVoterName);
    motifVoteItem.addActionListener(this);
    methodMenu.add(motifVoteItem);
            
    JMenuItem runCliqueItem = new JMenuItem(runCliqueName);
    runCliqueItem.addActionListener(this);
    methodMenu.add(runCliqueItem);
    */

    for (int i = 0; i < Method.values().length; i++) {
        JMenuItem item = new JMenuItem(Method.values()[i].name());
        item.addActionListener(this);
        methodMenu.add(item);
    }

    /* Run Analysis for Methods Menu */
    JMenu analysisMenu = new JMenu("Analysis");
    analysisMenu.setFont(menuFont);
    jJMenuBar.add(analysisMenu);

    JMenuItem evaluateTompaMotifEachItem = new JMenuItem(evaluateTompaMotifEachName);
    evaluateTompaMotifEachItem.addActionListener(this);
    analysisMenu.add(evaluateTompaMotifEachItem);

    JMenuItem evaluateTompaMotifItem = new JMenuItem(evaluateTompaMotifAccName);
    evaluateTompaMotifItem.addActionListener(this);
    analysisMenu.add(evaluateTompaMotifItem);

    JMenuItem evaluateTompaMotifTotalItem = new JMenuItem(evaluateTompaMotifTotalName);
    evaluateTompaMotifTotalItem.addActionListener(this);
    analysisMenu.add(evaluateTompaMotifTotalItem);

    JMenuItem evaluateMotifVoterItem = new JMenuItem(evaluateMotifVoterName);
    evaluateMotifVoterItem.addActionListener(this);
    analysisMenu.add(evaluateMotifVoterItem);

    JMenuItem evaluateMotifVoterTotalItem = new JMenuItem(evaluateMotifVoterTotalName);
    evaluateMotifVoterTotalItem.addActionListener(this);
    analysisMenu.add(evaluateMotifVoterTotalItem);

    JMenuItem evaluateMVDirFirstEleItem = new JMenuItem(evaluateMVDirFirstEleName);
    evaluateMVDirFirstEleItem.addActionListener(this);
    analysisMenu.add(evaluateMVDirFirstEleItem);

    JMenuItem evaluateMVDirMergedItem = new JMenuItem(evaluateMVDirMergedName);
    evaluateMVDirMergedItem.addActionListener(this);
    analysisMenu.add(evaluateMVDirMergedItem);

    JMenuItem compareMotifVoterFirstItem = new JMenuItem(compareMotifVoterFirstName);
    compareMotifVoterFirstItem.addActionListener(this);
    analysisMenu.add(compareMotifVoterFirstItem);

    JMenuItem compareMotifVoterAllItem = new JMenuItem(compareMotifVoterAllName);
    compareMotifVoterAllItem.addActionListener(this);
    analysisMenu.add(compareMotifVoterAllItem);

    JMenuItem EvaluateAllResultsItem = new JMenuItem(evaluateAllResultsName);
    EvaluateAllResultsItem.addActionListener(this);
    analysisMenu.add(EvaluateAllResultsItem);

    return jJMenuBar;
}

From source file:base.BasePlayer.Main.java

static void addAnnotationFile(String genomeName, File annotationFile) {
    boolean first = false;

    if (genomehash.get(genomeName) == null) {
        genomehash.put(genomeName, new ArrayList<File>());
    }/*from w ww . ja va  2s  .c o m*/
    if (genome.getItemCount() == 0) {
        first = true;
    }

    genomehash.get(genomeName).add(annotationFile);
    JMenuItem additem = new JMenuItem(
            annotationFile.getName().substring(0, annotationFile.getName().indexOf(".bed.gz")));
    additem.setName(annotationFile.getName().substring(0, annotationFile.getName().indexOf(".bed.gz")));
    additem.addMouseListener(Main.thisMainListener);

    for (int i = 1; i < genome.getItemCount(); i++) {

        if (genome.getItem(i).getName().equals(genomeName)) {
            JMenu addMenu = (JMenu) genome.getItem(i);
            addMenu.setFont(menuFont);
            if (first) {
                JMenuItem addAnnotation = new JMenuItem("Add new annotation file...");
                addAnnotation.setFont(menuFont);
                addAnnotation.addMouseListener(Main.thisMainListener);
                addAnnotation.setName("add_annotation");
                addMenu.add(addAnnotation);
                JLabel addLabel = new JLabel("  Select annotation: ");
                addLabel.setFont(menuFont);
                labels.add(addLabel);
                addMenu.add(addLabel);
                addMenu.add(new JSeparator());
            }
            additem.setFont(menuFont);
            addMenu.add(additem);
            addMenu.revalidate();
            genome.revalidate();
            break;
        }
    }
    Main.defaultAnnotation = annotationFile.getName();
    setChromDrop(genomeName);
}

From source file:picocash.components.HeaderPanel.java

private JMenu createMenu(String text) {
    JMenu testMenu = new JMenu(text);
    testMenu.setFont(textFont);
    testMenu.setForeground(Color.WHITE);
    return testMenu;
}

From source file:pl.otros.logview.gui.LogViewPanel.java

private JPopupMenu initTableContextMenu() {
    JPopupMenu menu = new JPopupMenu("Menu");
    JMenuItem mark = new JMenuItem("Mark selected rows");
    mark.addActionListener(new MarkRowAction(otrosApplication));
    JMenuItem unmark = new JMenuItem("Unmark selected rows");
    unmark.addActionListener(new UnMarkRowAction(otrosApplication));

    JMenuItem autoResizeMenu = new JMenu("Table auto resize mode");
    autoResizeMenu.setIcon(Icons.TABLE_RESIZE);
    JMenuItem autoResizeSubsequent = new JMenuItem("Subsequent columns");
    autoResizeSubsequent//from   w w  w  .  j  a  va2s. c  o  m
            .addActionListener(new TableResizeActionListener(table, JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS));
    JMenuItem autoResizeLast = new JMenuItem("Last column");
    autoResizeLast.addActionListener(new TableResizeActionListener(table, JTable.AUTO_RESIZE_LAST_COLUMN));
    JMenuItem autoResizeNext = new JMenuItem("Next column");
    autoResizeNext.addActionListener(new TableResizeActionListener(table, JTable.AUTO_RESIZE_NEXT_COLUMN));
    JMenuItem autoResizeAll = new JMenuItem("All columns");
    autoResizeAll.addActionListener(new TableResizeActionListener(table, JTable.AUTO_RESIZE_ALL_COLUMNS));
    JMenuItem autoResizeOff = new JMenuItem("Auto resize off");
    autoResizeOff.addActionListener(new TableResizeActionListener(table, JTable.AUTO_RESIZE_OFF));
    autoResizeMenu.add(autoResizeSubsequent);
    autoResizeMenu.add(autoResizeOff);
    autoResizeMenu.add(autoResizeNext);
    autoResizeMenu.add(autoResizeLast);
    autoResizeMenu.add(autoResizeAll);
    JMenu removeMenu = new JMenu("Remove log events");
    removeMenu.setFont(menuLabelFont);
    removeMenu.setIcon(Icons.BIN);
    JLabel removeLabel = new JLabel("Remove by:");
    removeLabel.setFont(menuLabelFont);
    removeMenu.add(removeLabel);

    Map<String, Set<String>> propKeyValue = getPropertiesOfSelectedLogEvents();
    for (AcceptCondition acceptCondition : acceptConditionList) {
        removeMenu.add(new JMenuItem(new RemoveByAcceptanceCriteria(acceptCondition, otrosApplication)));
    }
    for (String propertyKey : propKeyValue.keySet()) {
        for (String propertyValue : propKeyValue.get(propertyKey)) {
            PropertyAcceptCondition propAcceptCondition = new PropertyAcceptCondition(propertyKey,
                    propertyValue);
            removeMenu
                    .add(new JMenuItem(new RemoveByAcceptanceCriteria(propAcceptCondition, otrosApplication)));
        }
    }

    menu.add(new JSeparator());
    JLabel labelMarkingRows = new JLabel("Marking/unmarking rows");
    labelMarkingRows.setFont(menuLabelFont);
    menu.add(labelMarkingRows);
    menu.add(new JSeparator());
    menu.add(mark);
    menu.add(unmark);
    JMenu[] markersMenu = getAutomaticMarkersMenu();
    menu.add(markersMenu[0]);
    menu.add(markersMenu[1]);
    menu.add(new ClearMarkingsAction(otrosApplication));
    menu.add(new JSeparator());
    JLabel labelQuickFilters = new JLabel("Quick filters");
    labelQuickFilters.setFont(menuLabelFont);
    menu.add(labelQuickFilters);
    menu.add(new JSeparator());
    menu.add(focusOnThisThreadAction);
    menu.add(focusOnEventsAfter);
    menu.add(focusOnEventsBefore);
    menu.add(focusOnSelectedClassesAction);
    menu.add(ignoreSelectedEventsClasses);
    menu.add(focusOnSelectedLoggerNameAction);
    menu.add(showCallHierarchyAction);
    for (String propertyKey : propKeyValue.keySet()) {
        for (String propertyValue : propKeyValue.get(propertyKey)) {
            menu.add(new FocusOnSelectedPropertyAction(propertyFilter, propertyFilterPanel.getEnableCheckBox(),
                    otrosApplication, propertyKey, propertyValue));
        }
    }
    menu.add(new JSeparator());
    menu.add(removeMenu);
    menu.add(new JSeparator());
    JLabel labelTableOptions = new JLabel("Table options");
    labelTableOptions.setFont(menuLabelFont);
    menu.add(labelTableOptions);
    menu.add(new JSeparator());
    menu.add(autoResizeMenu);

    menu.add(new JSeparator());
    List<MenuActionProvider> menuActionProviders = otrosApplication.getLogViewPanelMenuActionProvider();
    for (MenuActionProvider menuActionProvider : menuActionProviders) {
        try {
            List<OtrosAction> actions = menuActionProvider.getActions(otrosApplication, this);
            if (actions == null) {
                continue;
            }
            for (OtrosAction action : actions) {
                menu.add(action);
            }
        } catch (Exception e) {
            LOGGER.log(Level.SEVERE, "Cant get action from from provider " + menuActionProvider, e);
        }
    }

    return menu;
}