22import java.awt.BorderLayout;
23import java.awt.CardLayout;
24import java.awt.event.ActionEvent;
25import java.awt.event.ActionListener;
26import java.beans.PropertyChangeEvent;
27import java.beans.PropertyChangeListener;
28import java.util.ArrayList;
32import javax.swing.JButton;
33import javax.swing.JLabel;
34import javax.swing.JPanel;
35import javax.swing.table.DefaultTableModel;
37import org.openscience.cdk.interfaces.IAtom;
38import org.openscience.cdk.interfaces.IAtomContainer;
40import denoptim.exception.DENOPTIMException;
41import denoptim.graph.AttachmentPoint;
42import denoptim.graph.EmptyVertex;
43import denoptim.graph.Fragment;
44import denoptim.graph.Template;
45import denoptim.graph.Vertex;
108 super(
new BorderLayout());
109 this.editableAPTable = editableTable;
127 +
"of this vertex.");
129 public void actionPerformed(ActionEvent e) {
138 +
"of this vertex.");
140 public void actionPerformed(ActionEvent e) {
149 +
"of this vertex.");
151 public void actionPerformed(ActionEvent e) {
167 new PropertyChangeListener() {
169 public void propertyChange(PropertyChangeEvent evt) {
180 new PropertyChangeListener() {
182 public void propertyChange(PropertyChangeEvent evt) {
193 new PropertyChangeListener() {
195 public void propertyChange(PropertyChangeEvent evt) {
374 System.err.println(
"Loading empty card as a result of vertex with "
375 +
"type " + v.getClass().getName());
484 graphNodeViewer.mapAPs =
null;
486 fragViewer.mapAPs =
null;
An empty vertex has the behaviors of a vertex, but has no molecular structure.
Class representing a continuously connected portion of chemical object holding attachment points.
boolean is3D()
Checks if atoms and APs contained in this fragment have non-zero 3D coordinates.
IAtomContainer getIAtomContainer()
The molecular representation, if any, is generated by this method and stored until further changes in...
A vertex is a data structure that has an identity and holds a list of AttachmentPoints.
Vertex.BBType getBuildingBlockType()
A panel with a molecular viewer and attachment point table.
boolean loadSMILES(String smiles)
Loads a molecule build from a smiles string.
void clearAll(boolean dataIsComing)
Removes the currently visualized molecule and AP table.
void setColorOfAtoms(List< IAtom > atoms, String color)
Highlights the given atoms in the Jmol viewer using colored halos (the same ring style as selection h...
ArrayList< IAtom > getAtomsSelectedFromJMol()
Identifies the atoms that are selected in the Jmol viewer.
void clearAPTable()
Clears the table of attachment points.
void loadPlainStructure(IAtomContainer mol)
Loads a structure in the Jmol viewer.
void deprotectEdits()
Overrides the flag signaling unsaved edits to saying that there are no altered data.
void loadFragmentToViewer(Fragment frag)
Loads the given fragments to this viewer.
void activateTabEditsListener(boolean var)
Allows to activate and deactivate the listener.
void clearMolecularViewer(boolean dataIsComing)
Clears the molecular viewer.
Fragment getLoadedStructure()
Returns the chemical representation of the currently loaded chemical object.
A panel to visualize a vertex as a graph component with attachment point table.
void setVertexSpecificEditableAPTable(boolean editable)
void loadVertexToViewer(Vertex v)
void deprotectEdits()
Overrides the flag signaling unsaved edits to saying that there are no altered data.
void clearAPTable()
Clears the table of attachment points.
A panel to visualize a vertex as two-dimensional chemical structure with attachment point table.
void loadVertexToViewer(Vertex v)
A panel for visualizing vertices.
void clearCurrentSystem()
Removes the currently visualized molecule and AP table.
FragmentViewPanel fragViewer
final String GRAPHVIEWERCARDNAME
ArrayList< Integer > getSelectedAPIDs()
Identifies which attachment points are selected in the currently active viewer.
void loadTemplateToViewer(Template tmpl)
Loads the given template to this viewer.
boolean hasUnsavedAPEdits()
Check for unsaved edits to the AP data.
DefaultTableModel getAPTableModel()
VertexViewPanel(boolean editableTable)
Constructor that allows to specify whether the AP table is editable or not.
void activateTabEditsListener(boolean var)
Allows to activate and deactivate the listener.
Map< Integer, AttachmentPoint > getActiveMapAPs()
Returns the map of attachment points in the currently active viewer.
Vertex vertex
The currently loaded vertex.
void deprotectEdits()
Overrides the flag signaling unsaved edits to saying that there are no altered data.
final String MOLVIEWERCARDNAME
void loadFragmentToViewer(Fragment frag)
Loads the given fragments to this viewer.
JButton btnSwitchToNodeViewer
final String TWODVIEWERCARDNAME
void loadVertexToViewer(Vertex v)
Loads the given vertex to this viewer.
boolean switchbleByVertexType
Flag enabling/disabling the capability to switch between mol- and graph-based viewer.
Vertex getLoadedStructure()
Returns the currently loaded vertex.
void loadPlainStructure(IAtomContainer mol)
Loads a structure in the Jmol viewer.
VertexAsGraphViewPanel graphNodeViewer
static final long serialVersionUID
Version UID.
void switchToMolecularViewer()
boolean alteredAPData
Flag signalling that data about APs has been changed in the GUI.
final String EMPTYCARDNAME
void highlightAtoms(List< IAtom > atoms)
Highlights the given atoms in the Jmol viewer.
boolean loadSMILES(String smiles)
Loads a molecule build from a smiles string.
JButton btnSwitchToMolViewer
JButton btnSwitchTo2DViewer
void setSwitchable(boolean switchable)
Enable/disable switch-able view.
void switchToGraphNodeViewer()
ArrayList< IAtom > getAtomsSelectedFromJMol()
Identifies the atoms that are selected in the Jmol viewer.
void clearMolecularViewer(boolean dataIsComing)
Clears the molecular viewer.
VertexAsTwoDimStructureViewPanel twoDimViewer
IVertexAPSelection activeViewer
void loadEmptyVertexToViewer(EmptyVertex ev)
Loads the given empty vertex to this viewer.
Interface for all vertex viewers that intend to allow selection of attachment points.
ArrayList< Integer > getSelectedAPIDs()
Map< Integer, AttachmentPoint > getMapOfAPsInTable()
final String APDATACHANGEEVENT
DefaultTableModel getAPTableModel()