Codota Logo
JCheckBoxMenuItem.getState
Code IndexAdd Codota to your IDE (free)

How to use
getState
method
in
javax.swing.JCheckBoxMenuItem

Best Java code snippets using javax.swing.JCheckBoxMenuItem.getState (Showing top 20 results out of 315)

  • Common ways to obtain JCheckBoxMenuItem
private void myMethod () {
JCheckBoxMenuItem j =
  • Codota Iconnew JCheckBoxMenuItem()
  • Codota IconString str;new JCheckBoxMenuItem(str)
  • Codota IconAction action;new JCheckBoxMenuItem(action)
  • Smart code suggestions by Codota
}
origin: chewiebug/GCViewer

/**
 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
 */
@Override
public void actionPerformed(ActionEvent e) {
  if (e.getSource() == menuItemWatch) {
    watchToggle.setSelected(menuItemWatch.getState());
  }
  else {
    menuItemWatch.setState(watchToggle.isSelected());
  }
}
origin: chewiebug/GCViewer

boolean state = ((JCheckBoxMenuItem)e.getSource()).getState();
if (GCPreferences.SHOW_MODEL_METRICS_PANEL.equals(e.getActionCommand())) {
  gui.getSelectedGCDocument().setShowModelMetricsPanel(state);
origin: chewiebug/GCViewer

/**
 * Copies values that are stored in menu items into <code>GCPreferences</code> instance.
 * 
 * @param gui source to copy values from
 * @return <code>GCPreferences</code> with current values
 */
private GCPreferences copyPreferencesFromGui(GCViewerGui gui) {
  GCPreferences preferences = gui.getPreferences();
  for (Entry<String, JCheckBoxMenuItem> menuEntry : ((GCViewerGuiMenuBar)gui.getJMenuBar()).getViewMenuItems().entrySet()) {
    JCheckBoxMenuItem item = menuEntry.getValue();
    preferences.setGcLineProperty(item.getActionCommand(), item.getState());
  }
  preferences.setWindowWidth(gui.getWidth());
  preferences.setWindowHeight(gui.getHeight());
  preferences.setWindowX(gui.getX());
  preferences.setWindowY(gui.getY());
  OpenFile openFileAction = (OpenFile)gui.getActionMap().get(ActionCommands.OPEN_FILE.toString());
  if (openFileAction.getLastSelectedFiles().length != 0) {
    preferences.setLastFile(openFileAction.getLastSelectedFiles()[0].getAbsolutePath());
  }
  
  // recent files
  List<String> recentFileList = new LinkedList<String>();
  for (GCResourceGroup urlSet : ((GCViewerGuiMenuBar) gui.getJMenuBar()).getRecentGCResourcesModel().getResourceNameGroups()) {    
    recentFileList.add(urlSet.getUrlGroupString());
  }
  preferences.setRecentFiles(recentFileList);
  
  return preferences;
}
origin: pentaho/mondrian

private void viewXMLMenuItemActionPerformed(ActionEvent evt) {
  JInternalFrame jf = desktopPane.getSelectedFrame();
  boolean oldValue = viewXmlMenuItem.getState();
  if (jf != null
    && jf.getContentPane().getComponent(0) instanceof SchemaExplorer)
  {
    SchemaExplorer se =
      (SchemaExplorer) jf.getContentPane().getComponent(0);
    // Call schema explorer's view xml event and update the workbench's
    // view menu accordingly'
    ((JCheckBoxMenuItem) evt.getSource()).setSelected(se.editMode(evt));
    return;
  }
  viewXmlMenuItem.setSelected(!oldValue);
}
origin: magefree/mage

popupMenu.add(holdPriorityMenuItem);
holdPriorityMenuItem.addActionListener(e -> {
  boolean holdPriority = ((JCheckBoxMenuItem) e.getSource()).getState();
  gamePanel.setMenuStates(manaPoolMenuItem1.getState(), manaPoolMenuItem2.getState(), useFirstManaAbilityItem.getState(), holdPriority);
  gamePanel.holdPriority(holdPriority);
});
  boolean manaPoolAutomatic = ((JCheckBoxMenuItem) e.getSource()).getState();
  PreferencesDialog.saveValue(KEY_GAME_MANA_AUTOPAYMENT, manaPoolAutomatic ? "true" : "false");
  gamePanel.setMenuStates(manaPoolAutomatic, manaPoolMenuItem2.getState(), useFirstManaAbilityItem.getState(), holdPriorityMenuItem.getState());
  SessionHandler.sendPlayerAction(manaPoolAutomatic ? PlayerAction.MANA_AUTO_PAYMENT_ON : PlayerAction.MANA_AUTO_PAYMENT_OFF, gameId, null);
});
  boolean manaPoolAutomaticRestricted = ((JCheckBoxMenuItem) e.getSource()).getState();
  PreferencesDialog.saveValue(KEY_GAME_MANA_AUTOPAYMENT_ONLY_ONE, manaPoolAutomaticRestricted ? "true" : "false");
  gamePanel.setMenuStates(manaPoolMenuItem1.getState(), manaPoolAutomaticRestricted, useFirstManaAbilityItem.getState(), holdPriorityMenuItem.getState());
  SessionHandler.sendPlayerAction(manaPoolAutomaticRestricted ? PlayerAction.MANA_AUTO_PAYMENT_RESTRICTED_ON : PlayerAction.MANA_AUTO_PAYMENT_RESTRICTED_OFF, gameId, null);
});
  boolean useFirstManaAbility = ((JCheckBoxMenuItem) e.getSource()).getState();
  PreferencesDialog.saveValue(KEY_USE_FIRST_MANA_ABILITY, useFirstManaAbility ? "true" : "false");
  gamePanel.setMenuStates(manaPoolMenuItem1.getState(), manaPoolMenuItem2.getState(), useFirstManaAbility, holdPriorityMenuItem.getState());
  SessionHandler.sendPlayerAction(useFirstManaAbility ? PlayerAction.USE_FIRST_MANA_ABILITY_ON : PlayerAction.USE_FIRST_MANA_ABILITY_OFF, gameId, null);
});
    boolean requestsAllowed = ((JCheckBoxMenuItem) e.getSource()).getState();
    PreferencesDialog.setPrefValue(KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, requestsAllowed);
    SessionHandler.sendPlayerAction(requestsAllowed ? PlayerAction.PERMISSION_REQUESTS_ALLOWED_ON : PlayerAction.PERMISSION_REQUESTS_ALLOWED_OFF, gameId, null);
