public final class DefaultTerminalFactory extends Object implements TerminalFactory
Note that for all systems with a graphical environment present, the SwingTerminalFrame will be chosen. You can suppress this by calling setForceTextTerminal(true) on this factory.
Constructor and Description |
---|
DefaultTerminalFactory()
Creates a new DefaultTerminalFactory with all properties set to their defaults
|
DefaultTerminalFactory(OutputStream outputStream,
InputStream inputStream,
Charset charset)
Creates a new DefaultTerminalFactory with I/O and character set options customisable.
|
Modifier and Type | Method and Description |
---|---|
AWTTerminalFrame |
createAWTTerminal() |
SwingTerminalFrame |
createSwingTerminal() |
Terminal |
createTerminal()
Instantiates a Terminal according to the factory implementation.
|
Terminal |
createTerminalEmulator()
Creates a new terminal emulator window which will be either Swing-based or AWT-based depending on what is
available on the system
|
void |
setAutoOpenTerminalEmulatorWindow(boolean autoOpenTerminalFrame)
Controls whether a SwingTerminalFrame shall be automatically shown (.setVisible(true)) immediately after
creation.
|
DefaultTerminalFactory |
setForceAWTOverSwing(boolean forceAWTOverSwing)
Normally when a graphical terminal emulator is created by the factory, it will create a
SwingTerminalFrame unless Swing is not present in the system. |
DefaultTerminalFactory |
setForceTextTerminal(boolean forceTextTerminal)
Controls whether a SwingTerminalFrame shall always be created if the system is one with a graphical environment
|
DefaultTerminalFactory |
setInitialTerminalSize(TerminalSize initialTerminalSize)
Sets a hint to the TerminalFactory of what size to use when creating the terminal.
|
DefaultTerminalFactory |
setMouseCaptureMode(MouseCaptureMode mouseCaptureMode)
Sets the mouse capture mode the terminal should use.
|
DefaultTerminalFactory |
setTerminalEmulatorColorConfiguration(TerminalEmulatorColorConfiguration colorConfiguration)
Sets the color configuration to use on created SwingTerminalFrames created by this factory
|
DefaultTerminalFactory |
setTerminalEmulatorDeviceConfiguration(TerminalEmulatorDeviceConfiguration deviceConfiguration)
Sets the device configuration to use on created SwingTerminalFrames created by this factory
|
DefaultTerminalFactory |
setTerminalEmulatorFontConfiguration(AWTTerminalFontConfiguration fontConfiguration)
Sets the font configuration to use on created SwingTerminalFrames created by this factory
|
DefaultTerminalFactory |
setTerminalEmulatorFrameAutoCloseTrigger(TerminalEmulatorAutoCloseTrigger autoCloseTrigger)
Sets the auto-close trigger to use on created SwingTerminalFrames created by this factory
|
DefaultTerminalFactory |
setTerminalEmulatorTitle(String title)
Sets the title to use on created SwingTerminalFrames created by this factory
|
public DefaultTerminalFactory()
public DefaultTerminalFactory(OutputStream outputStream, InputStream inputStream, Charset charset)
outputStream
- Output stream to use for text-based Terminal implementationsinputStream
- Input stream to use for text-based Terminal implementationscharset
- Character set to assume the client is usingpublic Terminal createTerminal() throws IOException
TerminalFactory
createTerminal
in interface TerminalFactory
IOException
- If there was an I/O error with the underlying input/output systempublic Terminal createTerminalEmulator()
Terminal
interfacepublic AWTTerminalFrame createAWTTerminal()
public SwingTerminalFrame createSwingTerminal()
public DefaultTerminalFactory setInitialTerminalSize(TerminalSize initialTerminalSize)
initialTerminalSize
- Size (in rows and columns) of the newly created terminalpublic DefaultTerminalFactory setForceTextTerminal(boolean forceTextTerminal)
forceTextTerminal
- If true, will always create a text-based Terminalpublic DefaultTerminalFactory setForceAWTOverSwing(boolean forceAWTOverSwing)
SwingTerminalFrame
unless Swing is not present in the system. Setting this property to true
will
make it create an AWTTerminalFrame
even if Swing is presentforceAWTOverSwing
- If true
, will always create an AWTTerminalFrame
over a
SwingTerminalFrame
if asked to create a graphical terminal emulatorpublic void setAutoOpenTerminalEmulatorWindow(boolean autoOpenTerminalFrame)
false
, you will manually need to call .setVisible(true)
on the JFrame to actually
see the terminal window. Default for this value is true
.autoOpenTerminalFrame
- Automatically open SwingTerminalFrame after creationpublic DefaultTerminalFactory setTerminalEmulatorTitle(String title)
title
- Title to use on created SwingTerminalFrames created by this factorypublic DefaultTerminalFactory setTerminalEmulatorFrameAutoCloseTrigger(TerminalEmulatorAutoCloseTrigger autoCloseTrigger)
autoCloseTrigger
- Auto-close trigger to use on created SwingTerminalFrames created by this factorypublic DefaultTerminalFactory setTerminalEmulatorColorConfiguration(TerminalEmulatorColorConfiguration colorConfiguration)
colorConfiguration
- Color configuration to use on created SwingTerminalFrames created by this factorypublic DefaultTerminalFactory setTerminalEmulatorDeviceConfiguration(TerminalEmulatorDeviceConfiguration deviceConfiguration)
deviceConfiguration
- Device configuration to use on created SwingTerminalFrames created by this factorypublic DefaultTerminalFactory setTerminalEmulatorFontConfiguration(AWTTerminalFontConfiguration fontConfiguration)
fontConfiguration
- Font configuration to use on created SwingTerminalFrames created by this factorypublic DefaultTerminalFactory setMouseCaptureMode(MouseCaptureMode mouseCaptureMode)
mouseCaptureMode
- Capture mode for mouse interactionsCopyright © 2016. All rights reserved.