|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchemaxon.checkers.AbstractStructureChecker
public abstract class AbstractStructureChecker
Abstract base class of all functions checking and repairing chemical structures.
Field Summary | |
---|---|
protected StructureCheckerErrorType |
errorType
The error type of the current checker. |
protected java.beans.PropertyChangeSupport |
propertyChangeSupport
property change support object bound to this |
Fields inherited from interface chemaxon.checkers.StructureChecker |
---|
PROPERTY_KEY_VALID |
Constructor Summary | |
---|---|
AbstractStructureChecker(StructureCheckerErrorType errorType)
Constructor to create a Structure checker instance with the given errorType |
Method Summary | |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. |
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.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,
java.util.Map<MolAtom,MolAtom> atomMap,
java.util.Map<MolBond,MolBond> bondMap)
Handles the mapping of a cloned and expanded molecule result to the original molecule. |
boolean |
equals(java.lang.Object obj)
|
protected Molecule |
expandMolecule(Molecule molecule,
java.util.Map<MolAtom,MolAtom> atomMap,
java.util.Map<MolBond,MolBond> bondMap)
Returns the original molecule if no groups to expand, or the clone of the original molecule with expanded groups. |
java.lang.String |
getDescription()
|
chemaxon.checkers.StructureCheckerDescriptor |
getDescriptor()
Returns a StructureCheckerDescriptor instance which represents the user interface
related informations of the checker |
java.lang.String |
getEditorClassName()
|
java.lang.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 java.lang.String |
getErrorDescription(int errorCount)
Generate the error description depends on erroCount |
StructureCheckerErrorType |
getErrorType()
|
java.lang.String |
getHelpText()
Gets the help text of the checker |
javax.swing.Icon |
getIcon()
Gets the Icon of the current checker |
java.lang.String |
getLocalMenuName()
Gets the local menu name of the checker |
java.lang.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()
Returns information about the licensing of the product. |
boolean |
isValid()
Returns true if the checker's configuration is valid, false otherwise |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list. |
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener for a specific property. |
void |
setDescription(java.lang.String description)
Sets the description of the checker |
void |
setHelpText(java.lang.String helpText)
Sets the detailed help of the checker which will shown in the tooltip on the GUI |
void |
setIcon(javax.swing.Icon icon)
Sets the icon of the checker |
void |
setLicenseEnvironment(java.lang.String env)
Every license can have a modifier environment that's typically an integration environment. |
void |
setLocalMenuName(java.lang.String localMenuName)
Set the local menu name of the checker |
void |
setMoreErrorMessage(java.lang.String moreErrorMessage)
Sets the message which will given in the result if two or more error found |
void |
setName(java.lang.String name)
Sets the name of the checker |
void |
setNoErrorMessage(java.lang.String noErrorMessage)
Sets the message which will given in the result if no error found |
void |
setOneErrorMessage(java.lang.String oneErrorMessage)
Sets the message which will given in the result if one error found |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final StructureCheckerErrorType errorType
protected java.beans.PropertyChangeSupport propertyChangeSupport
Constructor Detail |
---|
public AbstractStructureChecker(StructureCheckerErrorType errorType)
errorType
- element of StructureCheckerErrorType
Method Detail |
---|
public java.lang.String getName()
StructureChecker
getName
in interface StructureChecker
public void setName(java.lang.String name)
StructureChecker
setName
in interface StructureChecker
name
- the human readable name of the checkerpublic void setNoErrorMessage(java.lang.String noErrorMessage)
StructureChecker
setNoErrorMessage
in interface StructureChecker
noErrorMessage
- the error message if no error foundpublic void setOneErrorMessage(java.lang.String oneErrorMessage)
StructureChecker
setOneErrorMessage
in interface StructureChecker
oneErrorMessage
- the error message if one error foundpublic void setMoreErrorMessage(java.lang.String moreErrorMessage)
StructureChecker
setMoreErrorMessage
in interface StructureChecker
moreErrorMessage
- the error message if two or more error foundprotected java.lang.String getErrorDescription(int errorCount)
errorCount
- number of errors found
public java.lang.String getLocalMenuName()
StructureChecker
getLocalMenuName
in interface StructureChecker
public void setLocalMenuName(java.lang.String localMenuName)
StructureChecker
setLocalMenuName
in interface StructureChecker
localMenuName
- a String
to be shown in the local menupublic java.lang.String getHelpText()
StructureChecker
getHelpText
in interface StructureChecker
public void setHelpText(java.lang.String helpText)
StructureChecker
setHelpText
in interface StructureChecker
helpText
- a String
to be shown in the tooltippublic javax.swing.Icon getIcon()
StructureChecker
Icon
of the current checker
getIcon
in interface StructureChecker
Icon
of the current checkerpublic void setIcon(javax.swing.Icon icon)
StructureChecker
setIcon
in interface StructureChecker
icon
- is an instance of Icon
public final StructureCheckerResult check(Molecule molecule) throws java.lang.NullPointerException, chemaxon.license.LicenseException
StructureChecker
check
in interface StructureChecker
molecule
- a Molecule
instance have to be checked
StructureCheckerResult
(which contains all data needed
to fix the problem) if the molecule contains the examined error, null
otherwise
java.lang.NullPointerException
- if molecule is null
chemaxon.license.LicenseException
protected abstract StructureCheckerResult check1(Molecule molecule)
molecule
- the Molecule
instance to be checked for problems
StructureCheckerResult
which represents the problem or null
if no problem foundprotected Molecule expandMolecule(Molecule molecule, java.util.Map<MolAtom,MolAtom> atomMap, java.util.Map<MolBond,MolBond> bondMap)
molecule
- the molecule to check
protected void convertResult(Molecule originalMolecule, Molecule expandedMolecule, StructureCheckerResult result, java.util.Map<MolAtom,MolAtom> atomMap, java.util.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()
chemaxon.license.Licensable
return LicenseHandler.isLicensed( LicenseHandler.MY_IDENTIFIER, licenseEnvironment );
isLicensed
in interface chemaxon.license.Licensable
public void setLicenseEnvironment(java.lang.String env)
chemaxon.license.Licensable
private String licenseEnvironment = ""; public void setLicenseEnvironment(String env) { licenseEnvironment = env; }
setLicenseEnvironment
in interface chemaxon.license.Licensable
env
- environment String to be stored and passed to the LicenseHandler in the isLicensed methodpublic StructureCheckerErrorType getErrorType()
getErrorType
in interface StructureChecker
public java.lang.String getErrorCode()
StructureChecker
String
represented error code of the checker (this error code
should be used for external implementation support instead of StructureChecker.getErrorType()
)
getErrorCode
in interface StructureChecker
String
represented error code of the checker (this error code
should be used for external implementation support instead of StructureChecker.getErrorType()
)public java.lang.String getEditorClassName()
getEditorClassName
in interface StructureChecker
public java.lang.String getDescription()
getDescription
in interface StructureChecker
public boolean isValid()
StructureChecker
isValid
in interface StructureChecker
public boolean isAvailable()
StructureChecker
isAvailable
in interface StructureChecker
public StructureChecker cloneItem()
StructureChecker
cloneItem
in interface StructureChecker
public AbstractStructureChecker clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public void setDescription(java.lang.String description)
StructureChecker
setDescription
in interface StructureChecker
description
- the description to setpublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
StructureChecker
listener
is null, no exception is thrown and no action
is taken.
addPropertyChangeListener
in interface StructureChecker
listener
- The PropertyChangeListener to be addedPropertyChangeSupport.addPropertyChangeListener(PropertyChangeListener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
StructureChecker
listener
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 StructureChecker
listener
- The PropertyChangeListener to be removedPropertyChangeSupport.removePropertyChangeListener(PropertyChangeListener)
public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
StructureChecker
propertyName
or listener
is null, no
exception is thrown and no action is taken.
addPropertyChangeListener
in interface StructureChecker
propertyName
- The name of the property to listen on.listener
- The PropertyChangeListener to be addedPropertyChangeSupport.addPropertyChangeListener(String, PropertyChangeListener)
public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
StructureChecker
listener
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 StructureChecker
propertyName
- The name of the property that was listened on.listener
- The PropertyChangeListener to be removedPropertyChangeSupport.removePropertyChangeListener(String, PropertyChangeListener)
public chemaxon.checkers.StructureCheckerDescriptor getDescriptor()
StructureChecker
StructureCheckerDescriptor
instance which represents the user interface
related informations of the checker
getDescriptor
in interface StructureChecker
StructureCheckerDescriptor
instance which represents the user interface
related informations of the checkerpublic void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |