Package org.tn5250j
Class SessionPanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- org.tn5250j.SessionPanel
-
- All Implemented Interfaces:
java.awt.image.ImageObserver,java.awt.MenuContainer,java.io.Serializable,javax.accessibility.Accessible,SessionConfigListener,SessionListener,RubberBandCanvasIF
public class SessionPanel extends javax.swing.JPanel implements RubberBandCanvasIF, SessionConfigListener, SessionListener
A host GUI session (Hint: old name was SessionGUI)- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classSessionPanel.TNRubberBandRubberBanding end code-
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
-
-
Field Summary
Fields Modifier and Type Field Description protected KeyboardHandlerkeyHandlerprotected SessionPanel.TNRubberBandrubberbandprotected SessionConfigsesConfigprotected Session5250session-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor Description SessionPanel(Session5250 session)
-
Method Summary
Modifier and Type Method Description voidactionAttributes()Show the session attributes screen for modification of the attribute/ settings of the session.voidactionCopy()Copy and Paste start codevoidactionSpool()voidaddEmulatorActionListener(EmulatorActionListener listener)Add a EmulatorActionListener to the listener list.voidaddSessionJumpListener(SessionJumpListener listener)Add a SessionJumpListener to the listener list.voidaddSessionListener(SessionListener listener)Add a SessionListener to the listener list.voidareaBounded(RubberBand band, int x1, int y1, int x2, int y2)booleancanDrawRubberBand(RubberBand b)voidcloseDown()booleanconfirmCloseSession(boolean reallyclose)voidconnect()voidcrossHair()coming up: Change to be mnemonic key.voiddisconnect()voiddoKeyBoundArea(java.awt.event.KeyEvent ke, java.lang.String last)This routine allows areas to be bounded by using the keyboardvoidexecuteMacro(java.awt.event.ActionEvent ae)voidexecuteMacro(java.lang.String macro)protected voidfireEmulatorAction(int action)Notify all registered listeners of the onEmulatorAction event.java.lang.StringgetAllocDeviceName()RectgetBoundingArea()voidgetBoundingArea(java.awt.Rectangle bounds)java.awt.RectanglegetDrawingBounds()java.awt.GraphicsgetDrawingGraphics()Returns a pointer to the graphics area that we can draw onvoidgetFocusForMe()java.lang.StringgetHostName()intgetPosFromView(int x, int y)Screen5250getScreen()Session5250getSession()java.lang.StringgetSessionName()tnvtgetVT()booleanisConnected()booleanisFocusTraversable()booleanisHotSpots()booleanisMacroRunning()booleanisManagingFocus()booleanisOnSignOnScreen()booleanisSessionRecording()booleanisStopMacroRequested()voidnextSession()voidonConfigChanged(SessionConfigEvent configEvent)Update the configuration settingsvoidonSessionChanged(SessionChangeEvent changeEvent)protected voidpaintComponent(java.awt.Graphics g)voidprevSession()voidprintMe()This routine is responsible for setting up a PrinterJob on this component and initiating the print session.voidprocessKeyEvent(java.awt.event.KeyEvent evt)voidremoveEmulatorActionListener(EmulatorActionListener listener)Remove a EmulatorActionListener from the listener list.voidremoveSessionJumpListener(SessionJumpListener listener)Remove a SessionJumpListener from the listener list.voidremoveSessionListener(SessionListener listener)Remove a SessionListener from the listener list.voidsendScreenEMail()voidsetMacroRunning(boolean mr)protected voidsetRubberBand(SessionPanel.TNRubberBand newValue)voidsetRunningHeadless(boolean headless)voidsetSession(Session5250 session)voidsetStopMacroRequested()voidstartDuplicateSession()voidstartNewSession()protected voidstartRecordingMe()protected voidstopRecordingMe()protected java.util.Vector<java.lang.Double>sumThem(boolean which)Sum themvoidtoggleConnection()Toggles connection (connect or disconnect)voidtoggleDebug()voidtoggleHotSpots()java.awt.PointtranslateEnd(java.awt.Point end)java.awt.PointtranslateStart(java.awt.Point start)voidupdate(java.awt.Graphics g)-
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, hide, isDoubleBuffered, isLightweightComponent, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, 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
-
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, 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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.tn5250j.RubberBandCanvasIF
addMouseListener, addMouseMotionListener, getBackground
-
-
-
-
Field Detail
-
session
protected Session5250 session
-
rubberband
protected SessionPanel.TNRubberBand rubberband
-
sesConfig
protected SessionConfig sesConfig
-
keyHandler
protected KeyboardHandler keyHandler
-
-
Constructor Detail
-
SessionPanel
public SessionPanel(Session5250 session)
-
-
Method Detail
-
setRunningHeadless
public void setRunningHeadless(boolean headless)
-
processKeyEvent
public void processKeyEvent(java.awt.event.KeyEvent evt)
- Overrides:
processKeyEventin classjavax.swing.JComponent
-
sendScreenEMail
public void sendScreenEMail()
-
doKeyBoundArea
public void doKeyBoundArea(java.awt.event.KeyEvent ke, java.lang.String last)This routine allows areas to be bounded by using the keyboard- Parameters:
ke- key eventlast- last
-
confirmCloseSession
public boolean confirmCloseSession(boolean reallyclose)
- Parameters:
reallyclose- TRUE if session/tab should be closed; FALSE, if only ask for confirmation- Returns:
- True if closed; False if still open
-
getFocusForMe
public void getFocusForMe()
-
isFocusTraversable
public boolean isFocusTraversable()
- Overrides:
isFocusTraversablein classjava.awt.Component
-
isManagingFocus
public boolean isManagingFocus()
- Overrides:
isManagingFocusin classjavax.swing.JComponent
-
onConfigChanged
public void onConfigChanged(SessionConfigEvent configEvent)
Description copied from interface:SessionConfigListenerUpdate the configuration settings- Specified by:
onConfigChangedin interfaceSessionConfigListener- Parameters:
configEvent- sessionConfigEvent
-
getVT
public tnvt getVT()
-
toggleDebug
public void toggleDebug()
-
startNewSession
public void startNewSession()
-
startDuplicateSession
public void startDuplicateSession()
-
toggleConnection
public void toggleConnection()
Toggles connection (connect or disconnect)
-
nextSession
public void nextSession()
-
prevSession
public void prevSession()
-
fireEmulatorAction
protected void fireEmulatorAction(int action)
Notify all registered listeners of the onEmulatorAction event.- Parameters:
action- The action to be performed.
-
isMacroRunning
public boolean isMacroRunning()
-
isStopMacroRequested
public boolean isStopMacroRequested()
-
isSessionRecording
public boolean isSessionRecording()
-
setMacroRunning
public void setMacroRunning(boolean mr)
-
setStopMacroRequested
public void setStopMacroRequested()
-
closeDown
public void closeDown()
-
actionAttributes
public void actionAttributes()
Show the session attributes screen for modification of the attribute/ settings of the session.
-
actionSpool
public void actionSpool()
-
executeMacro
public void executeMacro(java.awt.event.ActionEvent ae)
-
executeMacro
public void executeMacro(java.lang.String macro)
-
stopRecordingMe
protected void stopRecordingMe()
-
startRecordingMe
protected void startRecordingMe()
-
getDrawingBounds
public java.awt.Rectangle getDrawingBounds()
-
paintComponent
protected void paintComponent(java.awt.Graphics g)
- Overrides:
paintComponentin classjavax.swing.JComponent
-
update
public void update(java.awt.Graphics g)
- Overrides:
updatein classjavax.swing.JComponent
-
isHotSpots
public boolean isHotSpots()
-
toggleHotSpots
public void toggleHotSpots()
-
crossHair
public void crossHair()
coming up: Change to be mnemonic key. This toggles the ruler line.
-
actionCopy
public final void actionCopy()
Copy and Paste start code
-
sumThem
protected final java.util.Vector<java.lang.Double> sumThem(boolean which)
Sum them- Parameters:
which- formatting option to use- Returns:
- vector string of numeric values
-
printMe
public final void printMe()
This routine is responsible for setting up a PrinterJob on this component and initiating the print session.
-
addSessionJumpListener
public void addSessionJumpListener(SessionJumpListener listener)
Add a SessionJumpListener to the listener list.- Parameters:
listener- The SessionListener to be added
-
removeSessionJumpListener
public void removeSessionJumpListener(SessionJumpListener listener)
Remove a SessionJumpListener from the listener list.- Parameters:
listener- The SessionJumpListener to be removed
-
addEmulatorActionListener
public void addEmulatorActionListener(EmulatorActionListener listener)
Add a EmulatorActionListener to the listener list.- Parameters:
listener- The EmulatorActionListener to be added
-
removeEmulatorActionListener
public void removeEmulatorActionListener(EmulatorActionListener listener)
Remove a EmulatorActionListener from the listener list.- Parameters:
listener- The EmulatorActionListener to be removed
-
getDrawingGraphics
public java.awt.Graphics getDrawingGraphics()
Returns a pointer to the graphics area that we can draw on- Specified by:
getDrawingGraphicsin interfaceRubberBandCanvasIF
-
setRubberBand
protected final void setRubberBand(SessionPanel.TNRubberBand newValue)
-
getBoundingArea
public Rect getBoundingArea()
-
translateStart
public java.awt.Point translateStart(java.awt.Point start)
- Specified by:
translateStartin interfaceRubberBandCanvasIF
-
translateEnd
public java.awt.Point translateEnd(java.awt.Point end)
- Specified by:
translateEndin interfaceRubberBandCanvasIF
-
getPosFromView
public int getPosFromView(int x, int y)
-
getBoundingArea
public void getBoundingArea(java.awt.Rectangle bounds)
-
areaBounded
public void areaBounded(RubberBand band, int x1, int y1, int x2, int y2)
- Specified by:
areaBoundedin interfaceRubberBandCanvasIF
-
canDrawRubberBand
public boolean canDrawRubberBand(RubberBand b)
- Specified by:
canDrawRubberBandin interfaceRubberBandCanvasIF
-
getSession
public Session5250 getSession()
-
setSession
public void setSession(Session5250 session)
-
isConnected
public boolean isConnected()
-
isOnSignOnScreen
public boolean isOnSignOnScreen()
-
getSessionName
public java.lang.String getSessionName()
- Returns:
- the session name
- See Also:
Session5250.getSessionName()
-
getAllocDeviceName
public java.lang.String getAllocDeviceName()
-
getHostName
public java.lang.String getHostName()
-
getScreen
public Screen5250 getScreen()
-
connect
public void connect()
-
disconnect
public void disconnect()
-
onSessionChanged
public void onSessionChanged(SessionChangeEvent changeEvent)
- Specified by:
onSessionChangedin interfaceSessionListener
-
addSessionListener
public void addSessionListener(SessionListener listener)
Add a SessionListener to the listener list.- Parameters:
listener- The SessionListener to be added
-
removeSessionListener
public void removeSessionListener(SessionListener listener)
Remove a SessionListener from the listener list.- Parameters:
listener- The SessionListener to be removed
-
-