$darkmode
DENOPTIM
denoptim.gui.GUIVertexInspector Class Reference

A panel with a viewer capable of visualising DENOPTIM fragments and allows to create and edit fragments. More...

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

Classes

class  VrtxSpinnerChangeEvent
 

Public Member Functions

 GUIVertexInspector (GUIMainPanel mainPanel)
 Constructor. More...
 
void importStructureFromFile (File file)
 
void importStructureFromSMILES (String smiles)
 Imports the given SMILES into the viewer. More...
 
void importVerticesFromFile (File file)
 Imports fragments from a file. More...
 
void importVertices (List< Vertex > fragments)
 Imports vertices. More...
 
boolean hasUnsavedChanges ()
 Check whether there are unsaved changes. More...
 
void dispose ()
 
- Public Member Functions inherited from denoptim.gui.GUICardPanel
 GUICardPanel (GUIMainPanel mainPanel, String newPanelName)
 Constructor for JPanel meant to be a single "card" in the deck of cards. More...
 
boolean hasUnsavedChanges ()
 Check for unsaved changes in the components included in this card. More...
 

Static Public Member Functions

static boolean dialogToDefineCuttingRules (FragmenterParameters settings, ClassLoader classLoader, Component parent, boolean setMolToGraphSettings)
 Starts a dialog to define the on-the-fly fragmentation settings. More...
 
static List< APClasschoseOrCreateNewAPClass (JComponent parent, boolean singleSelection)
 Runs a dialog aimed at selecting an existing APClass or defining a new one. More...
 
static String ensureGoodAPRuleString (String currApRule, String title, boolean mustReply, JComponent parent) throws DENOPTIMException
 Forces the user to specify a properly formatted APRule, i.e., the first component of an APClass. More...
 

Static Public Attributes

static AtomicInteger prepVrtxTabUID = new AtomicInteger(1)
 Unique identified for instances of this inspector. More...
 

Private Member Functions

void initialize ()
 Initialize the panel and add buttons. More...
 
void loadCurrentVrtxIdxToViewer ()
 Loads the fragments corresponding to the field index. More...
 
void clearCurrentSystem ()
 
void updateVrtxListSpinner ()
 
boolean convertAtomToAP (IAtom trgAtm, String ruleAndSubClass)
 Removes an atom and replaces it with an attachment point. More...
 
void removeAtoms (ArrayList< IAtom > atmsToDels)
 
void deprotectEditedSystem ()
 
void protectEditedSystem ()
 
void activateTabEditsListener (boolean var)
 
void removeCurrentVrtx () throws DENOPTIMException
 
void saveUnsavedChanges ()
 

Private Attributes

ArrayList< VertexverticesLibrary = new ArrayList<Vertex>()
 The currently loaded list of fragments. More...
 
Vertex vertex
 The currently loaded vertex. More...
 
int currVrtxIdx = 0
 The index of the currently loaded fragment [0–(n-1)}. More...
 
boolean unsavedChanges = false
 Flag signaling that loaded data has changes since last save. More...
 
VertexViewPanel vertexViewer
 
JPanel ctrlPane
 
JPanel navigPanel
 
JPanel navigPanel2
 
JPanel navigPanel3
 
JButton btnAddVrtx
 
JButton btnDelVrtx
 
JButton btnOpenVrtxs
 
JSpinner navigSpinner
 
JLabel totalVrtxsLabel
 
final VrtxSpinnerChangeEvent vrtxSpinnerListener
 
JPanel pnlImportStruct
 
JButton btnOpenMol
 
JButton btnOpenSMILES
 
JPanel pnlEmptFrag
 
JButton btnEmptFrag
 
JPanel pnlAtmToAP
 
JButton btnAtmToAP
 
JPanel pnlChop
 
JButton btnChop
 
JPanel pnlDelSel
 
JButton btnDelSel
 
JPanel pnlSaveEdits
 
JButton btnSaveEdits
 

Static Private Attributes

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

Additional Inherited Members

- Protected Attributes inherited from denoptim.gui.GUICardPanel
GUIMainPanel mainPanel
 The main panel (cards deck) More...
 

Detailed Description

A panel with a viewer capable of visualising DENOPTIM fragments and allows to create and edit fragments.

The molecular viewer is provided by Jmol.

Author
Marco Foscato

Definition at line 92 of file GUIVertexInspector.java.

Constructor & Destructor Documentation

◆ GUIVertexInspector()

denoptim.gui.GUIVertexInspector.GUIVertexInspector ( GUIMainPanel  mainPanel)

