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 FormModifier 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, visible
source
author, 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, titleName
CONTROLLER_PROPERTY, MENU_REASON_CANCELED, MENU_REASON_DESELECTED, MENU_REASON_SELECTED
AUTHOR, 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, unregister
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeArray, getPropertyChangeListenerArray, getPropertyChangeListenerArray, isPropertyChangeEventSuspended, removePropertyChangeListener, removePropertyChangeListener, setSource, suspendPropertyChangeEvents
getAuthor, 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, setTitleName
getNiceVersion
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addActionListener, 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, unregister
addCommand, addCommand, addToGroup, addToGroup, clearCommands, commandsAvailable, deleteGroup, getCommand, getCommands, getGroup, groupExists, removeCommand, removeFromGroup, setCommands
getPresentationString, getPresentationString
getController, setController
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeArray, getPropertyChangeListenerArray, getPropertyChangeListenerArray, isPropertyChangeEventSuspended, removePropertyChangeListener, removePropertyChangeListener, setSource, suspendPropertyChangeEvents
public 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()
FwkInterface
getVersion
in interface FwkInterface
getVersion
in class FwkCommand
public static FwkDescriptionInterface getDescriptor()
public void init()
init
in interface MEDCalculatorInterface
execute(EventObject)
public void release()
release
in interface FwkInterface
release
in interface MEDCalculatorInterface
release
in class Fwk
execute(EventObject)
public FwkIconInterface getIcon()
getIcon
in interface FwkCommandInterface
getIcon
in interface FwkDescriptionInterface
getIcon
in class FwkCommand
FwkCommand.setIconKey(String)
,
#setIconImage(Image)
,
#getIconFilename()
public MEDInterface getMED()
getMED
in interface MEDCalculatorInterface
public java.lang.String getIdent()
getIdent
in interface FwkDialogPaneValueInterface
public java.util.Iterator getProperties()
getProperties
in interface FwkCommandInterface
getProperties
in interface FwkDialogPaneValueInterface
getProperties
in class FwkCommand
public java.lang.Object getProperty(java.lang.String propertyName)
getProperty
in interface FwkCommandInterface
getProperty
in interface FwkDialogPaneValueInterface
getProperty
in class FwkCommand
propertyName
- The name name of the property.public void setIdent(java.lang.String ident)
setIdent
in interface FwkDialogPaneValueInterface
ident
- The new value ident.public void setProperties(java.util.Map properties)
setProperties
in interface FwkDialogPaneValueInterface
properties
- The name-value map.public void setProperty(java.lang.String propertyName, java.lang.Object propertyValue)
setProperty
in interface FwkCommandInterface
setProperty
in interface FwkDialogPaneValueInterface
setProperty
in class FwkCommand
propertyName
- The name name of the property.propertyValue
- The new value of the property.public java.lang.String toString()
toString
in class FwkCommand
public double[] calculate(double[] independent, double[] data) throws FwkException
calculate
in interface MEDCalculatorInterface
independent
- An array containing The independent channel.data
- The array containing the channel data of interest.FwkException
public 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 MEDCalculatorInterface
independent
- 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.FwkException
calculate(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 MEDCalculatorInterface
FwkException
calculate(FwkArrayInterface, FwkArrayInterface)
public void setChannelCopy(boolean flag)
setChannelCopy
in interface MEDCalculatorInterface
flag
- if true the source channels will be copied.public boolean getChannelCopy()
getChannelCopy
in interface MEDCalculatorInterface
public void setChannelCut(boolean flag)
setChannelCut
in interface MEDCalculatorInterface
flag
- if true the source area of interest will be cut
out of the source channel.public boolean getChannelCut()
getChannelCut
in interface MEDCalculatorInterface
public void setImplicitChannelCalculation(boolean flag)
setImplicitChannelCalculation
in interface MEDCalculatorInterface
flag
- 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 MEDCalculatorInterface
setImplictChannelCalculation(boolean)
public java.lang.String getChannelName(FwkColumnAccessInterface col, double[] limit)
getChannelName
in interface MEDCalculatorInterface
col
- 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 MEDCalculatorInterface
col
- the source channel.limit
- a two element array containing the upper and the lower limit.public java.lang.String getMarkerFilter()
getMarkerFilter
in interface MEDCalculatorInterface
public void setMarkerFilter(java.lang.String filter)
setMarkerFilter
in interface MEDCalculatorInterface
filter
- the marker dialog filter.public java.lang.String getChannelFilter()
getChannelFilter
in interface MEDCalculatorInterface
public void setChannelFilter(java.lang.String filter)
setChannelFilter
in interface MEDCalculatorInterface
filter
- the channel dialog filter.public java.lang.String getIndependentFilter()
getIndependentFilter
in interface MEDCalculatorInterface
public void setIndependentFilter(java.lang.String filter)
setIndependentFilter
in interface MEDCalculatorInterface
filter
- the independent channel dialog filter.public FwkPanelInterface getCalculatorPanel()
This method should return a dialog to configurate the calculator specific properties.
getCalculatorPanel
in interface MEDCalculatorInterface
public FwkDialogPaneInterface getDialogPanel()
getDialogPanel
in interface MEDCalculatorInterface
public java.awt.Container getDialogParent(java.util.EventObject ev)
getDialogParent
in interface MEDCalculatorInterface
public java.lang.String[] getChannelNames()
getChannelNames
in interface MEDCalculatorInterface
public void setChannelNames(java.lang.String[] channels)
setChannelNames
in interface MEDCalculatorInterface
channels
- all selected channel names.public void setIndependentChannelName(java.lang.String name)
setIndependentChannelName
in interface MEDCalculatorInterface
name
- the name of the independent column.public java.lang.String getIndependentChannelName()
getIndependentChannelName
in interface MEDCalculatorInterface
public java.lang.String getChannelInfoBusName()
getChannelInfoBusName
in interface MEDCalculatorInterface
public java.lang.String[] getMarkerNames()
getMarkerNames
in interface MEDCalculatorInterface
public void setMarkerNames(java.lang.String[] markers)
setMarkerNames
in interface MEDCalculatorInterface
markers
- all selected marker names.public java.lang.String getMarkerInfoBusName()
getMarkerInfoBusName
in interface MEDCalculatorInterface
public boolean execute(java.util.EventObject ev)
execute
in interface FwkCommandInterface
execute
in class FwkCommand
ev
- the event object.public void setCalculatorPanelPosition(java.lang.String position)
setCalculatorPanelPosition
in interface MEDCalculatorInterface
position
- The position of the panel.public java.lang.String getCalculatorPanelPosition()
getCalculatorPanelPosition
in interface MEDCalculatorInterface
position
- The position of the panel.setCalculatorPanelPosition(String)
public boolean canCreateImplicitChannel()
canCreateImplicitChannel
in interface MEDCalculatorInterface
public boolean canChangeChannel()
canChangeChannel
in interface MEDCalculatorInterface
public boolean canCopyChannel()
canCopyChannel
in interface MEDCalculatorInterface
public boolean checkCalulatorPanel() throws FwkException
checkCalulatorPanel
in interface MEDCalculatorInterface
FwkException
- 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.Map
public boolean containsKey(java.lang.Object obj)
containsKey
in interface java.util.Map
public boolean containsValue(java.lang.Object obj)
containsValue
in interface java.util.Map
public java.util.Set entrySet()
entrySet
in interface java.util.Map
public java.lang.Object get(java.lang.Object obj)
get
in interface java.util.Map
public boolean isEmpty()
isEmpty
in interface java.util.Map
public java.util.Set keySet()
keySet
in interface java.util.Map
public java.lang.Object put(java.lang.Object obj, java.lang.Object obj1)
put
in interface java.util.Map
public void putAll(java.util.Map map)
putAll
in interface java.util.Map
public java.lang.Object remove(java.lang.Object obj)
remove
in interface java.util.Map
public int size()
size
in interface java.util.Map
public java.util.Collection values()
values
in interface java.util.Map