origin: com.mgmtp.gcviewer/gcviewer

  public void actionPerformed(final ActionEvent e) {
    watchToggle.setSelected(menuItemWatch.getState());
  }
});
origin: Waikato/weka-trunk

 @Override
 public void actionPerformed(ActionEvent ae) {
  boolean bPrev = m_bViewCliques;
  m_bViewCliques = viewCliques.getState();
  if (bPrev == false && viewCliques.getState() == true) {
   updateStatus();
  }
  repaint();
 }
});
origin: elki-project/elki

 @Override
 public void itemStateChanged(ItemEvent e) {
  VisualizationTree.setVisible(context, v, visItem.getState());
 }
});
origin: nz.ac.waikato.cms.weka/weka-stable

 @Override
 public void actionPerformed(ActionEvent ae) {
  boolean bPrev = m_bViewMargins;
  m_bViewMargins = viewMargins.getState();
  if (bPrev == false && viewMargins.getState() == true) {
   updateStatus();
  }
  repaint();
 }
});
origin: org.scijava/scijava-ui-swing

  @Override
  public void actionPerformed(ActionEvent e) {
    logFormatter.setVisible(field, menuItem.getState());
    updateFilter();
  }
});
origin: sc.fiji/TrakEM2_

  public void actionPerformed(ActionEvent ae) {
    Object src = ae.getSource();
    if (src == cbI) display.setTranspOverlayImages(cbI.getState()); 
    else if (src == cbA) display.setTranspOverlayAreas(cbA.getState());
    else if (src == cbL) display.setTranspOverlayTextLabels(cbL.getState());
  }
};
origin: nz.ac.waikato.cms.weka/weka-stable

 @Override
 public void actionPerformed(ActionEvent ae) {
  boolean bPrev = m_bViewCliques;
  m_bViewCliques = viewCliques.getState();
  if (bPrev == false && viewCliques.getState() == true) {
   updateStatus();
  }
  repaint();
 }
});
origin: jawi/ols

