public class ChuiOutputManager extends OutputManager<BasePrimitives>
Modifier and Type | Field and Description |
---|---|
private BasePrimitives |
directOutput
Direct drawing routines.
|
private WidgetRegistry<ChuiOutputManager> |
registry
Widget registry.
|
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, debug, 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 |
activateWindow(TopLevelWindow<?> window)
Activates the provided window instance, depending on the output manager type.
|
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.
|
ChuiOutputManager |
hLine(double len,
Color color)
Draw horizontal line.
|
void |
init()
Initialize this output manager.
|
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.
|
protected 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.
|
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, isRedirected, markArea, newInstance, readKey, realizeWindow, refresh, releaseWindow, resetBitmap, resetInvalidate, resetMode, resolveWidget, restoreInvalidate, resume, saveInvalidate, screenBitmap, screenDimension, screenHeight, screenWidth, selectWindow, setBitmap, setCursorStatus, setDrawingArea, setInvalidate, setInvalidate, setInvalidate, setTerminalType, startScreenSearch, suspend, switchOutput, sync, terminalType
public 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 BasePrimitives directOutput
private WidgetRegistry<ChuiOutputManager> registry
public ChuiOutputManager(ScreenDriver<ChuiOutputManager> driver)
driver
- Implements low level input/output primitives. Must NOT be null
.public void activateWindow(TopLevelWindow<?> window)
For ChUI case, it makes the window visible immediately.
activateWindow
in class OutputManager<BasePrimitives>
window
- A window.public void init()
init
in class OutputManager<BasePrimitives>
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)
text
- 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 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.protected ScreenBitmap screenBitmap()
ScreenBitmap
associated with this window.protected 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.