21import java.awt.Component;
22import java.awt.event.ActionEvent;
23import java.awt.event.ActionListener;
24import java.util.ArrayList;
27import javax.swing.JPanel;
29import org.openscience.cdk.interfaces.IAtom;
30import org.openscience.cdk.interfaces.IAtomContainer;
32import denoptim.graph.Vertex;
33import denoptim.utils.MoleculeUtils;
56 @SuppressWarnings(
"serial")
58 List<IAtom> highlightedAtoms,
59 int selectionGroupsCount,
int selectionGroupIndex)
61 super(refForPlacement);
63 if (selectionGroupsCount > 1) {
64 setTitle(
"Select Atoms of group " + (selectionGroupIndex) +
" (out of " + selectionGroupsCount +
" groups)");
66 this.
btnDone.setToolTipText(
"Save selection and move to next selection group.");
68 setTitle(
"Select Atoms");
70 this.
btnDone.setToolTipText(
"Save selection.");
79 if (highlightedAtoms !=
null) {
84 for (ActionListener listener :
btnDone.getActionListeners())
86 btnDone.removeActionListener(listener);
89 this.
btnDone.setToolTipText(
"Save selection and moves on.");
90 this.
btnDone.addActionListener(
new ActionListener() {
93 public void actionPerformed(ActionEvent e) {
95 IAtomContainer iac = vertex.getIAtomContainer();
100 for (IAtom atm : selectedAtms) {
A vertex is a data structure that has an identity and holds a list of AttachmentPoints.
A dialog window meant only to select atoms one or multiple times.
static final long serialVersionUID
Version UID.
VertexViewPanel vertexViewer
List< List< IAtom > > selectedAtoms
JButton btnCanc
The button that is used to close the dialog without processing any input.
void addToCentralPane(JComponent comp)
Adds a component to the central part of this dialog frame.
JButton btnDone
The button that is used to launch the processing of the data given to the open dialog,...
Object result
The result to be returned once the dialog is closed.
void close()
Closes the dialog window.
A panel for visualizing vertices.
void loadVertexToViewer(Vertex v)
Loads the given vertex to this viewer.
void highlightAtoms(List< IAtom > atoms)
Highlights the given atoms in the Jmol viewer.
ArrayList< IAtom > getAtomsSelectedFromJMol()
Identifies the atoms that are selected in the Jmol viewer.
Utilities for molecule conversion.
static String getAtomRef(IAtom atm, IAtomContainer mol)