com.sshtools.terminal
Interface VDUDisplay

All Known Implementing Classes:
AWTTerminalPanel, SwingTerminalPanel

public interface VDUDisplay

Interface for implementations of a component that will do the actual drawing of the terminal screen. Currently this must be an instance of a Component so it can be added to a VirtualTerminal implementation.

Author:
$Author: brett $

Field Summary
static int BACKGROUND_IMAGE_CENTERED
           
static int BACKGROUND_IMAGE_FILL
           
static int BACKGROUND_IMAGE_SCALED
           
static int BACKGROUND_IMAGE_TILED
           
static int CURSOR_BLOCK
          Solid block cursor style
static int CURSOR_LINE
          Underline cursor style
static int FORWARD_AUTO_SCROLL
           
static int NO_AUTO_SCROLL
          Autoscroll types
static int NO_BACKGROUND_IMAGE
          Background image types
static int RESIZE_FONT
           
static int RESIZE_NONE
           
static int RESIZE_SCREEN
           
static int REVERSE_AUTO_SCROLL
           
 
Method Summary
 void focusTerminal()
          Terminal component requests focus
 java.awt.Color getBackground()
          Get the background color
 int getCharacterColumns(char ch)
          Get the number of columns the supplied unicode character will take up on this terminal.
 java.awt.Component getComponent()
          Get the component.
 int getCursorStyle()
           Get the cursor style.
 int getResizeStrategy()
          Return the current resize strategy.
 VDUScrollBar getScrollBar()
          Get the scrollbar (if any) that this display is using
 java.lang.String getSelection()
          Return the currently selected text from the terminal.
 java.awt.Font getTerminalFont()
          Get the terminal font
 VDUBuffer getVDUBuffer()
          Get the current buffer
 void init(VDUBuffer buffer)
          Initialise the display.
 void interruptBlink()
          Interupt the blink (make it 'on' for another cycle)
 boolean isCenter()
          Get whether or not to keep the display central when resizing occurs
 boolean isCursorBlink()
          Get whether the cursor shoud blink or not.
 boolean isReverseVideo()
          Get whether reverse video is currently enabled
 void recalculateFontAndDisplaySize()
          Recalculate the font size and the size of the display.
 void redisplay()
          Redisplay everything, including resizing the display if necessary.
 void redraw()
          Implement to redraw the terminal screen from the current buffer
 void resizeFont(int w, int h)
          Resize the font to best match the given size
 void scrollTo(int position)
          Set the scroll bar position and scroll the display
 void selectScreen()
          Select the entire screen
 void setBackgroundImage(java.awt.Image backgroundImage)
          Set the background image
 void setBackgroundImageType(int backgroundImageType)
          Set the type of background image
 void setCenter(boolean center)
          Set whether or not to keep the display central when resizing occurs
 void setColorPrinting(boolean colorPrinting)
          Set whether colors should be printed.
 void setCursorBlink(boolean blink)
          Set whether the cursor shoud blink or not.
 void setCursorColors(java.awt.Color foreground, java.awt.Color background)
          Set the cursor colors.
 void setCursorStyle(int cursorStyle)
           Set the cursor style.
 void setDefaultBackground(java.awt.Color color)
          Set the default background color of the terminal
 void setDefaultForeground(java.awt.Color color)
          Set the default background color of the terminal
 void setMouseWheelIncrement(int i)
          Set the mouse wheel increment in lines.
 void setResizeStrategy(int resizeStrategy)
           Set the resize strategy.
 void setReverseVideo(boolean reverseVideo)
          Set whether reverse video is enabled
 void setScrollBar(VDUScrollBar scrollBar)
          Set the scrollbar (or null for no scrollbar) that this display should use.
 void setSelectionXOR(java.awt.Color selectionXOR)
          Set XOR color to use the current selection.
 void setSetClipboardOnSelect(boolean setClipboardOnSelect)
          Set whether or not to set the clipboard upon selection
 void setTerminalFont(java.awt.Font font)
          Set the default font
 void setVDUBuffer(VDUBuffer buffer)
          Set the current buffer
 

Field Detail

NO_AUTO_SCROLL

static final int NO_AUTO_SCROLL
Autoscroll types

See Also:
Constant Field Values

FORWARD_AUTO_SCROLL

static final int FORWARD_AUTO_SCROLL
See Also:
Constant Field Values

REVERSE_AUTO_SCROLL

static final int REVERSE_AUTO_SCROLL
See Also:
Constant Field Values

NO_BACKGROUND_IMAGE

static final int NO_BACKGROUND_IMAGE
Background image types

See Also:
Constant Field Values

BACKGROUND_IMAGE_CENTERED

static final int BACKGROUND_IMAGE_CENTERED
See Also:
Constant Field Values

BACKGROUND_IMAGE_FILL

static final int BACKGROUND_IMAGE_FILL
See Also:
Constant Field Values

BACKGROUND_IMAGE_SCALED

static final int BACKGROUND_IMAGE_SCALED
See Also:
Constant Field Values

BACKGROUND_IMAGE_TILED

static final int BACKGROUND_IMAGE_TILED
See Also:
Constant Field Values

CURSOR_BLOCK

static final int CURSOR_BLOCK
Solid block cursor style

See Also:
Constant Field Values

CURSOR_LINE

static final int CURSOR_LINE
Underline cursor style

See Also:
Constant Field Values

RESIZE_NONE