Constructor.

Definition at line 165 of file GUIVertexInspector.java.

References denoptim.gui.GUIVertexInspector.initialize(), denoptim.gui.GUICardPanel.mainPanel, and denoptim.gui.GUIVertexInspector.prepVrtxTabUID.

Here is the call graph for this function:

Member Function Documentation

◆ activateTabEditsListener()

void denoptim.gui.GUIVertexInspector.activateTabEditsListener ( boolean  var)
private

Definition at line 1360 of file GUIVertexInspector.java.

References denoptim.gui.VertexViewPanel.activateTabEditsListener(), and denoptim.gui.GUIVertexInspector.vertexViewer.

Referenced by denoptim.gui.GUIVertexInspector.saveUnsavedChanges(), and denoptim.gui.GUIVertexInspector.VrtxSpinnerChangeEvent.stateChanged().

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

◆ choseOrCreateNewAPClass()

static List< APClass > denoptim.gui.GUIVertexInspector.choseOrCreateNewAPClass ( JComponent  parent,
boolean  singleSelection 
)
static

Runs a dialog aimed at selecting an existing APClass or defining a new one.

Parameters
parentthe component the dialog window will the bound to.
singleSelectionuse true to restrict the choice to a single APClass.
Returns

Definition at line 1532 of file GUIVertexInspector.java.

References denoptim.graph.APClass.getAllAPClassesAsString(), denoptim.graph.APClass.make(), and denoptim.gui.GUIModalDialog.showDialog().

Referenced by denoptim.gui.GUIEmptyVertexMaker.GUIEmptyVertexMaker(), and denoptim.gui.GUIVertexInspector.initialize().

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

◆ clearCurrentSystem()

void denoptim.gui.GUIVertexInspector.clearCurrentSystem ( )
private

Definition at line 1142 of file GUIVertexInspector.java.

References denoptim.gui.VertexViewPanel.clearCurrentSystem(), denoptim.gui.GUIVertexInspector.vertex, and denoptim.gui.GUIVertexInspector.vertexViewer.

Referenced by denoptim.gui.GUIVertexInspector.importStructureFromFile(), denoptim.gui.GUIVertexInspector.importStructureFromSMILES(), denoptim.gui.GUIVertexInspector.loadCurrentVrtxIdxToViewer(), and denoptim.gui.GUIVertexInspector.removeCurrentVrtx().

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

◆ convertAtomToAP()

boolean denoptim.gui.GUIVertexInspector.convertAtomToAP ( IAtom  trgAtm,
String  ruleAndSubClass 
)
private

Removes an atom and replaces it with an attachment point.

Parameters
ruleAndSubClassthe attachment point class of the new AP. This must be a valid string as we do not check for validity. We assume the check has been done already.
trgAtm
Returns
true if the conversion was successful

Definition at line 1169 of file GUIVertexInspector.java.

References denoptim.graph.Fragment.addAPOnAtom(), denoptim.graph.Fragment.getConnectedAtomsCount(), denoptim.graph.Fragment.getConnectedAtomsList(), denoptim.utils.MoleculeUtils.getPoint3d(), denoptim.graph.Fragment.indexOf(), denoptim.graph.APClass.make(), denoptim.constants.DENOPTIMConstants.SEPARATORAPPROPSCL, and denoptim.gui.GUIVertexInspector.vertex.

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

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

◆ deprotectEditedSystem()

◆ dialogToDefineCuttingRules()

static boolean denoptim.gui.GUIVertexInspector.dialogToDefineCuttingRules ( FragmenterParameters  settings,
ClassLoader  classLoader,
Component  parent,
boolean  setMolToGraphSettings 
)
static

Starts a dialog to define the on-the-fly fragmentation settings.

Parameters
settingswhere settings will be stored
classLoaderused to find resources
parentused to place dialog windows in the relevant position.
setMolToGraphSettingsif true enabled the setting of parameters that make sense only when we convert molecules to DGraphs.
Returns
true if it all went well.

Definition at line 834 of file GUIVertexInspector.java.

References denoptim.programs.fragmenter.FragmenterParameters.getCuttingRulesFilePathname(), denoptim.gui.GUIPreferences.lastCutRulesFile, denoptim.io.DenoptimIO.readCuttingRules(), denoptim.gui.GUIModalDialog.result, and denoptim.programs.RunTimeParameters.startConsoleLogger().

Referenced by denoptim.gui.GUIGraphHandler.initialize(), and denoptim.gui.GUIVertexInspector.initialize().

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

◆ dispose()

