public class TerminalWindow extends JComponent implements ActionListener, PropertyChangeListener, ComponentListener, KeyListener
This class is used by the Clients, but also by the terminal window on the Server when running in GUI mode.
| Modifier and Type | Class and Description |
|---|---|
static class |
TerminalWindow.SetUp |
JComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
static int |
ATTR_UNDERLINE
Underline attribute.
|
Color[] |
cgaColors
The 16 CGA colors.
|
static boolean |
useBoldFonts
Use bold fonts.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
TerminalWindow(Container terminalParent,
Container container,
Color[] cgaColors,
String ii,
String im,
String mw,
String caps,
String num,
int cx,
int cy,
int x,
int y,
char[] cd,
int[] ad,
TerminalWindowListener listener)
The constructor creates the child components (terminal display
with possible scroll bars and the status bar.
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(ActionEvent e)
The action performed is actually a timer message
and causes the cursor to flash.
|
void |
componentHidden(ComponentEvent e)
Invoked when the component has been made invisible.
|
void |
componentMoved(ComponentEvent e)
Invoked when the component's position changes.
|
void |
componentResized(ComponentEvent e)
Invoked when the component's size changes.
|
void |
componentShown(ComponentEvent e)
Invoked when the component has been made visible.
|
void |
dispose()
Disposes of this window.
|
void |
doLayout()
The component is resized.
|
void |
fillCharBackground(Graphics g,
int xPos,
int yPos,
int x,
int y,
int cx,
int cy)
Fills the background of a character position with the current color.
|
Color |
getBackground(Color background,
int x,
int y)
Gets the background color when drawing a character.
|
Point |
getCursorPoint()
Gets the current point of the cursor.
|
int |
getcxFont()
Gets the vertical font size.
|
int |
getcyFont()
Gets the horizontal font size.
|
FieldPaintInterface.Fields |
getFields(boolean inputOnly)
Gets all host fields defined in the current screen.
|
Container |
getFrame() |
int |
getLeftMargin()
Gets the left margin.
|
Rectangle |
getMark()
Get the current selected mark.
|
Dimension |
getMinimumSize()
Gets the minimum size of this component.
|
MouseInterface |
getMouseHandler()
Get the mouse handler.
|
Dimension |
getPreferredSize()
Gets the minimum size of this component.
|
int |
getScreenWidth()
Gets the screenWidth.
|
String |
getTerminalContent(int pos,
int length)
Get the terminal character content in the indicated position.
|
int |
getTopMargin()
Gets the top margin.
|
boolean |
inInsertMode()
The insert mode can be read using this method, but it only checks the
enabled state of the control in the status bar.
|
void |
initialize()
Perform any necessary initialization.
|
static void |
initializeFonts()
Initializes the fonts for the terminal window.
|
boolean |
isFocusTraversable()
The emulator window can receive input focus, and therefore
returning true here.
|
boolean |
isLocked()
Checks if the lock state is present.
|
boolean |
isManagingFocus()
This method returns true because the emulator needs the Tab keys.
|
void |
keyPressed(KeyEvent e)
Special key pressed (CapsLock, NumLock).
|
void |
keyReleased(KeyEvent e)
Special key pressed (CapsLock, NumLock).
|
void |
keyTyped(KeyEvent e)
Special key pressed (CapsLock, NumLock).
|
void |
paint(Graphics g)
Paints the emulator window.
|
void |
postPaint(Graphics g,
int xPos,
int yPos,
int x,
int y,
int cx,
int cy)
Post-paints a character position as required.
|
FieldPaintInterface.Field |
probeHostField(int position)
Probe for host field.
|
protected void |
processFocusEvent(FocusEvent e)
The focus event.
|
protected void |
processKeyEvent(KeyEvent e)
Key events comes here.
|
void |
processKeyEvent0(KeyEvent e)
Key events comes here.
|
protected void |
processMouseEvent(MouseEvent e)
Processes mouse events.
|
protected void |
processMouseMotionEvent(MouseEvent e)
Processes mouse events.
|
void |
propertyChange(PropertyChangeEvent e)
Property change event processing to check for selection
change (i.e.
|
void |
removeExcludedPopup()
Perform remove excluded pop-up window action in the editor.
|
void |
removeMark()
Removes the mouse marking area that currently exists.
|
void |
repaintComponent(JComponent jc)
Repaints a component and all its dirty regions using the Swing
Repaint Manager.
|
void |
repaintStatusLine()
Repaints the status line.
|
void |
repaintText(int beginPos,
int endPos)
Change of character/color data between two positions.
|
void |
selectAll()
Selects all text on the screen.
|
void |
sendHostKey(int key)
Sends a key to the terminal.
|
void |
setCursor(int x,
int y)
Changes cursor position.
|
void |
setInsertMode(boolean on)
Sets the insert mode indicator.
|
void |
setLocked(boolean isLocked)
Sets the lock state.
|
static void |
setMouseExit(MouseInterface theMouseExit)
Sets a mouse exit.
|
void |
setNormalPainting(boolean on)
Sets normal painting or not (non-normal is when doing block-mode for the
client part).
|
static void |
setPaintExit(PaintInterface paintExit)
Sets a paint exit.
|
void |
setScreenSize(int cx,
int cy,
char[] cd,
int[] ad)
Sets the current screen size.
|
void |
setup(List<HotSpot>[] lineHotSpots)
Sets up the hot spots definition.
|
void |
setup(String p,
String fn,
int cursorHeight)
Sets up the terminal window with user settings.
|
void |
setup(TerminalWindow.SetUp setup)
Sets up the terminal window with user settings.
|
void |
setUsePrivateInsertMode(boolean on)
Sets the usage of private insert mode flag.
|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUIadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic static boolean useBoldFonts
public static final int ATTR_UNDERLINE
public Color[] cgaColors
public TerminalWindow(Container terminalParent, Container container, Color[] cgaColors, String ii, String im, String mw, String caps, String num, int cx, int cy, int x, int y, char[] cd, int[] ad, TerminalWindowListener listener)
public static void initializeFonts()
public void dispose()
public void setup(String p, String fn, int cursorHeight)
public void setup(TerminalWindow.SetUp setup)
public boolean isFocusTraversable()
isFocusTraversable in class Componentpublic boolean isManagingFocus()
isManagingFocus in class JComponentpublic Dimension getMinimumSize()
getMinimumSize in class JComponentpublic MouseInterface getMouseHandler()
public String getTerminalContent(int pos, int length)
public int getScreenWidth()
public int getTopMargin()
public int getLeftMargin()
public int getcxFont()
public int getcyFont()
public Dimension getPreferredSize()
getPreferredSize in class JComponentpublic void doLayout()
protected void processFocusEvent(FocusEvent e)
processFocusEvent in class Componentpublic void propertyChange(PropertyChangeEvent e)
propertyChange in interface PropertyChangeListenerprotected void processKeyEvent(KeyEvent e)
processKeyEvent in class JComponentpublic void processKeyEvent0(KeyEvent e)
public Container getFrame()
public Point getCursorPoint()
protected void processMouseEvent(MouseEvent e)
processMouseEvent in class JComponentprotected void processMouseMotionEvent(MouseEvent e)
processMouseMotionEvent in class JComponentpublic void removeMark()
public FieldPaintInterface.Field probeHostField(int position)
position - Field position.public void selectAll()
public static void setPaintExit(PaintInterface paintExit)
public static void setMouseExit(MouseInterface theMouseExit)
public void paint(Graphics g)
paint in class JComponentpublic Color getBackground(Color background, int x, int y)
public FieldPaintInterface.Fields getFields(boolean inputOnly)
public void fillCharBackground(Graphics g, int xPos, int yPos, int x, int y, int cx, int cy)
public void postPaint(Graphics g, int xPos, int yPos, int x, int y, int cx, int cy)
public void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenerpublic void setNormalPainting(boolean on)
public void repaintComponent(JComponent jc)
public void setCursor(int x,
int y)
public void repaintText(int beginPos,
int endPos)
public void repaintStatusLine()
public void setLocked(boolean isLocked)
public boolean isLocked()
public void setUsePrivateInsertMode(boolean on)
public void setInsertMode(boolean on)
public boolean inInsertMode()
public void initialize()
public void removeExcludedPopup()
public void sendHostKey(int key)
key - The key to send.public Rectangle getMark()
public void setScreenSize(int cx,
int cy,
char[] cd,
int[] ad)
public void componentHidden(ComponentEvent e)
componentHidden in interface ComponentListenerpublic void componentMoved(ComponentEvent e)
componentMoved in interface ComponentListenerpublic void componentResized(ComponentEvent e)
componentResized in interface ComponentListenerpublic void componentShown(ComponentEvent e)
componentShown in interface ComponentListenerpublic void keyPressed(KeyEvent e)
keyPressed in interface KeyListenerpublic void keyReleased(KeyEvent e)
keyReleased in interface KeyListenerpublic void keyTyped(KeyEvent e)
keyTyped in interface KeyListenerPhantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.