Package com.iizix.term
Class HostScreen
java.lang.Object
com.iizix.term.HostScreen
This class does everything required for a host screen.
- Author:
- Christopher Mindus
- Field SummaryFieldsModifier and TypeFieldDescription- static final intBlink attribute.- static final intBold attribute.- static final intUnderline attribute.
- Constructor SummaryConstructors
- Method SummaryModifier and TypeMethodDescription- void- addListener- (HostScreenListener newListener) Add an additional owner- voidAnalyzes the host pop-up windows.- void- append- (SendTransaction trans, boolean doFields, boolean doPopupWindows) Appends the host fields and possibly the pop-up windows.- voidAdds 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.- int[]Gets the attribute data for the screen.- 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[]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.Gets the current host pop-up window.- intGets the current index of the pop-up window.- intGets the current offset in X for a pop-up window.- intGets the current offset in Y for a pop-up window.Gets the current absolute cursor position on the screen, without taking into account any current host pop-up window.Gets the current relative cursor position on the screen, taking into account any current host pop-up window.- getFieldAbsolute- (int pos) Gets a host field from a position.- getFieldAbsolute- (int x, int y) Gets the host field from a X/Y position.- getFieldRelative- (int x, int y) Gets the host field from a X/Y position relative to the current pop-up window.Gets all the host fields.- getFirstFieldAbsolute- (int pos) Gets the first host field from a position.- getFirstFieldAbsolute- (int x, int y) Gets the first host field from a X/Y position.- getFirstFieldRelative- (int x, int y) Gets the first host field from a X/Y position.- intGets the height of the screen.- getHiddenStringAbsolute- (int xx, int yy, int length) Gets a text string from host at an absolute position on the screen.- getHiddenStringRelative- (int xx, int yy, int length) Gets a text string from host at a relative position.- int- getLengthExclusive- (int beginPos, int endPos) Calculates the length between two positions with support for screen wrapping.- int- getLengthExclusive- (int xBegin, int yBegin, int xEnd, int yEnd) Calculates the length between two positions with support for screen wrapping.- int- getLengthInclusive- (int beginPos, int endPos) Calculates the length between two positions with support for screen wrapping.- int- getLengthInclusive- (int xBegin, int yBegin, int xEnd, int yEnd) Calculates the length between two positions with support for screen wrapping.The lock object to synchronize on when processing e.g.- getPopupWindow- (int index) Gets the pop-up window at an index.- intChecks how many pop-up windows exist.- Rect[]Gets the pop-up windows.- int- getPosition- (int x, int y) Gets the position.Gets the entire screen, blanking out hidden characters and replacing box drawing characters (to +-|) and null (to space).- getStringAbsolute- (int xx, int yy, int length) Gets a text string from host at an absolute position on the screen.- getStringAbsolute- (int xx, int yy, int length, boolean doGetHidden) Gets a text string from host at an absolute position on the screen.- getStringRelative- (int xx, int yy, int length) Gets a text string from host at a relative position.- getStringRelative- (int xx, int yy, int length, boolean doGetHidden) Gets a text string from host at a relative position.- int- getWidth()Gets the width of the screen.- void- initialize- (ReadTransaction trans) Initializes the host fields and/or the pop-up windows from a transaction.- boolean- isEmpty()Checks if all characters on the screen (except the last line) are spaces.- booleanChecks if this host screen is field formatted.- 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- removeListener- (HostScreenListener oldListener) Remove the additional owner- 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.
- Field Details- ATTR_BOLDpublic static final int ATTR_BOLDBold attribute.- See Also:
 
- ATTR_BLINKpublic static final int ATTR_BLINKBlink attribute.- See Also:
 
- ATTR_UNDERLINEpublic static final int ATTR_UNDERLINEUnderline attribute.- See Also:
 
 
- Constructor Details- HostScreenpublic HostScreen()Creates a new screen of size 80 x 24.
 
- Method Details- getLockObjectThe lock object to synchronize on when processing e.g. screen identifications, used when the host session will update the screen in blocks in a separate thread.
- addListenerAdd an additional owner- Parameters:
- newListener- The listener.
 
- removeListenerRemove the additional owner- Parameters:
- oldListener- The listener.
 
- clearpublic void clear()Clears the entire screen.
- analyzePopupWindowspublic void analyzePopupWindows()Analyzes the host pop-up windows.
- getPopupWindowCountpublic int getPopupWindowCount()Checks how many pop-up windows exist.
- getPopupWindowsGets the pop-up windows. Do not modify the rectangles returned!
- getPopupWindowGets the pop-up window at an index.- Returns:
- null if index is out of range.
 
- getCurrentPopupWindowXOffsetpublic int getCurrentPopupWindowXOffset()Gets the current offset in X for a pop-up window.
- getCurrentPopupWindowYOffsetpublic int getCurrentPopupWindowYOffset()Gets the current offset in Y for a pop-up window.
- getCurrentPopupWindowGets the current host pop-up window.- Returns:
- null if none exists or none has been set.
 
- getCurrentPopupWindowIndexpublic int getCurrentPopupWindowIndex()Gets the current index of the pop-up window.- Returns:
- The index, or -1 for none.
 