void denoptim.gui.GUIVertexInspector.dispose ( )

Definition at line 1681 of file GUIVertexInspector.java.

References denoptim.gui.VertexViewPanel.dispose(), and denoptim.gui.GUIVertexInspector.vertexViewer.

Here is the call graph for this function:

◆ ensureGoodAPRuleString()

static String denoptim.gui.GUIVertexInspector.ensureGoodAPRuleString ( String  currApRule,
String  title,
boolean  mustReply,
JComponent  parent 
) throws DENOPTIMException
static

Forces the user to specify a properly formatted APRule, i.e., the first component of an APClass.

Parameters
currApRulethe current value of the APRule, or empty string
mustReplyset to true to prevent escaping the question
Returns
Exceptions
DENOPTIMExceptionis the used did not choose a valid value.

Definition at line 1625 of file GUIVertexInspector.java.

References denoptim.graph.APClass.isValidAPRuleString().

Here is the call graph for this function:

◆ hasUnsavedChanges()

boolean denoptim.gui.GUIVertexInspector.hasUnsavedChanges ( )

Check whether there are unsaved changes.

Returns
true if there are unsaved changes.

Reimplemented from denoptim.gui.GUICardPanel.

Definition at line 1671 of file GUIVertexInspector.java.

References denoptim.gui.GUIVertexInspector.unsavedChanges.

◆ importStructureFromFile()

void denoptim.gui.GUIVertexInspector.importStructureFromFile ( File  file)

◆ importStructureFromSMILES()

void denoptim.gui.GUIVertexInspector.importStructureFromSMILES ( String  smiles)

Imports the given SMILES into the viewer.

As SMILES cannot hold attachment points (APs), no AP will be created and the resulting system is a plain molecule instead of a fragment.

Parameters
smilesthe SMILES string

Definition at line 979 of file GUIVertexInspector.java.

References denoptim.gui.GUIVertexInspector.btnAtmToAP, denoptim.gui.GUIVertexInspector.btnDelSel, denoptim.gui.GUIVertexInspector.btnSaveEdits, denoptim.gui.GUIVertexInspector.clearCurrentSystem(), denoptim.gui.GUIVertexInspector.currVrtxIdx, denoptim.gui.VertexViewPanel.getLoadedStructure(), denoptim.gui.VertexViewPanel.loadSMILES(), denoptim.gui.GUIVertexInspector.unsavedChanges, denoptim.gui.GUIVertexInspector.updateVrtxListSpinner(), denoptim.gui.GUIVertexInspector.vertex, denoptim.gui.GUIVertexInspector.vertexViewer, and denoptim.gui.GUIVertexInspector.verticesLibrary.

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

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

◆ importVertices()

void denoptim.gui.GUIVertexInspector.importVertices ( List< Vertex fragments)

Imports vertices.

Parameters
fragmentsthe list of vertices to import

Definition at line 1058 of file GUIVertexInspector.java.

References denoptim.gui.GUIVertexInspector.currVrtxIdx, denoptim.gui.GUIVertexInspector.loadCurrentVrtxIdxToViewer(), denoptim.gui.GUIVertexInspector.updateVrtxListSpinner(), and denoptim.gui.GUIVertexInspector.verticesLibrary.

Referenced by denoptim.gui.GUIVertexInspector.importVerticesFromFile(), and denoptim.gui.GUIVertexInspector.initialize().

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

◆ importVerticesFromFile()

void denoptim.gui.GUIVertexInspector.importVerticesFromFile ( File  file)

Imports fragments from a file.

Parameters
filethe file to open

Definition at line 1018 of file GUIVertexInspector.java.

References denoptim.gui.GUIVertexInspector.btnAddVrtx, denoptim.graph.Vertex.BBType.FRAGMENT, denoptim.gui.GUIVertexInspector.importVertices(), and denoptim.io.DenoptimIO.readVertexes().

Referenced by denoptim.gui.MainToolBar.openFile().

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

◆ initialize()

void denoptim.gui.GUIVertexInspector.initialize ( )
private

Initialize the panel and add buttons.

Definition at line 177 of file GUIVertexInspector.java.

