javax.swing.JMenu.setVisible()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(8.8k)|赞(0)|评价(0)|浏览(89)

本文整理了Java中javax.swing.JMenu.setVisible()方法的一些代码示例,展示了JMenu.setVisible()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JMenu.setVisible()方法的具体详情如下:
包路径:javax.swing.JMenu
类名称:JMenu
方法名:setVisible

JMenu.setVisible介绍

暂无

代码示例

代码示例来源:origin: igvteam/igv

public void enableExtrasMenu() {
  extrasMenu.setVisible(true);
}

代码示例来源:origin: edu.toronto.cs.savant/savant-core

public void drawModeChanged(DrawingMode mode) {
  if (intervalMenu != null) {
    intervalMenu.setVisible(mode != DrawingMode.ARC && mode != DrawingMode.ARC_PAIRED && mode != DrawingMode.SNP && mode != DrawingMode.STRAND_SNP);
  }
}

代码示例来源:origin: igvteam/igv

public void enableGoogleMenu(boolean aBoolean) {
  googleMenu.setVisible(aBoolean);
}

代码示例来源:origin: tinyMediaManager/tinyMediaManager

@Override
 public void componentShown(ComponentEvent e) {
  menu.setVisible(true);
  super.componentHidden(e);
 }
});

代码示例来源:origin: tinyMediaManager/tinyMediaManager

@Override
public void componentHidden(ComponentEvent e) {
 menu.setVisible(false);
 super.componentHidden(e);
}

代码示例来源:origin: tinyMediaManager/tinyMediaManager

@Override
public void componentHidden(ComponentEvent e) {
 menu.setVisible(false);
 super.componentHidden(e);
}

代码示例来源:origin: tinyMediaManager/tinyMediaManager

@Override
 public void componentShown(ComponentEvent e) {
  menu.setVisible(true);
  super.componentHidden(e);
 }
});

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction
@Override
public void setVisible(boolean aValue) {
  super.setVisible(aValue);
}

代码示例来源:origin: khuxtable/seaglass

/**
   * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
   */
  public void actionPerformed(ActionEvent e) {
    if (show) {
      windowMenu.doClick();
    } else {
      windowMenu.setVisible(false);
    }
  }
}

代码示例来源:origin: eu.mihosoft.vrl/vrl

/**
 * Defines the menu capabilities depending on canvas capabilities.
 */
private void defineCapabilities() {
  if (mainCanvas.getCapabilityManager().
      isCapable(CanvasCapabilities.ALLOW_REMOVE_COMPONENTS)) {
    removeComponents.setVisible(true);
  } else {
    removeComponents.setVisible(false);
  }
  if (mainCanvas.getCapabilityManager().
      isCapable(CanvasCapabilities.ALLOW_EDIT)) {
    codeTemplates.setVisible(true);
    addGroovyCode.setVisible(true);
  } else {
    codeTemplates.setVisible(false);
    addGroovyCode.setVisible(false);
  }
  if (mainCanvas.getCapabilityManager().
      isCapable(CanvasCapabilities.ALLOW_INSTANCIATION)) {
    components.setVisible(true);
    addComponents.setVisible(true);
  } else {
    components.setVisible(false);
    addComponents.setVisible(false);
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-kenai-ui

private JMenu constructKenaiMenu(Node[] nodes) {
  kenaiPopup.setVisible(true);
    kenaiPopup.setVisible(false);

代码示例来源:origin: stackoverflow.com

item1.setVisible(false);//visible false
menu1.add(item1);
menu1.setVisible(false);//visible false
menuBar.add(menu1);
final JMenuItem item2 = new JMenuItem("item2");
item2.setVisible(false);//visible false
menu2.setVisible(false);//visible false
menu2.add(item2);
menuBar.add(menu2);

代码示例来源:origin: org.cytoscape/vizmap-gui-impl

@Override
  public void run() {
    // Network properties don't have visual mappings
    final JMenu mapValueGeneratorsMenu = vizMapperMainPanel.getMapValueGeneratorsSubMenu();
    final Class<? extends CyIdentifiable> targetDataType = vpSheet.getModel().getTargetDataType();
    mapValueGeneratorsMenu.setVisible(targetDataType != CyNetwork.class);
    
    if (mapValueGeneratorsMenu.isVisible()) {
      // Add all mapping generators again, to keep a consistent order
      mapValueGeneratorsMenu.removeAll();
      Class<?> dataType = null; // will store the previous generator's data type
      
      for (final Entry<String, GenerateDiscreteValuesAction> entry : mappingGenerators.entrySet()) {
        if (dataType != null && dataType != entry.getValue().getGenerator().getDataType())
          mapValueGeneratorsMenu.add(new JSeparator());
        
        mapValueGeneratorsMenu.add(entry.getValue());
        dataType = entry.getValue().getGenerator().getDataType();
      }
    }
    
    // Show context menu
    final Component parent = (Component) e.getSource();
    contextMenu.show(parent, e.getX(), e.getY());
  }
});

代码示例来源:origin: eu.mihosoft.vrl/vrl

/**
 * Maps a session entry to a menu item.
 *
 * @param fileName the entry to add
 */
private void addToMenu(final RecentFilesEntry entry) {
  if (sessionsMenu != null) {
    final JMenuItem loadSessionItem = new JMenuItem(entry.getFileName());
    loadSessionItem.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        if (e.getActionCommand().equals(entry.getFileName())) {
          loadRequest.request(entry.getFileName());
          // update default directory
          FileDialogManager.setDefaultDir(new File(entry.getFileName()));
        }
      }
    });
    sessionsMenu.add(loadSessionItem, 0);
    sessionsMenu.setVisible(true);
    if (getRecentSessions().isEmpty()) {
      sessionsMenu.setEnabled(false);
    } else {
      sessionsMenu.setEnabled(true);
    }
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-kenai-ui

