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;
31import javax.swing.JButton;
32import javax.swing.JLabel;
33import javax.swing.JPanel;
34import javax.swing.table.DefaultTableModel;
36import org.openscience.cdk.interfaces.IAtom;
37import org.openscience.cdk.interfaces.IAtomContainer;
39import denoptim.exception.DENOPTIMException;
40import denoptim.graph.AttachmentPoint;
41import denoptim.graph.EmptyVertex;
42import denoptim.graph.Fragment;
43import denoptim.graph.Template;
44import denoptim.graph.Vertex;
107 super(
new BorderLayout());
108 this.editableAPTable = editableTable;
126 +
"of this vertex.");
128 public void actionPerformed(ActionEvent e) {
137 +
"of this vertex.");
139 public void actionPerformed(ActionEvent e) {
148 +
"of this vertex.");
150 public void actionPerformed(ActionEvent e) {
166 new PropertyChangeListener() {
168 public void propertyChange(PropertyChangeEvent evt) {
179 new PropertyChangeListener() {
181 public void propertyChange(PropertyChangeEvent evt) {
192 new PropertyChangeListener() {
194 public void propertyChange(PropertyChangeEvent evt) {
373 System.err.println(
"Loading empty card as a result of vertex with "
374 +
"type " + v.getClass().getName());
472 graphNodeViewer.mapAPs =
null;
474 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.
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
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()