org.openadaptor.hospital.gui
Class HATPayloadPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.openadaptor.hospital.gui.HATPayloadPanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.ListSelectionListener, HATConstants

public class HATPayloadPanel
extends javax.swing.JPanel
implements javax.swing.event.ListSelectionListener, HATConstants

Part of the HAT GUI. It is composed of GUI components to display the DataObject payload of the currently selected hospital patient. Also, allows the user to select one of the DataObjects and display it attributes. This panel must be embedded in a frame in order to be displayed

If an attribute of a selecetd DataObject contains an array of DataObjects then a second window is displayed when the user selects this attribute.

Security: Users of the application are assigned roles (HATUser, HATManager, HATController, HATAdmin). The default role is HATUser which offers you a read-only view of the selected hospital. Higher roles inherrit the permissions of the lower ones (ie. HATAdmins have all the functionality of HATControllers, HATManagers and HATUsers).

The roles are defined in the hospital database. In order to conenct to the hospital the user must supply a SQL username and password. This username is then looked up in the security table to get the user's role.

The basic layout is: HATPauloadPanel +-------------------------------------------------------+ | DataObject Attribute | <- GUI_POPUP_MENU +-------------------------------------------------------+ +-------------------------------------------------------+ <- GUI_PATIENT_PAYLOAD_MAIN_PANEL | SDO 0 || +---------+----------+----------+| | SDO 1 || | Name | Value | Type |<--- GUI_PATIENT_PAYLOAD_ATTRIBUTE_TABLE | SDO 2 || +---------+----------+----------+| | || | || | || | || | <------------------------------------------ GUI_PATIENT_PAYLOAD_DATAOBJECT_LIST_PANEL | || | || | || | || | ||<------------------------------------- GUI_PATIENT_PAYLOAD_SPLITTER | || | || | || | || | || +-------------------------------+| +-------------------------------------------------------+

Author:
Andree Riechert, Russ Fennell
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
(package private)  HATFrame _frame
          reference to the frame that contains this panel
 boolean _isRootPanel
           
static HATPayloadPanel _rootPanel
          the root panel of the HATDetailsPanel.
(package private) static HATMenuActionListener GUI_MENU_ATTRIBUTE_ADD
           
(package private) static HATMenuActionListener GUI_MENU_ATTRIBUTE_EDIT
           
(package private) static HATMenuActionListener GUI_MENU_ATTRIBUTE_REMOVE
           
(package private) static HATMenuActionListener GUI_MENU_DATAOBJECT_ADD
           
(package private) static HATMenuActionListener GUI_MENU_DATAOBJECT_REMOVE
           
(package private) static HATMenuActionListener GUI_MENU_PAYLOAD_SAVE
           
(package private)  javax.swing.JScrollPane GUI_PATIENT_PAYLOAD_ATTRIBUTE_SCROLLER
           
(package private) static javax.swing.JTable GUI_PATIENT_PAYLOAD_ATTRIBUTE_TABLE
           
(package private)  javax.swing.JPanel GUI_PATIENT_PAYLOAD_BUTTONS_PANEL
           
(package private) static javax.swing.JList GUI_PATIENT_PAYLOAD_DATAOBJECT_LIST
           
(package private)  javax.swing.JPanel GUI_PATIENT_PAYLOAD_DATAOBJECT_LIST_PANEL
           
(package private)  javax.swing.JScrollPane GUI_PATIENT_PAYLOAD_DATAOBJECT_LIST_SCROLLER
           
(package private)  javax.swing.JPanel GUI_PATIENT_PAYLOAD_MAIN_PANEL
          GUI display elements
(package private)  javax.swing.JSplitPane GUI_PATIENT_PAYLOAD_SPLITTER
           
(package private)  HATPopupMenu GUI_POPUP_MENU
           
(package private) static org.apache.log4j.Logger log
           
