public abstract class AbstractStructureChecker extends Object implements StructureChecker, chemaxon.license.Licensable, Cloneable, PropertyChangeListener
| Modifier and Type | Field and Description |
|---|---|
protected StructureCheckerErrorType |
errorType
The error type of the current checker.
|
protected PropertyChangeSupport |
propertyChangeSupport
property change support object bound to this
|
PROPERTY_KEY_VALID| Constructor and Description |
|---|
AbstractStructureChecker(StructureCheckerErrorType errorType)
Constructor to create a Structure checker instance with the given errorType
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list.
|
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Add a PropertyChangeListener for a specific property.
|
StructureCheckerResult |
check(Molecule molecule)
Detects a specific error in the molecule.
|
protected abstract StructureCheckerResult |
check1(Molecule molecule)
This method contains the current checking mechanism.
|
AbstractStructureChecker |
clone() |
StructureChecker |
cloneItem()
Returns a clone of this StructureChecker instance
|
protected void |
convertResult(Molecule originalMolecule,
Molecule expandedMolecule,
StructureCheckerResult result,
Map<MolAtom,MolAtom> atomMap,
Map<MolBond,MolBond> bondMap)
Handles the mapping of a cloned and expanded molecule result to the original molecule.
|
boolean |
equals(Object obj) |
protected Molecule |
expandMolecule(Molecule molecule,
Map<MolAtom,MolAtom> atomMap,
Map<MolBond,MolBond> bondMap)
Returns the original molecule if no groups to expand,
or the clone of the original molecule with expanded groups.
|
String |
getDescription() |
StructureCheckerDescriptor |
getDescriptor()
Returns a
StructureCheckerDescriptor instance which represents the user interface
related informations of the checker |
String |
getEditorClassName() |
String |
getErrorCode()
Returns the
String represented error code of the checker (this error code
should be used for external implementation support instead of StructureChecker.getErrorType()) |
protected String |
getErrorDescription(int errorCount)
Generate the error description depends on erroCount
|
StructureCheckerErrorType |
getErrorType() |
String |
getHelpText()
Gets the help text of the checker
|
Icon |
getIcon()
Gets the
Icon of the current checker |
String |
getLocalMenuName()
Gets the local menu name of the checker
|
String |
getName()
Gets the name of the checker
|
int |
hashCode() |
boolean |
isAvailable()
Returns true if the checker is available, and can be used
|
boolean |
isLicensed() |
boolean |
isValid()
Returns true if the checker's configuration is valid, false otherwise
|
void |
propertyChange(PropertyChangeEvent evt) |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list.
|
void |
removePropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Remove a PropertyChangeListener for a specific property.
|
void |
setDescription(String description)
Sets the description of the checker
|
void |
setHelpText(String helpText)
Sets the detailed help of the checker which will shown in the tooltip on the GUI
|
void |
setIcon(Icon icon)
Sets the icon of the checker
|
void |
setLicenseEnvironment(String env) |
void |
setLocalMenuName(String localMenuName)
Set the local menu name of the checker
|
void |
setMoreErrorMessage(String moreErrorMessage)
Sets the message which will given in the result if two or more error found
|
void |
setName(String name)
Sets the name of the checker
|
void |
setNoErrorMessage(String noErrorMessage)
Sets the message which will given in the result if no error found
|
void |
setOneErrorMessage(String oneErrorMessage)
Sets the message which will given in the result if one error found
|
String |
toString() |
protected final StructureCheckerErrorType errorType
protected PropertyChangeSupport propertyChangeSupport
public AbstractStructureChecker(StructureCheckerErrorType errorType)
errorType - element of StructureCheckerErrorTypepublic String getName()
StructureCheckergetName in interface StructureCheckerpublic void setName(String name)
StructureCheckersetName in interface StructureCheckername - the human readable name of the checkerpublic void setNoErrorMessage(String noErrorMessage)
StructureCheckersetNoErrorMessage in interface StructureCheckernoErrorMessage - the error message if no error foundpublic void setOneErrorMessage(String oneErrorMessage)
StructureCheckersetOneErrorMessage in interface StructureCheckeroneErrorMessage - the error message if one error foundpublic void setMoreErrorMessage(String moreErrorMessage)
StructureCheckersetMoreErrorMessage in interface StructureCheckermoreErrorMessage - the error message if two or more error foundprotected String getErrorDescription(int errorCount)
errorCount - number of errors foundpublic String getLocalMenuName()
StructureCheckergetLocalMenuName in interface StructureCheckerpublic void setLocalMenuName(String localMenuName)
StructureCheckersetLocalMenuName in interface StructureCheckerlocalMenuName - a String to be shown in the local menupublic String getHelpText()
StructureCheckergetHelpText in interface StructureCheckerpublic void setHelpText(String helpText)
StructureCheckersetHelpText in interface StructureCheckerhelpText - a String to be shown in the tooltippublic Icon getIcon()
StructureCheckerIcon of the current checkergetIcon in interface StructureCheckerIcon of the current checkerpublic void setIcon(Icon icon)
StructureCheckersetIcon in interface StructureCheckericon - is an instance of Iconpublic final StructureCheckerResult check(Molecule molecule) throws NullPointerException, chemaxon.license.LicenseException
StructureCheckercheck in interface StructureCheckermolecule - a Molecule instance have to be checkedStructureCheckerResult (which contains all data needed
to fix the problem) if the molecule contains the examined error, null
otherwiseNullPointerException - if molecule is nullchemaxon.license.LicenseExceptionprotected abstract StructureCheckerResult check1(Molecule molecule)
molecule - the Molecule instance to be checked for problemsStructureCheckerResult which represents the problem or null
if no problem foundprotected Molecule expandMolecule(Molecule molecule, Map<MolAtom,MolAtom> atomMap, Map<MolBond,MolBond> bondMap)
molecule - the molecule to checkprotected void convertResult(Molecule originalMolecule, Molecule expandedMolecule, StructureCheckerResult result, Map<MolAtom,MolAtom> atomMap, Map<MolBond,MolBond> bondMap)
originalMolecule - the original moleculeexpandedMolecule - the cloned then expanded moleculeresult - the structure checker result on cloned moleculeatomMap - the mapping of cloned molecule and original molecule atomsbondMap - the mapping of cloned molecule and original molecule bondspublic boolean isLicensed()
isLicensed in interface chemaxon.license.Licensablepublic void setLicenseEnvironment(String env)
setLicenseEnvironment in interface chemaxon.license.Licensablepublic StructureCheckerErrorType getErrorType()
getErrorType in interface StructureCheckerpublic String getErrorCode()
StructureCheckerString represented error code of the checker (this error code
should be used for external implementation support instead of StructureChecker.getErrorType())getErrorCode in interface StructureCheckerString represented error code of the checker (this error code
should be used for external implementation support instead of StructureChecker.getErrorType())public String getEditorClassName()
getEditorClassName in interface StructureCheckerpublic String getDescription()
getDescription in interface StructureCheckerpublic boolean isValid()
StructureCheckerisValid in interface StructureCheckerpublic boolean isAvailable()
StructureCheckerisAvailable in interface StructureCheckerpublic StructureChecker cloneItem()
StructureCheckercloneItem in interface StructureCheckerpublic AbstractStructureChecker clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionpublic void setDescription(String description)
StructureCheckersetDescription in interface StructureCheckerdescription - the description to setpublic void addPropertyChangeListener(PropertyChangeListener listener)
StructureCheckerlistener is null, no exception is thrown and no action
is taken.addPropertyChangeListener in interface StructureCheckerlistener - The PropertyChangeListener to be addedPropertyChangeSupport.addPropertyChangeListener(PropertyChangeListener)public void removePropertyChangeListener(PropertyChangeListener listener)
StructureCheckerlistener was added more than once to the same event
source, it will be notified one less time after being removed.
If listener is null, or was never added, no exception is
thrown and no action is taken.removePropertyChangeListener in interface StructureCheckerlistener - The PropertyChangeListener to be removedPropertyChangeSupport.removePropertyChangeListener(PropertyChangeListener)public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
StructureCheckerpropertyName or listener is null, no
exception is thrown and no action is taken.addPropertyChangeListener in interface StructureCheckerpropertyName - The name of the property to listen on.listener - The PropertyChangeListener to be addedPropertyChangeSupport.addPropertyChangeListener(String, PropertyChangeListener)public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
StructureCheckerlistener was added more than once to the same event
source for the specified property, it will be notified one less time
after being removed.
If propertyName is null, no exception is thrown and no
action is taken.
If listener is null, or was never added for the specified
property, no exception is thrown and no action is taken.removePropertyChangeListener in interface StructureCheckerpropertyName - The name of the property that was listened on.listener - The PropertyChangeListener to be removedPropertyChangeSupport.removePropertyChangeListener(String, PropertyChangeListener)public StructureCheckerDescriptor getDescriptor()
StructureCheckerStructureCheckerDescriptor instance which represents the user interface
related informations of the checkergetDescriptor in interface StructureCheckerStructureCheckerDescriptor instance which represents the user interface
related informations of the checkerpublic void propertyChange(PropertyChangeEvent evt)
propertyChange in interface PropertyChangeListener