$darkmode
DENOPTIM
denoptim.gui.VertexViewPanel Class Reference

A panel for visualizing vertices. More...

Inheritance diagram for denoptim.gui.VertexViewPanel:
[legend]
Collaboration diagram for denoptim.gui.VertexViewPanel:
[legend]

Public Member Functions

 VertexViewPanel (boolean editableTable)
 Constructor that allows to specify whether the AP table is editable or not. More...
 
boolean hasUnsavedAPEdits ()
 Check for unsaved edits to the AP data. More...
 
void deprotectEdits ()
 Overrides the flag signaling unsaved edits to saying that there are no altered data. More...
 
void setSwitchable (boolean switchable)
 Enable/disable switch-able view. More...
 
boolean loadSMILES (String smiles)
 Loads a molecule build from a smiles string. More...
 
Vertex getLoadedStructure ()
 Returns the currently loaded vertex. More...
 
void loadPlainStructure (IAtomContainer mol)
 Loads a structure in the Jmol viewer. More...
 
void loadVertexToViewer (Vertex v)
 Loads the given vertex to this viewer. More...
 
void clearCurrentSystem ()
 Removes the currently visualized molecule and AP table. More...
 
void clearMolecularViewer (boolean dataIsComing)
 Clears the molecular viewer. More...
 
Map< Integer, AttachmentPointgetActiveMapAPs ()
 Returns the map of attachment points in the currently active viewer. More...
 
DefaultTableModel getAPTableModel ()
 
ArrayList< Integer > getSelectedAPIDs ()
 Identifies which attachment points are selected in the currently active viewer. More...
 

Public Attributes

boolean alteredAPData = false
 Flag signalling that data about APs has been changed in the GUI. More...
 

Protected Member Functions

ArrayList< IAtom > getAtomsSelectedFromJMol ()
 Identifies the atoms that are selected in the Jmol viewer. More...
 
void activateTabEditsListener (boolean var)
 Allows to activate and deactivate the listener. More...
 
void dispose ()
 

Protected Attributes

final String EMPTYCARDNAME = "emptyCard"
 
final String GRAPHVIEWERCARDNAME = "emptyVertesCard"
 
final String MOLVIEWERCARDNAME = "fragViewerCard"
 
final String TWODVIEWERCARDNAME = "twoDimViewerCard"
 

Private Member Functions

void initialize ()
 
void switchToEmptyCard ()
 
void switchToGraphNodeViewer ()
 
void switchToMolecularViewer ()
 
void switchTo2DViewer ()
 
void loadEmptyVertexToViewer (EmptyVertex ev)
 Loads the given empty vertex to this viewer. More...
 
void loadFragmentToViewer (Fragment frag)
 Loads the given fragments to this viewer. More...
 
void loadTemplateToViewer (Template tmpl)
 Loads the given template to this viewer. More...
 

Private Attributes

Vertex vertex
 The currently loaded vertex. More...
 
JPanel titlePanel
 
JLabel labTitle
 
JButton btnSwitchToNodeViewer
 
JButton btnSwitchToMolViewer
 
JButton btnSwitchTo2DViewer
 
JPanel centralPanel
 
JPanel emptyViewerCard
 
FragmentViewPanel fragViewer
 
VertexAsGraphViewPanel graphNodeViewer
 
VertexAsTwoDimStructureViewPanel twoDimViewer
 
IVertexAPSelection activeViewer
 
boolean editableAPTable = false
 
boolean switchbleByVertexType = true
 Flag enabling/disabling the capability to switch between mol- and graph-based viewer. More...
 

Static Private Attributes

static final long serialVersionUID = 1L
 Version UID. More...
 

Detailed Description

A panel for visualizing vertices.

This is a deck of cards that brings up a specific card depending on the type of vertex to visualize.

Author
Marco Foscato

Definition at line 54 of file VertexViewPanel.java.

Constructor & Destructor Documentation

◆ VertexViewPanel()

denoptim.gui.VertexViewPanel.VertexViewPanel ( boolean  editableTable)

Constructor that allows to specify whether the AP table is editable or not.