public void run() {
    String s = (String) proj.getProjectDirectory().getAttribute("ProvidedExtensions.RemoteLocation"); //NOI18N
    if (s == null || KenaiProject.getNameForRepository(s) == null) {
      repoForProjCache.put(proj, ""); //NOI18N null cannot be used - project with no repo is null, "" is to indicate I already checked this one...
      dummy.setVisible(false);
    } else {
      repoForProjCache.put(proj, s);
      final JMenu tmp = constructKenaiMenu(nodes);
      final Component[] c = tmp.getMenuComponents();
      SwingUtilities.invokeLater(new Runnable() {
        public void run() {
          tmp.revalidate();
          dummy.setText(NbBundle.getMessage(KenaiPopupMenu.class, "KENAI_POPUP")); //NOI18N
          dummy.setEnabled(true);
          for (int i = 0; i < c.length; i++) {
            Component item = c[i];
            dummy.add(item);
          }
          dummy.getParent().validate();
        }
      });
    }
  }
});

代码示例来源:origin: igvteam/igv

private List<AbstractButton> createMenus() {
  List<AbstractButton> menus = new ArrayList<AbstractButton>();
  menus.add(createFileMenu());
  menus.add(createGenomesMenu());
  menus.add(createViewMenu());
  menus.add(createTracksMenu());
  menus.add(createRegionsMenu());
  refreshToolsMenu();
  menus.add(toolsMenu);
  menus.add(createGenomeSpaceMenu());
  extrasMenu = createExtrasMenu();
  //extrasMenu.setVisible(false);
  menus.add(extrasMenu);
  try {
    googleMenu = createGoogleMenu();
    googleMenu.setVisible(PreferencesManager.getPreferences().getAsBoolean(ENABLE_GOOGLE_MENU));
    menus.add(googleMenu);
  } catch (IOException e) {
    log.error("Error creating google menu: " + e.getMessage());
  }
  menus.add(createHelpMenu());
  // Experimental -- remove for production release
  return menus;
}

代码示例来源:origin: eu.mihosoft.vrl/vrl

removeGroupMenu.setVisible(true);

代码示例来源:origin: igvteam/igv

menu.setVisible(PreferencesManager.getPreferences().getAsBoolean(GENOME_SPACE_ENABLE));

代码示例来源:origin: GoldenGnu/jeveassets

@Override
  public void run() {
    if (cache.isEmpty()) {
      return;
    }
    jNextChart.getXYPlot().setDomainCrosshairVisible(true);
    double xValue = jNextChart.getXYPlot().getDomainCrosshairValue();
    double yValue = jNextChart.getXYPlot().getRangeCrosshairValue();
    RectangleEdge xEdge = jNextChart.getXYPlot().getDomainAxisEdge();
    RectangleEdge yEdge = jNextChart.getXYPlot().getRangeAxisEdge();
    Rectangle2D dataArea = jChartPanel.getScreenDataArea(); // jChartPanel.getChartRenderingInfo().getPlotInfo().getSubplotInfo(0).getDataArea();
    int x = (int) jNextChart.getXYPlot().getDomainAxis().valueToJava2D(xValue, dataArea, xEdge);
    int y = (int) jNextChart.getXYPlot().getRangeAxis().valueToJava2D(yValue, dataArea, yEdge);
    Date date = new Date((long)xValue);
    jIskValue.setText(iskFormat.format(yValue));
    jDateValue.setText(dateFormat.format(date));
    TrackerNote trackerNote = Settings.get().getTrackerNotes().get(new TrackerDate(date));
    if (trackerNote != null) {
      jAddNote.setVisible(false);
      jEditNote.setVisible(true);
      jNote.setVisible(true);
      jNote.setText(trackerNote.getNote());
    } else {
      jAddNote.setVisible(true);
      jEditNote.setVisible(false);
      jNote.setVisible(false);
    }
    jPopupMenu.show((Component)cme.getTrigger().getSource(), x, y);
  }
});

代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf

protected void enableVisible() {
  aggregate.setVisible(!toolWindow.isVisible());
  aggregateMenu.setVisible(aggregate.isVisible());
  visible.setText(toolWindow.isVisible() ?
          resourceManager.getString("@@tool.hide") :
          resourceManager.getString("@@tool.show"));
  if (toolWindow.getType() == ToolWindowType.DOCKED) {
    dockedMode.setVisible(descriptor.getTypeDescriptor(ToolWindowType.SLIDING).isEnabled());
    floatingMode.setVisible(descriptor.getTypeDescriptor(ToolWindowType.FLOATING).isEnabled());
    floatingLiveMode.setState(false);
    floatingLiveMode.setVisible(descriptor.getTypeDescriptor(ToolWindowType.FLOATING_LIVE).isEnabled());
  } else if (toolWindow.getType() == ToolWindowType.SLIDING) {
    floatingMode.setVisible(descriptor.getTypeDescriptor(ToolWindowType.FLOATING).isEnabled());
    floatingLiveMode.setState(false);
    floatingLiveMode.setVisible(descriptor.getTypeDescriptor(ToolWindowType.FLOATING_LIVE).isEnabled());
  } else if (toolWindow.getType() == ToolWindowType.FLOATING) {
    floatingLiveMode.setState(false);
    floatingLiveMode.setVisible(descriptor.getTypeDescriptor(ToolWindowType.FLOATING_LIVE).isEnabled());
  } else if (toolWindow.getType() == ToolWindowType.FLOATING_LIVE) {
    dockedMode.setState(false);
    floatingMode.setState(false);
    floatingMode.setVisible(descriptor.getTypeDescriptor(ToolWindowType.FLOATING).isEnabled());
  }
}

相关文章