public class communicationsWindow extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
colsCurrent
The number of columns in the TextArea objects
currently.
|
protected int |
colsLarger
The number of columns in the TextArea objects if
the window is made wider.
|
protected int |
colsSmaller
The number of columns in the TextArea objects if
the window is made narrower.
|
protected int |
heightCurrent
This is the height in pixels returned by the
TextArea.getMinimumSize method for a
TextArea block rowsCurrent rows in height.
|
protected int |
heightLarger
This is the height in pixels returned by the
TextArea.getMinimumSize method for a
TextArea block rowsLarger rows in height.
|
protected int |
heightSmaller
This is the height in pixels returned by the
TextArea.getMinimumSize method for a
TextArea block rowsSmaller rows in height.
|
protected boolean |
initialized
Set to true when the objects in the window
have been initialized.
|
protected int |
rowsCurrent |
protected int |
rowsLarger |
protected int |
rowsSmaller
Used to determine the number of rows that should
be in the TextArea objects when the height of
TextArea objects is made slightly smaller.
|
protected int |
widthCurrent
The width of the TextArea objects in pixels when
they are colsCurrent columns wide.
|
protected int |
widthLarger
The width of the TextArea objects in pixels when
they are colsLarger columns wide.
|
protected int |
widthSmaller
The width of the TextArea objects in pixels when
they are colsSmaller columns wide.
|
Constructor and Description |
---|
communicationsWindow(String name) |
Modifier and Type | Method and Description |
---|---|
protected void |
addMessage(String display)
This method generates a message and adds it to the
log and the Sys.output character stream.
|
int |
getDebugLevel() |
protected void |
processKey(KeyEvent e)
This function is called whenever a key is pressed.
|
protected void |
sendMessage()
This method is called when the Send button is depressed
on the form
or the user depresses the Return key on the keyboard.
|
void |
setDebugLevel(int level)
This method is used to control the amount of diagnostic
messages generated.
|
void |
start(Socket inputSock)
This is the main method for creating the communications
window and setting up the communications stream.
|
protected void |
windowResizer()
This method is called when the window is resized.
|
protected int colsSmaller
protected int colsCurrent
protected int colsLarger
protected int widthSmaller
protected int widthCurrent
protected int widthLarger
protected int rowsSmaller
The TextArea.getMinimumSize method is applied to an object eight rows taller than the topWindow object. This allows room for bottomWindow and the buttons.
protected int rowsCurrent
protected int rowsLarger
protected int heightSmaller
protected int heightCurrent
protected int heightLarger
protected boolean initialized
Some events related to window movement and resizing may be generated before the objects fully initialized. These should not be responded to as the sizes and locations have not yet been set.
public communicationsWindow(String name)
protected void windowResizer()
It examines the width and height of the windows to determine whether the TextArea objects should have their height and width changed.
protected void addMessage(String display)
display
- name to be used on windowprotected void processKey(KeyEvent e)
If the Delete or Backspace key is depressed, the last character in the bottomWindow textArea is removed.
If the Return key is depressed, the contents of bottomWindow are sent to the remote system and contents of bottomWindow are erased.
e
- event to be processedprotected void sendMessage()
public void setDebugLevel(int level)
A value of 0 means no messages are to be printed. Higher values generate larger amounts of messages.
level
- value to be used for debugLevel.public int getDebugLevel()
Copyright © 2017. All rights reserved.