Parameters
editableTableuse true to make the AP table editable

Definition at line 105 of file VertexViewPanel.java.

References denoptim.gui.VertexViewPanel.initialize().

Here is the call graph for this function:

Member Function Documentation

◆ activateTabEditsListener()

void denoptim.gui.VertexViewPanel.activateTabEditsListener ( boolean  var)
protected

Allows to activate and deactivate the listener.

Parameters
varuse true to activate the listener

Definition at line 546 of file VertexViewPanel.java.

References denoptim.gui.FragmentViewPanel.activateTabEditsListener(), and denoptim.gui.VertexViewPanel.fragViewer.

Referenced by denoptim.gui.GUIVertexInspector.activateTabEditsListener(), and denoptim.gui.GUIVertexSelector.activateTabEditsListener().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearCurrentSystem()

void denoptim.gui.VertexViewPanel.clearCurrentSystem ( )

Removes the currently visualized molecule and AP table.

Definition at line 469 of file VertexViewPanel.java.

References denoptim.gui.FragmentViewPanel.clearAPTable(), denoptim.gui.VertexAsGraphViewPanel.clearAPTable(), denoptim.gui.VertexViewPanel.fragViewer, denoptim.gui.VertexViewPanel.graphNodeViewer, denoptim.gui.VertexViewPanel.switchToEmptyCard(), and denoptim.gui.VertexViewPanel.vertex.

Referenced by denoptim.gui.GUIVertexInspector.clearCurrentSystem(), and denoptim.gui.GUIVertexSelector.clearCurrentSystem().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearMolecularViewer()

void denoptim.gui.VertexViewPanel.clearMolecularViewer ( boolean  dataIsComing)

Clears the molecular viewer.

WARNING: this is VERY SLOW: do not do it unless you are sure you really need to clear the data. Typically, if there is incoming data, you do not need to run this, as the old data will be overwritten anyway.

Parameters
dataIsComingset true when there is incoming molecular data to visualize.

Definition at line 491 of file VertexViewPanel.java.

References denoptim.gui.FragmentViewPanel.clearMolecularViewer(), and denoptim.gui.VertexViewPanel.fragViewer.

Referenced by denoptim.gui.GUIVertexInspector.removeCurrentVrtx().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deprotectEdits()

void denoptim.gui.VertexViewPanel.deprotectEdits ( )

Overrides the flag signaling unsaved edits to saying that there are no altered data.

Definition at line 223 of file VertexViewPanel.java.

References denoptim.gui.VertexViewPanel.alteredAPData, denoptim.gui.FragmentViewPanel.deprotectEdits(), denoptim.gui.VertexAsGraphViewPanel.deprotectEdits(), denoptim.gui.VertexViewPanel.fragViewer, and denoptim.gui.VertexViewPanel.graphNodeViewer.

Referenced by denoptim.gui.GUIVertexInspector.deprotectEditedSystem().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dispose()

void denoptim.gui.VertexViewPanel.dispose ( )
protected

Definition at line 556 of file VertexViewPanel.java.

References denoptim.gui.FragmentViewPanel.dispose(), and denoptim.gui.VertexViewPanel.fragViewer.

Referenced by denoptim.gui.GUIVertexInspector.dispose(), and denoptim.gui.GUIVertexSelector.GUIVertexSelector().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getActiveMapAPs()

Map< Integer, AttachmentPoint > denoptim.gui.VertexViewPanel.getActiveMapAPs ( )

Returns the map of attachment points in the currently active viewer.

Returns
the map of attachment points in the currently active viewer.

Definition at line 502 of file VertexViewPanel.java.

References denoptim.gui.VertexViewPanel.activeViewer, and denoptim.gui.IVertexAPSelection.getMapOfAPsInTable().

Referenced by denoptim.gui.GUIVertexInspector.saveUnsavedChanges().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAPTableModel()

DefaultTableModel denoptim.gui.VertexViewPanel.getAPTableModel ( )
Returns
the table model of the currently active viewer

Definition at line 512 of file VertexViewPanel.java.