(package private) static java.lang.String sClass
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface org.openadaptor.hospital.HATConstants
DB_ROW_LIMIT, DB_SLOW_LOAD_LIMIT, GUI_DATAOBJECT_LIST_WIDTH, GUI_HEIGHT, GUI_LOGIN_DIALOG_COMBO_WIDTH, GUI_LOGIN_DIALOG_LABELS_WIDTH, GUI_LOGIN_DIALOG_TEXTFIELD_WIDTH, GUI_PATIENT_LIST_WIDTH, GUI_TEXTFIELD_HEIGHT, GUI_WIDTH, HAT_ATTRIBUTE_HEADING_NAME, HAT_ATTRIBUTE_HEADING_TYPE, HAT_ATTRIBUTE_HEADING_VALUE, HAT_AUTHORISATION_DB, HAT_AUTHORISATION_DB_NO_SEC, HAT_AUTHORISATION_LDAP, HAT_AUTHORISATION_NA, HAT_COLOUR_APPLICATION, HAT_COLOUR_CORNFLOWER, HAT_COLOUR_DARKBLUE, HAT_COLOUR_LIGHTGREEN, HAT_COLOUR_LILAC, HAT_COLOUR_ORANGE, HAT_COLOUR_PATIENTDETAILS, HAT_COLOUR_PATIENTLIST, HAT_COLOUR_PAYLOAD, HAT_COLOUR_PURPLE, HAT_DECIMAL_FORMAT, HAT_DEFAULT_ICONFILE, HAT_DEFAULT_IMAGE_PATH, HAT_DEFAULT_SQL_STATEMENTS, HAT_EDIT_ALL_ATTRIBUTES, HAT_LOGIN_DIALOG_CANCEL_BUTTON, HAT_LOGIN_DIALOG_HOSPITAL_COMBO, HAT_LOGIN_DIALOG_OK_BUTTON, HAT_LOGIN_DIALOG_TEST_BUTTON, HAT_MENU_ABOUT, HAT_MENU_ADMIN_ATTRIBUTES, HAT_MENU_ADMIN_ROLES, HAT_MENU_ADMIT, HAT_MENU_ATTRIBUTE_ADD, HAT_MENU_ATTRIBUTE_EDIT, HAT_MENU_ATTRIBUTE_REMOVE, HAT_MENU_CHOOSE_HOSPITAL, HAT_MENU_CLEAR_PATIENT_LIST, HAT_MENU_DATAOBJECT_ADD, HAT_MENU_DATAOBJECT_REMOVE, HAT_MENU_DELETE_ALL_PATIENTS, HAT_MENU_DELETE_PATIENT, HAT_MENU_DISCHARGE, HAT_MENU_EXIT, HAT_MENU_LOAD_FROM_HOSPITAL, HAT_MENU_PAYLOAD_SAVE, HAT_MENU_READMIT, HAT_MENU_REFRESH_PATIENT_LIST, HAT_MENU_VALIDATE, HAT_MENU_VALIDATE_DISCHARGE, HAT_MOUSE_LISTENER_PATIENT_LIST, HAT_MOUSE_LISTENER_PAYLOAD_ATRIBUTE_TABLE, HAT_MOUSE_LISTENER_PAYLOAD_DO_LIST, HAT_NEW_ATTRIBUTE_NAME, HAT_OA_LOGO, HAT_PANEL_PATIENT, HAT_PANEL_PATIENTDETAILS, HAT_PANEL_PAYLOAD, HAT_PROPERTIES_FILE, HAT_ROLE_ADMIN, HAT_ROLE_CONTROLLER, HAT_ROLE_MANAGER, HAT_ROLE_NONE, HAT_ROLE_SECURITY, HAT_ROLE_USER, HAT_TITLE, HAT_VALID_DO_TYPES, LOG_DEBUG, LOG_ERROR, LOG_FATAL, LOG_INFO, LOG_NULL, LOG_WARN, PROPS_AUTHORISATION_METHOD, PROPS_DB_ROWLIMIT, PROPS_DB_SLOWLOADLIMIT, PROPS_FILENAME, PROPS_HOSPITALNAME, PROPS_ICON, PROPS_JDBC_CONNECTIONURL, PROPS_JDBC_DRIVER, PROPS_JDBC_HOSPITAL, PROPS_JDBC_PASSWORD, PROPS_JDBC_USER, PROPS_LOGIN_PASSWORD, PROPS_LOGIN_USER, PROPS_PLUGIN, PROPS_SECURITY_LIST_SEPARATOR, PROPS_SQL_STATEMENTS
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
HATPayloadPanel(HATFrame frame, java.util.Properties props, SimpleDataObject[] sdoArray, java.lang.String className)
          Constructor.
HATPayloadPanel(HATFrame frame, java.util.Properties props, SimpleDataObject sdo, java.lang.String className)
          Constructor.
 
