Class Terminal

java.lang.Object
com.iizigo.term.internal.Terminal
All Implemented Interfaces:
TerminalWindowListener

public class Terminal extends Object implements TerminalWindowListener
The Terminal class displays the window of the emulator. All keystrokes are sent to the host and all changes of the screen is mapped back into the terminal window.
  • Constructor Details Link icon

  • Method Details Link icon

    • addListener Link icon

      public void addListener(ITerminalListener listener)
      Adds a terminal listener.
    • removeListener Link icon

      public void removeListener(ITerminalListener listener)
      Removes a terminal listener.
    • switchProperties Link icon

      public void switchProperties(HostSession hostSession, EditorTerminalProps terminalProps)
      Switches properties.
    • getHostSession Link icon

      public HostSession getHostSession()
      Gets the HostSession.
    • getSettings Link icon

      public TerminalSettings getSettings()
      Gets the Settings container.
    • createTerminal Link icon

      public void createTerminal(Canvas canvas, TerminalStatusBar statusBar, IScreenDesigner designer)
      Creates an instance of the terminal window.
    • onActivateMenu Link icon

      public boolean onActivateMenu(boolean isPopup)
      Handles display of the pop-up window or activation of the menu bar.
      Specified by:
      onActivateMenu in interface TerminalWindowListener
      Parameters:
      isPopup - Flag indicating it's a pop-up that should be activated, as opposed to the menu bar.
      Returns:
      true if handled (i.e. menu is displayed).
    • onPopup Link icon

      public boolean onPopup(int x, int y)
      Handles display of the pop-up window.
      Specified by:
      onPopup in interface TerminalWindowListener
      Parameters:
      x - The mouse position in X relative the terminal container.
      y - The mouse position in Y relative the terminal container.
      Returns:
      true if handled (i.e. menu is displayed).
    • clear Link icon

      public void clear()
      Clears the entire screen.
    • sendKey Link icon

      public void sendKey(HostKeyEvent e)
      Sends a key to the terminal.
      Specified by:
      sendKey in interface TerminalWindowListener
      Parameters:
      e - The Host Key Event.
    • sendHostKey Link icon

      public void sendHostKey(int key)
      Sends a host key to the host. This method is only called from the "block mode" terminal emulation (HScreen, HField's or "this"), and doesn't take keyboard type-ahead into account.
      Specified by:
      sendHostKey in interface TerminalWindowListener
      Parameters:
      key - The key to send.
    • sendCharacter Link icon

      public void sendCharacter(char ch)
      Sends a character string to the terminal.
      Specified by:
      sendCharacter in interface TerminalWindowListener
      Parameters:
      ch - The character to send.
    • setCursor Link icon

      public boolean setCursor(int x, int y)
      Sets the cursor position to X/Y.
      Specified by:
      setCursor in interface TerminalWindowListener
      Parameters:
      x - The X position.
      y - The Y position.
      Returns:
      false for failure (or not supported).
    • isLocked Link icon

      public boolean isLocked()
      Checks if the terminal session is locked.
      Specified by:
      isLocked in interface TerminalWindowListener
      Returns:
      true if locked.
    • inInsertMode Link icon

      public boolean inInsertMode()
      The insert mode can be read using this method.
      Specified by:
      inInsertMode in interface TerminalWindowListener
      Returns:
      true if insert mode, false = overwrite.
    • soundAlarm Link icon

      public void soundAlarm(boolean isHostAlarm)
      Sounds the Alarm.
    • updateScreenData Link icon

      public void updateScreenData(int begin, int end)
      The screen has changed between two points in a wrapping fashion.
      Parameters:
      begin - The beginning position.
      end - The end position (inclusive).
    • updateScreenSize Link icon

      public void updateScreenSize()
      Sets the screen size from Local terminal.
    • updateCursor Link icon

      public void updateCursor(int x, int y)
      The cursor position has changed from Local terminal.
    • dispose Link icon

      public void dispose()
      Disposes of the instance.
    • hasMark Link icon

      public boolean hasMark()
      Checks if a rectangle is presently marked.
    • getMarks Link icon

      public Rectangle[] getMarks()
      Gets the rectangle presently marked.
    • removeMarks Link icon

      public void removeMarks()
      Removes the rectangle mark.
    • isDisconnected Link icon

      public boolean isDisconnected()
      Checks if disconnected, used e.g. to paint the cursor.
      Specified by:
      isDisconnected in interface TerminalWindowListener
      Returns:
      true if disconnected.
    • selectAll Link icon

      public void selectAll()
      Selects all in terminal window.
    • onMarkChange Link icon

      public void onMarkChange()
      Called when the mark changes.
      Specified by:
      onMarkChange in interface TerminalWindowListener
    • getTerminalWindow Link icon

      public TerminalWindow getTerminalWindow()
      Gets the AWT TerminalWindow container.
    • isMarkAllowed Link icon

      public boolean isMarkAllowed()
      Checks if marking is allowed, i.e. connected.
      Specified by:
      isMarkAllowed in interface TerminalWindowListener
      Returns:
      Mark allowed.
    • getCursorX Link icon

      public int getCursorX()
      Gets the cursor X.
    • getCursorY Link icon

      public int getCursorY()
      Gets the cursor X.
    • getInsertMode Link icon

      public boolean getInsertMode()
      Gets the insert mode.
    • getAttributes Link icon

      public int[] getAttributes()
      Gets the attributes for direct manipulation of underlines.