|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.marvin.plugin.CalculatorPluginDisplay
public class CalculatorPluginDisplay
Common base class for calculator plugin displays. Also provides default implementation for molecule display, therefore plugins with molecule / atom data only may use the base class itself.
| Field Summary | |
|---|---|
protected static int |
CELLSIZE
The default viewer cell size. |
protected boolean |
displayInMarvinSpace
Display in MarvinSpace is enabled or not. |
protected static int |
HTML
Property display type: display in html text. |
protected int |
icell
The viewer cell index (0 for sketcher). |
protected static int |
LABEL
Property display type: display in label. |
protected static int |
MAX_LINE_LENGTH
Maximum desired line length used to form multi-line text. |
protected static int |
NONE
Property display type: no property display. |
protected java.awt.Component |
parent
The parent component. |
protected DPoint3[] |
reactionArrow
The reaction arrow endpoints, null if not a reaction. |
protected java.util.ArrayList |
resultMolList
The result molecules to be displayed. |
protected java.util.ArrayList |
resultValues
The result values to be displayed in MarvinSpace. |
protected static int |
TEXT
Property display type: display in text. |
protected java.lang.String |
title
The result frame title. |
protected static java.lang.String |
WORD_SEPARATORS
Word separators used to form multi-line text if the text is too long. |
| Constructor Summary | |
|---|---|
CalculatorPluginDisplay()
|
|
| Method Summary | |
|---|---|
protected java.lang.String |
appendpHText(java.lang.String text)
Appends the pH text. |
void |
clear()
Clears the display. |
protected chemaxon.marvin.util.CallbackIface |
createMolsFrame()
|
protected ParameterPanelHandler |
createParameterPanel()
Creates the parameter panel. |
protected chemaxon.marvin.plugin.gui.ResultView |
createResultView(java.lang.String title,
chemaxon.marvin.common.swing.MolPanel mpan)
|
protected java.awt.Component |
createSpacePanel(Molecule[] mols)
Creates space panel with given molecules, creates colored surface to each molecule. |
protected chemaxon.marvin.view.swing.ViewPanel |
createViewPanel(Molecule[] mols)
Creates view panel with given molecules, places molecule properties in formatted texts. |
protected chemaxon.marvin.view.swing.ViewPanel |
createViewPanel(Molecule[] mols,
int rows,
int cols,
int size,
int propertyDisplayType)
Creates view panel with given molecules, places molecule properties in formatted texts. |
java.awt.Component |
getErrorComponent()
c Returns a component with the appropriate error message. |
protected java.lang.Object |
getHResult(int i)
Returns the sum result of the H neighbours of the given atom. |
java.lang.String[] |
getLabels(double[] values)
Returns formatted array. |
ParameterPanelHandler |
getParameterPanel()
Returns the parameter panel. |
protected CalculatorPlugin |
getPlugin()
Returns the plugin. |
MProgressMonitor |
getProgressMonitor(java.awt.Component parent)
Creates a progress observer object to be used in CalculatorPlugin.setProgressMonitor(chemaxon.marvin.util.MProgressMonitor). |
protected java.lang.String |
getPropertyText(Molecule mol)
Returns molecule properties is text form. |
java.lang.String |
getRemark()
Returns the calculation remark. |
java.awt.Component |
getResultComponent()
Returns the result component for display. |
protected java.lang.String |
getTableText(java.lang.String header,
java.lang.String[] labels,
double[][] values)
Returns table in string form. |
java.lang.String |
getTitle()
Returns the frame title. |
boolean |
isMultipleDisplay()
Returns true if results for more molecules can be displayed
in a single component, false if each molecule should be displayed
in a separate component. |
void |
pop()
Clears the last stored item from the display. |
void |
setCellIndex(int icell)
Sets the viewer cell index. |
void |
setParameters(java.util.Properties params)
Sets parameters. |
void |
setParent(java.awt.Component parent)
Sets the parent component. |
void |
setPlugin(CalculatorPlugin plugin)
Sets the plugin. |
void |
setReactionArrow(DPoint3[] reactionArrow)
Sets the reaction arrow. |
void |
setTitle(java.lang.String title)
Sets the frame title. |
void |
store()
Stores a new result item. |
void |
storeResults(Molecule mol)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final int CELLSIZE
protected static final int NONE
protected static final int LABEL
protected static final int TEXT
protected static final int HTML
protected static final java.lang.String WORD_SEPARATORS
protected static final int MAX_LINE_LENGTH
protected java.awt.Component parent
protected java.lang.String title
protected int icell
protected boolean displayInMarvinSpace
protected java.util.ArrayList resultMolList
protected java.util.ArrayList resultValues
protected DPoint3[] reactionArrow
null if not a reaction.
| Constructor Detail |
|---|
public CalculatorPluginDisplay()
| Method Detail |
|---|
public void setPlugin(CalculatorPlugin plugin)
plugin - is the pluginprotected final CalculatorPlugin getPlugin()
public final void setParent(java.awt.Component parent)
parent - is the parent componentpublic final void setCellIndex(int icell)
icell - is the viewer cell indexpublic void setParameters(java.util.Properties params)
params - is the parameter tablepublic void setTitle(java.lang.String title)
title - is the frame titlepublic java.lang.String getTitle()
public void setReactionArrow(DPoint3[] reactionArrow)
store() will be taken as
reaction components. The next clear() resets this reaction mode.
reactionArrow - is the reaction arrow endpoint arraypublic MProgressMonitor getProgressMonitor(java.awt.Component parent)
CalculatorPlugin.setProgressMonitor(chemaxon.marvin.util.MProgressMonitor).
Short calculations do not need this object.
The default implementation returns null,
subclasses may return MProgressMonitor
or any other progress monitor implemeting
MProgressMonitor.
parent - is the parent component (centralize relative to)
public final ParameterPanelHandler getParameterPanel()
throws PluginException
PluginException - on error
protected ParameterPanelHandler createParameterPanel()
throws PluginException
ParameterPanel object
from the <plugin class name>Parameters.xml
configuration XML read from CalculatorPlugin.PLUGIN_DIR
with user parameter settings read from
$HOME/chemaxon/<plugin class name>Parameters.properties (Windows), or
$HOME/.chemaxon/<plugin class name>Parameters.properties (UNIX / Linux).
Returns null (no paramter panel for this plugin) if the configuration XML
is not found.
PluginException - on errorpublic boolean isMultipleDisplay()
true if results for more molecules can be displayed
in a single component, false if each molecule should be displayed
in a separate component. The default implementation returns true.
true if results for more molecules can be displayed in a
single componentpublic void pop()
resultMolList
and resets reactionArrow.
public void clear()
resultMolList and resets reactionArrow.
public void store()
throws PluginException
CalculatorPlugin.getResultMolecule() to
resultMolList.
PluginException
public void storeResults(Molecule mol)
throws PluginException
PluginException
protected java.lang.Object getHResult(int i)
throws PluginException
i - index of the atom
PluginException
public java.awt.Component getResultComponent()
throws PluginException
resultMolList in a viewer and displays
molecular results (stored in molecule properties) in text fields.
PluginException - on error
protected chemaxon.marvin.plugin.gui.ResultView createResultView(java.lang.String title,
chemaxon.marvin.common.swing.MolPanel mpan)
throws PluginException
PluginException
protected chemaxon.marvin.util.CallbackIface createMolsFrame()
throws PluginException
PluginException
public java.awt.Component getErrorComponent()
throws PluginException
CalculatorPlugin.run(), or equivalently
CalculatorPlugin.isOK() returns false.
PluginException
public java.lang.String getRemark()
throws PluginException
PluginException
protected chemaxon.marvin.view.swing.ViewPanel createViewPanel(Molecule[] mols)
throws PluginException
mols - is the molecule array
PluginException
protected chemaxon.marvin.view.swing.ViewPanel createViewPanel(Molecule[] mols,
int rows,
int cols,
int size,
int propertyDisplayType)
mols - is the molecule arrayrows - the number of visible rowscols - the number of columnspropertyDisplayType - is TEXT, LABEL, HTML or NONE
protected java.lang.String getPropertyText(Molecule mol)
mol - is the molecule
protected java.lang.String appendpHText(java.lang.String text)
text - is the text
public final java.lang.String[] getLabels(double[] values)
values - is the numerical array
protected final java.lang.String getTableText(java.lang.String header,
java.lang.String[] labels,
double[][] values)
header - is the header (the first char is the separator)labels - is the first columnvalues - is the value column array
protected java.awt.Component createSpacePanel(Molecule[] mols)
throws PluginException
mols - is the molecule array
PluginException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||