|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unihalle.informatik.Alida.dataio.provider.swing.events.ALDSwingValueChangeReporter
de.unihalle.informatik.Alida.dataio.provider.swing.components.ALDOperatorParameterPanel
public class ALDOperatorParameterPanel
Panel to hold graphical elements for configuring an operator.
Field Summary | |
---|---|
protected ALDOperator |
operator
The operator associated with this panel. |
Fields inherited from class de.unihalle.informatik.Alida.dataio.provider.swing.events.ALDSwingValueChangeReporter |
---|
listenerList |
Constructor Summary | |
---|---|
ALDOperatorParameterPanel(ALDOperator op,
Parameter.ExpertMode mode,
boolean topLevel,
ALDSwingValueChangeListener listener)
Default constructor. |
Method Summary | |
---|---|
void |
changeViewMode(Parameter.ExpertMode mode)
Switches view mode of the panel. |
void |
copyConfiguration(ALDOperatorParameterPanel opParameterPanel)
TODO Function should usually not be required... |
void |
disableComponents()
Disables all components in the different sub-panels. |
void |
dispose()
Disposes all components in the different sub-panels. |
void |
enableComponents()
Enables all components in the different sub-panels. |
protected java.lang.Object |
getDefaultValue(java.lang.Boolean useRequired,
java.lang.Boolean useSupplemental,
ALDOpParameterDescriptor descr)
Get the default for a paramter. |
javax.swing.JPanel |
getJPanel()
Get access to the main panel. |
void |
handleValueChangeEvent(ALDSwingValueChangeEvent event)
Method which is called on event occurence. |
protected void |
registerDescriptor(java.util.LinkedList<ALDOpParameterDescriptor> paramDescriptors,
ALDOpParameterDescriptor descr)
Register a descriptor. |
java.util.HashMap<ALDOpParameterDescriptor,java.lang.String> |
setNewOperator(ALDOperator op)
Sets a new operator for the panel. |
java.util.HashMap<ALDOpParameterDescriptor,java.lang.String> |
setOperatorParameters()
Retrieve parameter values from GUI and configure operator accordingly. |
boolean |
setParameterBatchModeInput(java.lang.String paramName)
|
boolean |
setParameterLinked(java.lang.String paramName,
java.lang.String sourceOp,
java.lang.String sourceParamName)
Changes panel for a parameter to indicate that it is linked. |
boolean |
setParameterNotLinked(java.lang.String paramName)
Changes panel for a parameter to indicate that it is not linked anymore. |
void |
updateConfigurationStatus(java.util.Collection<java.lang.String> missingParams)
Marks configurations status of required parameters by color. |
protected void |
updateOperatorDescriptors()
Initializes all internal members dealing with operator descriptors. |
java.util.HashMap<ALDParameterDescriptor,java.lang.String> |
validateOperatorParameters(boolean deepValidate)
Check if operator is ready to run. |
Methods inherited from class de.unihalle.informatik.Alida.dataio.provider.swing.events.ALDSwingValueChangeReporter |
---|
addValueChangeEventListener, fireALDSwingValueChangeEvent, removeValueChangeEventListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ALDOperator operator
Constructor Detail |
---|
public ALDOperatorParameterPanel(ALDOperator op, Parameter.ExpertMode mode, boolean topLevel, ALDSwingValueChangeListener listener)
Note that value change event listeners added after construction of the object might will events generated during initialization. To avoid that a listener can be handed over to the object upon creation.
op
- Operator associated with this panel.mode
- Display mode of the panel.topLevel
- If true, a top-level context is assumed.listener
- Optional value change event listener.Method Detail |
---|
public javax.swing.JPanel getJPanel()
protected void registerDescriptor(java.util.LinkedList<ALDOpParameterDescriptor> paramDescriptors, ALDOpParameterDescriptor descr)
Registration is needed to allow the panel to get aware of the parameter. E.g., sometimes actions are required for certain parameter types on initialization, and this can be done within this function.
This method is intended to be overriden to customize parameter handling.
paramDescriptors
- List to which the descriptor is added.descr
- Descriptor to be registered.protected java.lang.Object getDefaultValue(java.lang.Boolean useRequired, java.lang.Boolean useSupplemental, ALDOpParameterDescriptor descr)
Usually the default value of a parameter is fetched directly from the parameter descriptor itself. However, sometimes default values depend on the system state or are taken from external devices (database, GUI). This method allows to customize the reading of default parameters and is intended to be overriden by sub-classes.
useRequired
- Ignored.useSupplemental
- Ignored.descr
- Parameter descriptor in question.
public boolean setParameterLinked(java.lang.String paramName, java.lang.String sourceOp, java.lang.String sourceParamName)
paramName
- Name of the parameter.sourceOp
- Source node from where the edge originates.sourceParamName
- Name of the source parameter.
public boolean setParameterNotLinked(java.lang.String paramName)
paramName
- Name of the parameter.sourceOp
- Source node from where the edge originates.sourceParamName
- Name of the source parameter.
public boolean setParameterBatchModeInput(java.lang.String paramName)
public java.util.HashMap<ALDOpParameterDescriptor,java.lang.String> setNewOperator(ALDOperator op) throws ALDDataIOProviderException
This function is, e.g., called in case of loading a new operator from file.
op
- New operator object to be associated with GUI.
ALDDataIOProviderException
protected void updateOperatorDescriptors()
public void updateConfigurationStatus(java.util.Collection<java.lang.String> missingParams)
A required parameter which is neither properly configured nor has an incoming edge is gets a red label, all others get black labels.
public void changeViewMode(Parameter.ExpertMode mode)
mode
- Desired view mode.public void disableComponents()
public void enableComponents()
public void dispose()
public java.util.HashMap<ALDParameterDescriptor,java.lang.String> validateOperatorParameters(boolean deepValidate) throws ALDOperatorException
The operator can be run if all GUI elements of required parameters return non-null values, and if furtheron the operator's validate() method returns true.
deepValidate
- True if operator has to be validate itself.
ALDOperatorException
public java.util.HashMap<ALDOpParameterDescriptor,java.lang.String> setOperatorParameters()
public void handleValueChangeEvent(ALDSwingValueChangeEvent event)
ALDSwingValueChangeListener
handleValueChangeEvent
in interface ALDSwingValueChangeListener
event
- Event to be handled.public void copyConfiguration(ALDOperatorParameterPanel opParameterPanel) throws ALDDataIOException
opLink
- b
-
ALDDataIOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |