use of javax.swing.JCheckBoxMenuItem in project knime-core by knime.
the class RankCorrelationComputeNodeView method getJMenu.
private JMenu getJMenu() {
JMenu menu = new JMenu("View");
JCheckBoxMenuItem useColorBox = new JCheckBoxMenuItem("Use Colors");
useColorBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
if (((JCheckBoxMenuItem) e.getSource()).isSelected()) {
changeRenderer(ColorRender.DESCRIPTION);
} else {
changeRenderer(DoubleValueRenderer.STANDARD_RENDERER.getDescription());
}
}
});
useColorBox.addPropertyChangeListener("ancestor", new PropertyChangeListener() {
/**
* {@inheritDoc}
*/
@Override
public void propertyChange(final PropertyChangeEvent evt) {
((JCheckBoxMenuItem) evt.getSource()).setSelected(m_currentRendererID.equals(ColorRender.DESCRIPTION));
}
});
JMenuItem colWidthItem = new JMenuItem("Cell Size...");
colWidthItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
int colWidth = m_tableView.getColumnWidth();
JSpinner s = new JSpinner(new SpinnerNumberModel(colWidth, 1, Integer.MAX_VALUE, 1));
int r = JOptionPane.showConfirmDialog(m_tableView, s, "Cell Size", JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
if (r == JOptionPane.OK_OPTION) {
m_tableView.setColumnWidth((Integer) s.getValue());
m_tableView.setRowHeight((Integer) s.getValue());
}
}
});
menu.add(useColorBox);
menu.add(colWidthItem);
return menu;
}
use of javax.swing.JCheckBoxMenuItem in project knime-core by knime.
the class PMCCNodeView method getJMenu.
private JMenu getJMenu() {
JMenu menu = new JMenu("View");
JCheckBoxMenuItem useColorBox = new JCheckBoxMenuItem("Use Colors");
useColorBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
if (((JCheckBoxMenuItem) e.getSource()).isSelected()) {
changeRenderer(ColorRender.DESCRIPTION);
} else {
changeRenderer(DoubleValueRenderer.STANDARD_RENDERER.getDescription());
}
}
});
useColorBox.addPropertyChangeListener("ancestor", new PropertyChangeListener() {
/**
* {@inheritDoc}
*/
@Override
public void propertyChange(final PropertyChangeEvent evt) {
((JCheckBoxMenuItem) evt.getSource()).setSelected(m_currentRendererID.equals(ColorRender.DESCRIPTION));
}
});
JMenuItem colWidthItem = new JMenuItem("Cell Size...");
colWidthItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
int colWidth = m_tableView.getColumnWidth();
JSpinner s = new JSpinner(new SpinnerNumberModel(colWidth, 1, Integer.MAX_VALUE, 1));
int r = JOptionPane.showConfirmDialog(m_tableView, s, "Cell Size", JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
if (r == JOptionPane.OK_OPTION) {
m_tableView.setColumnWidth((Integer) s.getValue());
m_tableView.setRowHeight((Integer) s.getValue());
}
}
});
menu.add(useColorBox);
menu.add(colWidthItem);
return menu;
}
use of javax.swing.JCheckBoxMenuItem in project knime-core by knime.
the class Rule2DPlotter method getHiLiteMenu.
/**
* {@inheritDoc}
*/
@Override
public JMenu getHiLiteMenu() {
JMenu menu = super.getHiLiteMenu();
if (m_hiliteRules == null && m_unhiliteRules == null) {
menu.addSeparator();
JMenuItem item;
/*-------"hilite selected rules"----*/
m_hiliteRules = new JMenuItem(HILITE_RULES);
m_hiliteRules.setEnabled(false);
m_hiliteRules.addActionListener(this);
menu.add(m_hiliteRules);
/*----------"unhilite selected rules"-----*/
m_unhiliteRules = new JMenuItem(UNHILITE_RULES);
// item.setEnabled(rulesSelected);
m_unhiliteRules.addActionListener(this);
m_unhiliteRules.setEnabled(false);
menu.add(m_unhiliteRules);
/* --- "[ ] hide unhilited rules" --- */
item = new JCheckBoxMenuItem(HIDE_UNHILITED_RULES, getDrawingPane().isHideUnhilitedRules());
item.addActionListener(this);
menu.add(item);
}
return menu;
}
Aggregations