- setCurrentPopupWindowpublic void setCurrentPopupWindow- (int index) Sets the current pop-up window.
- appendAppends the host fields and possibly the pop-up windows.
- initializeInitializes the host fields and/or the pop-up windows from a transaction.- Parameters:
- trans- The transaction with the information.
 
- setSizepublic void setSize- (int cx, int cy) Sets the current screen size.
- setCursorpublic void setCursor- (int x, int y) Changes cursor position.
- onHostScreenChangeGets new character and attribute data from the host session.
- getCharacterspublic char[] getCharacters()Gets the character data for the screen. This is mainly used by the screen identification process in order to be quicker.- Note: While using the returned data, the host screen *must* be synchronized. 
- getAttributespublic int[] getAttributes()Gets the attribute data for the screen. This is mainly used by the server-to-client routines to dispatch changes of screens to several listening parties.- Note: While using the returned data, the host screen *must* be synchronized. 
- getWidthpublic int getWidth()Gets the width of the screen.
- getHeightpublic int getHeight()Gets the height of the screen.
- getFieldsGets all the host fields.
- isFieldFormattedpublic boolean isFieldFormatted()Checks if this host screen is field formatted. This method is not like the one in HostSession, this one checks for presence of HostFields that the ClientSession has read from the HostSession when the worker thread has queued a host event. Use the HostSession method directly to see if any fields are present.
- getFieldAbsoluteGets a host field from a position.- Returns:
- null if no host field exists in the position.
 
- getFieldAbsoluteGets the host field from a X/Y position.- Returns:
- null if no host field exists in the position.
 
- getFieldRelativeGets the host field from a X/Y position relative to the current pop-up window.- Returns:
- null if no host field exists in the position.
 
- getFirstFieldAbsoluteGets the first host field from a position.- Returns:
- null if no host field exists in the position.
 
- getFirstFieldAbsoluteGets the first host field from a X/Y position.- Returns:
- null if no host field exists in the position.
 
- getFirstFieldRelativeGets the first host field from a X/Y position.- Returns:
- null if no host field exists in the position.
 
- getCharAbsolutepublic char getCharAbsolute- (int pos) Gets a character from a position.
- getCharAbsolutepublic char getCharAbsolute- (int xx, int yy) Gets a character from a X/Y position.
- getColorAbsolutepublic int getColorAbsolute- (int pos) Gets a CGA color from a position.
- getColorAbsolutepublic int getColorAbsolute- (int xx, int yy) Gets a CGA color from a position.
- getColorRelativepublic int getColorRelative- (int xx, int yy) Gets the CGA color from a relative position.
- getStringAbsoluteGets a text string from host at an absolute position on the screen. No provision for host pop-up windows are made. The string returns blanks for hidden characters.
- getStringAbsoluteGets a text string from host at an absolute position on the screen. No provision for host pop-up windows are made. The string returns blanks for hidden characters depending on the flag.
- getHiddenStringAbsoluteGets a text string from host at an absolute position on the screen. No provision for host pop-up windows are made.
- getStringRelativeGets a text string from host at a relative position. This position is relative to the current host pop-up window offset. The string returns blanks for hidden characters.
- getStringRelativeGets a text string from host at a relative position. This position is relative to the current host pop-up window offset. The string returns blanks for hidden characters.
- getHiddenStringRelativeGets a text string from host at a relative position. This position is relative to the current host pop-up window offset. The string returns blanks for hidden characters.
- isEmptypublic boolean isEmpty()Checks if all characters on the screen (except the last line) are spaces. This is useful during connect to a host session in order to inhibit all panel processing until the connection is done and has a non-empty screen.
- getCursorAbsoluteGets the current absolute cursor position on the screen, without taking into account any current host pop-up window.
- getCursorRelativeGets the current relative cursor position on the screen, taking into account any current host pop-up window. If no host pop-up window exists, the cursor position will be the same as the absolute cursor position.
- appendScreenAdds the entire host screen definition in a transaction that will cause the client to display a new terminal window.
- mapBoxCharpublic char mapBoxChar- (char ch, int pos) Routine to map special Unicode box drawing characters to printable Ansi "+-|" characters.
- getScreenCharsGets the entire screen, blanking out hidden characters and replacing box drawing characters (to +-|) and null (to space).
- getLengthExclusivepublic int getLengthExclusive- (int xBegin, int yBegin, int xEnd, int yEnd) Calculates the length between two positions with support for screen wrapping. The positions are excluding the ending position.
- getLengthExclusivepublic int getLengthExclusive- (int beginPos, int endPos) Calculates the length between two positions with support for screen wrapping. The positions are excluding the ending position.
- getLengthInclusivepublic int getLengthInclusive- (int xBegin, int yBegin, int xEnd, int yEnd) Calculates the length between two positions with support for screen wrapping. The positions are excluding the ending position.
- getLengthInclusivepublic int getLengthInclusive- (int beginPos, int endPos) Calculates the length between two positions with support for screen wrapping. The positions are including the ending position.
- getPositionpublic int getPosition- (int x, int y) Gets the position.