static final int RESIZE_NONE
See Also:
Constant Field Values

RESIZE_FONT

static final int RESIZE_FONT
See Also:
Constant Field Values

RESIZE_SCREEN

static final int RESIZE_SCREEN
See Also:
Constant Field Values
Method Detail

setSetClipboardOnSelect

void setSetClipboardOnSelect(boolean setClipboardOnSelect)
Set whether or not to set the clipboard upon selection


setCursorStyle

void setCursorStyle(int cursorStyle)

Set the cursor style. Can be one of :-


getCursorStyle

int getCursorStyle()

Get the cursor style. Can be one of :-


setCursorBlink

void setCursorBlink(boolean blink)
Set whether the cursor shoud blink or not.

Parameters:
blink - cursor blink

interruptBlink

void interruptBlink()
Interupt the blink (make it 'on' for another cycle)


isCursorBlink

boolean isCursorBlink()
Get whether the cursor shoud blink or not.

Returns:
blink cursor

setCursorColors

void setCursorColors(java.awt.Color foreground,
                     java.awt.Color background)
Set the cursor colors. null means default to text color.

Parameters:
foreground - cursor foreground
background - cursor background

getSelection

java.lang.String getSelection()
Return the currently selected text from the terminal.

Returns:
selected text

setResizeStrategy

void setResizeStrategy(int resizeStrategy)
                       throws java.lang.IllegalArgumentException

Set the resize strategy. Can be one of :-

Parameters:
resizeStrategy - resize strategy
Throws:
java.lang.IllegalArgumentException - if implementation doesnt support the specified strategy

setColorPrinting

void setColorPrinting(boolean colorPrinting)
Set whether colors should be printed.

Parameters:
colorPrinting - color printing

redraw

void redraw()
Implement to redraw the terminal screen from the current buffer


setVDUBuffer

void setVDUBuffer(VDUBuffer buffer)
Set the current buffer

Parameters:
buffer - buffer

getVDUBuffer

VDUBuffer getVDUBuffer()
Get the current buffer

Returns:
buffer

init

void init(VDUBuffer buffer)
Initialise the display.

Parameters:
buffer - buffer

getComponent

java.awt.Component getComponent()
Get the component. This will be added to container applications UI.

Returns:
VDU display component

getScrollBar

VDUScrollBar getScrollBar()
Get the scrollbar (if any) that this display is using

Returns:
scrollbar

setScrollBar

void setScrollBar(VDUScrollBar scrollBar)
Set the scrollbar (or null for no scrollbar) that this display should use.

Parameters:
scrollBar - scrollbar

redisplay

void redisplay()
Redisplay everything, including resizing the display if necessary.


getResizeStrategy

int getResizeStrategy()
Return the current resize strategy. Can be one of :-

Returns:
resize strategy

setMouseWheelIncrement

void setMouseWheelIncrement(int i)
Set the mouse wheel increment in lines. I.e., if the user scrolls 3 clicks and the increment is 2, then the terminal display will be scrolled 6 lines.

Parameters:
i - mouse wheel increment

setDefaultBackground

void setDefaultBackground(java.awt.Color color)
Set the default background color of the terminal

Parameters:
color - default background color

setDefaultForeground

void setDefaultForeground(java.awt.Color color)
Set the default background color of the terminal

Parameters:
color - default background color

setTerminalFont

void setTerminalFont(java.awt.Font font)
Set the default font

Parameters:
font - default font

getTerminalFont

java.awt.Font getTerminalFont()
Get the terminal font

Returns:
terminal font

focusTerminal

void focusTerminal()
Terminal component requests focus


isReverseVideo

boolean isReverseVideo()
Get whether reverse video is currently enabled

Returns:
reverse video

setReverseVideo

void setReverseVideo(boolean reverseVideo)
Set whether reverse video is enabled

Parameters:
reverseVideo - reverse video

recalculateFontAndDisplaySize

void recalculateFontAndDisplaySize()
Recalculate the font size and the size of the display. Invoked when a screen resize event occurs.


resizeFont

void resizeFont(int w,
                int h)
Resize the font to best match the given size

Parameters:
w - width
h - height

setCenter

void setCenter(boolean center)
Set whether or not to keep the display central when resizing occurs

Parameters:
center - center display

isCenter

boolean isCenter()
Get whether or not to keep the display central when resizing occurs

Returns:
center display

scrollTo

void scrollTo(int position)
Set the scroll bar position and scroll the display

Parameters:
position - scroll bar position

setBackgroundImageType

void setBackgroundImageType(int backgroundImageType)
Set the type of background image

Parameters:
backgroundImageType - background image type

setBackgroundImage

void setBackgroundImage(java.awt.Image backgroundImage)
Set the background image

Parameters:
backgroundImage - background image

selectScreen

void selectScreen()
Select the entire screen


getBackground

java.awt.Color getBackground()
Get the background color

Returns:
background color

setSelectionXOR

void setSelectionXOR(java.awt.Color selectionXOR)
Set XOR color to use the current selection. By default, this will either by the terminal foreground color (if reverse video) or the terminal background color (if not reverse video).

Set to null to reverse to the default behaviour.

Parameters:
selectionXOR - selection XOR color

getCharacterColumns

int getCharacterColumns(char ch)
Get the number of columns the supplied unicode character will take up on this terminal.

Parameters:
character - columns
Returns:
number of colums


Copyright © 2003-2004 3SP LTD. All Rights Reserved.