public class ChuiOutputManager extends OutputManager<BasePrimitives> implements StreamableManager
| Modifier and Type | Field and Description |
|---|---|
protected BasePrimitives |
directOutput
Direct drawing routines.
|
private static CentralLogger |
LOG
Logger
|
private WidgetRegistry<ChuiOutputManager> |
registry
Widget registry.
|
private Window<?> |
streamableWindow
The window to which streamable widgets are attached, in redirected mode.
|
static char |
UACS_BTEE
Bottom tee drawing char.
|
static char |
UACS_CKBOARD
Checker board char for scrollbars body.
|
static char |
UACS_DARROW
Down arrow char for vertical scrollbars.
|
static char |
UACS_HLINE
Horizontal line drawing char.
|
static char |
UACS_LARROW
Left arrow char for horizontal scrollbars.
|
static char |
UACS_LLCORNER
Lower left corner drawing char.
|
static char |
UACS_LRCORNER
Lower right corner drawing char.
|
static char |
UACS_RARROW
Right arrow char for horizontal scrollbars.
|
static char |
UACS_SELECT
Current selection char for selection lists.
|
static char |
UACS_TTEE
Top tee drawing char.
|
static char |
UACS_UARROW
Up arrow char for vertical scrollbars.
|
static char |
UACS_ULCORNER
Upper left corner drawing char.
|
static char |
UACS_URCORNER
Upper right corner drawing char.
|
static char |
UACS_VLINE
Vertical line drawing char.
|
CHUI_DRIVER_BATCH, CHUI_DRIVER_CONSOLE, CHUI_DRIVER_SWING, CHUI_DRIVER_WEB, defaultOutput, defaultTerminal, drawing, driver, GUI_DRIVER_SWING, GUI_DRIVER_WEB, invalidate, output| Constructor and Description |
|---|
ChuiOutputManager(ScreenDriver<ChuiOutputManager> driver)
Create a new output manager instance, with the specified driver.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEditableFrameForWidget(Widget<?> widget)
Register editable frame related widget resources.
|
ChuiOutputManager |
append(int chr,
Color color)
Append character with specified color at current cursor location and
advance the cursor.
|
ChuiOutputManager |
append(java.lang.String text,
Color color)
Append string with specified color at current cursor location and
advance the cursor.
|
ChuiOutputManager |
at(double x,
double y)
Set cursor position.
|
ChuiOutputManager |
at(NativePoint p)
Set cursor position.
|
ChuiOutputManager |
at(Point p)
Set cursor position.
|
Color |
borderColor(Widget<ChuiOutputManager> widget)
Obtain border color for specified widget.
|
ChuiOutputManager |
box(Point origin,
Dimension size,
Color color)
Draw box at specified location with provided size and color.
|
private ChuiOutputManager |
box(Rectangle rect,
Color color)
Draw box at specified location with provided size and color.
|
void |
boxToScreen(Point origin,
Dimension size,
Color color)
Draw box at interactive terminal.
|
void |
clear(Widget<?> widget)
Clear area occupied by specified widget.
|
void |
clearScreen()
Clear screen.
|
NativePoint |
cursor()
Get current cursor position.
|
private void |
drawHBorder(double col,
double row,
double width,
Color color)
Draw the upper or lower border.
|
private void |
drawVBorder(double col,
double row,
double height,
Color color)
Draw the left or right border.
|
ScreenBitmap |
getBitmapCopy()
Get a copy of the current screen bitmap.
|
BasePrimitives |
getDirectOutput()
Obtain the direct output worker.
|
ChuiWidgetFactory |
getFactory()
Access driver-specific widget factory.
|
WidgetRegistry<ChuiOutputManager> |
getRegistry()
Get the widget registry for this output manager.
|
StreamableManager |
getStreamableManager()
Get the streamable manager for this manager instance, used for redirected terminal support.
|
Window<?> |
getStreamableWindow()
Get the
Window instance which can be used in redirected mode. |
boolean |
hasWindowEmulator(int windowId)
Check if window has an emulator for the given window id.
|
ChuiOutputManager |
hLine(double len,
Color color)
Draw horizontal line.
|
void |
init()
Initialize this output manager.
|
boolean |
isRedirected()
Reports if the terminal is currently redirected to a stream.
|
protected TitledWindow<?> |
overrideWindow(TopLevelWindow<?> window)
Check if the window being drawn needs to be overridden.
|
protected boolean |
raiseStopCondition(int key)
Check if the given key can raise the STOP condition.
|
void |
releaseWidgetResources(Widget<?> widget)
ChUI Implementation specific method of removing widget from registry
|
void |
removeEditableFrameForWidget(Widget<?> widget)
Register editable frame related widget resources.
|
ScreenBitmap |
screenBitmap()
Determine the screen bitmap associated with the default window.
|
void |
setBitmap(ScreenBitmap bitmap)
Restore the bitmap to a previous state.
|
ChuiOutputManager |
stayAt(NativePoint p)
Set real cursor position.
|
ChuiOutputManager |
stayAt(Point p)
Set real cursor position.
|
BasePrimitives |
switchOutput(OutputPrimitives newOps)
Redirect terminal output to the drawing worker represented by
newOps (or back to the interactive terminal if
newOps is null) and return the instance
representing the current output destination. |
ChuiOutputManager |
vLine(double len,
Color color)
Draw a vertical line of the specified length starting at the current
cursor position.
|
activateBatch, beep, clear, clear, clipWith, coordinates, drawNeeded, fixCoordinates, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getClippings, getClippings, getDriver, getInstanceDriver, getInteractiveOutput, getInvalidChars, inBatchMode, init, initErrorWriter, initErrorWriter, instance, isBatchInBackground, isBatchModeOverride, isChui, isInvalidate, managerInstance, markArea, newInstance, readKey, refresh, registerWindow, registerWindow, releaseWindow, releaseWindow, resetBitmap, resetInvalidate, resetMode, resolveWidget, restoreInvalidate, resume, saveInvalidate, saveInvalidate, screenBitmap, screenDimension, screenHeight, screenWidth, selectWindow, setBitmap, setCursorStatus, setDisableRedraw, setDrawingArea, setInvalidate, setInvalidate, setInvalidate, setTerminalType, startScreenSearch, suspend, sync, terminalTypeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitnewInstancepublic static final char UACS_BTEE
public static final char UACS_TTEE
public static final char UACS_LLCORNER
public static final char UACS_LRCORNER
public static final char UACS_URCORNER
public static final char UACS_ULCORNER
public static final char UACS_HLINE
public static final char UACS_VLINE
public static final char UACS_UARROW
public static final char UACS_DARROW
public static final char UACS_LARROW
public static final char UACS_RARROW
public static final char UACS_CKBOARD
public static final char UACS_SELECT
private static final CentralLogger LOG
protected BasePrimitives directOutput
private final WidgetRegistry<ChuiOutputManager> registry
private Window<?> streamableWindow
public ChuiOutputManager(ScreenDriver<ChuiOutputManager> driver)
driver - Implements low level input/output primitives. Must NOT be null.public Window<?> getStreamableWindow()
Window instance which can be used in redirected mode.getStreamableWindow in interface StreamableManagerpublic StreamableManager getStreamableManager()
getStreamableManager in class OutputManager<BasePrimitives>public void init()
init in class OutputManager<BasePrimitives>public BasePrimitives switchOutput(OutputPrimitives newOps)
newOps (or back to the interactive terminal if
newOps is null) and return the instance
representing the current output destination. This may be another
null if the interactive terminal is in use.switchOutput in class OutputManager<BasePrimitives>newOps - The drawing worker or null to remove redirections
and activate the interactive terminal.public boolean isRedirected()
isRedirected in class OutputManager<BasePrimitives>true if the terminal is redirected to a stream,
false if the terminal is interactive.public ChuiWidgetFactory getFactory()
getFactory in class OutputManager<BasePrimitives>public WidgetRegistry<ChuiOutputManager> getRegistry()
getRegistry in class OutputManager<BasePrimitives>public void clear(Widget<?> widget)
clear in class OutputManager<BasePrimitives>widget - Reference widget.public void clearScreen()
public ChuiOutputManager append(int chr, Color color)
chr - Character to append.color - Color and attribute.this to enable chaining.public ChuiOutputManager append(java.lang.String text, Color color)
append in interface StreamableManagertext - Character to append.color - Color and attribute.this to enable chaining.public ChuiOutputManager hLine(double len, Color color)
len - Line length.color - Line color.this to enable chaining.public ChuiOutputManager vLine(double len, Color color)
len - Vertical line length.color - Line color.this to enable chaining.public ChuiOutputManager box(Point origin, Dimension size, Color color)
origin - Upper left corner of the box.size - Box dimensions.color - Color and attribute of the box lines.this to enable chaining.public void boxToScreen(Point origin, Dimension size, Color color)
origin - Upper left corner.size - Box dimensions.color - Box color.public Color borderColor(Widget<ChuiOutputManager> widget)
widget - Widget for which border color should be obtained.public ChuiOutputManager at(double x, double y)
x - Cursor X.y - Cursor Y.this to enable chaining.public ChuiOutputManager at(Point p)
p - New cursor position.this to enable chaining.public ChuiOutputManager at(NativePoint p)
p - New cursor position.this to enable chaining.public ChuiOutputManager stayAt(Point p)
p - New cursor position.this to enable chaining.public ChuiOutputManager stayAt(NativePoint p)
p - New cursor position.this to enable chaining.public BasePrimitives getDirectOutput()
public boolean hasWindowEmulator(int windowId)
hasWindowEmulator in class OutputManager<BasePrimitives>windowId - Window ID.true.public NativePoint cursor()
private ChuiOutputManager box(Rectangle rect, Color color)
rect - The box to draw.color - Color and attribute of the box lines.this to enable chaining.private void drawHBorder(double col,
double row,
double width,
Color color)
col - The column number where to draw.row - The row number where to draw.width - The border width.color - The number of the color-pair (foreground+background)private void drawVBorder(double col,
double row,
double height,
Color color)
col - The column number where to draw.row - The row number where to draw.height - The border height.color - The number of the color-pair (foreground+background)public ScreenBitmap getBitmapCopy()
public void setBitmap(ScreenBitmap bitmap)
bitmap - The bitmap instance to set as the output primitive's bitmap.protected boolean raiseStopCondition(int key)
raiseStopCondition in class OutputManager<BasePrimitives>key - The key code to be checked.true if the key is the Key.VK_CTRL_C key.public ScreenBitmap screenBitmap()
screenBitmap in interface StreamableManagerScreenBitmap associated with this window.public void releaseWidgetResources(Widget<?> widget)
releaseWidgetResources in class OutputManager<BasePrimitives>widget - Widget to have resources releasedprotected TitledWindow<?> overrideWindow(TopLevelWindow<?> window)
In ChUI, the current top window will always be returned. This might be some other window than default-window.
overrideWindow in class OutputManager<BasePrimitives>window - The currently active window.public void removeEditableFrameForWidget(Widget<?> widget)
removeEditableFrameForWidget in class OutputManager<BasePrimitives>widget - Widget to have resources releasedpublic void addEditableFrameForWidget(Widget<?> widget)
addEditableFrameForWidget in class OutputManager<BasePrimitives>widget - Widget to have resources released