Package com.iizigo.term.internal
Class TerminalWindow
java.lang.Object
com.iizigo.term.internal.TerminalWindow
- All Implemented Interfaces:
- Runnable,- EventListener,- DisposeListener,- FocusListener,- KeyListener,- MouseListener,- MouseMoveListener,- PaintListener,- SWTEventListener
public class TerminalWindow extends Object implements FocusListener, KeyListener, MouseListener, MouseMoveListener, PaintListener, DisposeListener, Runnable
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 SummaryConstructorsConstructorDescription- 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.
- Method SummaryModifier and TypeMethodDescription- void- addMark- (int x, int y, int cx, int cy) Adds a mark.- voidAdds a mark.- computeSize- (int wHint, int hHint) Gets the minimum size without scroll bars.- voidKey pressed.- voidKey released.- voidMouse double-click, continued.- voidMouse pressed.- voidMouse released, continued.- voidFocus gained.- voidFocus is lost.Gets the current pointer position relative canvas.Gets the current point of the cursor relative the "frame".- intGets the font height.Gets the font name used.- intGets the font width.- intGets the left margin.- getMarks()Get the current selected marks.- intGets the screenHeight.- intGets the screenWidth.- intGets the top margin.- boolean- hasMark()Get the current selected mark.- booleanCheck for a single mark.- voidKey pressed.- voidKey released.- voidMouse double-click.- voidMouse pressed.- voidMouse move.- voidMouse released.- void- onNewSize- (int cx, int cy) Called when a new size is set.- voidThe paint listener.- boolean- removeMark- (int x, int y, int cx, int cy) Removes a mark.- void- repaint()Repaint entire area now.- void- repaintCharRect- (int x, int y, int cx, int cy) Repaints one or two rectangles in character scaling.- voidRepaints one or two rectangles in character scaling.- void- repaintPixelRect- (int x, int y, int cx, int cy) The repaint a rectangle, later.- voidThe repaint a rectangle, later.- void- repaintText- (int beginPos, int endPos) Change of character/color data between two positions.- void- run()The action performed is actually a timer message and causes the cursor to flash.- void- setCapture- (boolean on) Sets mouse capture.- boolean- setCursorVisible- (boolean on) Shows or hides the cursor for a session.- void- setFocusProcessing- (boolean on) setIgnoreFocusTime- void- setInsertMode- (boolean on) Sets the insert mode indicator.- void- setMoveSize- (boolean on) Call to set moving/sizing in order to skip cursor drawing.- void- setPreview- (boolean doAntiAlias) Preview anti-alias.- void- setScreenSize- (int cx, int cy, char[] cd, int[] ad) Sets the current screen size.- void- setShowHiddenText- (boolean on) Sets showing of hidden text.- void- update()Updates the terminal window now, after a repaint.- voidDispose listener.
- Constructor Details- TerminalWindowpublic 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- setPreviewpublic void setPreview- (boolean doAntiAlias) Preview anti-alias.- Parameters:
- doAntiAlias- Flag to perform anti-alias or not.
 
- getScreenWidthpublic int getScreenWidth()Gets the screenWidth.- Returns:
- The screen width.
 
- getScreenHeightpublic int getScreenHeight()Gets the screenHeight.- Returns:
- The screen height.
 
- getTopMarginpublic int getTopMargin()Gets the top margin.- Returns:
- The top margin.
 
- getLeftMarginpublic int getLeftMargin()Gets the left margin.- Returns:
- The left margin.
 
- getFontWidthpublic int getFontWidth()Gets the font width.- Returns:
- The font width in pixels.
 
- getFontHeightpublic int getFontHeight()Gets the font height.- Returns:
- The font height in pixels.
 
- keyPressedKey pressed.- Specified by:
- keyPressedin interface- KeyListener
- Parameters:
- e- The KeyEvent.
 
- doKeyPressedKey pressed.- Parameters:
- e- The KeyEvent.
 
- keyReleasedKey released.- Specified by:
- keyReleasedin interface- KeyListener
- Parameters:
- e- The KeyEvent.
 
- doKeyReleasedKey released.- Parameters:
- e- The KeyEvent.
 
- getCursorPointGets the current point of the cursor relative the "frame".
- setCapturepublic void setCapture- (boolean on) Sets mouse capture.
- mouseDownMouse pressed.- Specified by:
- mouseDownin interface- MouseListener
 
- doMouseDownMouse pressed.
- mouseDoubleClickMouse double-click.- Specified by:
- mouseDoubleClickin interface- MouseListener
 
- doMouseDoubleClickMouse double-click, continued.
- mouseUpMouse released.- Specified by:
- mouseUpin interface- MouseListener
 
- doMouseUpMouse released, continued.
- mouseMoveMouse move.- Specified by:
- mouseMovein interface- MouseMoveListener
 
- addMarkpublic void addMark- (int x, int y, int cx, int cy) Adds a mark.
- addMarkAdds a mark.
- removeMarkpublic boolean removeMark- (int x, int y, int cx, int cy) Removes a mark.- Returns:
- true for success, false if not found.
 
- widgetDisposedDispose listener.- Specified by:
- widgetDisposedin interface- DisposeListener
 
- paintControlThe paint listener.- Specified by:
- paintControlin interface- PaintListener
 
- onNewSizepublic void onNewSize- (int cx, int cy) Called when a new size is set.
- computeSizeGets the minimum size without scroll bars.
- repaintpublic void repaint()Repaint entire area now.
- updatepublic void update()Updates the terminal window now, after a repaint.
- getCursorLocationGets the current pointer position relative canvas.
- repaintPixelRectThe repaint a rectangle, later.
- repaintPixelRectpublic void repaintPixelRect- (int x, int y, int cx, int cy) The repaint a rectangle, later.
- repaintCharRectRepaints one or two rectangles in character scaling.
- repaintCharRectpublic void repaintCharRect- (int x, int y, int cx, int cy) Repaints one or two rectangles in character scaling.
- setFocusProcessingpublic void setFocusProcessing- (boolean on) setIgnoreFocusTime
- focusGainedFocus gained.- Specified by:
- focusGainedin interface- FocusListener
 
- focusLostFocus is lost.- Specified by:
- focusLostin interface- FocusListener
 
- setMoveSizepublic void setMoveSize- (boolean on) Call to set moving/sizing in order to skip cursor drawing.
- runpublic void run()The action performed is actually a timer message and causes the cursor to flash.
- setCursorVisiblepublic boolean setCursorVisible- (boolean on) Shows or hides the cursor for a session.
- repaintTextpublic void repaintText- (int beginPos, int endPos) Change of character/color data between two positions.
- setInsertModepublic void setInsertMode- (boolean on) Sets the insert mode indicator.
- hasMarkpublic boolean hasMark()Get the current selected mark.- Returns:
- Rectangle
 
- hasSingleMarkpublic boolean hasSingleMark()Check for a single mark.- Returns:
- Rectangle
 
- getMarksGet the current selected marks.- Returns:
- Rectangle array.
 
- setScreenSizepublic void setScreenSize- (int cx, int cy, char[] cd, int[] ad) Sets the current screen size.
- getFontNameGets the font name used.
- setShowHiddenTextpublic void setShowHiddenText- (boolean on) Sets showing of hidden text.