|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.openadaptor.hospital.gui.HATPayloadPanel
public class HATPayloadPanel
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 | || | || | || | || | || +-------------------------------+| +-------------------------------------------------------+
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 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 |
---|
static org.apache.log4j.Logger log
static java.lang.String sClass
public static HATPayloadPanel _rootPanel
public boolean _isRootPanel
javax.swing.JPanel GUI_PATIENT_PAYLOAD_MAIN_PANEL
javax.swing.JPanel GUI_PATIENT_PAYLOAD_DATAOBJECT_LIST_PANEL
javax.swing.JPanel GUI_PATIENT_PAYLOAD_BUTTONS_PANEL
javax.swing.JSplitPane GUI_PATIENT_PAYLOAD_SPLITTER
javax.swing.JScrollPane GUI_PATIENT_PAYLOAD_ATTRIBUTE_SCROLLER
javax.swing.JScrollPane GUI_PATIENT_PAYLOAD_DATAOBJECT_LIST_SCROLLER
static javax.swing.JTable GUI_PATIENT_PAYLOAD_ATTRIBUTE_TABLE
static javax.swing.JList GUI_PATIENT_PAYLOAD_DATAOBJECT_LIST
static HATMenuActionListener GUI_MENU_DATAOBJECT_ADD
static HATMenuActionListener GUI_MENU_DATAOBJECT_REMOVE
static HATMenuActionListener GUI_MENU_ATTRIBUTE_ADD
static HATMenuActionListener GUI_MENU_ATTRIBUTE_EDIT
static HATMenuActionListener GUI_MENU_ATTRIBUTE_REMOVE
static HATMenuActionListener GUI_MENU_PAYLOAD_SAVE
HATPopupMenu GUI_POPUP_MENU
HATFrame _frame
Constructor Detail |
---|
public HATPayloadPanel(HATFrame frame, java.util.Properties props, SimpleDataObject sdo, java.lang.String className)
frame
- reference to the container frameprops
- java.util.Properties reference.sdo
- the data object to be displayedclassName
- the classname attached to the SimpleDataObjectpublic HATPayloadPanel(HATFrame frame, java.util.Properties props, SimpleDataObject[] sdoArray, java.lang.String className)
frame
- reference to the container frameprops
- reference to the HAT_PROPERTIES_FILE file contentssdoArray
- array of data objects to be displayedclassName
- the classname attached to the type of SimpleDataObjects
inside the arrayMethod Detail |
---|
public void setRootPanel()
public void setParent(SimpleDataObject sdoParent, java.lang.String attributeName)
sdoParent
- SimpleDataObject which is the parent one.attributeName
- The attribute name of the parent object.public static boolean isParent()
public void updateSDOSelectionList()
public void clearSelectionList()
public SimpleDataObject getActiveSDO()
public void setSDOFocus(int index)
index
- valid index from 0 to n.public void clearAttributeTable()
public static void setHeaderRenderer()
public void removeEntry(int index)
index
- valid index from 0 to n.public void addEntry(SimpleDataObject sdoNew)
sdoNew
- the data object to addpublic void setRootPanelArray(SimpleDataObject[] sdoArray)
sdoArray
- the SDO array referenceboolean isDoubleClick(java.awt.event.MouseEvent e)
MouseEvent
for a double click.
e
- MouseEvent
public static boolean isDataObject(java.lang.Object obj)
obj
- the object to check
public static boolean isSimpleDataObject(java.lang.Object obj)
obj
- the object to check
public static boolean isComplexAttribute(java.lang.Object obj)
obj
- the object to check
public void attributeTableClicked(java.awt.event.MouseEvent evnt)
evnt
- MouseEventpublic void valueChanged(javax.swing.event.ListSelectionEvent e)
valueChanged
in interface javax.swing.event.ListSelectionListener
e
- ListSelectionEvent
ListSelectionListener
public void listClicked(java.awt.event.MouseEvent e)
e
- mouse eventpublic boolean payloadIsEmpty()
public static SimpleDataObject getSdo()
public SimpleDataObject[] getSdoArray()
public static boolean isDirty()
public void setDirty(boolean dirty)
dirty
- boolean.public boolean addAttribute(java.lang.String name, java.lang.Object value, DOType type)
name
- the name of the new attributevalue
- the value of the new attributetype
- the DataObject type
public boolean removeAttribute(java.lang.String name)
name
- the name of the attribute to remove
public boolean renameAttribute(java.lang.String oldName, java.lang.String newName)
oldName
- the old name for the attributenewName
- the new name for the attribute
public boolean setAttributeType(java.lang.String name, DOType type)
name
- the name of the attribute to be modifiedtype
- the new DOType for the attribute
public void savePayload()
public void jMenuPayloadSave_actionPerformed(java.awt.event.ActionEvent evnt)
evnt
- ActionEvent
public void addDataObject()
public void removeDataObject()
public void addAttribute()
public void editAttribute()
public void removeAttribute()
public void checkForSave()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |