public class ExecutionProxy extends Object implements IExecutionProtocol
| Modifier and Type | Field and Description |
|---|---|
private static org.apache.log4j.Logger |
logger
Custom class logger.
|
private MultiResultDialog |
multiResultDialog
The dialog for displaying the multiple results of an operator.
|
private IOperator |
operator
The operator (processing algorithm).
|
private IOperatorDescriptor |
operatorDescriptor
The descriptor.
|
private IOperatorGUI |
operatorGUI
The operator's GUI.
|
private String |
operatorName
The cached operator name.
|
private IOperatorValidator |
operatorValidator
The operator's validator.
|
private ParameterBlockIQM |
pb
The parameters of this protocol.
|
private Result |
previewResult
The preview result object of the protocol.
|
private int |
state
Set the default state to
ExecutionState.IDLE. |
private IWorkPackage |
workPackage
The work package of this protocol.
|
| Modifier | Constructor and Description |
|---|---|
private |
ExecutionProxy(String operatorName)
The constructor always uses the name of the operator.
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
buildWorkPackage()
Constructs a work package for an operator.
|
void |
cancelProtocol() |
void |
disableInputs(AbstractOperatorGUI window)
Sets a wait cursor to a
JFrame and disables the inputs. |
void |
displayPreviewResults(Result result) |
void |
enableInputs(AbstractOperatorGUI window)
Sets the default cursor to a
JFrame and enables the inputs. |
void |
executeParallelProcessing(int nThreads)
Executes the processing of all selected manager items in a parallel
manner.
|
void |
executePreview(IWorkPackage wp,
IOperatorGUI opGUI)
Executes a preview with the given work package and GUI.
|
void |
executeSerialProcessing()
Executes a serial stack processing task with the selected manager items.
|
void |
finishProtocol()
Clean up the the protocol and set the static instance to
null for subsequent protocol executions. |
private Vector<Object> |
getAllSourcesForManager(int managerList)
Gets all sources for the currently selected manager list into a
Vector of IqmDataBoxes |
static IExecutionProtocol |
getCurrentInstance()
Returns the current control instance for executing operators.
|
MultiResultDialog |
getMultiResultDialog()
Gets the Dialog for selecting multiple output results in order to add
them to the Tank list.
|
IOperatorDescriptor |
getOperatorDescriptor()
Gets the operator descriptor of this protocol.
|
IOperatorGUI |
getOperatorGUI()
Gets the GUI of this protocol.
|
String |
getOperatorName()
Gets the name of the currently launched operator.
|
OperatorType |
getOperatorType()
Gets the type of the requested operator.
|
Result |
getPreviewResult()
Gets the preview result in the current execution protocol.
|
int |
getState()
Gets the current state of the protocol.
|
IWorkPackage |
getWorkPackage()
Gets the work package of this protocol.
|
protected int |
initialize()
Initializes all necessary classes and constructs instances of them.
|
static IExecutionProtocol |
launchInstance(IOperatorDescriptor opDesc)
This method launches a new instance of the
IOperator specified by
the given IOperatorDescriptor. |
static IExecutionProtocol |
launchInstance(String name)
This method launches a new instance of the
IOperator specified by
the given name. |
int |
launchProtocol()
Launch the protocol.
|
void |
setPreviewResult(IResult previewResult)
Sets the preview result in the current execution protocol.
|
void |
setVirtualFlagToOperatorGUI(boolean virtual)
Sets the "virtual" flag to the operator's GUI, if supported.
|
protected int |
showOperatorGUI()
Shows the requested operator GUI.
|
void |
updateGUI()
This method updates the operator GUI.
|
int[] |
updateSources(int[] currMgrIdxs,
int[] targetMgrIdxs)
Updates the sources after items are changed in the manager and validates
them again using the operator's validator.
|
protected int |
validateWorkPackage()
Validates the work package and sets the state of the protocol to
ExecutionState.VALIDATING_PARAMETERS while the
IOperatorValidator is validating. |
private static final org.apache.log4j.Logger logger
private int state
ExecutionState.IDLE.private String operatorName
private IOperatorDescriptor operatorDescriptor
private IOperator operator
private IOperatorGUI operatorGUI
private IOperatorValidator operatorValidator
private IWorkPackage workPackage
private Result previewResult
private MultiResultDialog multiResultDialog
private ParameterBlockIQM pb
private ExecutionProxy(String operatorName)
operatorName - the unique name of the operator, located in the
String[][] resources of the
IOperatorDescriptorOperatorAlreadyOpenException - if another operator is already launchedpublic static IExecutionProtocol launchInstance(String name) throws UnknownOperatorException
IOperator specified by
the given name.name - the registered name of the operatorUnknownOperatorException - if the operator is not found.public static IExecutionProtocol launchInstance(IOperatorDescriptor opDesc)
IOperator specified by
the given IOperatorDescriptor.opDesc - the descriptor of the operator to be launchedpublic static IExecutionProtocol getCurrentInstance()
ExecutionProxy, or
null if the instance is not initializedprotected int initialize()
ExecutionState.INITIALIZED if successful,
ExecutionState.INITIALIZATION_FAILED otherwisepublic int launchProtocol()
launchProtocol in interface IExecutionProtocolExecutionState.FINISHED if no errors occur,
ExecutionState.ERROR otherwiseprotected int buildWorkPackage()
ParameterBlockIQM.ExecutionState.WORKPACKAGE_CONSTRUCTED if successful,
ExecutionState.ERROR, if notprotected int validateWorkPackage()
ExecutionState.VALIDATING_PARAMETERS while the
IOperatorValidator is validating.ExecutionState.VALIDATION_PASSED if successful,
ExecutionState.VALIDATION_FAILED otherwiseprotected int showOperatorGUI()
ExecutionState.GUI_VISIBLE if successful,
ExecutionState.ERROR otherwisepublic void executePreview(IWorkPackage wp, IOperatorGUI opGUI)
IExecutionProtocolexecutePreview in interface IExecutionProtocolpublic void executeSerialProcessing()
executeSerialProcessing in interface IExecutionProtocolpublic void executeParallelProcessing(int nThreads)
IExecutionProtocolnThreads.executeParallelProcessing in interface IExecutionProtocolnThreads - the number of threads that are supposed to run concurrentlypublic void disableInputs(AbstractOperatorGUI window)
JFrame and disables the inputs.disableInputs in interface IExecutionProtocolwindow - public void enableInputs(AbstractOperatorGUI window)
JFrame and enables the inputs.enableInputs in interface IExecutionProtocolwindow - public int getState()
public OperatorType getOperatorType()
public int[] updateSources(int[] currMgrIdxs,
int[] targetMgrIdxs)
If validation fails, the source is set back to the original one when the operator was launched and the user is notified that the processing is not possible with the selected images.
Perform a reset of the sources by passing null for both
parameters. This will yield a null value in return.
updateSources in interface IExecutionProtocolcurrMgrIdxs - the currently selected cellstargetMgrIdxs - the manager list indexes to be selected after validationpublic void updateGUI()
throws Exception
updateGUI in interface IExecutionProtocolExceptionpublic void cancelProtocol()
public void finishProtocol()
null for subsequent protocol executions.finishProtocol in interface IExecutionProtocolpublic void setVirtualFlagToOperatorGUI(boolean virtual)
IExecutionProtocolsetVirtualFlagToOperatorGUI in interface IExecutionProtocolvirtual - true, if the check box should be selected,
false otherwisepublic String getOperatorName()
IExecutionProtocolgetOperatorName in interface IExecutionProtocolString[][] resources with the key
GlobalNamepublic IWorkPackage getWorkPackage()
IExecutionProtocolgetWorkPackage in interface IExecutionProtocolpublic IOperatorGUI getOperatorGUI()
IExecutionProtocolgetOperatorGUI in interface IExecutionProtocolpublic IOperatorDescriptor getOperatorDescriptor()
IExecutionProtocolgetOperatorDescriptor in interface IExecutionProtocolpublic void setPreviewResult(IResult previewResult)
IExecutionProtocolsetPreviewResult in interface IExecutionProtocolpublic void displayPreviewResults(Result result)
public Result getPreviewResult()
IExecutionProtocolgetPreviewResult in interface IExecutionProtocolpublic MultiResultDialog getMultiResultDialog()
IExecutionProtocolgetMultiResultDialog in interface IExecutionProtocolMultiResultDialogprivate Vector<Object> getAllSourcesForManager(int managerList)
Vector of IqmDataBoxesmanagerList - left list = 0, right list = 1WorkPackageCopyright © 2009–2017 Helmut Ahammer, Philipp Kainz. All rights reserved.