javax.swing.JMenuItem.isSelected()方法的使用及代码示例

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

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

JMenuItem.isSelected介绍

暂无

代码示例

代码示例来源:origin: ron190/jsql-injection

@Override
public void stateChanged(ChangeEvent e) {
  if (e.getSource() instanceof JMenuItem) {
    JMenuItem item = (JMenuItem) e.getSource();
    if (item.isSelected() || item.isArmed()) {
      ManagerCoder.this.actionCoder.actionPerformed(this.nameMethod);
    }
  }
}

代码示例来源:origin: protegeproject/protege

public boolean isSelected() {
    if(menuItem == null) {
      return false;
    }
    return menuItem.isSelected();
  }
}

代码示例来源:origin: psidev.psi.mi/psimitab

public void actionPerformed( ActionEvent e ) {
    // If selected, all files dropped or selected at once are aggregated into a single MITAB file
    aggregateSelectedFiles = mergeItem.isSelected();
    log.debug( "Aggregate is " + aggregateSelectedFiles );
  }
} );

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

@Override
  public void actionPerformed(ActionEvent e) {
    System.out.println("Trying to locking Y max: " + !itemy.isSelected());
    graphPane.setYMaxLocked(itemy.isSelected());
  }
});

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

public void actionPerformed(ActionEvent aEvt) {
    boolean linkedReads = bxItem.isSelected();
    setLinkedReads(linkedReads, "BX");
  }
});

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

@Override
  public void actionPerformed(ActionEvent e) {
    if (this.parent.isSelected()) {
      this.toDeselect.setSelected(false);
    }
  }
}

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

public void actionPerformed(ActionEvent e) {
    showGroupNames = item.isSelected();
    repaint();
  }
});

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

public void actionPerformed(ActionEvent aEvt) {
    boolean linkedReads = miItem.isSelected();
    setLinkedReads(linkedReads, "MI");
  }
});

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

public void actionPerformed(ActionEvent e) {
    showSampleNamesWhenGrouped = item2.isSelected();
    repaint();
  }
});

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

public void actionPerformed(ActionEvent aEvt) {
    boolean linkedReads = bxItem.isSelected();
    setLinkedReads(linkedReads, "READNAME");
  }
});

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

@Override
  public void actionPerformed(ActionEvent e) {
    alignmentTrack.setVisible(alignmentItem.isSelected());
  }
});

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

@Override
  public void actionPerformed(ActionEvent arg0) {
    if (mnWindows.getItem(0).isSelected()) {
      prefs.putBoolean(PREF_WINDOW_STYLE_MULTIPLE, true);
    }
    else {
      prefs.putBoolean(PREF_WINDOW_STYLE_MULTIPLE, false);
    }
    MessageBoxes.infoBox("Windows Style Changed", //$NON-NLS-1$
        "Window style has been changed. Please restart OpenPnP to see the changes."); //$NON-NLS-1$
  }
};

代码示例来源:origin: jawi/ols

/**
 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
 */
@Override
public void actionPerformed( final ActionEvent aEvent )
{
 final JMenuItem menuItem = ( JMenuItem )aEvent.getSource();
 getController().selectDevice( menuItem.isSelected() ? this.deviceName : null );
}

代码示例来源:origin: locationtech/jts

public void actionPerformed(ActionEvent e) {
  JTSTestBuilder.controller().setShowingLabel(((JMenuItem)e.getSource()).isSelected());
 }
});

代码示例来源:origin: sc.fiji/Simple_Neurite_Tracer

@Override
  public void itemStateChanged(final ItemEvent e) {
    if (filteredTypes.contains(mi.getText()) && !mi.isSelected()) {
      filteredTypes.remove(mi.getText());
    } else if (!filteredTypes.contains(mi.getText()) && mi.isSelected()) {
      filteredTypes.add(mi.getText());
    }
    reloadPaths();
    updateResults();
  }
});

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

ChangeListener ch = new ChangeListener() {
   @Override
   public void stateChanged(ChangeEvent e) {
     if (e.getSource() instanceof JMenuItem) {
       JMenuItem item = (JMenuItem) e.getSource();
       if (item.isSelected() || item.isArmed()) {
         System.out.println("Highlighted: " + item.getActionCommand());
       }
     }
   }
 };

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

public void addViewAsPairsMenuItem() {
  final JMenuItem item = new JCheckBoxMenuItem("View as pairs");
  item.setSelected(renderOptions.isViewPairs());
  item.addActionListener(aEvt -> {
    boolean viewAsPairs = item.isSelected();
    setViewAsPairs(viewAsPairs);
  });
  item.setEnabled(dataManager.isPairedEnd());
  add(item);
}

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

public JMenuItem addShowMismatchesMenuItem() {
  // Change track height by attribute
  final JMenuItem item = new JCheckBoxMenuItem("Show mismatched bases");
  item.setSelected(renderOptions.isShowMismatches());
  item.addActionListener(aEvt -> {
    renderOptions.setShowMismatches(item.isSelected());
    refresh();
  });
  add(item);
  return item;
}

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

public JMenuItem addQuickConsensusModeItem() {
  // Change track height by attribute
  final JMenuItem item = new JCheckBoxMenuItem("Quick consensus mode");
  item.setSelected(renderOptions.isQuickConsensusMode());
  item.addActionListener(aEvt -> {
    renderOptions.setQuickConsensusMode(item.isSelected());
    refresh();
  });
  add(item);
  return item;
}

代码示例来源:origin: org.zaproxy/zap

@Override
public void actionPerformed(ActionEvent event) {
  JMenuItem item = (JMenuItem) event.getSource();
  if (item.isSelected()) {
    showColumn(item.getText());
  } else {
    hideColumn(item.getText());
  }
}

相关文章

JMenuItem类方法