References denoptim.gui.VertexViewPanel.activeViewer, and denoptim.gui.IVertexAPSelection.getAPTableModel().

Referenced by denoptim.gui.GUIVertexInspector.saveUnsavedChanges().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAtomsSelectedFromJMol()

ArrayList< IAtom > denoptim.gui.VertexViewPanel.getAtomsSelectedFromJMol ( )
protected

Identifies the atoms that are selected in the Jmol viewer.

Returns
the list of selected atoms

Definition at line 535 of file VertexViewPanel.java.

References denoptim.gui.VertexViewPanel.fragViewer, and denoptim.gui.FragmentViewPanel.getAtomsSelectedFromJMol().

Referenced by denoptim.gui.GUIVertexInspector.initialize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLoadedStructure()

Vertex denoptim.gui.VertexViewPanel.getLoadedStructure ( )

Returns the currently loaded vertex.

In case of mismatch between the system loaded into the Jmol viewer and the one in the local memory, we take that from Jmol and made it be The 'current fragment'. Previously set references to the previous 'current fragment' will make no sense anymore.

Returns
the chemical representation of what is currently visualised. Can be empty and null.

Definition at line 322 of file VertexViewPanel.java.

References denoptim.gui.VertexViewPanel.fragViewer, denoptim.gui.FragmentViewPanel.getLoadedStructure(), denoptim.gui.VertexViewPanel.switchToMolecularViewer(), and denoptim.gui.VertexViewPanel.vertex.

Referenced by denoptim.gui.GUIVertexInspector.importStructureFromFile(), denoptim.gui.GUIVertexInspector.importStructureFromSMILES(), denoptim.gui.GUIVertexInspector.initialize(), and denoptim.gui.GUIVertexInspector.saveUnsavedChanges().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSelectedAPIDs()

ArrayList< Integer > denoptim.gui.VertexViewPanel.getSelectedAPIDs ( )

Identifies which attachment points are selected in the currently active viewer.

Returns
the list of attachment points indexes

Definition at line 524 of file VertexViewPanel.java.

References denoptim.gui.VertexViewPanel.activeViewer, and denoptim.gui.IVertexAPSelection.getSelectedAPIDs().

Referenced by denoptim.gui.GUIVertexSelector.GUIVertexSelector().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasUnsavedAPEdits()

boolean denoptim.gui.VertexViewPanel.hasUnsavedAPEdits ( )

Check for unsaved edits to the AP data.

Returns
true if there are unsaved edits

Definition at line 212 of file VertexViewPanel.java.

References denoptim.gui.VertexViewPanel.alteredAPData.

Referenced by denoptim.gui.GUIVertexInspector.removeCurrentVrtx(), and denoptim.gui.GUIVertexInspector.saveUnsavedChanges().

Here is the caller graph for this function:

◆ initialize()

◆ loadEmptyVertexToViewer()

void denoptim.gui.VertexViewPanel.loadEmptyVertexToViewer ( EmptyVertex  ev)
private

Loads the given empty vertex to this viewer.

This type of vertex does not have any associated molecular data, but does have attachment points (APs) that are listed in table of APs.

Parameters
evthe vertex to visualize

Definition at line 387 of file VertexViewPanel.java.

References denoptim.gui.VertexViewPanel.btnSwitchTo2DViewer, denoptim.gui.VertexViewPanel.btnSwitchToMolViewer, denoptim.gui.VertexViewPanel.btnSwitchToNodeViewer, denoptim.gui.VertexViewPanel.graphNodeViewer, denoptim.gui.VertexAsGraphViewPanel.loadVertexToViewer(), denoptim.gui.VertexViewPanel.switchbleByVertexType, and denoptim.gui.VertexViewPanel.switchToGraphNodeViewer().

Referenced by denoptim.gui.VertexViewPanel.loadVertexToViewer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadFragmentToViewer()

void denoptim.gui.VertexViewPanel.loadFragmentToViewer ( Fragment  frag)
private

Loads the given fragments to this viewer.

The molecular data is loaded in the Jmol viewer, and the attachment point (AP) information in the the list of APs. Jmol is not aware of AP-related information, so this also launches the generation of the graphical objects representing the APs.

