public class MEDCalculator extends FwkCommand implements MEDCalculatorInterface
Designers of a new calculator must decide at what level they want to make the calculation. This implementation uses all levels and the calculation is falling down to the third level when a new result array is created.
,
Serialized Form| Modifier and Type | Class and Description |
|---|---|
class |
MEDCalculator.CalculationResult
The class to hold the temporary results.
|
class |
MEDCalculator.CalculatorThread
The thread that build the relation display panel.
|
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
channelCopy |
protected boolean |
channelCut |
protected java.lang.String |
channelFilter |
protected java.lang.String[] |
channels |
protected static FwkDescriptionInterface |
descriptor |
protected java.util.Map |
getHt |
protected java.lang.String |
ident |
protected boolean |
implicitChannelCalculation |
protected java.lang.String |
independentColumnName |
protected java.lang.String |
independentFilter |
protected java.lang.String |
markerFilter |
protected java.lang.String[] |
markers |
protected java.lang.String |
position |
protected java.util.Map |
setHt |
static java.lang.String |
version |
actionListeners, buttonClass, commandName, helpID, icon, iconKey, instruction, menuEventEnabled, menuItemClass, menuListeners, mnemonic, properties, radioGroupState, registry, sensitive, separator, text, textKey, toggle, toggleState, toolBarEnabled, toolTipKey, toolTipText, visiblesourceauthor, buildnr, className, company, copyright, creationDate, dateFormatString, description, eMail, FWK_ICON, FWK_ICON_ARRAY, FWK_ICON_BG, FWK_ICON_BG_ARRAY, FWK_ICON_BG_LARGE, FWK_ICON_BG_LARGE_ARRAY, FWK_ICON_LARGE, FWK_ICON_LARGE_ARRAY, ICON, iconCount, internetAddress, name, titleNameCONTROLLER_PROPERTY, MENU_REASON_CANCELED, MENU_REASON_DESELECTED, MENU_REASON_SELECTEDAUTHOR, BUILDNR, COMPANY, COPYRIGHT, DATE_FORMAT, DEFAULT_ICON, DESCRIPTION, INTERNET, LARGE_ICON, LARGE_KEY_EXT, LARGE_OPAQUE_ICON, LARGE_OPAQUE_KEY_EXT, OPAQUE_ICON, OPAQUE_KEY_EXT, RCS_DATE_FORMAT, SUPPORT_EMAIL, TITLE_NAME| Constructor and Description |
|---|
MEDCalculator()
The default constructor.
|
MEDCalculator(FwkControllerInterface controller)
The default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String[] |
calculate()
The highlevelCalculate the results.
|
double[] |
calculate(double[] independent,
double[] data)
Calculate the results of a single channel.
|
double[] |
calculate(double[] indep,
FwkColumnAccessInterface independent,
double[] values,
FwkColumnAccessInterface column,
P2DMarkerGroupInterface marker)
Calculate the result of a single channel.
|
FwkArrayInterface |
calculate(FwkColumnAccessInterface independent,
FwkArrayInterface channels,
FwkArrayInterface markers)
The low level calculation method that calculates the result.
|
boolean |
canChangeChannel()
Returns a boolean that signals whether or not the calculator is able to
change a channel.
|
boolean |
canCopyChannel()
Returns a boolean that signals whether or not the calculator is able to
create a channel.
|
boolean |
canCreateImplicitChannel()
Returns a boolean that signals whether or not the calculator is able to
create an implicit channel.
|
boolean |
checkCalulatorPanel()
Check the calculator specific dialog panel values.
|
void |
clear()
Clear the map.
|
boolean |
containsKey(java.lang.Object obj)
Returns a boolean whether the map contains the specifies property key.
|
boolean |
containsValue(java.lang.Object obj)
Returns a boolean whether the map contains the specifies property.
|
java.util.Set |
entrySet()
Returns an entry set of the properties.
|
boolean |
execute(java.util.EventObject ev)
Execute the command.
|
java.lang.Object |
get(java.lang.Object obj)
Get an entry from the map belongs to the given key.
|
FwkPanelInterface |
getCalculatorPanel()
Get the calculator dialog.
|
java.lang.String |
getCalculatorPanelPosition()
Get the calculator panel position.
|
java.lang.String |
getChannelColumnName(FwkColumnAccessInterface col,
double[] limit)
Get the short name of a newly created channel.
|
boolean |
getChannelCopy()
Get the channel copy flag.
|
boolean |
getChannelCut()
Get the channel CUT flag.
|
java.lang.String |
getChannelFilter()
Get the channel selection filter.
|
java.lang.String |
getChannelInfoBusName()
Get the name of the infobus from where the channel should be selected.
|
java.lang.String |
getChannelName(FwkColumnAccessInterface col,
double[] limit)
Get the name of a newly created channel.
|
java.lang.String[] |
getChannelNames()
Returns an array containing all selected channel names.
|
static FwkDescriptionInterface |
getDescriptor() |
FwkDialogPaneInterface |
getDialogPanel()
Get the dialog panel to select channels and markers.
|
java.awt.Container |
getDialogParent(java.util.EventObject ev)
Returns the dialog parent, if available.
|
FwkIconInterface |
getIcon()
Get the icon image of the command.
|
java.lang.String |
getIdent()
Get the ident of the value.
|
boolean |
getImplicitChannelCalculation()
Get the implicit channel calculation flag.
|
java.lang.String |
getIndependentChannelName()
Get the name of the independent column.
|
java.lang.String |
getIndependentFilter()
Get the independent channel selection filter.
|
java.lang.String |
getMarkerFilter()
Get the marker selection filter.
|
java.lang.String |
getMarkerInfoBusName()
Get the name of the infobus from where the marker should be selected.
|
java.lang.String[] |
getMarkerNames()
Returns an array containing all selected marker names.
|
MEDInterface |
getMED()
Returns the MED object belongs to that command if available.
|
java.util.Iterator |
getProperties()
Retrieves a map that holds all properties of the pane value.
|
java.lang.Object |
getProperty(java.lang.String propertyName)
Retrieves the property that belongs to the specified property name.
|
java.lang.String |
getVersion()
Return the version string of the FWK component.
|
void |
init()
Init the calculator.
|
boolean |
isEmpty()
Returns a boolean whether the map is empty.
|
java.util.Set |
keySet()
Returns the key set of the map.
|
static void |
main(java.lang.String[] args)
The main testing routine.
|
java.lang.Object |
put(java.lang.Object obj,
java.lang.Object obj1)
Put an entry into the map.
|
void |
putAll(java.util.Map map)
Put the whole map into the map.
|
void |
release()
Release the calculator.
|
java.lang.Object |
remove(java.lang.Object obj)
Removes an entry.
|
void |
setCalculatorPanelPosition(java.lang.String position)
Set the calculator panel position.
|
void |
setChannelCopy(boolean flag)
Set the channel copy flag.
|
void |
setChannelCut(boolean flag)
Set the channel CUT flag.
|
void |
setChannelFilter(java.lang.String filter)
Set the channel filter for dialog.
|
void |
setChannelNames(java.lang.String[] channels)
Sets an array containing all selected channel names.
|
void |
setIdent(java.lang.String ident)
Set the ident of the value.
|
void |
setImplicitChannelCalculation(boolean flag)
Set the implicit channel calculation flag.
|
void |
setIndependentChannelName(java.lang.String name)
Set the name of the independent column.
|
void |
setIndependentFilter(java.lang.String filter)
Set the indenpendent channel filter for dialog.
|
void |
setMarkerFilter(java.lang.String filter)
Set the marker filter for dialog.
|
void |
setMarkerNames(java.lang.String[] markers)
Sets an array containing all selected marker names.
|
void |
setProperties(java.util.Map properties)
Set the properties.
|
void |
setProperty(java.lang.String propertyName,
java.lang.Object propertyValue)
Sets the property that belongs to the specified identifier.
|
int |
size()
Returns the total number of available entries in map.
|
java.lang.String |
toString()
Print out the properties of the value.
|
java.util.Collection |
values()
Returns a collection of the map values.
|
addActionListener, addCommand, addCommand, addMenuListener, addToGroup, addToGroup, clearCommands, commandsAvailable, deleteGroup, getActionListenerArray, getButtonClass, getCommand, getCommandName, getCommands, getController, getGroup, getHelpID, getIconKey, getMenuEventEnabled, getMenuItemClass, getMenuListenerArray, getMnemonic, getRadioGroupState, getSensitivity, getSeparator, getText, getTextKey, getToggle, getToggleState, getToolBarEnabled, getToolTipKey, getToolTipText, getVisibility, groupExists, hasActionListeners, hasMenuListeners, isParent, menuSelect, register, registeredObjects, registrySize, removeActionListener, removeCommand, removeFromGroup, removeMenuListener, setAsParent, setButtonClass, setCommandName, setCommands, setController, setHelpID, setIcon, setIconKey, setMenuEventEnabled, setMenuItemClass, setMnemonic, setRadioGroupState, setSensitivity, setSeparator, setText, setTextKey, setToggle, setToggleState, setToolBarEnabled, setToolTipKey, setToolTipText, setVisibility, unregisteraddPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeArray, getPropertyChangeListenerArray, getPropertyChangeListenerArray, isPropertyChangeEventSuspended, removePropertyChangeListener, removePropertyChangeListener, setSource, suspendPropertyChangeEventsgetAuthor, getBuild, getClassName, getCompany, getCompanyInternetAddress, getCopyright, getCreationDate, getCreationDate, getDateFormatString, getDescription, getIcon, getIconKey, getName, getPresentationString, getPresentationString, getSupportEMail, getTitle, getTitleName, getTransferData, getTransferDataFlavors, isDataFlavorSupported, lostOwnership, setAuthor, setBuild, setClassName, setCompany, setCompanyInternetAddress, setCopyright, setCreationDate, setCreationDate, setDateFormatString, setDescription, setDescriptor, setIcon, setIconKey, setName, setSupportEMail, setTitleNamegetNiceVersionclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddActionListener, addMenuListener, getActionListenerArray, getButtonClass, getCommandName, getHelpID, getIconKey, getMenuEventEnabled, getMenuItemClass, getMenuListenerArray, getMnemonic, getRadioGroupState, getSensitivity, getSeparator, getText, getTextKey, getToggle, getToggleState, getToolBarEnabled, getToolTipKey, getToolTipText, getVisibility, hasActionListeners, hasMenuListeners, isParent, menuSelect, register, registeredObjects, registrySize, removeActionListener, removeMenuListener, setAsParent, setButtonClass, setCommandName, setHelpID, setIcon, setIconKey, setMenuEventEnabled, setMenuItemClass, setMnemonic, setRadioGroupState, setSensitivity, setSeparator, setText, setTextKey, setToggle, setToggleState, setToolBarEnabled, setToolTipKey, setToolTipText, setVisibility, unregisteraddCommand, addCommand, addToGroup, addToGroup, clearCommands, commandsAvailable, deleteGroup, getCommand, getCommands, getGroup, groupExists, removeCommand, removeFromGroup, setCommandsgetPresentationString, getPresentationStringgetController, setControlleraddPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeArray, getPropertyChangeListenerArray, getPropertyChangeListenerArray, isPropertyChangeEventSuspended, removePropertyChangeListener, removePropertyChangeListener, setSource, suspendPropertyChangeEventspublic static final java.lang.String version
protected static final FwkDescriptionInterface descriptor
protected java.lang.String ident
protected java.util.Map getHt
protected java.util.Map setHt
protected java.lang.String[] channels
protected java.lang.String[] markers
protected java.lang.String independentColumnName
protected java.lang.String channelFilter
protected java.lang.String markerFilter
protected java.lang.String independentFilter
protected boolean implicitChannelCalculation
protected boolean channelCopy
protected boolean channelCut
protected java.lang.String position
public MEDCalculator()
public MEDCalculator(FwkControllerInterface controller)
controller - must be an instance implementing com.highqsoft.med.MEDInterface.public java.lang.String getVersion()
FwkInterfacegetVersion in interface FwkInterfacegetVersion in class FwkCommandpublic static FwkDescriptionInterface getDescriptor()
public void init()
init in interface MEDCalculatorInterfaceexecute(EventObject)public void release()
release in interface FwkInterfacerelease in interface MEDCalculatorInterfacerelease in class Fwkexecute(EventObject)public FwkIconInterface getIcon()
getIcon in interface FwkCommandInterfacegetIcon in interface FwkDescriptionInterfacegetIcon in class FwkCommandFwkCommand.setIconKey(String),
#setIconImage(Image),
#getIconFilename()public MEDInterface getMED()
getMED in interface MEDCalculatorInterfacepublic java.lang.String getIdent()
getIdent in interface FwkDialogPaneValueInterfacepublic java.util.Iterator getProperties()
getProperties in interface FwkCommandInterfacegetProperties in interface FwkDialogPaneValueInterfacegetProperties in class FwkCommandpublic java.lang.Object getProperty(java.lang.String propertyName)
getProperty in interface FwkCommandInterfacegetProperty in interface FwkDialogPaneValueInterfacegetProperty in class FwkCommandpropertyName - The name name of the property.public void setIdent(java.lang.String ident)
setIdent in interface FwkDialogPaneValueInterfaceident - The new value ident.public void setProperties(java.util.Map properties)
setProperties in interface FwkDialogPaneValueInterfaceproperties - The name-value map.public void setProperty(java.lang.String propertyName,
java.lang.Object propertyValue)
setProperty in interface FwkCommandInterfacesetProperty in interface FwkDialogPaneValueInterfacesetProperty in class FwkCommandpropertyName - The name name of the property.propertyValue - The new value of the property.public java.lang.String toString()
toString in class FwkCommandpublic double[] calculate(double[] independent,
double[] data)
throws FwkException
calculate in interface MEDCalculatorInterfaceindependent - An array containing The independent channel.data - The array containing the channel data of interest.FwkExceptionpublic double[] calculate(double[] indep,
FwkColumnAccessInterface independent,
double[] values,
FwkColumnAccessInterface column,
P2DMarkerGroupInterface marker)
indep - The values inside the marker range of the independent channel.
null if not available.independent - The independent channel.
null if not available.values - the values inside the marker range of the channelcolumn - The column.marker - the marker if available.public FwkArrayInterface calculate(FwkColumnAccessInterface independent, FwkArrayInterface channels, FwkArrayInterface markers) throws FwkException
At this phase no infobus communication was already done. The result will be published from the high level calculation method.
Currently this method does nothing. Designers of a new calculator must overwrite this method.
The current implementation doesn't support the implicit calculation of new channels. Newly created columns will be published via the FwkColumnAccessProducer.
calculate in interface MEDCalculatorInterfaceindependent - The independent channel.channels - The array containing the channels.
This array may be null or empty.markers - The array containing the markers.
This array may be null or empty.FwkExceptioncalculate(String, String[], String[])public java.lang.String[] calculate()
throws FwkException
This method handles the infobus communication that is necessary to get the input data and to publish the result data. This method uses the lowe level calculation method for the core calculation.
calculate in interface MEDCalculatorInterfaceFwkExceptioncalculate(FwkArrayInterface, FwkArrayInterface)public void setChannelCopy(boolean flag)
setChannelCopy in interface MEDCalculatorInterfaceflag - if true the source channels will be copied.public boolean getChannelCopy()
getChannelCopy in interface MEDCalculatorInterfacepublic void setChannelCut(boolean flag)
setChannelCut in interface MEDCalculatorInterfaceflag - if true the source area of interest will be cut
out of the source channel.public boolean getChannelCut()
getChannelCut in interface MEDCalculatorInterfacepublic void setImplicitChannelCalculation(boolean flag)
setImplicitChannelCalculation in interface MEDCalculatorInterfaceflag - if true the source channels will be calculated implicitly.
This means that the data will be calculated at every request.setImplictChannelCalculation()public boolean getImplicitChannelCalculation()
getImplicitChannelCalculation in interface MEDCalculatorInterfacesetImplictChannelCalculation(boolean)public java.lang.String getChannelName(FwkColumnAccessInterface col, double[] limit)
getChannelName in interface MEDCalculatorInterfacecol - the source channel.limit - a two element array containing the upper and the lower limit.public java.lang.String getChannelColumnName(FwkColumnAccessInterface col, double[] limit)
getChannelColumnName in interface MEDCalculatorInterfacecol - the source channel.limit - a two element array containing the upper and the lower limit.public java.lang.String getMarkerFilter()
getMarkerFilter in interface MEDCalculatorInterfacepublic void setMarkerFilter(java.lang.String filter)
setMarkerFilter in interface MEDCalculatorInterfacefilter - the marker dialog filter.public java.lang.String getChannelFilter()
getChannelFilter in interface MEDCalculatorInterfacepublic void setChannelFilter(java.lang.String filter)
setChannelFilter in interface MEDCalculatorInterfacefilter - the channel dialog filter.public java.lang.String getIndependentFilter()
getIndependentFilter in interface MEDCalculatorInterfacepublic void setIndependentFilter(java.lang.String filter)
setIndependentFilter in interface MEDCalculatorInterfacefilter - the independent channel dialog filter.public FwkPanelInterface getCalculatorPanel()
This method should return a dialog to configurate the calculator specific properties.
getCalculatorPanel in interface MEDCalculatorInterfacepublic FwkDialogPaneInterface getDialogPanel()
getDialogPanel in interface MEDCalculatorInterfacepublic java.awt.Container getDialogParent(java.util.EventObject ev)
getDialogParent in interface MEDCalculatorInterfacepublic java.lang.String[] getChannelNames()
getChannelNames in interface MEDCalculatorInterfacepublic void setChannelNames(java.lang.String[] channels)
setChannelNames in interface MEDCalculatorInterfacechannels - all selected channel names.public void setIndependentChannelName(java.lang.String name)
setIndependentChannelName in interface MEDCalculatorInterfacename - the name of the independent column.public java.lang.String getIndependentChannelName()
getIndependentChannelName in interface MEDCalculatorInterfacepublic java.lang.String getChannelInfoBusName()
getChannelInfoBusName in interface MEDCalculatorInterfacepublic java.lang.String[] getMarkerNames()
getMarkerNames in interface MEDCalculatorInterfacepublic void setMarkerNames(java.lang.String[] markers)
setMarkerNames in interface MEDCalculatorInterfacemarkers - all selected marker names.public java.lang.String getMarkerInfoBusName()
getMarkerInfoBusName in interface MEDCalculatorInterfacepublic boolean execute(java.util.EventObject ev)
execute in interface FwkCommandInterfaceexecute in class FwkCommandev - the event object.public void setCalculatorPanelPosition(java.lang.String position)
setCalculatorPanelPosition in interface MEDCalculatorInterfaceposition - The position of the panel.public java.lang.String getCalculatorPanelPosition()
getCalculatorPanelPosition in interface MEDCalculatorInterfaceposition - The position of the panel.setCalculatorPanelPosition(String)public boolean canCreateImplicitChannel()
canCreateImplicitChannel in interface MEDCalculatorInterfacepublic boolean canChangeChannel()
canChangeChannel in interface MEDCalculatorInterfacepublic boolean canCopyChannel()
canCopyChannel in interface MEDCalculatorInterfacepublic boolean checkCalulatorPanel()
throws FwkException
checkCalulatorPanel in interface MEDCalculatorInterfaceFwkException - if the check failed. The calculator is responsable.
to signal the problem to the user.public static void main(java.lang.String[] args)
public void clear()
clear in interface java.util.Mappublic boolean containsKey(java.lang.Object obj)
containsKey in interface java.util.Mappublic boolean containsValue(java.lang.Object obj)
containsValue in interface java.util.Mappublic java.util.Set entrySet()
entrySet in interface java.util.Mappublic java.lang.Object get(java.lang.Object obj)
get in interface java.util.Mappublic boolean isEmpty()
isEmpty in interface java.util.Mappublic java.util.Set keySet()
keySet in interface java.util.Mappublic java.lang.Object put(java.lang.Object obj,
java.lang.Object obj1)
put in interface java.util.Mappublic void putAll(java.util.Map map)
putAll in interface java.util.Mappublic java.lang.Object remove(java.lang.Object obj)
remove in interface java.util.Mappublic int size()
size in interface java.util.Mappublic java.util.Collection values()
values in interface java.util.Map