Method Summary
 void addAttribute()
          Menu item Attribute-->Add (action performed)
 boolean addAttribute(java.lang.String name, java.lang.Object value, DOType type)
          adds a new attribute to the currently selecetd DataObject
 void addDataObject()
          Menu item DataObject-->Add (action performed)
 void addEntry(SimpleDataObject sdoNew)
          Add an entry to the DataObject selection list.
 void attributeTableClicked(java.awt.event.MouseEvent evnt)
          Handle any MouseEvent for the attribute details table.
 void checkForSave()
          checks to see if any new details has been added to the payload and if so then prompts the user to save the data to the database.
 void clearAttributeTable()
          removes all data from the attribute table and leaves it empty
 void clearSelectionList()
          Clear the data object selection list.
 void editAttribute()
          Menu item Attribute-->Edit (action performed)
 SimpleDataObject getActiveSDO()
          Get the reference to the active data object in the selection list.
static SimpleDataObject getSdo()
          returns the current SimpleDataObject that we are displaying the attributes for
 SimpleDataObject[] getSdoArray()
          returns an array of the currently selected DataObjects
static boolean isComplexAttribute(java.lang.Object obj)
          Check if the passed object is primitive object or a business object.
static boolean isDataObject(java.lang.Object obj)
          checks if the supplied object is a DataObject array.
static boolean isDirty()
          flag to indicate that some elements of the payload have been modified and need to be saved to the database
(package private)  boolean isDoubleClick(java.awt.event.MouseEvent e)
          Check the MouseEvent for a double click.
static boolean isParent()
          Checks if this HATPayloadPanel object has a parent or not.
static boolean isSimpleDataObject(java.lang.Object obj)
          checks if the supplied object is an array of SimpleDataObjects.
 void jMenuPayloadSave_actionPerformed(java.awt.event.ActionEvent evnt)
          Menu item Payload-->save (action performed)
 void listClicked(java.awt.event.MouseEvent e)
          Change the focus inside the DataObject list
 boolean payloadIsEmpty()
          returns flag to indicate that there are no DataObjects in the patients payload
 void removeAttribute()
          Menu item Attribute-->remove (action performed)
 boolean removeAttribute(java.lang.String name)
          removes the supplied attribute from the currently selecetd DataObject
 void removeDataObject()
          Menu item DataObject-->remove (action performed)
 void removeEntry(int index)
          Remove the entry with the supplied index from the DataObject selection list.
 boolean renameAttribute(java.lang.String oldName, java.lang.String newName)
          renames the supplied attribute from the currently selecetd DataObject
 void savePayload()
          write the current patient's payload back to the database.
 boolean setAttributeType(java.lang.String name, DOType type)
          renames the supplied attribute from the currently selecetd DataObject
 void setDirty(boolean dirty)
          sets the flag to indicate that the elements of the payload have been modified and need to be saved to the database.
static void setHeaderRenderer()
          takes the supplied header renderer and applies it to each column in the table
 void setParent(SimpleDataObject sdoParent, java.lang.String attributeName)
          Set the parent reference for this data object.
 void setRootPanel()
          Sets this instance of the HATPayloadPanel to the root one.
 void setRootPanelArray(SimpleDataObject[] sdoArray)
          Set the current DataObject array reference.
 void setSDOFocus(int index)
          Set the focus of the DataObject selection list to the index requested
 void updateSDOSelectionList()
          Refresh of the DataObject selection list.
 void valueChanged(javax.swing.event.ListSelectionEvent e)
          Implementation method of the ListSelectionListener.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

static org.apache.log4j.Logger log

sClass

static java.lang.String sClass

_rootPanel

public static HATPayloadPanel _rootPanel
the root panel of the HATDetailsPanel. When the user wants to display details of an attribute that is an array of DataObjects, a second window is displayed. We use this reference tio navigate between them as the -rootPanel is effectively the parent of the second one.


_isRootPanel

public boolean _isRootPanel

GUI_PATIENT_PAYLOAD_MAIN_PANEL

javax.swing.JPanel GUI_PATIENT_PAYLOAD_MAIN_PANEL
GUI display elements


GUI_PATIENT_PAYLOAD_DATAOBJECT_LIST_PANEL

javax.swing.JPanel GUI_PATIENT_PAYLOAD_DATAOBJECT_LIST_PANEL

GUI_PATIENT_PAYLOAD_BUTTONS_PANEL

javax.swing.JPanel GUI_PATIENT_PAYLOAD_BUTTONS_PANEL

GUI_PATIENT_PAYLOAD_SPLITTER

javax.swing.JSplitPane GUI_PATIENT_PAYLOAD_SPLITTER

GUI_PATIENT_PAYLOAD_ATTRIBUTE_SCROLLER

javax.swing.JScrollPane GUI_PATIENT_PAYLOAD_ATTRIBUTE_SCROLLER