Parameters
fragthe fragment to visualize

Definition at line 407 of file VertexViewPanel.java.

References denoptim.gui.VertexViewPanel.btnSwitchTo2DViewer, denoptim.gui.VertexViewPanel.btnSwitchToMolViewer, denoptim.gui.VertexViewPanel.btnSwitchToNodeViewer, denoptim.gui.VertexViewPanel.fragViewer, denoptim.gui.VertexViewPanel.graphNodeViewer, denoptim.graph.Fragment.is3D(), denoptim.gui.FragmentViewPanel.loadFragmentToViewer(), denoptim.gui.VertexAsGraphViewPanel.loadVertexToViewer(), denoptim.gui.VertexAsTwoDimStructureViewPanel.loadVertexToViewer(), denoptim.gui.VertexViewPanel.switchbleByVertexType, denoptim.gui.VertexViewPanel.switchTo2DViewer(), denoptim.gui.VertexViewPanel.switchToMolecularViewer(), and denoptim.gui.VertexViewPanel.twoDimViewer.

Referenced by denoptim.gui.VertexViewPanel.loadTemplateToViewer(), and denoptim.gui.VertexViewPanel.loadVertexToViewer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadPlainStructure()

void denoptim.gui.VertexViewPanel.loadPlainStructure ( IAtomContainer  mol)

Loads a structure in the Jmol viewer.

Parameters
molthe structure to load

Definition at line 341 of file VertexViewPanel.java.

References denoptim.gui.VertexViewPanel.fragViewer, denoptim.gui.FragmentViewPanel.loadPlainStructure(), and denoptim.gui.VertexViewPanel.switchToMolecularViewer().

Referenced by denoptim.gui.GUIVertexInspector.importStructureFromFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadSMILES()

boolean denoptim.gui.VertexViewPanel.loadSMILES ( String  smiles)

Loads a molecule build from a smiles string.

The 3D geometry is either taken from remote CACTUS service (requires connection to the Internet) or built with CDK tools, as a fall-back. The CDK builder, however will produce a somewhat lower quality conformation than that obtained from on online generator.

Parameters
smilesthe SMILES of the molecule to load
Returns
true if the SMILES could be converted into a 3D structure
Exceptions
DENOPTIMException

Definition at line 305 of file VertexViewPanel.java.

References denoptim.gui.VertexViewPanel.fragViewer, denoptim.gui.FragmentViewPanel.loadSMILES(), and denoptim.gui.VertexViewPanel.switchToMolecularViewer().

Referenced by denoptim.gui.GUIVertexInspector.importStructureFromSMILES().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadTemplateToViewer()

void denoptim.gui.VertexViewPanel.loadTemplateToViewer ( Template  tmpl)
private

◆ loadVertexToViewer()

void denoptim.gui.VertexViewPanel.loadVertexToViewer ( Vertex  v)

Loads the given vertex to this viewer.

The molecular data is loaded in the Jmol viewer, and the attachment point (AP) information in the the list of APs. Jmol is not aware of AP-related information, so this also launches the generation of the graphical objects representing the APs.

Parameters
fragthe fragment to visualize

Definition at line 357 of file VertexViewPanel.java.

References denoptim.gui.VertexViewPanel.labTitle, denoptim.gui.VertexViewPanel.loadEmptyVertexToViewer(), denoptim.gui.VertexViewPanel.loadFragmentToViewer(), denoptim.gui.VertexViewPanel.loadTemplateToViewer(), denoptim.gui.VertexViewPanel.switchToEmptyCard(), and denoptim.gui.VertexViewPanel.vertex.

Referenced by denoptim.gui.GUIVertexInspector.initialize(), denoptim.gui.GUIVertexInspector.loadCurrentVrtxIdxToViewer(), and denoptim.gui.GUIVertexSelector.loadCurrentVrtxIdxToViewer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSwitchable()

void denoptim.gui.VertexViewPanel.setSwitchable ( boolean  switchable)

Enable/disable switch-able view.

Does not overwrite the control set upon loading a vertex