References denoptim.gui.ButtonsBar.add(), denoptim.utils.DummyAtomHandler.addDummiesOnLinearities(), denoptim.files.FileUtils.addToRecentFiles(), denoptim.gui.IVertexAPSelection.APDATACHANGEEVENT, denoptim.gui.GUIVertexInspector.btnAddVrtx, denoptim.gui.GUIVertexInspector.btnAtmToAP, denoptim.gui.GUIVertexInspector.btnChop, denoptim.gui.GUIVertexInspector.btnDelSel, denoptim.gui.GUIVertexInspector.btnDelVrtx, denoptim.gui.GUIModalDialog.btnDone, denoptim.gui.GUIVertexInspector.btnEmptFrag, denoptim.gui.GUIVertexInspector.btnOpenMol, denoptim.gui.GUIVertexInspector.btnOpenSMILES, denoptim.gui.GUIVertexInspector.btnOpenVrtxs, denoptim.gui.GUIVertexInspector.btnSaveEdits, denoptim.gui.GUIVertexInspector.choseOrCreateNewAPClass(), denoptim.gui.GUIVertexInspector.convertAtomToAP(), denoptim.gui.GUIVertexInspector.ctrlPane, denoptim.gui.GUIVertexSelector.ctrlPane, denoptim.gui.GUIVertexInspector.currVrtxIdx, denoptim.gui.GUIVertexInspector.deprotectEditedSystem(), denoptim.gui.GUIVertexInspector.dialogToDefineCuttingRules(), denoptim.files.FileAndFormat.file, denoptim.files.FileAndFormat.format, denoptim.graph.Vertex.BBType.FRAGMENT, denoptim.fragmenter.FragmenterTools.fragmentation(), denoptim.gui.VertexViewPanel.getAtomsSelectedFromJMol(), denoptim.programs.fragmenter.FragmenterParameters.getCuttingRules(), denoptim.programs.fragmenter.FragmenterParameters.getCuttingRulesFilePathname(), denoptim.graph.Vertex.getIAtomContainer(), denoptim.programs.fragmenter.FragmenterParameters.getLinearAngleLimit(), denoptim.gui.VertexViewPanel.getLoadedStructure(), denoptim.programs.RunTimeParameters.getLogger(), denoptim.gui.GUIVertexInspector.importStructureFromFile(), denoptim.gui.GUIVertexInspector.importStructureFromSMILES(), denoptim.gui.GUIVertexInspector.importVertices(), denoptim.gui.GUIVertexSelector.load(), denoptim.gui.VertexViewPanel.loadVertexToViewer(), denoptim.gui.GUIVertexInspector.navigPanel, denoptim.gui.GUIVertexInspector.navigPanel2, denoptim.gui.GUIVertexInspector.navigPanel3, denoptim.gui.GUIVertexInspector.navigSpinner, denoptim.gui.GUIFileOpener.pickFile(), denoptim.gui.GUIFileSaver.pickFileForSavingVertexes(), denoptim.gui.GUIVertexInspector.pnlAtmToAP, denoptim.gui.GUIVertexInspector.pnlChop, denoptim.gui.GUIVertexInspector.pnlDelSel, denoptim.gui.GUIVertexInspector.pnlEmptFrag, denoptim.gui.GUIVertexInspector.pnlImportStruct, denoptim.gui.GUIVertexInspector.pnlSaveEdits, denoptim.gui.GUIVertexInspector.protectEditedSystem(), denoptim.io.DenoptimIO.readVertexes(), denoptim.gui.GUIVertexInspector.removeAtoms(), denoptim.gui.GUIVertexInspector.removeCurrentVrtx(), denoptim.gui.GUIVertexInspector.saveUnsavedChanges(), denoptim.gui.GUIVertexSelector.setRequireApSelection(), denoptim.gui.GUIModalDialog.showDialog(), denoptim.gui.GUIVertexInspector.totalVrtxsLabel, denoptim.gui.GUIVertexInspector.unsavedChanges, denoptim.gui.GUIVertexInspector.vertex, denoptim.gui.GUIVertexInspector.vertexViewer, denoptim.gui.GUIVertexInspector.verticesLibrary, denoptim.gui.GUIVertexInspector.vrtxSpinnerListener, and denoptim.io.DenoptimIO.writeVertexesToFile().

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

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

◆ loadCurrentVrtxIdxToViewer()

void denoptim.gui.GUIVertexInspector.loadCurrentVrtxIdxToViewer ( )
private

Loads the fragments corresponding to the field index.

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.

Definition at line 1114 of file GUIVertexInspector.java.

References denoptim.gui.GUIVertexInspector.btnAtmToAP, denoptim.gui.GUIVertexInspector.btnDelSel, denoptim.gui.GUIVertexInspector.clearCurrentSystem(), denoptim.gui.GUIVertexInspector.currVrtxIdx, denoptim.gui.VertexViewPanel.loadVertexToViewer(), denoptim.gui.GUIVertexInspector.vertex, denoptim.gui.GUIVertexInspector.vertexViewer, and denoptim.gui.GUIVertexInspector.verticesLibrary.

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

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