GUI_PATIENT_PAYLOAD_DATAOBJECT_LIST_SCROLLER

javax.swing.JScrollPane GUI_PATIENT_PAYLOAD_DATAOBJECT_LIST_SCROLLER

GUI_PATIENT_PAYLOAD_ATTRIBUTE_TABLE

static javax.swing.JTable GUI_PATIENT_PAYLOAD_ATTRIBUTE_TABLE

GUI_PATIENT_PAYLOAD_DATAOBJECT_LIST

static javax.swing.JList GUI_PATIENT_PAYLOAD_DATAOBJECT_LIST

GUI_MENU_DATAOBJECT_ADD

static HATMenuActionListener GUI_MENU_DATAOBJECT_ADD

GUI_MENU_DATAOBJECT_REMOVE

static HATMenuActionListener GUI_MENU_DATAOBJECT_REMOVE

GUI_MENU_ATTRIBUTE_ADD

static HATMenuActionListener GUI_MENU_ATTRIBUTE_ADD

GUI_MENU_ATTRIBUTE_EDIT

static HATMenuActionListener GUI_MENU_ATTRIBUTE_EDIT

GUI_MENU_ATTRIBUTE_REMOVE

static HATMenuActionListener GUI_MENU_ATTRIBUTE_REMOVE

GUI_MENU_PAYLOAD_SAVE

static HATMenuActionListener GUI_MENU_PAYLOAD_SAVE

GUI_POPUP_MENU

HATPopupMenu GUI_POPUP_MENU

_frame

HATFrame _frame
reference to the frame that contains this panel

Constructor Detail

HATPayloadPanel

public HATPayloadPanel(HATFrame frame,
                       java.util.Properties props,
                       SimpleDataObject sdo,
                       java.lang.String className)
Constructor. Sets up variables and then calls init() to display the panel. Only one SimpleDataObject is passed.

Parameters:
frame - reference to the container frame
props - java.util.Properties reference.
sdo - the data object to be displayed
className - the classname attached to the SimpleDataObject

HATPayloadPanel

public HATPayloadPanel(HATFrame frame,
                       java.util.Properties props,
                       SimpleDataObject[] sdoArray,
                       java.lang.String className)
Constructor. Sets up variables and then calls init() to display the panel. An arry of SimpleDataObjects are passed

Parameters:
frame - reference to the container frame
props - reference to the HAT_PROPERTIES_FILE file contents
sdoArray - array of data objects to be displayed
className - the classname attached to the type of SimpleDataObjects inside the array
Method Detail

setRootPanel

public void setRootPanel()
Sets this instance of the HATPayloadPanel to the root one.


setParent

public void setParent(SimpleDataObject sdoParent,
                      java.lang.String attributeName)
Set the parent reference for this data object.

Parameters:
sdoParent - SimpleDataObject which is the parent one.
attributeName - The attribute name of the parent object.

isParent

public static boolean isParent()
Checks if this HATPayloadPanel object has a parent or not.

Returns:
true if there is a parent object or false if not.

updateSDOSelectionList

public void updateSDOSelectionList()
Refresh of the DataObject selection list. The data objects numbered "SDO 1", "SDO 2",..."SDO n".


clearSelectionList

public void clearSelectionList()
Clear the data object selection list.


getActiveSDO

public SimpleDataObject getActiveSDO()
Get the reference to the active data object in the selection list.

Returns:
reference to the focused object or null if the list is empty.

setSDOFocus

public void setSDOFocus(int index)
Set the focus of the DataObject selection list to the index requested

Parameters:
index - valid index from 0 to n.

clearAttributeTable

public void clearAttributeTable()
removes all data from the attribute table and leaves it empty


setHeaderRenderer

public static void setHeaderRenderer()
takes the supplied header renderer and applies it to each column in the table


removeEntry

public void removeEntry(int index)
Remove the entry with the supplied index from the DataObject selection list.

Parameters:
index - valid index from 0 to n.

addEntry

public void addEntry(SimpleDataObject sdoNew)
Add an entry to the DataObject selection list.

Parameters:
sdoNew - the data object to add

setRootPanelArray

public void setRootPanelArray(SimpleDataObject[] sdoArray)
Set the current DataObject array reference. Updates the _rootPanel window with a copy of the supplied DataObject array and refreshes the list and sets the focus

Parameters:
sdoArray - the SDO array reference

isDoubleClick

boolean isDoubleClick(java.awt.event.MouseEvent e)
Check the MouseEvent for a double click.