/**
 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
 */
@Override
public void actionPerformed( final ActionEvent aEvent )
{
 final JCheckBoxMenuItem menuItem = ( JCheckBoxMenuItem )aEvent.getSource();
 this.controller.setCursorMode( menuItem.getState() );
}
origin: jawi/ols

/**
 * {@inheritDoc}
 */
@Override
public void actionPerformed( final ActionEvent aEvent )
{
 final JCheckBoxMenuItem menuItem = ( JCheckBoxMenuItem )aEvent.getSource();
 this.controller.setSnapModeEnabled( menuItem.getState() );
}
origin: org.activecomponents.jadex/jadex-editor-bpmn

  public void actionPerformed(ActionEvent e)
  {
    JCheckBoxMenuItem saveonexititem = (JCheckBoxMenuItem) e.getSource();
    editorwindow.getSettings().setSaveSettingsOnExit(saveonexititem.getState());
  }
});
origin: com.mgmtp.gcviewer/gcviewer

  public void actionPerformed(final ActionEvent e) {
    final GCDocument gcDocument = getSelectedGCDocument();
    if (gcDocument != null) {
      gcDocument.setShowModelPanel(menuItemShowDataPanel.getState());
    }
  }
});
origin: Audiveris/audiveris

/**
 * Triggered from popup menu.
 *
 * @param e menu item event
 */
@Override
public void itemStateChanged (ItemEvent e)
{
  JCheckBoxMenuItem item = (JCheckBoxMenuItem) e.getItem();
  Board board = getBoard(item.getText());
  board.setSelected(item.getState());
}
origin: org.rescarta.rc-mct/rc-mct

/**
 * Called when a property of an RcObjectMetadataJPanelParameters object has
 * changed.
 */
public void objectMetadataJPanelParametersChanged() {
  if (this.rcObjMdJPanelParams.getDisplayMetsXml() != this.menuBar.displayMetsXmlJCheckboxMenuItem.getState()) {
    this.menuBar.displayMetsXmlJCheckboxMenuItem.setSelected(this.rcObjMdJPanelParams.getDisplayMetsXml());
  }
}
origin: com.mgmtp.gcviewer/gcviewer

  public void actionPerformed(final ActionEvent e) {
    final GCDocument gcDocument = getSelectedGCDocument();
    if (gcDocument != null) {
      gcDocument.getModelChart().setAntiAlias(menuItemAntiAlias.getState());
      gcDocument.relayout();
    }
  }
});
origin: igvteam/igv

  @Override
  public void actionPerformed(ActionEvent e) {
    JCheckBoxMenuItem menuItem = (JCheckBoxMenuItem) e.getSource();
    PreferencesManager.getPreferences().setShowAttributeView(menuItem.getState());
    IGV.getInstance().getMainPanel().invalidate();
    IGV.getInstance().doRefresh();
  }
};
javax.swingJCheckBoxMenuItemgetState

Popular methods of JCheckBoxMenuItem

  • <init>
  • setSelected
  • addActionListener
  • isSelected
  • setEnabled
  • setState
  • setText
  • addItemListener
  • setMnemonic
  • setToolTipText
  • setActionCommand
  • setAccelerator
  • setActionCommand,
  • setAccelerator,
  • setAction,
  • getText,
  • setIcon,
  • setName,
  • getModel,
  • addChangeListener,
  • getActionCommand

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getContentResolver (Context)
  • getExternalFilesDir (Context)
  • getSystemService (Context)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Point (java.awt)
    A point representing a location in (x, y) coordinate space, specified in integer precision.
  • FileInputStream (java.io)
    A FileInputStream obtains input bytes from a file in a file system. What files are available depends
  • ResourceBundle (java.util)
    Resource bundles contain locale-specific objects. When your program needs a locale-specific resource
  • Collectors (java.util.stream)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now