public class HostScreen extends Object implements PaintInterface
Modifier and Type | Field and Description |
---|---|
static int |
ATTR_BLINK
Blink attribute.
|
static int |
ATTR_BOLD
Bold attribute.
|
static int |
ATTR_UNDERLINE
Underline attribute.
|
static Color[] |
cgaColors
The 16 CGA colors.
|
Constructor and Description |
---|
HostScreen(HostSessionManagerListener listener,
Container terminalFrame,
Container container,
TerminalWindowListener mgr,
String mw,
String im,
String ii,
String caps,
String num)
Creates a new screen of size 80 x 25.
|
HostScreen(HostSessionManagerListener listener,
JInternalFrame iframe,
HostSessionManager mgr)
Creates a new screen of size 80 x 25.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(ClientSession newListener)
Add an additional listener
|
void |
analyzePopupWindows()
Analyzes the host pop-up windows.
|
void |
appendScreen(Transaction t)
Adds the entire host screen definition in a transaction that will
cause the client to display a new terminal window.
|
boolean |
appendScreenNoLock(Transaction t)
Adds the entire host screen definition in a transaction that will
cause the client to display a new terminal window.
|
void |
clear()
Clears the entire screen.
|
boolean |
doesScreenMatch(PhantomHostScreen phantomScreen)
Checks if a host screen currently matches.
|
Vector<Integer> |
getAllPopupWindows()
Gets all the pop-up windows.
|
char |
getCharAbsolute(int pos)
Gets a character from a position.
|
char |
getCharAbsolute(int xx,
int yy)
Gets a character from a X/Y position.
|
char[] |
getCharacters()
Gets the character data for the screen.
|
int |
getColorAbsolute(int pos)
Gets a CGA color from a position.
|
int |
getColorAbsolute(int xx,
int yy)
Gets a CGA color from a position.
|
int |
getColorRelative(int xx,
int yy)
Gets the CGA color from a relative position.
|
Vector<Integer> |
getContainingPopupWindows(HostPopupWindow.Rect rect)
Gets the pop-up windows that match (= contain, but is not identical) the indicated rectangle.
|
HostPopupWindow.Rect |
getCurrentPopupWindow()
Gets the current host pop-up window.
|
int |
getCurrentPopupWindowXOffset()
Gets the current offset in X for a pop-up window.
|
int |
getCurrentPopupWindowYOffset()
Gets the current offset in Y for a pop-up window.
|
Point |
getCursorAbsolute()
Gets the current absolute cursor position on the screen, without
taking into account any current host pop-up window.
|
Vector<Integer> |
getCursorContainingPopupWindows()
Gets the pop-up windows that match (= contain) the current cursor position.
|
Point |
getCursorRelative()
Gets the current relative cursor position on the screen,
taking into account any current host pop-up window.
|
HostField |
getFieldAbsolute(int pos)
Gets a host field from a position.
|
HostField |
getFieldAbsolute(int x,
int y)
Gets the host field from a X/Y position.
|
HostField |
getFieldRelative(int x,
int y)
Gets the host field from a X/Y position relative to the
current pop-up window.
|
HostFields |
getFields()
Gets all the host fields.
|
HostField |
getFirstFieldAbsolute(int pos)
Gets the first host field from a position.
|
HostField |
getFirstFieldAbsolute(int x,
int y)
Gets the first host field from a X/Y position.
|
HostField |
getFirstFieldRelative(int x,
int y)
Gets the first host field from a X/Y position.
|
int |
getHeight()
Gets the height of the screen.
|
String |
getHiddenStringAbsolute(int xx,
int yy,
int length)
Gets a text string from host at an absolute position on the screen.
|
String |
getHiddenStringRelative(int xx,
int yy,
int length)
Gets a text string from host at a relative position.
|
Object |
getLockObject()
Gets the lock object for thread synchronization.
|
HostPopupWindow.Rect |
getPopupWindow(int index)
Gets a pop-up window.
|
int |
getPopupWindowCount()
Checks how many pop-up windows exist.
|
String |
getScreenChars()
Gets the entire screen, blanking out hidden characters and replacing box drawing
characters (to +-|) and null (to space).
|
Dimension |
getSize()
Gets the current screen size.
|
String |
getStringAbsolute(int xx,
int yy,
int length)
Gets a text string from host at an absolute position on the screen.
|
String |
getStringAbsolute(int xx,
int yy,
int length,
boolean doGetHidden)
Gets a text string from host at an absolute position on the screen.
|
String |
getStringRelative(int xx,
int yy,
int length)
Gets a text string from host at a relative position.
|
String |
getStringRelative(int xx,
int yy,
int length,
boolean doGetHidden)
Gets a text string from host at a relative position.
|
TerminalWindow |
getTerminalWindow()
Gets the terminal window (if in GUI mode, otherwise null).
|
int |
getWidth()
Gets the width of the screen.
|
boolean |
isEmpty()
Checks if all characters on the screen (except the last line) are spaces.
|
boolean |
isFieldFormatted()
Checks if this host screen is field formatted.
|
static boolean |
isHiddenTextDisplayed()
Checks if hidden characters are displayed for debugging purposes.
|
char |
mapBoxChar(char ch,
int pos)
Routine to map special Unicode box drawing characters to printable Ansi "+-|" characters.
|
void |
onHostScreenChange(HostSession hostSession,
int beginPos,
int endPos)
Gets new character and attribute data from the host session.
|
void |
paint(Graphics g,
TerminalWindow tw,
int leftMargin,
int topMargin,
int cxFont,
int cyFont)
Paints the emulator window.
|
void |
removeListener(ClientSession oldListener)
Remove the additional listener
|
void |
repaint()
This method is to be called whenever the host fields and/or the
host pop-up windows have changed.
|
void |
setCurrentPopupWindow(int index)
Sets the current pop-up window.
|
void |
setCursor(int x,
int y)
Changes cursor position.
|
void |
setSize(int cx,
int cy)
Sets the current screen size.
|
void |
writeString(int x,
int y,
String s,
int attr)
Writes a text string at a position.
|
public static final int ATTR_BOLD
public static final int ATTR_BLINK
public static final int ATTR_UNDERLINE
public static Color[] cgaColors
public HostScreen(HostSessionManagerListener listener, JInternalFrame iframe, HostSessionManager mgr)
public HostScreen(HostSessionManagerListener listener, Container terminalFrame, Container container, TerminalWindowListener mgr, String mw, String im, String ii, String caps, String num)
public static boolean isHiddenTextDisplayed()
public void addListener(ClientSession newListener)
newListener
- public void removeListener(ClientSession oldListener)
oldListener
- public Object getLockObject()
public void paint(Graphics g, TerminalWindow tw, int leftMargin, int topMargin, int cxFont, int cyFont)
paint
in interface PaintInterface
public void repaint()
public void clear()
public void analyzePopupWindows()
public int getPopupWindowCount()
public HostPopupWindow.Rect getPopupWindow(int index)
public Vector<Integer> getCursorContainingPopupWindows()
public Vector<Integer> getContainingPopupWindows(HostPopupWindow.Rect rect)
public Vector<Integer> getAllPopupWindows()
public int getCurrentPopupWindowXOffset()
public int getCurrentPopupWindowYOffset()
public HostPopupWindow.Rect getCurrentPopupWindow()
public void setCurrentPopupWindow(int index)
public void setSize(int cx, int cy)
public void setCursor(int x, int y)
public void writeString(int x, int y, String s, int attr)
public void onHostScreenChange(HostSession hostSession, int beginPos, int endPos)
public final Dimension getSize()
public char[] getCharacters()
Note: While using the returned data, the host screen *must* be synchronized.
public int getWidth()
public int getHeight()
public HostFields getFields()
public boolean isFieldFormatted()
public HostField getFieldAbsolute(int pos)
public HostField getFieldAbsolute(int x, int y)
public HostField getFieldRelative(int x, int y)
public HostField getFirstFieldAbsolute(int pos)
public HostField getFirstFieldAbsolute(int x, int y)
public HostField getFirstFieldRelative(int x, int y)
public char getCharAbsolute(int pos)
public char getCharAbsolute(int xx, int yy)
public int getColorAbsolute(int pos)
public int getColorAbsolute(int xx, int yy)
public int getColorRelative(int xx, int yy)
public String getStringAbsolute(int xx, int yy, int length)
public String getStringAbsolute(int xx, int yy, int length, boolean doGetHidden)
public String getHiddenStringAbsolute(int xx, int yy, int length)
public String getStringRelative(int xx, int yy, int length)
public String getStringRelative(int xx, int yy, int length, boolean doGetHidden)
public String getHiddenStringRelative(int xx, int yy, int length)
public boolean isEmpty()
public Point getCursorAbsolute()
public Point getCursorRelative()
public void appendScreen(Transaction t)
public boolean appendScreenNoLock(Transaction t)
public boolean doesScreenMatch(PhantomHostScreen phantomScreen)
public TerminalWindow getTerminalWindow()
public char mapBoxChar(char ch, int pos)
public String getScreenChars()
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.