Definition at line 236 of file VertexViewPanel.java.

References denoptim.gui.VertexViewPanel.btnSwitchTo2DViewer, denoptim.gui.VertexViewPanel.btnSwitchToMolViewer, denoptim.gui.VertexViewPanel.btnSwitchToNodeViewer, and denoptim.gui.VertexViewPanel.switchbleByVertexType.

Referenced by denoptim.gui.GUIVertexInspector.deprotectEditedSystem(), and denoptim.gui.GUIVertexInspector.protectEditedSystem().

Here is the caller graph for this function:

◆ switchTo2DViewer()

void denoptim.gui.VertexViewPanel.switchTo2DViewer ( )
private

Definition at line 285 of file VertexViewPanel.java.

References denoptim.gui.VertexViewPanel.activeViewer, denoptim.gui.VertexViewPanel.centralPanel, denoptim.gui.VertexViewPanel.twoDimViewer, and denoptim.gui.VertexViewPanel.TWODVIEWERCARDNAME.

Referenced by denoptim.gui.VertexViewPanel.initialize(), and denoptim.gui.VertexViewPanel.loadFragmentToViewer().

Here is the caller graph for this function:

◆ switchToEmptyCard()

void denoptim.gui.VertexViewPanel.switchToEmptyCard ( )
private

◆ switchToGraphNodeViewer()

void denoptim.gui.VertexViewPanel.switchToGraphNodeViewer ( )
private

◆ switchToMolecularViewer()

void denoptim.gui.VertexViewPanel.switchToMolecularViewer ( )
private

Member Data Documentation

◆ activeViewer

◆ alteredAPData

boolean denoptim.gui.VertexViewPanel.alteredAPData = false

Flag signalling that data about APs has been changed in the GUI.

Definition at line 69 of file VertexViewPanel.java.

Referenced by denoptim.gui.VertexViewPanel.deprotectEdits(), denoptim.gui.VertexViewPanel.hasUnsavedAPEdits(), and denoptim.gui.VertexViewPanel.initialize().

◆ btnSwitchTo2DViewer

◆ btnSwitchToMolViewer

◆ btnSwitchToNodeViewer

◆ centralPanel

◆ editableAPTable

boolean denoptim.gui.VertexViewPanel.editableAPTable = false
private

Definition at line 90 of file VertexViewPanel.java.

Referenced by denoptim.gui.VertexViewPanel.initialize().

◆ EMPTYCARDNAME

final String denoptim.gui.VertexViewPanel.EMPTYCARDNAME = "emptyCard"
protected

◆ emptyViewerCard

JPanel denoptim.gui.VertexViewPanel.emptyViewerCard
private

Definition at line 80 of file VertexViewPanel.java.

Referenced by denoptim.gui.VertexViewPanel.initialize().

◆ fragViewer

◆ graphNodeViewer

◆ GRAPHVIEWERCARDNAME

final String denoptim.gui.VertexViewPanel.GRAPHVIEWERCARDNAME = "emptyVertesCard"
protected

◆ labTitle

JLabel denoptim.gui.VertexViewPanel.labTitle
private

◆ MOLVIEWERCARDNAME

final String denoptim.gui.VertexViewPanel.MOLVIEWERCARDNAME = "fragViewerCard"
protected

◆ serialVersionUID

final long denoptim.gui.VertexViewPanel.serialVersionUID = 1L
staticprivate

Version UID.

Definition at line 59 of file VertexViewPanel.java.

◆ switchbleByVertexType

boolean denoptim.gui.VertexViewPanel.switchbleByVertexType = true
private

◆ titlePanel

JPanel denoptim.gui.VertexViewPanel.titlePanel
private

Definition at line 71 of file VertexViewPanel.java.

Referenced by denoptim.gui.VertexViewPanel.initialize().

◆ twoDimViewer

◆ TWODVIEWERCARDNAME

final String denoptim.gui.VertexViewPanel.TWODVIEWERCARDNAME = "twoDimViewerCard"
protected

◆ vertex

Vertex denoptim.gui.VertexViewPanel.vertex
private

The documentation for this class was generated from the following file: