Class TerminalWindow

java.lang.Object
com.iizigo.term.internal.TerminalWindow
All Implemented Interfaces:
Runnable, EventListener, DisposeListener, FocusListener, KeyListener, MouseListener, MouseMoveListener, PaintListener, SWTEventListener

This class creates and displays the terminal window inside a JComponent, typically a JFrame or JInternalFrame. It will create a status bar at the bottom, place the terminal window display on top and possibly with scroll bars around.

This class is used by the Clients, but also by the terminal window on the Server when running in GUI mode.

  • Constructor Details Link icon

    • TerminalWindow Link icon

      public TerminalWindow(Canvas canvas, TerminalStatusBar statusBar, IScreenDesigner designer, int cx, int cy, int x, int y, char[] cd, int[] ad, TerminalWindowListener listener, TerminalSettings settings)
      The constructor creates the child components (terminal display with possible scroll bars and the status bar. It also starts to listen to keystrokes and focus changes.
      Parameters:
      canvas - The canvas.
      statusBar - The status bar.
      designer - The designer interface.
      cx - Width.
      cy - Height.
      x - X position.
      y - Y position.
      cd - Character data.
      ad - Attribute data.
      listener - Listener.
      settings - Settings.
  • Method Details Link icon

    • setPreview Link icon

      public void setPreview(boolean doAntiAlias)
      Preview anti-alias.
      Parameters:
      doAntiAlias - Flag to perform anti-alias or not.
    • getScreenWidth Link icon

      public int getScreenWidth()
      Gets the screenWidth.
      Returns:
      The screen width.
    • getScreenHeight Link icon

      public int getScreenHeight()
      Gets the screenHeight.
      Returns:
      The screen height.
    • getTopMargin Link icon

      public int getTopMargin()
      Gets the top margin.
      Returns:
      The top margin.
    • getLeftMargin Link icon

      public int getLeftMargin()
      Gets the left margin.
      Returns:
      The left margin.
    • getFontWidth Link icon

      public int getFontWidth()
      Gets the font width.
      Returns:
      The font width in pixels.
    • getFontHeight Link icon

      public int getFontHeight()
      Gets the font height.
      Returns:
      The font height in pixels.
    • keyPressed Link icon

      public void keyPressed(KeyEvent e)
      Key pressed.
      Specified by:
      keyPressed in interface KeyListener
      Parameters:
      e - The KeyEvent.
    • doKeyPressed Link icon

      public void doKeyPressed(KeyEvent e)
      Key pressed.
      Parameters:
      e - The KeyEvent.
    • keyReleased Link icon

      public void keyReleased(KeyEvent e)
      Key released.
      Specified by:
      keyReleased in interface KeyListener
      Parameters:
      e - The KeyEvent.
    • doKeyReleased Link icon

      public void doKeyReleased(KeyEvent e)
      Key released.
      Parameters:
      e - The KeyEvent.
    • getCursorPoint Link icon

      public Point getCursorPoint()
      Gets the current point of the cursor relative the "frame".
    • setCapture Link icon

      public void setCapture(boolean on)
      Sets mouse capture.
    • mouseDown Link icon

      public void mouseDown(MouseEvent e)
      Mouse pressed.
      Specified by:
      mouseDown in interface MouseListener
    • doMouseDown Link icon

      public void doMouseDown(MouseEvent e)
      Mouse pressed.
    • mouseDoubleClick Link icon

      public void mouseDoubleClick(MouseEvent e)
      Mouse double-click.
      Specified by:
      mouseDoubleClick in interface MouseListener
    • doMouseDoubleClick Link icon

      public void doMouseDoubleClick(MouseEvent e)
      Mouse double-click, continued.
    • mouseUp Link icon

      public void mouseUp(MouseEvent e)
      Mouse released.
      Specified by:
      mouseUp in interface MouseListener
    • doMouseUp Link icon

      public void doMouseUp(MouseEvent e)
      Mouse released, continued.
    • mouseMove Link icon

      public void mouseMove(MouseEvent e)
      Mouse move.
      Specified by:
      mouseMove in interface MouseMoveListener
    • addMark Link icon

      public void addMark(int x, int y, int cx, int cy)
      Adds a mark.
    • addMark Link icon

      public void addMark(Rectangle mark)
      Adds a mark.
    • removeMark Link icon

      public boolean removeMark(int x, int y, int cx, int cy)
      Removes a mark.
      Returns:
      true for success, false if not found.
    • widgetDisposed Link icon

      public void widgetDisposed(DisposeEvent e)
      Dispose listener.
      Specified by:
      widgetDisposed in interface DisposeListener
    • paintControl Link icon

      public void paintControl(PaintEvent e)
      The paint listener.
      Specified by:
      paintControl in interface PaintListener
    • onNewSize Link icon

      public void onNewSize(int cx, int cy)
      Called when a new size is set.
    • computeSize Link icon

      public Point computeSize(int wHint, int hHint)
      Gets the minimum size without scroll bars.
    • repaint Link icon

      public void repaint()
      Repaint entire area now.
    • update Link icon

      public void update()
      Updates the terminal window now, after a repaint.
    • getCursorLocation Link icon

      public Point getCursorLocation()
      Gets the current pointer position relative canvas.
    • repaintPixelRect Link icon

      public void repaintPixelRect(Rectangle r)
      The repaint a rectangle, later.
    • repaintPixelRect Link icon

      public void repaintPixelRect(int x, int y, int cx, int cy)
      The repaint a rectangle, later.
    • repaintCharRect Link icon

      public void repaintCharRect(Rectangle r)
      Repaints one or two rectangles in character scaling.
    • repaintCharRect Link icon

      public void repaintCharRect(int x, int y, int cx, int cy)
      Repaints one or two rectangles in character scaling.
    • setFocusProcessing Link icon

      public void setFocusProcessing(boolean on)
      setIgnoreFocusTime
    • focusGained Link icon

      public void focusGained(FocusEvent e)
      Focus gained.
      Specified by:
      focusGained in interface FocusListener
    • focusLost Link icon

      public void focusLost(FocusEvent e)
      Focus is lost.
      Specified by:
      focusLost in interface FocusListener
    • setMoveSize Link icon

      public void setMoveSize(boolean on)
      Call to set moving/sizing in order to skip cursor drawing.
    • run Link icon

      public void run()
      The action performed is actually a timer message and causes the cursor to flash.
      Specified by:
      run in interface Runnable
    • setCursorVisible Link icon

      public boolean setCursorVisible(boolean on)
      Shows or hides the cursor for a session.
    • repaintText Link icon

      public void repaintText(int beginPos, int endPos)
      Change of character/color data between two positions.
    • setInsertMode Link icon

      public void setInsertMode(boolean on)
      Sets the insert mode indicator.
    • hasMark Link icon

      public boolean hasMark()
      Get the current selected mark.
      Returns:
      Rectangle
    • hasSingleMark Link icon

      public boolean hasSingleMark()
      Check for a single mark.
      Returns:
      Rectangle
    • getMarks Link icon

      public Rectangle[] getMarks()
      Get the current selected marks.
      Returns:
      Rectangle array.
    • setScreenSize Link icon

      public void setScreenSize(int cx, int cy, char[] cd, int[] ad)
      Sets the current screen size.
    • getFontName Link icon

      public String getFontName()
      Gets the font name used.
    • setShowHiddenText Link icon

      public void setShowHiddenText(boolean on)
      Sets showing of hidden text.