|
Josh Native console access wrapper for Java |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.yifanlu.Josh.JoshBuffer
com.yifanlu.Josh.Josh
public class Josh
Provides native access to the console.
The functions defined here are generic for any buffer, for more commands, see
out, outBuffer, in, and inBuffer for functions specific to
output/input buffers.
| Field Summary | |
|---|---|
static JoshInput |
in
Contains functions for reading keyboard input from the standard input buffer. |
static JoshInBuffer |
inBuffer
Contains functions for reading events from the standard input buffer. |
static JoshOutput |
out
Contains simplified output functions for the standard output buffer. |
static JoshOutBuffer |
outBuffer
Contains native output functions for the standard output buffer. |
static int |
STD_ERROR_HANDLE
Used in getStdHandle(int) and setStdHandle(com.yifanlu.Josh.ConsoleBuffer, int). |
static int |
STD_INPUT_HANDLE
Used in getStdHandle(int) and setStdHandle(com.yifanlu.Josh.ConsoleBuffer, int). |
static int |
STD_OUTPUT_HANDLE
Used in getStdHandle(int) and setStdHandle(com.yifanlu.Josh.ConsoleBuffer, int). |
| Constructor Summary | |
|---|---|
Josh()
|
|
| Method Summary | |
|---|---|
static void |
Beep()
Generates a single beep of 800Hz for 200 miliseconds. |
static void |
Beep(int frequency,
int duration)
Generates simple tones on the speaker. |
static ConsoleHistoryInfo |
getConsoleHistoryInfo()
Vista Only: Retrieves the history settings for the calling process's console. |
static java.lang.String |
getConsoleOrginialTitle()
Vista Only: Retrieves the original title for the current console window. |
static ConsoleSelectionInfo |
getConsoleSelectionInfo()
XP Only: Retrieves information about the current console selection. |
static java.lang.String |
getConsoleTitle()
Retrieves the title for the current console window. |
static ConsoleHandle |
getConsoleWindow()
Retrieves the window handle used by the console associated with the calling process. |
static int |
getNumberOfConsoleMouseButtons()
Retrieves the number of buttons on the mouse used by the current console. |
static ConsoleHandle |
getStdHandle(int type)
Retrieves a handle to the specified standard device (standard input, standard output, or standard error). |
static boolean |
isFullScreen()
XP Only: Sees if the current console window is in fullscreen mode. |
static void |
setConsoleActiveScreenBuffer(ConsoleBuffer screen)
Sets the specified screen buffer to be the currently displayed console screen buffer. |
static void |
setConsoleHistoryInfo(ConsoleHistoryInfo info)
Vista Only: Sets the history settings for the calling process's console. |
static void |
setConsoleTitle(java.lang.String title)
Sets the title for the current console window. |
static void |
setStdHandle(ConsoleBuffer buffer,
int forHandle)
Sets the handle for the specified standard device (standard input, standard output, or standard error). |
| Methods inherited from class com.yifanlu.Josh.JoshBuffer |
|---|
equals, getHandle, hashCode, setHandle |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int STD_INPUT_HANDLE
getStdHandle(int) and setStdHandle(com.yifanlu.Josh.ConsoleBuffer, int). Different handles to get/set.
public static final int STD_OUTPUT_HANDLE
getStdHandle(int) and setStdHandle(com.yifanlu.Josh.ConsoleBuffer, int). Different handles to get/set.
public static final int STD_ERROR_HANDLE
getStdHandle(int) and setStdHandle(com.yifanlu.Josh.ConsoleBuffer, int). Different handles to get/set.
public static final JoshOutput out
public static final JoshOutBuffer outBuffer
public static final JoshInput in
public static final JoshInBuffer inBuffer
| Constructor Detail |
|---|
public Josh()
| Method Detail |
|---|
public static void Beep()
public static void Beep(int frequency,
int duration)
frequency - The frequency of the sound, in hertz. This parameter must be in the range 37 through 32,767 (0x25 through 0x7FFF).duration - The duration of the sound, in milliseconds.public static void setConsoleActiveScreenBuffer(ConsoleBuffer screen)
screen - A ConsoleBuffer that should be displayed.public static java.lang.String getConsoleTitle()
public static void setConsoleTitle(java.lang.String title)
title - The string to be displayed in the title bar of the console window.
public static java.lang.String getConsoleOrginialTitle()
throws OSNotSupportedException
OSNotSupportedException - If the current OS is not Vista or higher.
public static ConsoleHistoryInfo getConsoleHistoryInfo()
throws OSNotSupportedException
OSNotSupportedException - If the current OS is not Vista or higher.
public static void setConsoleHistoryInfo(ConsoleHistoryInfo info)
throws OSNotSupportedException
info - The history settings for the calling process's console.
OSNotSupportedException - If the current OS is not Vista or higher.
public static ConsoleSelectionInfo getConsoleSelectionInfo()
throws OSNotSupportedException
OSNotSupportedException - If the current OS is not XP or higher.public static ConsoleHandle getConsoleWindow()
public static int getNumberOfConsoleMouseButtons()
public static ConsoleHandle getStdHandle(int type)
type - The standard device which is a constant defined in this class.
public static void setStdHandle(ConsoleBuffer buffer,
int forHandle)
buffer - What to set as the standard handle.forHandle - The standard device which is a constant defined in this class.
public static boolean isFullScreen()
throws OSNotSupportedException
OSNotSupportedException - If the current OS is not XP or higher.
|
Copyright © 2010 Yifan Lu | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||