com.ibm.ctg.epi

Class ScreenHandler

  • java.lang.Object
    • com.ibm.ctg.epi.ScreenHandler
  • All Implemented Interfaces:
    TerminalEventListener, java.awt.event.ActionListener, java.io.Serializable, java.util.EventListener


    public abstract class ScreenHandler
    extends java.lang.Object
    implements TerminalEventListener, java.io.Serializable, java.awt.event.ActionListener
    This class can be used as a base class for screen handlers. It implements some useful screen handler behaviour:
    • maintains a list of ScreenEventListeners and sends ScreenEvents to them
    • sets the screen AID
    • sets the screen cursor position
    • sends screens to CICS
    • handles ActionEvents by setting the screen AID to the action command
    • implements an exitScreen method, which attempts to exit the current CICS screen by setting the AID to PF3 and sending the screen to CICS
    • Constructor Detail

      • ScreenHandler

        public ScreenHandler()
    • Method Detail

      • addScreenEventListener

        public void addScreenEventListener(ScreenEventListener l)
        The specified ScreenEventListener will be called when this ScreenHandler gains control of the screen and again when it loses control. The ScreenEventListener object is added to a list of ScreenEventListeners managed by this ScreenHandler, it can be removed with removeScreenEventListener. Note: the JavaBeans specification does not require listeners to run in any particular order.
        Parameters:
        l - the ScreenEventListener
        See Also:
        removeScreenEventListener(com.ibm.ctg.epi.ScreenEventListener)
      • terminalDisconnected

        public void terminalDisconnected(TerminalEvent evt)
        Handles a terminal disconnect event. Sets the terminal variable to null, and sends the screenUnhandled event to any listeners.
        Specified by:
        terminalDisconnected in interface TerminalEventListener
        Parameters:
        evt - the EPI event sent
      • isHandling

        public boolean isHandling()
        Returns true if the ScreenHandler is handling the current screen.
        Returns:
        true if handling, false otherwise
      • setAID

        public void setAID(AID aid)
        Set the AID.
        Parameters:
        aid - the AID
      • send

        public void send()
        Send the screen to CICS.
      • setCursor

        public void setCursor(int row,
                     int col)
        Set the cursor position.
        Parameters:
        row - the cursor row
        col - the cursor column
      • getAID

        public AID getAID()
        Get the current AID value.
        Returns:
        the aid
      • getCursorRow

        public int getCursorRow()
        Get the cursor row position.
        Returns:
        the cursor row
      • getCursorColumn

        public int getCursorColumn()
        Get the cursor column position.
        Returns:
        the cursor column
      • actionPerformed

        public void actionPerformed(java.awt.event.ActionEvent evt)
        Handles an action event by converting the action command to an AID value and sending the screen to CICS. This method is provided as a simple way to make a button press set the AID and send the screen.
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Parameters:
        evt - the action event
      • exitScreen

        public void exitScreen()
        Exit the screen. You may need to override this method, which by default sets the aid to PF3 and sends the screen back to CICS.
©Copyright IBM Corp. 1994, 2013
Legal