ca.uhn.hl7v2.app
Class TestPanel

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 ca.uhn.hl7v2.app.TestPanel
All Implemented Interfaces:
ConnectionListener, ImageObserver, MenuContainer, Serializable, Accessible

Deprecated. This class has been replaced by the standalone TestPanel application. The new testpanel is located in a different HAPI module called "hapi-testpanel"

public class TestPanel
extends JPanel
implements ConnectionListener

A user interface for testing communications with an HL7 server. The UI contains a window with 4 main panels. One can enter message text into the first panel, press a "parse" button so that the message is displayed in a tree in the second panel, press "send" to send the message to a remote server and display the response in a tree in the third panel, and press "encode" to write the inbound message as text in the fourth panel. To use, run from the command line with no arguments, like this:

java -classpath . ca.uhn.hl7v2.app.TestPanel

Exceptions generated during parsing or server communication are logged in the working directory and displayed in a dialog box.

Author:
Bryan Tripp, Christian Ohr
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
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
TestPanel()
          Deprecated. Creates a new instance of TestPanel
 
Method Summary
 void connect(ca.uhn.hl7v2.app.ConnectionData cf)
          Deprecated. Sets up a connection to a remote server that uses the minimal lower layer protocol, and this TestPanel's GenericParser.
 void connect(String host, int port)
          Deprecated. Sets up a connection to a remote server that uses the minimal lower layer protocol, and this TestPanel's GenericParser.
 void connect(String host, int port, boolean tls)
          Deprecated. Sets up a connection to a remote server that uses the minimal lower layer protocol, and this TestPanel's GenericParser.
 void connect(String host, int inboundPort, int outboundPort)
          Deprecated. Sets up a connection to a remote server that uses the minimal lower layer protocol, and this TestPanel's GenericParser.
 void connect(String host, int inboundPort, int outboundPort, boolean tls)
          Deprecated. Sets up a connection to a remote server that uses the minimal lower layer protocol, and this TestPanel's GenericParser.
 void connectionDiscarded(Connection connection)
          Deprecated. Notifies the listener that a new connection is closed and is being discarded.
 void connectionReceived(Connection connection)
          Deprecated. Notification that a new Connection has arrived at an HL7Service.
 void encodeInbound()
          Deprecated. Encodes the message that is currently displayed in the tree into a traditionally encoded message string and displays in the inbound message text box.
 void encodeOutbound()
          Deprecated. Encodes the message that is currently displayed in the outbound tree into a traditionally encoded message string and displays in a new window.
protected  Parser getParser()
          Deprecated. Returns this TestPanel's underlying GenericParser.
 MessageTypeRouter getRouter()
          Deprecated. Returns the MessageTypeRouter associated with this TestPanel.
static void main(String[] args)
          Deprecated.  
static void openTextWindow(String title, String text)
          Deprecated. Opens a new window for displaying text (intended for displaying encoded messages.
 void parseOutbound()
          Deprecated. Attempts to parse the contents of the outbound message text box into a message object and display in the outbound message tree.
 void sendAndRecieve()
          Deprecated. Sends the message that is currently displayed in the outbound tree to the remote system that is currently connected.
 void showException(Exception e)
          Deprecated. Displays an exception in a standard way.
 
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, getBaseline, getBaselineResizeBehavior, 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, isPaintingForPrint, 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
 

Constructor Detail

TestPanel

public TestPanel()
          throws HL7Exception
Deprecated. 
Creates a new instance of TestPanel

Throws:
HL7Exception
Method Detail

getParser

protected Parser getParser()
Deprecated. 
Returns this TestPanel's underlying GenericParser. This method is needed by the HL7Service that the panel uses, so that it can share the parser and use whatever encoding it is using.


showException

public void showException(Exception e)
Deprecated. 
Displays an exception in a standard way. All exceptions for TestPanel are routed here. Currently this prints to std err, and displays an error dialog, but it could be changed.


parseOutbound

public void parseOutbound()
                   throws HL7Exception,
                          EncodingNotSupportedException
Deprecated. 
Attempts to parse the contents of the outbound message text box into a message object and display in the outbound message tree.

Throws:
HL7Exception
EncodingNotSupportedException

connect

public void connect(String host,
                    int port)
             throws Exception
Deprecated. 
Sets up a connection to a remote server that uses the minimal lower layer protocol, and this TestPanel's GenericParser.

Throws:
Exception

connect

public void connect(String host,
                    int port,
                    boolean tls)
             throws Exception
Deprecated. 
Sets up a connection to a remote server that uses the minimal lower layer protocol, and this TestPanel's GenericParser. // TODO ConnectionHub?

Throws:
Exception

connect

public void connect(String host,
                    int inboundPort,
                    int outboundPort)
             throws Exception
Deprecated. 
Sets up a connection to a remote server that uses the minimal lower layer protocol, and this TestPanel's GenericParser.

Throws:
Exception

connect

public void connect(String host,
                    int inboundPort,
                    int outboundPort,
                    boolean tls)
             throws Exception
Deprecated. 
Sets up a connection to a remote server that uses the minimal lower layer protocol, and this TestPanel's GenericParser.

Throws:
Exception

connect

public void connect(ca.uhn.hl7v2.app.ConnectionData cf)
             throws Exception
Deprecated. 
Sets up a connection to a remote server that uses the minimal lower layer protocol, and this TestPanel's GenericParser.

Throws:
Exception

connectionReceived

public void connectionReceived(Connection connection)
Deprecated. 
Notification that a new Connection has arrived at an HL7Service.

Specified by:
connectionReceived in interface ConnectionListener

connectionDiscarded

public void connectionDiscarded(Connection connection)
Deprecated. 
Description copied from interface: ConnectionListener
Notifies the listener that a new connection is closed and is being discarded.

Specified by:
connectionDiscarded in interface ConnectionListener

getRouter

public MessageTypeRouter getRouter()
Deprecated. 
Returns the MessageTypeRouter associated with this TestPanel. Every Connection that a TestPanel uses routes unsolicited messages through this MessageTypeRouter. Applications can be registered with the router using registerApplication().


sendAndRecieve

public void sendAndRecieve()
                    throws Exception
Deprecated. 
Sends the message that is currently displayed in the outbound tree to the remote system that is currently connected.

Throws:
Exception

encodeInbound

public void encodeInbound()
                   throws HL7Exception
Deprecated. 
Encodes the message that is currently displayed in the tree into a traditionally encoded message string and displays in the inbound message text box.

Throws:
HL7Exception

encodeOutbound

public void encodeOutbound()
                    throws HL7Exception
Deprecated. 
Encodes the message that is currently displayed in the outbound tree into a traditionally encoded message string and displays in a new window.

Throws:
HL7Exception

openTextWindow

public static void openTextWindow(String title,
                                  String text)
Deprecated. 
Opens a new window for displaying text (intended for displaying encoded messages.


main

public static void main(String[] args)
Deprecated. 


Copyright © 2001-2012 University Health Network. All Rights Reserved.