◆ protectEditedSystem()

void denoptim.gui.GUIVertexInspector.protectEditedSystem ( )
private

◆ removeAtoms()

void denoptim.gui.GUIVertexInspector.removeAtoms ( ArrayList< IAtom >  atmsToDels)
private

Definition at line 1233 of file GUIVertexInspector.java.

References denoptim.constants.DENOPTIMConstants.ATMPROPAPS, denoptim.graph.Fragment.bonds(), denoptim.graph.Fragment.getAPsFromAtom(), denoptim.graph.Fragment.getAttachmentPoints(), denoptim.graph.Fragment.removeAtom(), denoptim.graph.Fragment.removeBond(), denoptim.graph.Fragment.updateAPs(), and denoptim.gui.GUIVertexInspector.vertex.

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

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

◆ removeCurrentVrtx()

void denoptim.gui.GUIVertexInspector.removeCurrentVrtx ( ) throws DENOPTIMException
private

◆ saveUnsavedChanges()

◆ updateVrtxListSpinner()

void denoptim.gui.GUIVertexInspector.updateVrtxListSpinner ( )
private

Member Data Documentation

◆ btnAddVrtx

◆ btnAtmToAP

◆ btnChop

JButton denoptim.gui.GUIVertexInspector.btnChop
private

Definition at line 151 of file GUIVertexInspector.java.

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

◆ btnDelSel

◆ btnDelVrtx

JButton denoptim.gui.GUIVertexInspector.btnDelVrtx
private

Definition at line 131 of file GUIVertexInspector.java.

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

◆ btnEmptFrag

◆ btnOpenMol

◆ btnOpenSMILES

◆ btnOpenVrtxs

◆ btnSaveEdits

◆ ctrlPane

JPanel denoptim.gui.GUIVertexInspector.ctrlPane
private

Definition at line 125 of file GUIVertexInspector.java.

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

◆ currVrtxIdx

◆ navigPanel

JPanel denoptim.gui.GUIVertexInspector.navigPanel
private

Definition at line 126 of file GUIVertexInspector.java.

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

◆ navigPanel2

JPanel denoptim.gui.GUIVertexInspector.navigPanel2
private

Definition at line 127 of file GUIVertexInspector.java.

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

◆ navigPanel3

JPanel denoptim.gui.GUIVertexInspector.navigPanel3
private

Definition at line 128 of file GUIVertexInspector.java.

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

◆ navigSpinner

◆ pnlAtmToAP

JPanel denoptim.gui.GUIVertexInspector.pnlAtmToAP
private

Definition at line 147 of file GUIVertexInspector.java.

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

◆ pnlChop

JPanel denoptim.gui.GUIVertexInspector.pnlChop
private

Definition at line 150 of file GUIVertexInspector.java.

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

◆ pnlDelSel

JPanel denoptim.gui.GUIVertexInspector.pnlDelSel
private

Definition at line 153 of file GUIVertexInspector.java.

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

◆ pnlEmptFrag

JPanel denoptim.gui.GUIVertexInspector.pnlEmptFrag
private

Definition at line 144 of file GUIVertexInspector.java.

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

◆ pnlImportStruct

JPanel denoptim.gui.GUIVertexInspector.pnlImportStruct
private

Definition at line 140 of file GUIVertexInspector.java.

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

◆ pnlSaveEdits

JPanel denoptim.gui.GUIVertexInspector.pnlSaveEdits
private

Definition at line 156 of file GUIVertexInspector.java.

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

◆ prepVrtxTabUID

AtomicInteger denoptim.gui.GUIVertexInspector.prepVrtxTabUID = new AtomicInteger(1)
static

Unique identified for instances of this inspector.

Definition at line 102 of file GUIVertexInspector.java.

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

◆ serialVersionUID

final long denoptim.gui.GUIVertexInspector.serialVersionUID = 912850110991449553L
staticprivate

Version UID.

Definition at line 97 of file GUIVertexInspector.java.

◆ totalVrtxsLabel

JLabel denoptim.gui.GUIVertexInspector.totalVrtxsLabel
private

◆ unsavedChanges

boolean denoptim.gui.GUIVertexInspector.unsavedChanges = false
private

◆ vertex

◆ vertexViewer

◆ verticesLibrary

◆ vrtxSpinnerListener

final VrtxSpinnerChangeEvent denoptim.gui.GUIVertexInspector.vrtxSpinnerListener
private

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