Parameters:
e - MouseEvent
Returns:
true if it was a double click, false if not

isDataObject

public static boolean isDataObject(java.lang.Object obj)
checks if the supplied object is a DataObject array.

Parameters:
obj - the object to check
Returns:
true if the object is an array of DataObject or false if not.

isSimpleDataObject

public static boolean isSimpleDataObject(java.lang.Object obj)
checks if the supplied object is an array of SimpleDataObjects.

Parameters:
obj - the object to check
Returns:
true if the object is an array of SimpleDataObject or false if not.

isComplexAttribute

public static boolean isComplexAttribute(java.lang.Object obj)
Check if the passed object is primitive object or a business object.

Parameters:
obj - the object to check
Returns:
true if the object is an business object or false if not.

attributeTableClicked

public void attributeTableClicked(java.awt.event.MouseEvent evnt)
Handle any MouseEvent for the attribute details table. If the attribute pointed to is a business object, this means no primitive attribute, a new HATPayloadPanel will be created for this business data object. Otherwise we check the user's security rights and allow them to edit the attribute details if applicable.

Parameters:
evnt - MouseEvent

valueChanged

public void valueChanged(javax.swing.event.ListSelectionEvent e)
Implementation method of the ListSelectionListener. This implementation is necessary to get informed about list item selections.

Specified by:
valueChanged in interface javax.swing.event.ListSelectionListener
Parameters:
e - ListSelectionEvent
See Also:
ListSelectionListener

listClicked

public void listClicked(java.awt.event.MouseEvent e)
Change the focus inside the DataObject list

Parameters:
e - mouse event

payloadIsEmpty

public boolean payloadIsEmpty()
returns flag to indicate that there are no DataObjects in the patients payload

Returns:
true if the payload is empty

getSdo

public static SimpleDataObject getSdo()
returns the current SimpleDataObject that we are displaying the attributes for

Returns:
org.openadaptor.dataobjects.SimpleDataObject

getSdoArray

public SimpleDataObject[] getSdoArray()
returns an array of the currently selected DataObjects

Returns:
org.openadaptor.dataobjects.SimpleDataObject[]

isDirty

public static boolean isDirty()
flag to indicate that some elements of the payload have been modified and need to be saved to the database

Returns:
true is there have been changes

setDirty

public void setDirty(boolean dirty)
sets the flag to indicate that the elements of the payload have been modified and need to be saved to the database. Also recorsds the index for the patient in the patient list.

Parameters:
dirty - boolean.

addAttribute

public boolean addAttribute(java.lang.String name,
                            java.lang.Object value,
                            DOType type)
adds a new attribute to the currently selecetd DataObject

Parameters:
name - the name of the new attribute
value - the value of the new attribute
type - the DataObject type
Returns:
true if successfully added, false otherwise

removeAttribute

public boolean removeAttribute(java.lang.String name)
removes the supplied attribute from the currently selecetd DataObject

Parameters:
name - the name of the attribute to remove
Returns:
true if successfully removed, false otherwise

renameAttribute

public boolean renameAttribute(java.lang.String oldName,
                               java.lang.String newName)
renames the supplied attribute from the currently selecetd DataObject

Parameters:
oldName - the old name for the attribute
newName - the new name for the attribute
Returns:
true if successfully removed, false otherwise

setAttributeType

public boolean setAttributeType(java.lang.String name,
                                DOType type)
renames the supplied attribute from the currently selecetd DataObject

Parameters:
name - the name of the attribute to be modified
type - the new DOType for the attribute
Returns:
true if successfully removed, false otherwise

savePayload

public void savePayload()
write the current patient's payload back to the database. If we are using a file source as the hospital then there is no editing and hence nothing to save so we simply exit.


jMenuPayloadSave_actionPerformed

public void jMenuPayloadSave_actionPerformed(java.awt.event.ActionEvent evnt)
Menu item Payload-->save (action performed)

Parameters:
evnt - ActionEvent

addDataObject

public void addDataObject()
Menu item DataObject-->Add (action performed)


removeDataObject

public void removeDataObject()
Menu item DataObject-->remove (action performed)


addAttribute

public void addAttribute()
Menu item Attribute-->Add (action performed)


editAttribute

public void editAttribute()
Menu item Attribute-->Edit (action performed)


removeAttribute

public void removeAttribute()
Menu item Attribute-->remove (action performed)


checkForSave

public void checkForSave()
checks to see if any new details has been added to the payload and if so then prompts the user to save the data to the database. If the user says NO then the changes are lost