public class Prot_Analysis extends AbstractPluginQconf
Contain business logic for protrusion analysis. The UI is built by
ProtAnalysisUi
. The communication
between
these modules is through
ProtAnalysisOptions
fileExt, qconfLoader
apiCall, errorSink, logger, options
Constructor and Description |
---|
Prot_Analysis()
Default constructor.
|
Prot_Analysis(String paramString)
Constructor that allows to provide own configuration parameters.
|
Modifier and Type | Method and Description |
---|---|
String |
about()
Return plugin description.
|
protected boolean |
parseArgumentString(String arg)
Analyse and parse parameter string passed from IJ, macro or API.
|
void |
run(String arg)
Called on plugin run by ImageJ or from API.
|
protected void |
runFromPaqp()
Called if loaded file is paQP.
|
protected void |
runFromQconf()
Called if loaded file is QCONF.
|
void |
showUi(boolean val)
Open plugin UI.
|
protected void |
validate()
Override this method to pass your own validation of QCONF structure.
|
executer, getQconfLoader, loadFile, unload
setPluginName
getOptions, publishMacroString
public Prot_Analysis()
public Prot_Analysis(String paramString) throws QuimpPluginException
Immediately executes all computations.
paramString
- parameter string.QuimpPluginException
- on errorprotected void validate() throws QuimpException
AbstractPluginQconf
validate
in class AbstractPluginQconf
QuimpException
- if file can not be validated.public void showUi(boolean val) throws Exception
AbstractPluginBase
Executed if AbstractPluginBase.run(String)
could not parse parameters.
showUi
in class AbstractPluginBase
val
- true to show UIException
- on any error. Handled by AbstractPluginBase.run(String)
public String about()
IQuimpPlugin
public void run(String arg)
AbstractPluginBase
Overrides PlugIn.run(String)
. If input string is null or empty it sets
AbstractOptionsParser.errorSink
to
QuimpException.MessageSinkTypes.GUI
. Note that AbstractOptionsParser.apiCall
is set by
choosing proper constructor. Then it tries to parse specified parameter string, if it succeeds,
AbstractOptionsParser.options
is set and deserialised and AbstractPluginBase.executer()
method is
executed. If parsing fails, AbstractPluginBase.showUi(boolean)
is called with option true. If there is
parsable string AbstractOptionsParser.errorSink
is set to
QuimpException.MessageSinkTypes.IJERROR
Finally, macro string is published to ImageJ that represents current state of
AbstractOptionsParser.options
.
All exceptions thrown by plugin logic (from AbstractPluginBase.executer()
) are handled here depending
on AbstractOptionsParser.errorSink
value.
run
in interface ij.plugin.PlugIn
run
in class AbstractPluginBase
AbstractOptionsParser.parseArgumentString(String)
protected boolean parseArgumentString(String arg) throws QuimpPluginException
AbstractOptionsParser
If arg is empty or null, AbstractOptionsParser.parseArgumentString(String)
tries to get it from Macro, if
succeeds it parses it and returns true. Otherwise returns false. If arg is non-empty it assumes
Macro call, sets AbstractOptionsParser.errorSink
to QuimpException.MessageSinkTypes.IJERROR
and parses arg
returning true. AbstractOptionsParser.apiCall
is set to false.
If parser succeeded, internal AbstractPluginOptions
object is properly initalised
and deserialised.
parseArgumentString
in class AbstractOptionsParser
arg
- parameter stringQuimpPluginException
- when parsing failedAbstractPluginOptions
,
AbstractOptionsParser.getOptions()
protected void runFromPaqp() throws QuimpException
AbstractPluginQconf
This method expects that AbstractPluginQconf.qconfLoader
is already set up (AbstractPluginBase.run(String)
. In
macro or IJ mode exceptions will be handled in place and displayed as IJERROR or GUI message.
For API call (only if initialised by
AbstractPluginQconf.AbstractPluginQconf(String, AbstractPluginOptions, String)
)
exceptions are re-thrown.
runFromPaqp
in class AbstractPluginQconf
QuimpException
- on errorprotected void runFromQconf() throws QuimpException
AbstractPluginQconf
This method expects that AbstractPluginQconf.qconfLoader
is already set up (AbstractPluginBase.run(String)
. In
macro or IJ mode exceptions will be handled in place and displayed as IJERROR or GUI message.
For API call (only if initialised by
AbstractPluginQconf.AbstractPluginQconf(String, AbstractPluginOptions, String)
)
exceptions are re-thrown.
runFromQconf
in class AbstractPluginQconf
QuimpException
- on errorCopyright © 2002–2019 Department of Computer Science, Warwick University. All rights reserved.